...
 
Commits (216)
......@@ -2,29 +2,53 @@ stages:
- build
- deploy
build-linux:
.build-conda: &build-conda
stage: build
script:
- conda build ./conda --prefix-length=80 --output-folder=dist/ --channel=http://bcu-ci.esrf.fr/stable
artifacts:
paths:
- dist/
tags:
- conda
build-linux:
<<: *build-conda
script:
- git submodule update --init --recursive third-party/bitshuffle
- conda build ./conda/debug --prefix-length=80 --output-folder=dist/ --channel=http://bcu-ci.esrf.fr/stable
- conda build ./conda/release --prefix-length=80 --output-folder=dist/ --channel=http://bcu-ci.esrf.fr/stable
tags:
- linux
build-win:
stage: build
<<: *build-conda
script:
- conda build ./conda --prefix-length=80 --output-folder=dist/ --channel=http://bcu-ci.esrf.fr/stable
artifacts:
paths:
- dist/
- git submodule update --init --recursive third-party/bitshuffle
- call conda build ./conda/debug --prefix-length=80 --output-folder=dist/ --channel=http://bcu-ci.esrf.fr/stable
- call conda build ./conda/release --prefix-length=80 --output-folder=dist/ --channel=http://bcu-ci.esrf.fr/stable
tags:
- conda
- win
deploy:
deploy-devel:
stage: deploy
environment:
name: devel/$CI_COMMIT_REF_NAME
url: http://bcu-ci.esrf.fr/devel
dependencies:
- build-linux
- build-win
script:
- cp -Rf dist/* /conda-devel/
- conda index /conda-devel/
tags:
- conda
- linux
only:
- branches
except:
- stable
when: manual
deploy-stable:
stage: deploy
environment:
name: production
......@@ -38,4 +62,6 @@ deploy:
tags:
- conda
- linux
when: manual
only:
- tags
- stable
......@@ -120,10 +120,19 @@
url = git://github.com/kiyo-masui/bitshuffle
[submodule "camera/lambda"]
path = camera/lambda
url = git://github.com/esrf-bliss/Lima-camera-lambda
url = ../Lima-camera-lambda
[submodule "camera/fli"]
path = camera/fli
url = ../Lima-camera-fli
[submodule "camera/zwo"]
path = camera/zwo
url = ../Lima-camera-zwo
[submodule "camera/simulator"]
path = camera/simulator
url = ../Lima-camera-simulator.git
[submodule "camera/common/meta"]
path = camera/common/meta
url = ../Lima-camera-meta.git
[submodule "camera/qhyccd"]
path = camera/qhyccd
url = ../Lima-camera-qhyccd
This diff is collapsed.
# Set install dir for SIP files and CMake packages
set(SIP_INSTALL_DIR ${CMAKE_INSTALL_DATADIR}/sip/lima)
set(CMAKE_INSTALL_DIR ${CMAKE_INSTALL_DATADIR}/cmake/lima)
if(NOT LIMA_BUILD_SUBMODULES)
# Generate and install package config file and version
set(PROJECT_LIBRARIES limacore h5bshuf)
include(cmake/package_config.cmake)
include(cmake/components_config.cmake)
endif()
install(
TARGETS limacore
EXPORT "${TARGETS_EXPORT_NAME}"
COMPONENT runtime
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} # import library
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} # .so files are libraries
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} # .dll files are binaries
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} # this does not actually install anything (but used by downstream projects)
)
install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/project_version.h
${CMAKE_CURRENT_BINARY_DIR}/limacore_export.h
COMPONENT devel
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/lima
)
install(
DIRECTORY ${CMAKE_SOURCE_DIR}/common/include/
COMPONENT devel
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
FILES_MATCHING PATTERN "*.h"
)
install(
DIRECTORY ${CMAKE_SOURCE_DIR}/hardware/include/
COMPONENT devel
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
FILES_MATCHING PATTERN "*.h"
)
install(
DIRECTORY ${CMAKE_SOURCE_DIR}/control/include/
COMPONENT devel
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
FILES_MATCHING PATTERN "*.h"
)
install(
DIRECTORY ${CMAKE_SOURCE_DIR}/control/software_operation/include/
COMPONENT devel
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
FILES_MATCHING PATTERN "*.h"
)
if(NOT LIMA_BUILD_SUBMODULES)
install(
FILES ${CMAKE_SOURCE_DIR}/cmake/checksipexc.py
${CMAKE_SOURCE_DIR}/cmake/FindNumPy.cmake
${CMAKE_SOURCE_DIR}/cmake/FindSIP.cmake
${CMAKE_SOURCE_DIR}/cmake/FindSIP.py
${CMAKE_SOURCE_DIR}/cmake/SIPMacros.cmake
${CMAKE_SOURCE_DIR}/cmake/sip_init_numpy.cpp.in
${CMAKE_SOURCE_DIR}/cmake/package_config.cmake
${CMAKE_SOURCE_DIR}/cmake/components_config.cmake
${CMAKE_SOURCE_DIR}/cmake/project_version.cmake
${CMAKE_SOURCE_DIR}/cmake/project_version.cc.in
${CMAKE_SOURCE_DIR}/cmake/project_version.h.in
${CMAKE_SOURCE_DIR}/cmake/LimaTools.cmake
COMPONENT tools
DESTINATION ${CMAKE_INSTALL_DIR}
)
endif()
if(LIMA_ENABLE_PYTHON)
install(
DIRECTORY python/Lima/
COMPONENT sip
DESTINATION "${PYTHON_SITE_PACKAGES_DIR}/Lima")
file(GLOB SIP_SOURCES
"${CMAKE_SOURCE_DIR}/common/sip/*.sip"
"${CMAKE_SOURCE_DIR}/common/sip/*.sip"
"${CMAKE_SOURCE_DIR}/hardware/sip/*.sip"
"${CMAKE_SOURCE_DIR}/control/sip/*.sip"
"${CMAKE_SOURCE_DIR}/control/software_operation/sip/*.sip")
if(NOT LIMA_BUILD_SUBMODULES)
install(
FILES ${SIP_SOURCES}
${CMAKE_CURRENT_BINARY_DIR}/sip/limacore.sip
${CMAKE_SOURCE_DIR}/sip/limamodules.sip.in
COMPONENT sip
DESTINATION ${SIP_INSTALL_DIR}
)
endif()
endif()
//###########################################################################
// This file is part of LImA, a Library for Image Acquisition
//
// Copyright (C) : 2009-2017
// Copyright (C) : 2009-2019
// European Synchrotron Radiation Facility
// CS40220 38043 Grenoble Cedex 9
// FRANCE
......
###########################################################################
This file is part of LImA, a Library for Image Acquisition
Copyright (C) : 2009-2017
Copyright (C) : 2009-2019
European Synchrotron Radiation Facility
CS40220 38043 Grenoble Cedex 9
FRANCE
......
###########################################################################
# This file is part of LImA, a Library for Image Acquisition
#
# Copyright (C) : 2009-2017
# European Synchrotron Radiation Facility
# BP 220, Grenoble 38043
# FRANCE
#
# 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 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/>.
############################################################################
# Use submodules
option(LIMA_BUILD_SUBMODULES "Build with submodules (vs prebuilt packages)?" ON)
if(UNIX)
# Spec-like shared memory
if(DEFINED ENV{COMPILE_SPS_IMAGE})
set(LIMA_ENABLE_SPS_IMAGE "$ENV{COMPILE_SPS_IMAGE}" CACHE BOOL "compile sps_image?" FORCE)
else()
option(LIMA_ENABLE_SPS_IMAGE "compile sps_image?" OFF)
endif()
# openGL real-time display
if(DEFINED ENV{COMPILE_GLDISPLAY})
set(LIMA_ENABLE_GLDISPLAY "$ENV{COMPILE_GLDISPLAY}" CACHE BOOL "compile gldisplay?" FORCE)
else()
option(LIMA_ENABLE_GLDISPLAY "compile sps_image?" OFF)
endif()
endif()
#--------------------------------------------------------------------------------
# Compile tests
#--------------------------------------------------------------------------------
option(LIMA_ENABLE_TESTS "compile test directories ?" OFF)
#--------------------------------------------------------------------------------
# Compile with trace (debug information)
#--------------------------------------------------------------------------------
option(LIMA_ENABLE_DEBUG "compile with trace ?" ON)
#--------------------------------------------------------------------------------
# libconfig
#--------------------------------------------------------------------------------
if(DEFINED ENV{LIMA_ENABLE_CONFIG})
set(LIMA_ENABLE_CONFIG "$ENV{LIMA_ENABLE_CONFIG}" CACHE BOOL "compile with libconfig code?" FORCE)
else()
option(LIMA_ENABLE_CONFIG "compile with libconfig?" OFF)
endif()
#--------------------------------------------------------------------------------
# Saving formats can be enabled from environment variables using config.inc file
#--------------------------------------------------------------------------------
if(UNIX)
# The formats have not been tested on windows
if(DEFINED ENV{LIMA_ENABLE_CBF})
set(LIMA_ENABLE_CBF "$ENV{LIMA_ENABLE_CBF}" CACHE BOOL "compile CBF saving code?" FORCE)
else()
option(LIMA_ENABLE_CBF "compile CBF saving code?" OFF)
endif()
if(DEFINED ENV{LIMA_ENABLE_FITS})
set(LIMA_ENABLE_FITS "$ENV{LIMA_ENABLE_FITS}" CACHE BOOL "compile FITS saving code?" FORCE)
else()
option(LIMA_ENABLE_FITS "compile FITS saving code?" OFF)
endif()
if(DEFINED ENV{LIMA_ENABLE_NXS})
set(LIMA_ENABLE_NXS "$ENV{LIMA_ENABLE_NXS}" CACHE BOOL "compile Nexus saving code?" FORCE)
else()
option(LIMA_ENABLE_NXS "compile Nexus saving code?" OFF)
endif()
endif()
if(DEFINED ENV{LIMA_ENABLE_TIFF})
set(LIMA_ENABLE_TIFF "$ENV{LIMA_ENABLE_TIFF}" CACHE BOOL "compile TIFF saving code?" FORCE)
else()
option(LIMA_ENABLE_TIFF "compile TIFF saving code?" OFF)
endif()
if(DEFINED ENV{LIMA_ENABLE_EDFLZ4})
set(LIMA_ENABLE_EDFLZ4 "$ENV{LIMA_ENABLE_EDFLZ4}" CACHE BOOL "compile EDF.LZ4 saving code?" FORCE)
else()
option(LIMA_ENABLE_EDFLZ4 "compile EDF.LZ4 saving code?" OFF)
endif()
if(DEFINED ENV{LIMA_ENABLE_EDFGZ})
set(LIMA_ENABLE_EDFGZ "$ENV{LIMA_ENABLE_EDFGZ}" CACHE BOOL "compile EDF.GZ saving code?" FORCE)
else()
option(LIMA_ENABLE_EDFGZ "compile EDF.GZ saving code?" OFF)
endif()
if(DEFINED ENV{LIMA_ENABLE_HDF5})
set(LIMA_ENABLE_HDF5 "$ENV{LIMA_ENABLE_HDF5}" CACHE BOOL "compile HDF5 saving code?" FORCE)
else()
option(LIMA_ENABLE_HDF5 "compile HDF5 saving code?" OFF)
endif()
if(DEFINED ENV{LIMA_ENABLE_HDF5_BS})
set(LIMA_ENABLE_HDF5_BS "$ENV{LIMA_ENABLE_HDF5_BS}" CACHE BOOL "compile HDF5/BS saving code?" FORCE)
else()
option(LIMA_ENABLE_HDF5_BS "compile HDF5/BS saving code?" OFF)
endif()
# Compile python wrapping code generated using SIP
IF(DEFINED ENV{LIMA_ENABLE_PYTHON})
set(LIMA_ENABLE_PYTHON "$ENV{LIMA_ENABLE_PYTHON}" CACHE BOOL "compile python modules?" FORCE)
else()
option(LIMA_ENABLE_PYTHON "compile python modules?" OFF)
endif()
# Python Tango server
IF(DEFINED ENV{LIMA_ENABLE_PYTANGO_SERVER})
set(LIMA_ENABLE_PYTANGO_SERVER "$ENV{LIMA_ENABLE_PYTANGO_SEVER}" CACHE BOOL "install python tango server?" FORCE)
else()
option(LIMA_ENABLE_PYTANGO_SERVER "install python tango server?" OFF)
endif()
# LImA
[![License](https://img.shields.io/github/license/esrf-bliss/lima.svg?style=flat)](https://opensource.org/licenses/GPL-3.0)
[![Gitter](https://img.shields.io/gitter/room/esrf-bliss/lima.svg?style=flat)](https://gitter.im/esrf-bliss/LImA)
[![Conda](https://img.shields.io/conda/dn/esrf-bcu/lima-core.svg?style=flat)](https://anaconda.org/esrf-bcu)
[![Version](https://img.shields.io/conda/vn/esrf-bcu/lima-core.svg?style=flat)](https://anaconda.org/esrf-bcu)
[![Platform](https://img.shields.io/conda/pn/esrf-bcu/lima-core.svg?style=flat)](https://anaconda.org/esrf-bcu)
Lima ( **L** ibrary for **Im** age **A** cquisition) is a project for the unified control of 2D detectors. The aim is to clearly separate hardware specific code from common software configuration and features, like setting standard acquisition parameters (exposure time, external trigger), file saving and image processing.
Lima is a C++ library which can be used with many different cameras. The library also comes with a [Python](http://python.org) binding and provides a [PyTango](http://pytango.readthedocs.io/en/stable/) device server for remote control.
## Documentation
The documentation is available [here](http://lima.blissgarden.org). Thank you to the people running Read the Docs for such an excellent service.
The source for the documentation is in the `docs` folder. Here are the instructions to built and read it locally. The documentation is built with [Doxygen](http://www.doxygen.org/) and [Sphinx](http://www.sphinx-doc.org). The sphinx template is from [ReadtheDocs](https://docs.readthedocs.io). [Breathe](https://breathe.readthedocs.io) provides a bridge between the Sphinx and Doxygen documentation systems.
pip install --user sphinx sphinx-autobuild sphinx_rtd_theme breathe recommonmark
apt-get doxygen
cd docs
doxygen common.dox
doxygen control.dox
doxygen hardware.dox
make html
The html documentation is generated in `docs/.build/html`.
.. image:: http://lima.blissgarden.org/_static/lima-logo-2-40perc.png
=============================
Library for Image Acquisition
=============================
|Linux Status|
|Windows Status|
Description
-----------
Lima ( **L** ibrary for **Im** age **A** cquisition) is a project for the unified control of 2D detectors. The aim is to clearly separate hardware specific code from common software configuration and features, like setting standard acquisition parameters (exposure time, external trigger), file saving and image processing.
Lima is a C++ library which can be used for many different cameras. The library is also available for Python_ and it provides a PyTango_ server for remote control.
Documentation: http://lima.blissgarden.org
.. _requirements:
Requirements
------------
You need to install some tools and libraries for building Lima for both windows and Linux.
Build dependencies:
- gcc for Linux
- Visual Studio 2008 for x86 or x64 for Python 2.7.x
- Visual Studio 2008 Express for x86 only for Python 2.7.x
- Visual Studio 2015 for x86 and x64 for Python >= 3.5
- git_
- CMake_ >= 3.1
- gsl_: For windows, download the esrf binary package `gsl-windows`_ and install it under "c:\\program files\\"
**Python** dependencies:
Lima_ can be compiled for python 2 and 3. The following packages must be installed, development versions with header files (include files) are mandatory.
- numpy_ >= 1.1
- sip_ <= 4.18
The following requirements are optional.
Saving format dependencies:
- tiff_
- zlib_: for windows, you can download the esrf binary package `zlib-windows`_ and install it under "c:\\program files\\"
- cbf_
- hdf5_
- ccfits_
- lz4_ = 1.7.x
- libconfig_: for windows you can download the ESRF binary package `libconfig-windows`_ and install it under "c:\\program files\\"
PyTango_ server dependencies:
The LimaCCDs PyTango server only works for Python 2, it will be updated for Python 3 soon !!
- PyTango_
- libtango_
.. _git: https://git-scm.com
.. _Python: http://python.org
.. _Lima: http://lima.blissgarden.org
.. _gsl: https://www.gnu.org/software/gsl
.. _gsl-windows: http://ftp.esrf.fr/pub/bliss/lima/gsl-windows.zip
.. _zlib-windows: http://ftp.esrf.fr/pub/bliss/lima/zlib-windows.zip
.. _libconfig-windows: http://ftp.esrf.fr/pub/bliss/lima/libconfig-windows.zip
.. _CMake: https://cmake.org
.. _Tango: http://tango-control.org
.. _PyTango: http://github.com/tango-cs/pytango
.. _libtango: http://tango-controls.org/downloads/source
.. _numpy: http://pypi.python.org/pypi/numpy
.. _sip: https://www.riverbankcomputing.com/software/sip
.. _tiff: http://www.libtiff.org/
.. _zlib: https://zlib.net/
.. _cbf: http://www.bernstein-plus-sons.com/software/CBF
.. _hdf5: https://support.hdfgroup.org/HDF5
.. _ccfits: https://heasarc.gsfc.nasa.gov/fitsio/ccfits
.. _lz4: https://lz4.github.io/lz4
.. _libconfig: http://www.hyperrealm.com/libconfig
.. _build_installation:
Build and Install
-----------------
Using scripts
^^^^^^^^^^^^^
the **install** scripts will run cmake, compile and install.
It accepts input arguments (see below) but it also uses a configuration file **scripts/config.txt**. Feel free to update this file for setting a permanent configuration for your own installation.
Linux::
[sudo] install.sh
[--git]
[--prefix=<desired installation path>]
[--python-packages=<desired python installation path>]
[options]
Windows::
install.bat
[--prefix=<desired installation path>]
[--python-packages=<desired python installation path>]
[options]
The **--git** (Linux only) option cab be used to clone the required submodules as a prerequisite. Otherwise you should install the submodules with git commands, for instance::
$ git submodule init third-party/Processlib
$ git submodule init camera/basler
$ git submodule init applications/tango/python
$ git submodule update
Options are <camera-name> <saving-format> python pytango-server:
- camera-name::
andor|andor3|basler|prosilica|adsc|mythen3|ueye|xh|xspress3|ultra|
xpad|mythen|pco|marccd|pointgrey|imxpad|dexela|merlin|v4l2|
eiger|pixirad|hexitec|aviex|roperscientific|rayonixhs|espia|maxipix|frelon
- saving-format::
cbf|nxs|fits|edfgz|edflz4|tiff|hdf5
- python: to compile python module
- pytango-server: to install the PyTango_ server
Example::
$ sudo install.sh --git
--prefix=./install
--python-packages=./install/python
tiff basler python pytango-server
Using cmake
^^^^^^^^^^^
Install first the project submodules::
$ git submodule init third-party/Processlib
$ git submodule init camera/basler
$ git submodule init applications/tango/python
$ git submodule update
Run cmake in the build directory::
$ mkdir build
$ cd build
$ cmake ..
[-G "Visual Studio 9 2008 Win64" | -G "Visual Studio 9 2008" | -G "Unix Makefiles"]
[-DCMAKE_INSTALL_PREFIX=<desired installation path>]
[-DPYTHON_SITE_PACKAGES_DIR=<desired python installation path>]
-DLIMA_ENABLE_TIFF=true
-DLIMACAMERA_BASLER=true
-DLIMA_ENABLE_PYTANGO_SERVER=true
-DLIMA_ENABLE_PYTHON=true
Then compile and install::
$ cmake --build
$ sudo cmake --build --target install
May you need to update your environment?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If you have changed the default destination path for both libraries and python modules you should update
your environment variables.
For Linux:
.. code-block:: sh
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<my-new-install-dir>/Lima/lib
export PYTHONPATH=$PYTHONPATH:<my-new-install-dir>
For Windows:
Update the system wide variables PATH for the libraries and PYTHONPATH for python.
.. _PyTango: http://github.com/tango-cs/pytango
Lima Team contact: lima@esrf.fr
.. |Linux Status| image:: https://travis-ci.org/esrf-bliss/Lima.svg?branch=cmake
:target: https://travis-ci.org/esrf-bliss/Lima
:alt:
.. |Windows Status| image:: https://ci.appveyor.com/api/projects/status/rk0yqwem1jqxwubu?svg=true
:target: https://ci.appveyor.com/api/projects/status/rk0yqwem1jqxwubu/branch/cmake?svg=true
.. _Python: http://python.org
.. _PyTango: http://github.com/tango-cs/pytango
......@@ -2,9 +2,55 @@ LIMA Release Notes
This is the release notes of LIMA, the library for image acquisition.
You can find information releated to new features and bug fixes. The notes are ordered by branch and release number.
The notes are prefixed with a category name for core, subsystems image/saving/processlib/..., camera names andor/andor3/basler..., windows, applications tango python/tango c++/spec and third-party submodules sps/processlib/...
You can find information related to new features and bug fixes. The notes are ordered by branch and release number.
Version v1.9.0 released on September 13th 2019
----------------------------------------------
New features
* More conda packages for cameras are now supported:
andor3, andor, basler, dexela, eiger, frelon,
frelon, imxpad, maxipix, marccd, merlin,
mythen3, pco, pilatus, pixirad, pointgrey,
prosilica, simulator, slsdetector, ueye,
v4l2, xh
* Some refactoring and optimisation of the software buffer classes
* Support added for Numa (non-uniform memory access) memory management
Bug Fixes
* CBF saving format now fits with miniCBF spec for Pilatus detectors
* Video: fixed issue when taking 8/16-bit images and then changing to Accumulation
New cameras
* PCO usb
* Frelon 16
Version v1.8.0 released on February 2nd 2019
--------------------------------------------
With this release we introduced the following new features:
* Build system has been refactored to use CMake, a cross-platform build system (Windows and Linux)
* Building camera either standalone or using Lima as master project
* Better support for C++ developers (with CMake packages)
* Install.(sh|bat) to ease build and installation for CMake averse :-)
* Conda binary packages for processlib, LImA core and some cameras and pytango device server
* Support for Python 3
* CI running on ESRF's Gitlab instance
* Documentation improvements and migrated to ReadTheDocs (https://lima1.readthedocs.io)
* Use semantic versionning
* New HDF5 layout, direct chunk and bitshuffle LZ4 / gzip compression support
* New BPM pytango plugin, Beam Position Monitor
* Simulator improvements (new prefetch and read from files modes)
## New camera plugins
* ZWO camera plugin (thanks to Jens Krueger)
* SlsDetector (PSI Eiger) camera plugin (thanks to Alejandro Homs)
* FLI (Finger Lake Instrument) camera plugin (thanks to Laurent Claustre)
* Lambda (Quantum) camera plugin (thanks to Teresa Nunez)
Stable branch core-1.7
----------------------
......
###########################################################################
# This file is part of LImA, a Library for Image Acquisition
#
# Copyright (C) : 2009-2017
# European Synchrotron Radiation Facility
# BP 220, Grenoble 38043
# FRANCE
#
# 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 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/>.
############################################################################
set(saving_definitions)
set(saving_libs)
set(saving_private_libs)
set(saving_includes)
if(LIMA_ENABLE_EDFGZ)
find_package(ZLIB)
if(${ZLIB_FOUND})
list(APPEND saving_definitions -DWITH_Z_COMPRESSION)
list(APPEND saving_libs ${ZLIB_LIBRARIES})
list(APPEND saving_includes ${ZLIB_INCLUDE_DIRS})
else()
message(FATAL_ERROR "ZLIB library not found, please install or disable LIMA_ENABLE_EDFGZ")
endif()
endif()
if(LIMA_ENABLE_EDFLZ4)
find_package(LZ4)
if (${LZ4_FOUND})
list(APPEND saving_definitions -DWITH_LZ4_COMPRESSION)
list(APPEND saving_libs ${LZ4_LIBRARIES})
list(APPEND saving_includes ${LZ4_INCLUDE_DIRS})
else()
message(FATAL_ERROR "LZ4 library: required version = 1.8.2, please update or switch off LIMA_ENABLE_EDFLZ4")
endif()
endif()
if(LIMA_ENABLE_CBF)
find_package(CBF)
if (${CBF_FOUND})
list(APPEND saving_definitions -DWITH_CBF_SAVING)
list(APPEND saving_definitions -DPROTOTYPES)
list(APPEND control_srcs control/src/CtSaving_Cbf.cpp)
list(APPEND saving_libs ${CBF_LIBRARIES} crypto)
list(APPEND saving_includes ${CBF_INCLUDE_DIRS})
else()
message(FATAL_ERROR "CBF library not found, please install or disable LIMA_ENABLE_CBF")
endif()
endif()
if(LIMA_ENABLE_FITS)
find_package(CCFits)
if(${CCFITS_FOUND})
list(APPEND saving_definitions -DWITH_FITS_SAVING)
list(APPEND control_srcs control/src/CtSaving_Fits.cpp)
list(APPEND saving_libs ${CFITSIO_LIBRARY} ${CCFITS_LIBRARY})
list(APPEND saving_includes ${CFITSIO_INCLUDE_DIR})
else()
message(FATAL_ERROR "CFITSIO and/or CCFITS library not found, please install or disable LIMA_ENABLE_FITS")
endif()
endif()
if(LIMA_ENABLE_HDF5)
#set (HDF5_USE_STATIC_LIBRARIES ON)
find_package(HDF5 COMPONENTS CXX HL)
if(${HDF5_FOUND})
list(APPEND saving_definitions -DWITH_HDF5_SAVING ${HDF5_DEFINITIONS})
list(APPEND control_srcs control/src/CtSaving_Hdf5.cpp)
list(APPEND saving_libs ${HDF5_LIBRARIES} ${HDF5_HL_LIBRARIES} ${LIB_SZIP} ${LIB_ZLIB})
list(APPEND saving_includes ${HDF5_INCLUDE_DIRS})
else()
message(FATAL_ERROR "HDF5 library not found, please install or disable LIMA_ENABLE_HDF5")
endif()
if(LIMA_ENABLE_HDF5_BS)
#set(BITSHUFFLE_EXTERNALLY_CONFIGURED ON)
add_subdirectory(control/bitshuffle)
list(APPEND saving_definitions -DWITH_BS_COMPRESSION)
list(APPEND saving_includes ${CMAKE_CURRENT_SOURCE_DIR}/third-party/bitshuffle/src)
list(APPEND saving_private_libs h5bshuf_static)
# set(LIB_BS_INCLUDE_DIR "/usr/local/include/" CACHE PATH "Path to BitShuffle include files")
# link_directories(${LIB_HDF5_PLUGIN})
# find_library(LIB_HDF5_BS h5bshuf ${LIB_HDF5_PLUGIN})
# find_path(LIB_BS_INCLUDE_DIR bitshuffle.h)
# list(APPEND saving_libs ${LIB_HDF5_BS})
# list(APPEND saving_includes ${LIB_BS_INCLUDE_DIR})
endif()
endif()
if(LIMA_ENABLE_NXS)
find_package(NXS)
if(${NXS_FOUND})
list(APPEND saving_definitions -DWITH_NXS_SAVING)
list(APPEND control_srcs control/src/CtSaving_NXS.cpp)
list(APPEND saving_includes ${NXS_INCLUDE_DIRS})
list(APPEND saving_libs ${NXS_LIBRARIES})
else()
message(FATAL_ERROR "NEXUS cpp library not installed, please install or disable LIMA_ENABLE_NXS")
endif()
endif()
if(LIMA_ENABLE_TIFF)
find_package(TIFF)
if(${TIFF_FOUND})
list(APPEND saving_definitions -DWITH_TIFF_SAVING)
list(APPEND control_srcs control/src/CtSaving_Tiff.cpp)
list(APPEND saving_libs ${TIFF_LIBRARIES})
list(APPEND saving_includes ${TIFF_INCLUDE_DIRS})
else()
message(FATAL_ERROR "TIFF library not found, please install or disable LIMA_ENABLE_TIFF")
endif()
endif()
This diff is collapsed.
Subproject commit c572422f3905664267c88255e8e5e10e1d819a52
Subproject commit 91d21e0b8cc84f16de506b8a2b57d4c31f37b0f2
Subproject commit 771250b67247f09d159515bdb877f0c617d8e09d
Subproject commit df09b4e4a373220c73414965f9a0b5a456b789de
Subproject commit 735ba784e07b37fb991b49a00d20e346e7f6ad1a
Subproject commit 11d463d2bb88fbbf7b4ab37b2d8a8a5cc6622f80
Subproject commit 05fa3370c45bee7c164b16b104d43b13d6eb6e21
Subproject commit 00f52b4cad2179082b8a7b43b11c9be03a57b7c6
Subproject commit 20d7f4a75ac5b65daf51af314fa18e7432d8af3b
Subproject commit 826a4795eace6d3ae89d7168944a78d214785801
Subproject commit 485871741e4aa58f0c3edddb3552c606c570e846
Subproject commit 0180cd19446b01d48ecf76982c17fe217a2552ab
Subproject commit 2e3fc4df5063380337adbf2eca6a6814a2f8aefa
src-dirs = src
test-dirs =
include ../../../global.inc
//###########################################################################
// This file is part of LImA, a Library for Image Acquisition
//
// Copyright (C) : 2009-2011
// European Synchrotron Radiation Facility
// BP 220, Grenoble 38043
// FRANCE
//
// 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.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, see <http://www.gnu.org/licenses/>.
//###########################################################################
#ifndef METADETINFOCTRLOBJ_H
#define METADETINFOCTRLOBJ_H
#include "lima/HwDetInfoCtrlObj.h"
#include "lima/Debug.h"
namespace lima
{
class HwInterface;
namespace Meta
{
class Interface;
class DetInfoCtrlObj : public HwDetInfoCtrlObj, public HwMaxImageSizeCallbackGen
{
DEB_CLASS_NAMESPC(DebModCamera, "DetInfoCtrlObj","Meta");
class _MaxImageSizeCallback;
friend class _MaxImageSizeCallback;
friend class Interface;
public:
DetInfoCtrlObj(Interface&);
virtual ~DetInfoCtrlObj();
virtual void getMaxImageSize(Size& max_image_size);
virtual void getDetectorImageSize(Size& det_image_size);
virtual void getDefImageType(ImageType& def_image_type);
virtual void getCurrImageType(ImageType& curr_image_type);
virtual void setCurrImageType(ImageType curr_image_type);
virtual void getPixelSize(double& x_size,double &y_size);
virtual void getDetectorType(std::string& det_type);
virtual void getDetectorModel(std::string& det_model);
virtual void registerMaxImageSizeCallback(HwMaxImageSizeCallback& cb);
virtual void unregisterMaxImageSizeCallback(HwMaxImageSizeCallback& cb);
private:
Interface& m_interface;
std::list<_MaxImageSizeCallback*> m_cbk;
void _maxImageSizeChanged();
void _addInterface(HwInterface*);
};
} // namespace Meta
} // namespace lima
#endif // METADETINFOCTRLOBJ_H
//###########################################################################
// This file is part of LImA, a Library for Image Acquisition
//
// Copyright (C) : 2009-2011
// European Synchrotron Radiation Facility
// BP 220, Grenoble 38043
// FRANCE
//
// 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.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, see <http://www.gnu.org/licenses/>.
//###########################################################################
#ifndef METAINTERFACE_H
#define METAINTERFACE_H
#include <map>
#include "lima/HwInterface.h"
#include "processlib/Data.h"
namespace lima
{
namespace Meta
{
class DetInfoCtrlObj;
class SyncCtrlObj;
class Interface : public HwInterface
{
DEB_CLASS_NAMESPC(DebModCamera, "MetaInterface", "Meta");
friend class DetInfoCtrlObj;
friend class SyncCtrlObj;
public:
enum Geometry {TILE};
Interface(Geometry = TILE);
virtual ~Interface();
void addInterface(int row,int column,HwInterface*);
//- From HwInterface
virtual void getCapList(CapList&) const;
virtual void reset(ResetLevel reset_level);
virtual void prepareAcq();
virtual void startAcq();
virtual void stopAcq();
virtual void getStatus(StatusType& status);
virtual int getNbHwAcquiredFrames();
private:
class _BufferFrameCBK;
friend class _BufferFrameCBK;
typedef std::pair<int,int> ColumnRow;
struct ltColumnRow
{
bool operator()(const ColumnRow& a,const ColumnRow& b)
{
return a.second == b.second ?
a.first < b.first : a.second < b.second;
}
};
typedef std::map<ColumnRow,HwInterface*,ltColumnRow> TileCnt;
typedef std::map<ColumnRow,int> TileOffset;
typedef std::map<int,int> PendingFrames;
typedef std::vector<_BufferFrameCBK*> BufferFrameCBKs;
bool _newFrameReady(int row,int column,const Data&);
TileCnt m_tiles;
Geometry m_geometry;
DetInfoCtrlObj* m_det_info;
SyncCtrlObj* m_sync;
SoftBufferCtrlObj m_buffer;
bool m_dirty_geom_flag;
int m_width_step;
ImageType m_curr_type;
TileOffset m_tiles_offset;
bool m_continue_acq;
Mutex m_lock;
PendingFrames m_pending_frames;
BufferFrameCBKs m_buffer_cbks;
};
}
}
#endif
//###########################################################################
// This file is part of LImA, a Library for Image Acquisition
//
// Copyright (C) : 2009-2011
// European Synchrotron Radiation Facility
// BP 220, Grenoble 38043
// FRANCE
//
// 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.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, see <http://www.gnu.org/licenses/>.
//###########################################################################
#ifndef METASYNCCTRLOBJ_H
#define METASYNCCTRLOBJ_H
#include "lima/HwSyncCtrlObj.h"
#include "lima/HwInterface.h"
namespace lima
{
namespace Meta
{
class Interface;
class SyncCtrlObj : public HwSyncCtrlObj
{
DEB_CLASS_NAMESPC(DebModCamera,"SyncCtrlObj","Meta");
public:
SyncCtrlObj(Interface&);
virtual ~SyncCtrlObj();
virtual bool checkTrigMode(TrigMode trig_mode);
virtual void setTrigMode(TrigMode trig_mode);
virtual void getTrigMode(TrigMode& trig_mode);
virtual void setExpTime(double exp_time);
virtual void getExpTime(double& exp_time);
virtual bool checkAutoExposureMode(AutoExposureMode mode) const;
virtual void setHwAutoExposureMode(AutoExposureMode mode);
virtual void setLatTime(double lat_time);
virtual void getLatTime(double& lat_time);
virtual void setNbHwFrames(int nb_frames);
virtual void getNbHwFrames(int& nb_frames);
virtual void getValidRanges(ValidRangesType& valid_ranges);
private:
Interface& m_interface;
};
} // namespace Meta
} // namespace lima
#endif // METASYNCCTRLOBJ_H
############################################################################
# This file is part of LImA, a Library for Image Acquisition
#
# Copyright (C) : 2009-2011
# European Synchrotron Radiation Facility
# BP 220, Grenoble 38043
# FRANCE
#
# 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.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
############################################################################
from Lima import module_helper
mod_path = __path__
depends_on = 'Core'
has_dependent = False
cleanup_data = module_helper.load_prepare(mod_path, depends_on, has_dependent)
from Lima import Core
cleanup_data = module_helper.load_dep_cleanup(cleanup_data)
from Lima.Meta.limameta import Meta as _B
globals().update(_B.__dict__)
module_helper.load_cleanup(cleanup_data)
del mod_path, depends_on, has_dependent, cleanup_data
del module_helper
namespace Meta
{
class Interface : HwInterface
{
%TypeHeaderCode
#include <MetaInterface.h>
%End
public:
enum Geometry {TILE};
Interface(Geometry = TILE);
virtual ~Interface();
void addInterface(int row,int column,HwInterface*);
//- From HwInterface
// virtual void getCapList(CapList& /Out/) const;
virtual void getCapList(std::vector<HwCap> &cap_list /Out/) const;
virtual void reset(ResetLevel reset_level);
virtual void prepareAcq();
virtual void startAcq();
virtual void stopAcq();
virtual void getStatus(StatusType& status /Out/);
virtual int getNbHwAcquiredFrames();
};
};
meta-objs = MetaInterface.o MetaDetInfoCtrlObj.o MetaSyncCtrlObj.o
SRCS = $(meta-objs:.o=.cpp)
CXXFLAGS += -I../include -I../../../../hardware/include -I../../../../common/include \
-I../../../../control/include -I../../../../control/software_operation/include \
-I../../../../third-party/Processlib/core/include -Wall -pthread -fPIC -g
all: Meta.o
Meta.o: $(meta-objs)
$(LD) -o $@ -r $+
clean:
rm -f *.o *.P
%.o : %.cpp
$(COMPILE.cpp) -MD $(CXXFLAGS) -o $@ $<
@cp $*.d $*.P; \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \
rm -f $*.d
-include $(SRCS:.cpp=.P)
.PHONY: check-syntax
check-syntax:
$(CXX) -Wall -Wextra -fsyntax-only $(CXXFLAGS) $(CHK_SOURCES)
//###########################################################################
// This file is part of LImA, a Library for Image Acquisition
//
// Copyright (C) : 2009-2011
// European Synchrotron Radiation Facility
// BP 220, Grenoble 38043
// FRANCE
//
// 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.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, see <http://www.gnu.org/licenses/>.
//###########################################################################
#include <cstdlib>
#include "MetaDetInfoCtrlObj.h"
#include "MetaInterface.h"
using namespace lima;
using namespace lima::Meta;
#define GET_LOCAL_DET_INFO \
Interface::TileCnt::iterator i = m_interface.m_tiles.begin(); \
HwDetInfoCtrlObj* local_det_info; \
if(i == m_interface.m_tiles.end()) \
THROW_HW_ERROR(Error) << "Meta doesn't have any sub detector"; \
if(!i->second->getHwCtrlObj(local_det_info)) \
THROW_HW_ERROR(Error) << "Cannot get hardware det info";
class DetInfoCtrlObj::_MaxImageSizeCallback : public HwMaxImageSizeCallback
{
public:
_MaxImageSizeCallback(DetInfoCtrlObj &det) : m_det(det) {}
protected:
virtual void maxImageSizeChanged(const Size& size,ImageType image_type)
{
m_det._maxImageSizeChanged();
}
private:
DetInfoCtrlObj& m_det;
};
DetInfoCtrlObj::DetInfoCtrlObj(Interface& interface):
m_interface(interface)
{
}
DetInfoCtrlObj::~DetInfoCtrlObj()
{
for(std::list<_MaxImageSizeCallback*>::iterator i = m_cbk.begin();
i != m_cbk.end();++i)
delete *i;
}
void DetInfoCtrlObj::getMaxImageSize(Size& max_image_size)
{
DEB_MEMBER_FUNCT();
max_image_size = Size(0,0);
GET_LOCAL_DET_INFO;
Size local_max_image_size;
int prev_row = i->first.second;
local_det_info->getMaxImageSize(local_max_image_size);
int row_width = local_max_image_size.getWidth();
int row_height = local_max_image_size.getHeight();
for(++i;i != m_interface.m_tiles.end();++i)
{
if(!i->second->getHwCtrlObj(local_det_info))
THROW_HW_ERROR(Error) << "Cannot get hardware det info";
local_det_info->getMaxImageSize(local_max_image_size);
if(prev_row == i->first.second) // new column, same row
{
row_height = std::max(row_height,
local_max_image_size.getHeight());
row_width += local_max_image_size.getWidth();
}
else // new row
{
prev_row = i->first.second;
max_image_size = Size(std::max(max_image_size.getWidth(),row_width),
max_image_size.getHeight() + row_height);
row_height = local_max_image_size.getHeight();
row_width = local_max_image_size.getWidth();
}
}
max_image_size = Size(std::max(max_image_size.getWidth(),row_width),
max_image_size.getHeight() + row_height);
DEB_RETURN() << DEB_VAR1(max_image_size);
}
void DetInfoCtrlObj::getDetectorImageSize(Size& det_image_size)
{
DEB_MEMBER_FUNCT();
getMaxImageSize(det_image_size);
}
void DetInfoCtrlObj::getDefImageType(ImageType& def_image_type)
{
DEB_MEMBER_FUNCT();
GET_LOCAL_DET_INFO;
local_det_info->getDefImageType(def_image_type);
DEB_RETURN() << DEB_VAR1(def_image_type);
}
void DetInfoCtrlObj::getCurrImageType(ImageType& curr_image_type)
{
DEB_MEMBER_FUNCT();
getDefImageType(curr_image_type);
}
void DetInfoCtrlObj::setCurrImageType(ImageType curr_image_type)
{
DEB_MEMBER_FUNCT();
DEB_PARAM() << DEB_VAR1(curr_image_type);
for(Interface::TileCnt::iterator i = m_interface.m_tiles.begin();
i != m_interface.m_tiles.end();++i)
{
HwDetInfoCtrlObj* local_det_info;
if(!i->second->getHwCtrlObj(local_det_info))
THROW_HW_ERROR(Error) << "Cannot get hardware det info";
local_det_info->setCurrImageType(curr_image_type);
}
}
/** @brief get pixel size of detector
assumed that all detector have the same resolution, it might be wrong in some cases.
*/
void DetInfoCtrlObj::getPixelSize(double& x_size,double& y_size)
{
DEB_MEMBER_FUNCT();
GET_LOCAL_DET_INFO;
local_det_info->getPixelSize(x_size,y_size);
DEB_RETURN() << DEB_VAR2(x_size,y_size);
}
void DetInfoCtrlObj::getDetectorType(std::string& det_type)
{
DEB_MEMBER_FUNCT();
GET_LOCAL_DET_INFO;
std::string local_det_type;
local_det_info->getDetectorType(local_det_type);
bool allMatch = true;
for(++i;allMatch && i != m_interface.m_tiles.end();++i)
{
std::string loop_det_type;
if(!i->second->getHwCtrlObj(local_det_info))
THROW_HW_ERROR(Error) << "Cannot get hardware det info";
local_det_info->getDetectorType(loop_det_type);
allMatch = loop_det_type == local_det_type;
}
if(allMatch)
det_type = "Meta_" + local_det_type;
else
det_type = "Meta_Hybrid";
DEB_RETURN() << DEB_VAR1(det_type);
}
void DetInfoCtrlObj::getDetectorModel(std::string& det_model)
{
DEB_MEMBER_FUNCT();
det_model = "";
for(Interface::TileCnt::iterator i = m_interface.m_tiles.begin();
i != m_interface.m_tiles.end();++i)
{
std::string local_det_model;
HwDetInfoCtrlObj* local_det_info;
if(!i->second->getHwCtrlObj(local_det_info))
THROW_HW_ERROR(Error) << "Cannot get hardware det info";
local_det_info->getDetectorModel(local_det_model);
if(!det_model.size())
det_model = local_det_model;
else
det_model += " / " + local_det_model;
}
}
void DetInfoCtrlObj::registerMaxImageSizeCallback(HwMaxImageSizeCallback& cb)
{
this->HwMaxImageSizeCallbackGen::registerMaxImageSizeCallback(cb);
}
void DetInfoCtrlObj::unregisterMaxImageSizeCallback(HwMaxImageSizeCallback &cb)
{
this->HwMaxImageSizeCallbackGen::unregisterMaxImageSizeCallback(cb);
}
void DetInfoCtrlObj::_maxImageSizeChanged()
{
Size max_image_size;
getMaxImageSize(max_image_size);
ImageType def_image_type;
getCurrImageType(def_image_type);
maxImageSizeChanged(max_image_size,def_image_type);
m_interface.m_dirty_geom_flag = true;
}
void DetInfoCtrlObj::_addInterface(HwInterface* i)
{
DEB_MEMBER_FUNCT();
_MaxImageSizeCallback *cbk = new _MaxImageSizeCallback(*this);
HwDetInfoCtrlObj* local_det_info;
if(!i->getHwCtrlObj(local_det_info))
THROW_HW_ERROR(Error) << "Cannot get hardware det info";