Commit b462d869 authored by Laurent Claustre's avatar Laurent Claustre
Browse files

updated conda recipe for tango, remove useless bld.bat for windows


Signed-off-by: default avatarLaurent Claustre <claustre@linuxlolo1.esrf.fr>
parent bc54996d
stages:
- build
- build-noarch
- deploy
.build-conda: &build-conda
stage: build
artifacts:
paths:
- dist/
tags:
- conda
build-linux:
<<: *build-conda
script:
- conda build ./conda/camera --prefix-length=80 --output-folder=dist/ --channel=http://bcu-ci.esrf.fr/stable
tags:
- linux
build-noarch:
<<: *build-conda
stage: build-noarch
script:
- conda build ./conda/tango --prefix-length=80 --output-folder=dist/ -c tango-controls --channel=http://bcu-ci.esrf.fr/stable
dependencies:
- build-linux
deploy-devel:
stage: deploy
environment:
name: devel/$CI_COMMIT_REF_NAME
url: http://bcu-ci.esrf.fr/devel
dependencies:
- build-linux
- build-noarch
script:
- cp -Rf dist/* /conda-devel/
- conda index /conda-devel/
tags:
- conda
- linux
only:
- branches
except:
- master
when: manual
deploy-stable:
stage: deploy
environment:
name: production
url: http://bcu-ci.esrf.fr/stable
dependencies:
- build-linux
- build-noarch
script:
- cp -Rf dist/* /conda/
- conda index /conda/
tags:
- conda
- linux
only:
- tags
......@@ -6,6 +6,12 @@ project(dhyana)
include(GNUInstallDirs)
include(GenerateExportHeader)
#LIBRARIES
find_library(SDK_LIBRARIES
NAMES TUCam
)
message("${SDK_LIBRARIES}")
# If conda build, always set lib dir to 'lib'
if($ENV{CONDA_BUILD})
set(CMAKE_INSTALL_LIBDIR "lib")
......@@ -82,7 +88,7 @@ target_include_directories(dhyana
)
target_link_libraries(dhyana PUBLIC limacore)
target_link_libraries(dhyana PUBLIC TUCam)
target_link_libraries(dhyana PUBLIC ${SDK_LIBRARIES})
# Binding code for python
if(LIMA_ENABLE_PYTHON)
......@@ -123,4 +129,4 @@ if(LIMA_ENABLE_PYTHON)
if (LIMA_ENABLE_PYTANGO_SERVER)
add_subdirectory(tango)
endif()
endif()
\ No newline at end of file
endif()
This diff is collapsed.
#!/bin/bash
cmake -Bbuild -H. -DLIMA_ENABLE_PYTHON=1 -DCAMERA_ENABLE_TESTS=1 -DCMAKE_INSTALL_PREFIX=$PREFIX -DPYTHON_SITE_PACKAGES_DIR=$SP_DIR -DCMAKE_FIND_ROOT_PATH=$PREFIX
cmake --build build --target install
blas_impl:
- mkl # [x86_64]
c_compiler:
- vs2017 # [win]
cxx_compiler:
- vs2017 # [win]
python:
- 3.7
# This differs from target_platform in that it determines what subdir the compiler
# will target, not what subdir the compiler package will be itself.
# For example, we need a win-64 vs2008_win-32 package, so that we compile win-32
# code on win-64 miniconda.
cross_compiler_target_platform:
- win-64 # [win]
target_platform:
- win-64 # [win]
vc:
- 14
zip_keys:
- # [win]
- vc # [win]
- c_compiler # [win]
- cxx_compiler # [win]
# Strip the 'v' from the version tag
{% if GIT_DESCRIBE_TAG is defined %}
{% set version = GIT_DESCRIBE_TAG[1:] %}
{% else %}
{% set version = "0.0.0" %}
{% endif %}
package:
name: lima-camera-dhyana
version: {{ version }}
source:
path: ../..
build:
number: {{ environ.get('GIT_DESCRIBE_NUMBER', 0) }}
requirements:
host:
- python {{ python }}
- sip 4.19.8 # For compatibility with pyqt 5.9.2
- lima-core >=1.9.6
- tucam-sdk
build:
- git
- cmake
- make
- {{ compiler('cxx') }}
run:
- python {{ python }}
- sip >=4.19.4, <=4.19.8 # For compatibility with pyqt 5.9.2
- {{ pin_compatible('lima-core', max_pin='x.x') }}
- tucam-sdk
#test:
# imports:
# - Lima.Dhyana
about:
home: https://github.com/esrf-bliss/Lima
license: GPL
license_file: COPYING
summary: a library for the unified control of 2D detectors
#!/bin/bash
cd tango/
cmake -Bbuild -H. -DCMAKE_INSTALL_PREFIX=$PREFIX -DPYTHON_SITE_PACKAGES_DIR=$SP_DIR -DCMAKE_FIND_ROOT_PATH=$PREFIX
cmake --build build --target install
# Strip the 'v' from the version tag
{% if GIT_DESCRIBE_TAG is defined %}
{% set version = GIT_DESCRIBE_TAG[1:] %}
{% else %}
{% set version = "0.0.0" %}
{% endif %}
package:
name: lima-camera-dhyana-tango
version: {{ version }}
source:
path: ../..
build:
number: {{ environ.get('GIT_DESCRIBE_NUMBER', 0) }}
noarch: python
requirements:
build:
- cmake
- make
- git
- lima-core
run:
- lima-tango-server
- lima-camera-dhyana
about:
home: https://github.com/esrf-bliss/Lima
license: GPL
license_file: COPYING
summary: a library for the unified control of 2D detectors
......@@ -15,19 +15,46 @@ Intoduction
```````````
This plugin control a TUCSEN Dhyana (95) camera under WINDOWS, using TUCam (32 bits) SDK 1.0.0.9 library.
Linux is supported as well using the TUCam SDK (x86_64) for Linux, release. 1.0.0.0.
To get the SDK please contact your camera seller.
Prerequisite
````````````
The Dhyana 95 is only supporting USB3 interface. On Linux USB device can only be accessed by root user.
To allow any user to control the camera you should manually change the udev settings for this particular usb device.
As root create a new file under /etc/udev/rules.d/99-tucsen.rules add the following udev rules:
.. code-block::
ATTR{idVendor}=="5453", MODE="0666"
Then you can simply unplug your camera, restart the computer and then plug the camera
Installation & Module configuration
````````````````````````````````````
Follow the generic instructions in :ref:`build_installation`. If using CMake directly, add the following flag:
.. code-block:: sh
-DLIMACAMERA_DHYANA=true
For the Tango server installation, refers to :ref:`tango_installation`.
Initialisation and Capabilities
````````````````````````````````
Implementing a new plugin for new detector is driven by the LIMA framework but the developer has some freedoms to choose which standard and specific features will be made available. This section is supposed to give you the correct information regarding how the camera is exported within the LIMA framework.
Camera initialisation
......................
There is no initialisation to perform, just be sure your camera is switched on and connected on the computer via the USB cable.
Std capabilites
................
......@@ -75,5 +102,51 @@ Configuration
No Specific hardware configuration are needed
How to use
````````````
Getting started
```````````````
For a quick test one can use the python binding, here is a short code example:
.. code-block:: python
from Lima import Dhyana
from lima import Core
import time
cam = Dhyana.Camera()
# Get the hardware interface
hwint = Dhyana.Interface(cam)
# Get the control interface
control = Core.CtControl(hwint)
# Get the acquisition control
acq = control.acquisition()
# Set new file parameters and autosaving mode
saving=control.saving()
pars=saving.getParameters()
pars.directory='/tmp/'
pars.prefix='test1_'
pars.suffix='.edf'
pars.fileFormat=Core.CtSaving.EDF
pars.savingMode=Core.CtSaving.AutoFrame
saving.setParameters(pars)
# Now ask for 2 sec. exposure and 10 frames
acq.setAcqExpoTime(2)
acq.setAcqNbFrames(10)
control.prepareAcq()
control.startAcq()
# Wait for last image (#9) ready
lastimg = control.getStatus().ImageCounters.LastImageReady
while lastimg !=9:
time.sleep(0.1)
lastimg = control.getStatus().ImageCounters.LastImageReady
# read the first image
im0 = control.ReadImage(0)
Dhyana Tango device
========================
This is the reference documentation of the Dhyana Tango device.
you can also find some useful information about the camera models/prerequisite/installation/configuration/compilation in the :ref:`Dhyana camera plugin <camera-dhyana>` section.
Properties
----------
======================== =============== ================================= =====================================
Property name Mandatory Default value Description
======================== =============== ================================= =====================================
internal_trigger_timer No 999 Soft timer to generate software
trigger in millisecond.
======================== =============== ================================= =====================================
Attributes
----------
======================= ======= ======================= ======================================================================
Attribute name RW Type Description
======================= ======= ======================= ======================================================================
global_gain rw DevUShort Global gain setting on the sensor, from 0 to 10
fan_speed rw DevUShort FAN speed for cooling, from 0 to 10
temperature ro Devdouble Temperature of the sensor
temperature_target rw Devdouble Temperature target
firmware_version ro DevString Firmware version
tucam_version ro DevString TUCAM SDK version
======================= ======= ======================= ======================================================================
Commands
--------
======================= ======================== ======================= ===========================================
Command name Arg. in Arg. out Description
======================= ======================== ======================= ===========================================
Init DevVoid DevVoid Do not use
State DevVoid DevLong Return the device state
Status DevVoid DevString Return the device state as a string
getAttrStringValueList DevString: DevVarStringArray: Return the authorized string value list for
Attribute name String value list a given attribute name
======================= ======================== ======================= ===========================================
......@@ -71,7 +71,7 @@ namespace Dhyana
void getFanSpeed(unsigned& speed /Out/);
void setGlobalGain(unsigned gain);
void getGlobalGain(unsigned& gain /Out/);
void getTucamVersion(std::string& version);
void getTucamVersion(std::string& version /Out/);
void getFirmwareVersion(std::string& version /Out/);
bool isAcqRunning() const;
};
......
......@@ -15,16 +15,6 @@ class Dhyana(PyTango.Device_4Impl):
def __init__(self,*args) :
PyTango.Device_4Impl.__init__(self,*args)
# self.__TestImageSelector = {'TESTIMAGE_OFF': DhyanaAcq.Camera.TestImage_Off,
# 'TESTIMAGE_1': DhyanaAcq.Camera.TestImage_1,
# 'TESTIMAGE_2': DhyanaAcq.Camera.TestImage_2,
# 'TESTIMAGE_3': DhyanaAcq.Camera.TestImage_3,
# 'TESTIMAGE_4': DhyanaAcq.Camera.TestImage_4,
# 'TESTIMAGE_5': DhyanaAcq.Camera.TestImage_5,
# 'TESTIMAGE_6': DhyanaAcq.Camera.TestImage_6,
# 'TESTIMAGE_7': DhyanaAcq.Camera.TestImage_7,
# }
# self.__Attribute2FunctionBase = {
# }
......@@ -74,10 +64,9 @@ class DhyanaClass(PyTango.DeviceClass):
class_property_list = {}
device_property_list = {
# define one and only one of the following 4 properties:
'internal_trigger_timer':
[PyTango.DevLong,
"Internal Trigger Timer",0],
"Internal Trigger Timer",999],
}
cmd_list = {
......@@ -87,33 +76,61 @@ class DhyanaClass(PyTango.DeviceClass):
}
attr_list = {
'statistics_total_buffer_count':
[[PyTango.DevLong,
'temperature':
[[PyTango.DevDouble,
PyTango.SCALAR,
PyTango.READ],
{
'unit': 'N/A',
'unit': 'C',
'format': '',
'description': 'total number of frame requested',
'description': 'Camera temperature',
}],
'statistics_failed_buffer_count':
[[PyTango.DevLong,
'tucam_version':
[[PyTango.DevString,
PyTango.SCALAR,
PyTango.READ],
{
'unit': 'N/A',
'format': '',
'description': 'total number of failed frame',
}],
'test_image_selector':
'description': 'TuCam SDK version',
}],
'firmware_version':
[[PyTango.DevString,
PyTango.SCALAR,
PyTango.READ_WRITE],
PyTango.READ],
{
'unit': 'N/A',
'format': '',
'description': 'select a test image image_off/image_1/.../image_7',
'description': 'Camera firmware version',
}],
'temperature_target':
[[PyTango.DevDouble,
PyTango.SCALAR,
PyTango.READ_WRITE],
{
'unit': 'C',
'format': '',
'description': 'Temperature target',
}],
'global_gain':
[[PyTango.DevUShort,
PyTango.SCALAR,
PyTango.READ_WRITE],
{
'unit': 'C',
'format': '',
'description': 'Global gain setting',
}],
'fan_speed':
[[PyTango.DevUShort,
PyTango.SCALAR,
PyTango.READ_WRITE],
{
'unit': 'level',
'format': '',
'description': 'FAN speed',
}],
}
def __init__(self,name) :
......@@ -126,18 +143,11 @@ class DhyanaClass(PyTango.DeviceClass):
_DhyanaCam = None
_DhyanaInterface = None
# packet_size = 8000 suppose the eth MTU is set at least to 8192 (Jumbo mode !)
# otherwise frame transfer can failed, the package size must but
# correspond to the MTU, see README file under Pylon-3.2.2 installation
# directory for for details about network optimization.
def get_control(frame_transmission_delay = 0, inter_packet_delay = 0,
packet_size = 8000,force_video_mode= 'false', **keys) :
def get_control(**keys) :
global _DhyanaCam
global _DhyanaInterface
# if 'internal_trigger_timer' in keys:
# internal_trigger_timer = keys['internal_trigger_timer']
internal_trigger_timer = int(keys.get('internal_trigger_timer', 999))
# print ("Dhyana internal_trigger_timer:", internal_trigger_timer)
......@@ -145,9 +155,9 @@ def get_control(frame_transmission_delay = 0, inter_packet_delay = 0,
# so need to be converted to correct type
if _DhyanaCam is None:
_DhyanaCam = DhyanaAcq.Camera(999)
_DhyanaCam = DhyanaAcq.Camera(internal_trigger_timer)
_DhyanaInterface = DhyanaAcq.Interface(_DhyanaCam)
return Core.CtControl(_DhyanaInterface)
def get_tango_specific_class_n_device():
return DhyanaClass,Dhyana
\ No newline at end of file
return DhyanaClass,Dhyana
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