...
 
Commits (73)
...@@ -12,6 +12,7 @@ install ...@@ -12,6 +12,7 @@ install
*target* *target*
*.pyc *.pyc
*.bck *.bck
*.bak
/.project /.project
/2srv2.sh /2srv2.sh
/archive_all.sh /archive_all.sh
......
...@@ -6,6 +6,65 @@ You can find information releated to new features and bug fixes. The notes are o ...@@ -6,6 +6,65 @@ You can find information releated to new features and bug fixes. The notes are o
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/... 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/...
Stable branch core-1.7
----------------------
core-1.7.2 2017-02-03
Bug Fixes
* video: Fixed an inconsistency for scientific (monochrome) camera between
getSupportedVideoMode() and getMode().
core-1.7.1 2017-01-06
Features
* new tag 1.7.0 for cameras: andor/andor3/basler/dexela/espia/frelon/
maxipix/perkinelmer/pixirad/pointgrey/prosilica/roperscientific/simulator/
ueye/v4l2/xh
Bug Fixes
* maxipix: maxipix-1.7.1, Fixed for setFillMode, 2 reconstructionTask objects
created one passed to HwInterface the other kept internally in Camera object
* basler: basler-1.7.2, fixed monochrome vs. color mode
* basler: basler.-1.7.1, fixed bug introduced in 1.7.0 for Roi increments
* saving cbf: fixed Makefile + bison parser generation
New patch version just for CBF compilation
core-1.7.0 2017-04-01
Features
* Makefile: Improve Makefile library dependency definitions for parallel build
* tango: server with new saving statistics and with abort command
* basler: for color camera added yuv422packed video format
* saving header: add acquisiton and images parameters
* saving: added statistics.
We can now have saving, compression and incoming speed statistics
changing cbf,edf,fits,hdf5,nxs and tiff to manage statistics
* software operation: add possibility to force a copy for the first operation
internals operation are normally done in place but it's not always
safe with some type of memory.
i.e: You can not memove on a memory map, this cause a crash.
* saving: we can now write severals frames in parallel.
To control saving concurrency, you have to change the number of writing task
with method get/setMaxConcurrentWritingTask.
This commit contains also a small fix for write statistics:
As we recreate the container when changing saving type, thoses parameters
were not keeped.
We now set event callback in case of error when writing.
* saving cbf: compession optimisation with CBFMiniHeader format.
For now is only available for INT 32 images.
* control: added abort acquisition method
* basler: Pylon5 support and find proper pylon link flags
Bug Fixes
* video: fixed synchro to image when changing video mode.
- WARNING: only applied when live is started on already running
* saving cbf: fixed a bug in cbf header
* image: fixed roi when software operation is activated (rotation,flip...)
* image: fixed maximum roi
Stable branch core-1.6 Stable branch core-1.6
---------------------- ----------------------
......
...@@ -138,6 +138,7 @@ mod_version_data = { ...@@ -138,6 +138,7 @@ mod_version_data = {
'pointgrey': 'camera/pointgrey/VERSION', 'pointgrey': 'camera/pointgrey/VERSION',
'pixirad': 'camera/pixirad/VERSION', 'pixirad': 'camera/pixirad/VERSION',
'dexela': 'camera/dexela/VERSION', 'dexela': 'camera/dexela/VERSION',
'eiger': 'camera/eiger/VERSION',
'meta': 'camera/common/meta/VERSION', 'meta': 'camera/common/meta/VERSION',
'spec': 'applications/spec/VERSION', 'spec': 'applications/spec/VERSION',
'taco/camera/frelon': 'applications/taco/VERSION', 'taco/camera/frelon': 'applications/taco/VERSION',
...@@ -161,6 +162,7 @@ mod_version_data = { ...@@ -161,6 +162,7 @@ mod_version_data = {
'tango/camera/pointgrey': 'applications/tango/python/camera/PointGrey_VERSION', 'tango/camera/pointgrey': 'applications/tango/python/camera/PointGrey_VERSION',
'tango/camera/pixirad': 'applications/tango/python/camera/Pixirad_VERSION', 'tango/camera/pixirad': 'applications/tango/python/camera/Pixirad_VERSION',
'tango/camera/dexela': 'applications/tango/python/camera/Dexela_VERSION', 'tango/camera/dexela': 'applications/tango/python/camera/Dexela_VERSION',
'tango/camera/eiger': 'applications/tango/python/camera/Eiger_VERSION',
} }
windows_plugins = ['perkinelmer'] windows_plugins = ['perkinelmer']
......
Subproject commit 4b32d4904b26d8ea70c112ae45a2fe44b1b33c86 Subproject commit 043e98cdab4c87a0e61dc0c89b46008785d13bf8
Subproject commit e00b3f3bcb0ab8badc10f49aeb76edb7d3382910 Subproject commit d93b23f4bff5a1d7ed6ac75164685d11bb8ce9f9
...@@ -20,9 +20,6 @@ ...@@ -20,9 +20,6 @@
# along with this program; if not, see <http://www.gnu.org/licenses/>. # along with this program; if not, see <http://www.gnu.org/licenses/>.
############################################################################ ############################################################################
include ../config.inc
############################ ############################
# HELPER MACROS # HELPER MACROS
############################ ############################
...@@ -31,6 +28,10 @@ this-dir := $(shell pwd) ...@@ -31,6 +28,10 @@ this-dir := $(shell pwd)
lima-dir := $(this-dir)/.. lima-dir := $(this-dir)/..
third-party-dir := $(lima-dir)/third-party third-party-dir := $(lima-dir)/third-party
LIMA_DIR = $(lima-dir)
include $(LIMA_DIR)/config.inc
include $(LIMA_DIR)/control/control.inc
full-version = $(shell cat $(1)) full-version = $(shell cat $(1))
minor-version = $(shell echo $(call full-version,$(1)) | cut -f1-2 -d.) minor-version = $(shell echo $(call full-version,$(1)) | cut -f1-2 -d.)
ifneq ($(LINK_STRICT_VERSION),0) ifneq ($(LINK_STRICT_VERSION),0)
...@@ -44,15 +45,6 @@ lib-full = $(call lib-base,$(1)).$(call full-version,$(2)) ...@@ -44,15 +45,6 @@ lib-full = $(call lib-base,$(1)).$(call full-version,$(2))
lib-minor = $(call lib-base,$(1)).$(call minor-version,$(2)) lib-minor = $(call lib-base,$(1)).$(call minor-version,$(2))
lib-link = $(call lib-base,$(1)).$(call link-version,$(2)) lib-link = $(call lib-base,$(1)).$(call link-version,$(2))
lib-flags = -fPIC -Wl,-soname,$(call lib-link,$(1),$(2)) lib-flags = -fPIC -Wl,-soname,$(call lib-link,$(1),$(2))
lib-depshcmd = for p in $(1); do \
d=$$(echo $${p} | cut -d, -f1); \
l=$$(echo $${p} | cut -d, -f2); \
echo $(2); \
done
lib-depflagsstr = "-L $${d} -Wl,-rpath=$${d}"
lib-depflags = $(shell $(call lib-depshcmd,$(1),$(lib-depflagsstr)))
lib-deplibs = $(shell $(call lib-depshcmd,$(1),"-l$${l}"))
lib-deps = $(shell $(call lib-depshcmd,$(1),"$${d}/lib$${l}.so"))
# 1=name, 2=ver-file 3=deps 4=flags 5=libs, 6=target, 7=objs # 1=name, 2=ver-file 3=deps 4=flags 5=libs, 6=target, 7=objs
compile-lib = \ compile-lib = \
...@@ -70,40 +62,12 @@ create-links = \ ...@@ -70,40 +62,12 @@ create-links = \
# LIMA - CORE # LIMA - CORE
############################ ############################
CORE_LDFLAGS := CORE_LDFLAGS := $(CT_LDFLAGS)
CORE_LDLIBS := -lrt CORE_LDLIBS := $(CT_LDLIBS)
CORE_DEPLIBS := $(third-party-dir)/Processlib/build,processlib CORE_DEPLIBS := $(CT_DEPLIBS)
ifneq ($(COMPILE_CBF_SAVING),0)
CORE_LDLIBS += -lcrypto
CORE_DEPLIBS += $(third-party-dir)/CBFLib/lib,cbf
endif
ifneq ($(COMPILE_FITS_SAVING),0)
CORE_DEPLIBS += $(third-party-dir)/cfitsio/lib,cfitsio \
$(third-party-dir)/CCfits/.libs,CCfits
endif
ifneq ($(COMPILE_EDFGZ_SAVING),0)
CORE_LDLIBS += -lz
endif
ifneq ($(COMPILE_EDFLZ4_SAVING),0)
CORE_LDLIBS += -llz4
endif
ifneq ($(COMPILE_TIFF_SAVING),0)
CORE_LDLIBS += -ltiff
endif
ifneq ($(COMPILE_HDF5_SAVING),0) ifneq ($(COMPILE_HDF5_SAVING),0)
PROCESSOR_TYPE := $(shell uname -m) PROCESSOR_TYPE := $(shell uname -m)
CORE_DEPLIBS += $(third-party-dir)/hdf5/src/.libs,hdf5 \
$(third-party-dir)/hdf5/c++/src/.libs,hdf5_cpp
endif
ifneq ($(COMPILE_CONFIG),0)
CORE_DEPLIBS += $(third-party-dir)/libconfig/lib/.libs,config++
endif endif
ifneq ($(COMPILE_CORE),0) ifneq ($(COMPILE_CORE),0)
...@@ -249,6 +213,37 @@ build_targets += $(maxipix-libfull) ...@@ -249,6 +213,37 @@ build_targets += $(maxipix-libfull)
endif endif
############################
# LIMA - PCO
############################
ifneq ($(COMPILE_PCO),0)
PCO_LDFLAGS := -L$(SISODIR5)/lib64 -L. -g
PCO_LDLIBS := -lfglib5 -lclsersis -lhaprt -lpthread
pco-name := pco
pco-objs := ../camera/pco/src/Pco.o
pco-ver := ../camera/pco/VERSION
pco-flags := $(PCO_LDFLAGS)
pco-deps := $(DEPLIBS)
pco-libs := $(PCO_LDLIBS)
pco-libfull := $(call lib-full,$(pco-name),$(pco-ver))
# OLD 1=name, 2=ver-file 3=flags 4=deps, 5=target, 6=objs
# 1=name, 2=ver-file 3=deps 4=flags 5=libs, 6=target, 7=objs
$(pco-libfull): $(pco-objs)
$(call compile-lib,$(pco-name),$(pco-ver),\
$(pco-deps),$(pco-flags),$(pco-libs),$@,$(pco-objs))
$(call create-links,$(pco-name),$(pco-ver))
build_targets += $(pco-libfull)
endif
############################ ############################
# LIMA - BASLER # LIMA - BASLER
############################ ############################
...@@ -926,15 +921,14 @@ endif ...@@ -926,15 +921,14 @@ endif
ifneq ($(COMPILE_HEXITEC),0) ifneq ($(COMPILE_HEXITEC),0)
HEXITEC_LDFLAGS := $(LDFLAGS) -L/opt/pleora/ebus_sdk/CentOS-RHEL-7-x86_64/lib HEXITEC_LDFLAGS := -L/opt/pleora/ebus_sdk/CentOS-RHEL-7-x86_64/lib
HEXITEC_LDLIBS := $(LDLIBS) -lPvDevice -lPvStream -lPvBuffer -lPvGenICam -lPvBase -lPvSerial -lEbUtilsLib HEXITEC_LDLIBS := -lPvDevice -lPvStream -lPvBuffer -lPvGenICam -lPvBase -lPvSerial -lEbUtilsLib
hexitec-name := hexitec hexitec-name := hexitec
hexitec-objs := ../camera/hexitec/src/Hexitec.o hexitec-objs := ../camera/hexitec/src/Hexitec.o
hexitec-ver := ../camera/hexitec/VERSION hexitec-ver := ../camera/hexitec/VERSION
hexitec-flags := $(HEXITEC_LDFLAGS) hexitec-flags := $(LDFLAGS) $(HEXITEC_LDFLAGS)
hexitec-deps := $(HEXITEC_LDLIBS) hexitec-deps := $(LDLIBS) $(HEXITEC_LDLIBS)
$(call lib-full,$(hexitec-name),$(hexitec-ver)): $(hexitec-objs) $(call lib-full,$(hexitec-name),$(hexitec-ver)): $(hexitec-objs)
$(call compile-lib,$(hexitec-name),$(hexitec-ver),$(hexitec-flags),$(hexitec-deps),$@,$+) $(call compile-lib,$(hexitec-name),$(hexitec-ver),$(hexitec-flags),$(hexitec-deps),$@,$+)
......
<?xml version="1.0" encoding="Windows-1252"?> <?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject <VisualStudioProject
ProjectType="Visual C++" ProjectType="Visual C++"
Version="9.00" Version="9,00"
Name="LibLimaCore" Name="LibLimaCore"
ProjectGUID="{A4B703A6-C50F-442F-8952-54FB8EA51FF3}" ProjectGUID="{A4B703A6-C50F-442F-8952-54FB8EA51FF3}"
RootNamespace="LimaCore" RootNamespace="LimaCore"
...@@ -431,6 +431,62 @@ ...@@ -431,6 +431,62 @@
Name="VCPostBuildEventTool" Name="VCPostBuildEventTool"
/> />
</Configuration> </Configuration>
<Configuration
Name="Release_Win7_Sync|x64"
ConfigurationType="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations> </Configurations>
<References> <References>
</References> </References>
...@@ -645,187 +701,203 @@ ...@@ -645,187 +701,203 @@
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
> >
<File <File
RelativePath="..\..\..\..\common\include\AcqState.h" RelativePath="..\..\..\..\common\include\lima\AcqState.h"
>
</File>
<File
RelativePath="..\..\..\..\common\include\lima\AutoObj.h"
>
</File>
<File
RelativePath="..\..\..\..\common\include\lima\ConfigUtils.h"
>
</File>
<File
RelativePath="..\..\..\..\common\include\lima\Constants.h"
>
</File>
<File
RelativePath="..\..\..\..\control\include\lima\CtAccumulation.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\common\include\AutoObj.h" RelativePath="..\..\..\..\control\include\lima\CtAcquisition.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\common\include\BufferSave.h" RelativePath="..\..\..\..\control\include\lima\CtBuffer.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\common\include\Constants.h" RelativePath="..\..\..\..\control\include\lima\CtConfig.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\control\include\CtAccumulation.h" RelativePath="..\..\..\..\control\include\lima\CtControl.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\control\include\CtAcquisition.h" RelativePath="..\..\..\..\control\include\lima\CtEvent.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\control\include\CtBuffer.h" RelativePath="..\..\..\..\control\include\lima\CtImage.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\control\include\CtConfig.h" RelativePath="..\..\..\..\control\include\lima\CtSaving.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\control\include\CtControl.h" RelativePath="..\..\..\..\control\include\lima\CtShutter.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\control\include\CtImage.h" RelativePath="..\..\..\..\control\include\lima\CtSpsImage.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\control\include\CtSaving.h" RelativePath="..\..\..\..\control\include\lima\CtVideo.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\control\src\CtSaving_Cbf.h" RelativePath="..\..\..\..\common\include\lima\Debug.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\control\src\CtSaving_Edf.h" RelativePath="..\..\..\..\common\include\lima\DirectoryEventUtils.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\control\include\CtShutter.h" RelativePath="..\..\..\..\common\include\lima\Event.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\control\include\CtVideo.h" RelativePath="..\..\..\..\common\include\lima\Exceptions.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\common\include\Debug.h" RelativePath="..\..\..\..\hardware\include\lima\HwBinCtrlObj.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\common\include\Event.h" RelativePath="..\..\..\..\hardware\include\lima\HwBufferCtrlObj.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\common\include\Exceptions.h" RelativePath="..\..\..\..\hardware\include\lima\HwBufferMgr.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\hardware\include\HwBinCtrlObj.h" RelativePath="..\..\..\..\hardware\include\lima\HwBufferSave.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\hardware\include\HwBufferCtrlObj.h" RelativePath="..\..\..\..\hardware\include\lima\HwCap.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\hardware\include\HwBufferMgr.h" RelativePath="..\..\..\..\hardware\include\lima\HwConfigCtrlObj.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\hardware\include\HwCap.h" RelativePath="..\..\..\..\hardware\include\lima\HwDetInfoCtrlObj.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\hardware\include\HwConfigCtrlObj.h" RelativePath="..\..\..\..\hardware\include\lima\HwEventCtrlObj.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\hardware\include\HwDetInfoCtrlObj.h" RelativePath="..\..\..\..\hardware\include\lima\HwFileEventMgr.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\hardware\include\HwFlipCtrlObj.h" RelativePath="..\..\..\..\hardware\include\lima\HwFlipCtrlObj.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\hardware\include\HwFrameCallback.h" RelativePath="..\..\..\..\hardware\include\lima\HwFrameCallback.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\hardware\include\HwFrameInfo.h" RelativePath="..\..\..\..\hardware\include\lima\HwFrameInfo.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\hardware\include\HwInterface.h" RelativePath="..\..\..\..\hardware\include\lima\HwInterface.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\hardware\include\HwMaxImageSizeCallback.h" RelativePath="..\..\..\..\hardware\include\lima\HwMaxImageSizeCallback.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\hardware\include\HwRoiCtrlObj.h" RelativePath="..\..\..\..\hardware\include\lima\HwReconstructionCtrlObj.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\hardware\include\HwSavingCtrlObj.h" RelativePath="..\..\..\..\hardware\include\lima\HwRoiCtrlObj.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\hardware\include\HwSerialLine.h" RelativePath="..\..\..\..\hardware\include\lima\HwSavingCtrlObj.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\hardware\include\HwShutterCtrlObj.h" RelativePath="..\..\..\..\hardware\include\lima\HwSerialLine.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\hardware\include\HwSyncCtrlObj.h" RelativePath="..\..\..\..\hardware\include\lima\HwShutterCtrlObj.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\hardware\include\HwVideoCtrlObj.h" RelativePath="..\..\..\..\hardware\include\lima\HwSyncCtrlObj.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\common\include\MemUtils.h" RelativePath="..\..\..\..\hardware\include\lima\HwVideoCtrlObj.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\common\include\MiscUtils.h" RelativePath="..\..\..\..\common\include\lima\LimaCompatibility.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\camera\pco\include\PcoInterface.h" RelativePath="..\..\..\..\common\include\lima\MemUtils.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\common\include\SizeUtils.h" RelativePath="..\..\..\..\common\include\lima\MiscUtils.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\control\software_operation\include\SoftOpExternalMgr.h" RelativePath="..\..\..\..\common\include\lima\RegExUtils.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\control\software_operation\include\SoftOpId.h" RelativePath="..\..\..\..\common\include\lima\SizeUtils.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\control\software_operation\include\SoftOpInternalMgr.h" RelativePath="..\..\..\..\common\include\lima\StreamUtils.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\common\include\StreamUtils.h" RelativePath="..\..\..\..\common\include\lima\ThreadUtils.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\common\include\ThreadUtils.h" RelativePath="..\..\..\..\common\include\lima\Timer.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\common\include\Timestamp.h" RelativePath="..\..\..\..\common\include\lima\Timestamp.h"
> >
</File> </File>
<File <File
RelativePath="..\..\..\..\common\include\VideoUtils.h" RelativePath="..\..\..\..\common\include\lima\VideoUtils.h"
> >
</File> </File>
</Filter> </Filter>
......
...@@ -50,6 +50,14 @@ ifneq ($(COMPILE_MAXIPIX),0) ...@@ -50,6 +50,14 @@ ifneq ($(COMPILE_MAXIPIX),0)
sub-dirs += maxipix sub-dirs += maxipix
endif endif
ifndef COMPILE_PCO
COMPILE_PCO = 0
endif
ifneq ($(COMPILE_PCO),0)
sub-dirs += pco
endif
ifndef COMPILE_BASLER ifndef COMPILE_BASLER
COMPILE_BASLER = 0 COMPILE_BASLER = 0
endif endif
......
Subproject commit 0cd1373e3a86114dd61cd463e7cd507244e24b56 Subproject commit 0f37ee7043d4391c8a5c6ef44e88cbdc4e3991be
Subproject commit 15fb34b8c91944fd14ae7a0c0e21fa5ee65f58da Subproject commit 0c900768d0a18cee5b9e570da26064762bcfdb49
Subproject commit 5aa7b283d0dac0bb9c690354180cbc7dff0f58d9 Subproject commit c676cd4b1c761ac60ffbc66e24c92a2bd4bc0786
Subproject commit 50a1015660c8c13147560dde7d4b328df465aed9 Subproject commit 345a7cc7b70a04aaa91192aacf530747cf612c29
Subproject commit 7417bd9b7566e08fbbf61b04caccc8ab8702de48 Subproject commit ccc1e98aa4917d29eedd85c8a718029798d53e5e
Subproject commit 04b117bb8cdc54d4067122f32d8f8e9290437bb3 Subproject commit e7b56a4033ffe147665f47e5aa0abee3d364dec2
Subproject commit 41a247e681940ba4d37bb4a4058ffeaaea8e9681 Subproject commit eb023c563db6cef2db0ee5e3f45cceab3aa480e9
Subproject commit dc0442e42ed4f2a974ccf9e1858d0664320f5310 Subproject commit e4d993f69029b682081434a9d46fae463c4d4e9e
Subproject commit fba4a36718a4b142f28710de2615a5f8b9b418e1 Subproject commit c23f105f5fdb130015f4b06945b86abc15d478b2
Subproject commit c6c1bdf1806bd0c1ef206859ee50139b0da93768 Subproject commit 5adf0698f55cd7046f310be7e8f357b441f5261e
Subproject commit 6c3abdfd4a6fb3883c729de0856cf1abb5b36515 Subproject commit 802b4e3be7b1c5c7cf7c49f0de07f5b3f04c4dbb
Subproject commit 8b2f7e003c87210961fb2abce1df46c31d1a32f1 Subproject commit 81cfd99c024bf2b842431e27653c29e7b86e5515
Subproject commit 13e641256c464792d8480fea60343639bdbdcb45 Subproject commit 60031aa6c6d7c22eace59058b192eed088dad3cf
Subproject commit aecadc494adcae4f86c44d14fe3ec40d54096f37 Subproject commit 78e2af07dc0a30506bf48dba3fb383ab06a62aa4
Subproject commit c502186bb93c8a690230903bf47244d1256570b4 Subproject commit 67e0068d244cbb5e8fa417ecbfb4f98105913a1a
Subproject commit eb4c4c25f87ec3e82481006f1c33e4ea37a79f64 Subproject commit 45477aa6e9cab81e384b4d33e88281a2e1541ab3
...@@ -19,14 +19,19 @@ ...@@ -19,14 +19,19 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>. # along with this program; if not, see <http://www.gnu.org/licenses/>.
############################################################################ ############################################################################
LIMA_DIR := $(shell pwd)/../../..
include $(LIMA_DIR)/config.inc
include $(LIMA_DIR)/control/control.inc
simu-objs = SimulatorFrameBuilder.o SimulatorCamera.o SimulatorInterface.o \ simu-objs = SimulatorFrameBuilder.o SimulatorCamera.o SimulatorInterface.o \
SimulatorSyncCtrlObj.o SimulatorDetInfoCtrlObj.o SimulatorShutterCtrlObj.o SimulatorSyncCtrlObj.o SimulatorDetInfoCtrlObj.o SimulatorShutterCtrlObj.o
SRCS = $(simu-objs:.o=.cpp) SRCS = $(simu-objs:.o=.cpp)
CXX = g++ CXX = g++
INC = -I../include -I../../../common/include -I../../../hardware/include CPPFLAGS = -I../include $(CT_CPPFLAGS)
CXXFLAGS += $(INC) -Wall -pthread -fPIC -g CXXFLAGS = $(CT_CXXFLAGS)
all: Simu.o all: Simu.o
...@@ -37,7 +42,7 @@ clean: ...@@ -37,7 +42,7 @@ clean:
rm -f Simu.o *.P $(simu-objs) rm -f Simu.o *.P $(simu-objs)
%.o : %.cpp %.o : %.cpp
$(COMPILE.cpp) -MD $(CXXFLAGS) -o $@ $< $(COMPILE.cpp) $(CPPFLAGS) -MD $(CXXFLAGS) -o $@ $<
@cp $*.d $*.P; \ @cp $*.d $*.P; \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \ -e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \
...@@ -47,4 +52,4 @@ clean: ...@@ -47,4 +52,4 @@ clean:
.PHONY: check-syntax .PHONY: check-syntax
check-syntax: check-syntax:
$(CXX) -Wall -Wextra -fsyntax-only $(CXXFLAGS) $(CHK_SOURCES) $(CXX) $(CPPFLAGS) -Wextra -fsyntax-only $(CXXFLAGS) $(CHK_SOURCES)
...@@ -75,7 +75,7 @@ void Camera::SimuThread::execStartAcq() ...@@ -75,7 +75,7 @@ void Camera::SimuThread::execStartAcq()
buffer_mgr.setStartTimestamp(Timestamp::now()); buffer_mgr.setStartTimestamp(Timestamp::now());
FrameBuilder& frame_builder = m_simu->m_frame_builder; FrameBuilder& frame_builder = m_simu->m_frame_builder;
frame_builder.resetFrameNr(); frame_builder.resetFrameNr(m_acq_frame_nb);
int nb_frames = m_simu->m_trig_mode == IntTrig ? m_simu->m_nb_frames : m_acq_frame_nb + 1; int nb_frames = m_simu->m_trig_mode == IntTrig ? m_simu->m_nb_frames : m_acq_frame_nb + 1;
int& frame_nb = m_acq_frame_nb; int& frame_nb = m_acq_frame_nb;
......
...@@ -19,36 +19,38 @@ ...@@ -19,36 +19,38 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>. # along with this program; if not, see <http://www.gnu.org/licenses/>.
############################################################################ ############################################################################
LIMA_DIR := $(shell pwd)/../../..
simu-objs = ../src/Simu.o include $(LIMA_DIR)/config.inc
include $(LIMA_DIR)/control/control.inc
test-objs = test.o test-objs = test.o
test-ext-objs = $(simu-objs)
testsimulator-objs = testsimulator.o testsimulator-objs = testsimulator.o
testsimulator-ext-objs = $(simu-objs)
testsimuhwinterface-objs = testsimuhwinterface.o testsimuhwinterface-objs = testsimuhwinterface.o
testsimuhwinterface-ext-objs = $(simu-objs)
SRCS = $(test-objs:.o=.cpp) $(testsimulator-objs:.o=.cpp) \ SRCS = $(test-objs:.o=.cpp) $(testsimulator-objs:.o=.cpp) \
$(testsimuhwinterface-objs:.o=.cpp) $(testsimuhwinterface-objs:.o=.cpp)
INC = -I../include -I../../../common/include -I../../../hardware/include -I../../../third-party/Processlib/core/include CPPFLAGS = -I../include $(CT_CPPFLAGS)
CXXFLAGS += $(INC) -Wall -pthread -g CXXFLAGS = $(CT_CXXFLAGS)
LDFLAGS = -L../../../third-party/Processlib/build -lprocesslib -L../../../build -llimacore -pthread -lrt DEPLIBS = $(CT_DEPLIBS) \
$(LIMA_DIR)/build,limacore \
$(LIMA_DIR)/build,limasimulator
LDFLAGS = $(CT_LDFLAGS) $(call lib-depflags,$(DEPLIBS))
LDLIBS = $(CT_LDLIBS) $(call lib-deplibs,$(DEPLIBS))
all: test testsimulator testsimuhwinterface all: test testsimulator testsimuhwinterface
test: $(test-objs) $(test-ext-objs) test: $(test-objs)
$(CXX) -o $@ $+ $(LDFLAGS) $(CXX) $(LDFLAGS) -o $@ $+ $(LDLIBS)
testsimulator: $(testsimulator-objs) $(testsimulator-ext-objs) testsimulator: $(testsimulator-objs)
$(CXX) -o $@ $+ $(LDFLAGS) $(CXX) $(LDFLAGS) -o $@ $+ $(LDLIBS)
testsimuhwinterface: $(testsimuhwinterface-objs) \ testsimuhwinterface: $(testsimuhwinterface-objs)
$(testsimuhwinterface-ext-objs) $(CXX) $(LDFLAGS) -o $@ $+ $(LDLIBS)
$(CXX) -o $@ $+ $(LDFLAGS)
clean: clean:
rm -f $(test-objs) test *.edf rm -f $(test-objs) test *.edf
...@@ -57,7 +59,7 @@ clean: ...@@ -57,7 +59,7 @@ clean:
rm -f *.P rm -f *.P
%.o : %.cpp %.o : %.cpp
$(COMPILE.cpp) -MD $(CXXFLAGS) -o $@ $< $(COMPILE.cpp) $(CPPFLAGS) -MD $(CXXFLAGS) -o $@ $<
@cp $*.d $*.P; \ @cp $*.d $*.P; \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \ -e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \
......
Subproject commit 7d1b46a0874cc2b8ca4ab3fdbaa328aea410291e Subproject commit cc1369405e4eadea19eb001542979807049b53c9
Subproject commit 0c5c29faffd3fec69e4cdaa1ccc509dcad975a92 Subproject commit e41d908acaddda19361d4295f6828ccfd2f447a9
Subproject commit 8a6ceb1567f87c7506e94e340d927aaaa64fee92 Subproject commit 655f9c29c1d5aa738a5c76070090591ce0a3286d
...@@ -103,12 +103,12 @@ private: ...@@ -103,12 +103,12 @@ private:
{ {
public: public:
AutoLockData(M& mutex, int state=Locked) AutoLockData(M& mutex, int state=Locked)
: m(mutex), l(false), ul_at_end(true) : m(mutex), l(0), ul_at_end(true)
{ {
switch (state) { switch (state) {
case Locked: lock(); break; case Locked: lock(); break;
case TryLocked: tryLock(); break; case TryLocked: tryLock(); break;
case PrevLocked: l = true; break; case PrevLocked: l = 1; break;
default: break; default: break;
} }
} }
...@@ -132,20 +132,23 @@ private: ...@@ -132,20 +132,23 @@ private:
void lock() void lock()
{ {
if (!l++)
m.lock(); m.lock();
l = true;
} }
void unlock() void unlock()
{ {
if (!--l)
m.unlock(); m.unlock();
l = false;
} }
bool tryLock() bool tryLock()
{ {
if (!l)
l = m.tryLock(); l = m.tryLock();
return l; else
l++;
return !!l;
} }
void leaveLocked() void leaveLocked()
...@@ -162,7 +165,7 @@ private: ...@@ -162,7 +165,7 @@ private:
private: private:
AutoCounter c; AutoCounter c;
M& m; M& m;
bool l; char l;
bool ul_at_end; bool ul_at_end;
}; };
...@@ -180,6 +183,26 @@ private: ...@@ -180,6 +183,26 @@ private:
}; };
template <class M>
class AutoUnlock
{
public:
AutoUnlock(const AutoUnlock& o)
: l(o.l)
{ l.unlock(); }
AutoUnlock(AutoLock<M>& p)
: l(p)
{ l.unlock(); }
~AutoUnlock()
{ l.lock(); }
private:
AutoLock<M>& l;
};
/******************************************************************** /********************************************************************
* AutoPtr * AutoPtr
********************************************************************/ ********************************************************************/
...@@ -228,7 +251,7 @@ public: ...@@ -228,7 +251,7 @@ public:
return *this; return *this;
} }
AutoPtr& operator =(AutoPtr& o) AutoPtr& operator =(const AutoPtr& o)
{ {
AutoPtrData *od = o.getData(); // protects against "a = a" AutoPtrData *od = o.getData(); // protects against "a = a"
putData(); putData();
......
...@@ -561,6 +561,9 @@ inline DebProxy DebObj::write(DebType type, ConstStr file_name, int line_nr) ...@@ -561,6 +561,9 @@ inline DebProxy DebObj::write(DebType type, ConstStr file_name, int line_nr)
DebObj deb(getDebParams(), false, __FUNCTION__, \ DebObj deb(getDebParams(), false, __FUNCTION__, \
getDebObjName(), __FILE__, __LINE__) getDebObjName(), __FILE__, __LINE__)
#define DEB_PTR() \
(&deb)
#define DEB_FROM_PTR(deb_ptr) \ #define DEB_FROM_PTR(deb_ptr) \
DebObj& deb = *(deb_ptr) DebObj& deb = *(deb_ptr)
...@@ -601,6 +604,8 @@ inline DebProxy DebObj::write(DebType type, ConstStr file_name, int line_nr) ...@@ -601,6 +604,8 @@ inline DebProxy DebObj::write(DebType type, ConstStr file_name, int line_nr)
#define DEB_OBJ_NAME(o) \ #define DEB_OBJ_NAME(o) \
((o)->getDebObjName()) ((o)->getDebObjName())
#define DEB_CHECK_ANY(type) deb.checkAny(type)
#else //NO_LIMA_DEBUG #else //NO_LIMA_DEBUG
#define DEB_GLOBAL_FUNCT() DebSink deb #define DEB_GLOBAL_FUNCT() DebSink deb
...@@ -608,6 +613,7 @@ inline DebProxy DebObj::write(DebType type, ConstStr file_name, int line_nr) ...@@ -608,6 +613,7 @@ inline DebProxy DebObj::write(DebType type, ConstStr file_name, int line_nr)
#define DEB_DESTRUCTOR() DebSink deb #define DEB_DESTRUCTOR() DebSink deb
#define DEB_MEMBER_FUNCT() DebSink deb #define DEB_MEMBER_FUNCT() DebSink deb
#define DEB_PTR() NULL
#define DEB_FROM_PTR(deb_ptr) DebSink deb #define DEB_FROM_PTR(deb_ptr) DebSink deb
#define DEB_STATIC_FUNCT() DEB_GLOBAL_FUNCT() #define DEB_STATIC_FUNCT() DEB_GLOBAL_FUNCT()
#define DEB_SET_OBJ_NAME(n) #define DEB_SET_OBJ_NAME(n)
...@@ -631,6 +637,8 @@ inline DebProxy DebObj::write(DebType type, ConstStr file_name, int line_nr) ...@@ -631,6 +637,8 @@ inline DebProxy DebObj::write(DebType type, ConstStr file_name, int line_nr)
#define DEB_OBJ_NAME(o) #define DEB_OBJ_NAME(o)
#define DEB_CHECK_ANY(type) 0
#endif //NO_LIMA_DEBUG #endif //NO_LIMA_DEBUG
} // namespace lima } // namespace lima
......
//###########################################################################
// 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 SIMPLEPIPE_H
#define SIMPLEPIPE_H
#include <string>
class Pipe
{
public:
enum {
ReadFd = 0, WriteFd = 1,
};
Pipe(int buff_size = 0);
~Pipe();
void write(std::string s);
std::string read(int len, double timeout = -1);
std::string readLine(int len, std::string term, double timeout = -1);
void close(int which);
private:
bool waitForInput(double timeout);
int m_fd[2];
int m_buff_size;
static const int DefBuffSize;
};
#endif // SIMPLEPIPE_H
...@@ -78,6 +78,7 @@ class LIMACORE_API Mutex ...@@ -78,6 +78,7 @@ class LIMACORE_API Mutex
typedef AutoLock<Mutex> AutoMutex; typedef AutoLock<Mutex> AutoMutex;
typedef AutoUnlock<Mutex> AutoMutexUnlock;
class LIMACORE_API Cond class LIMACORE_API Cond
{ {
......
...@@ -19,20 +19,24 @@ ...@@ -19,20 +19,24 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>. # along with this program; if not, see <http://www.gnu.org/licenses/>.
############################################################################ ############################################################################
include ../../config.inc LIMA_DIR := $(shell pwd)/../..
include $(LIMA_DIR)/config.inc
include $(LIMA_DIR)/control/control.inc
common-objs := Constants.o SizeUtils.o Timestamp.o ThreadUtils.o Exceptions.o \ common-objs := Constants.o SizeUtils.o Timestamp.o ThreadUtils.o Exceptions.o \
MemUtils.o RegExUtils.o AcqState.o Debug.o VideoUtils.o Event.o \ MemUtils.o RegExUtils.o AcqState.o Debug.o VideoUtils.o Event.o \
Timer.o DirectoryEventUtils.o Timer.o DirectoryEventUtils.o SimplePipe.o
has_not_inotify = $(shell grep INOTIFY_USER /boot/config-$(shell uname -r) >/dev/null 2>&1; echo $$?) has_not_inotify = $(shell grep INOTIFY_USER /boot/config-$(shell uname -r) >/dev/null 2>&1; echo $$?)
SRCS = $(common-objs:.o=.cpp) SRCS = $(common-objs:.o=.cpp)
CXXFLAGS += -I../include -I../../hardware/include -I../../third-party/Processlib/core/include -Wall -pthread -fPIC -g CPPFLAGS = $(CT_CPPFLAGS)
CXXFLAGS = $(CT_CXXFLAGS)
ifeq ($(has_not_inotify),0) ifeq ($(has_not_inotify),0)
CXXFLAGS += -DHAS_INOTIFY CPPFLAGS += -DHAS_INOTIFY
endif endif
ifndef COMPILE_CONFIG ifndef COMPILE_CONFIG
...@@ -41,7 +45,7 @@ endif ...@@ -41,7 +45,7 @@ endif
ifneq ($(COMPILE_CONFIG),0) ifneq ($(COMPILE_CONFIG),0)
common-objs += ConfigUtils.o common-objs += ConfigUtils.o
CXXFLAGS += -DWITH_CONFIG -I../../third-party/libconfig/lib CPPFLAGS += -DWITH_CONFIG -I$(LIMA_DIR)/third-party/libconfig/lib
endif endif
all: Common.o all: Common.o
...@@ -54,7 +58,7 @@ clean: ...@@ -54,7 +58,7 @@ clean:
%.o : %.cpp %.o : %.cpp
$(COMPILE.cpp) -MD $(CXXFLAGS) -o $@ $< $(COMPILE.cpp) $(CPPFLAGS) -MD $(CXXFLAGS) -o $@ $<
@cp $*.d $*.P; \ @cp $*.d $*.P; \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \ -e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \
...@@ -64,4 +68,4 @@ clean: ...@@ -64,4 +68,4 @@ clean:
.PHONY: check-syntax .PHONY: check-syntax
check-syntax: check-syntax:
$(CXX) -Wall -Wextra -fsyntax-only $(CXXFLAGS) $(CHK_SOURCES) $(CXX) $(CPPFLAGS) -Wextra -fsyntax-only $(CXXFLAGS) $(CHK_SOURCES)
...@@ -122,11 +122,12 @@ MemBuffer::MemBuffer(int size) ...@@ -122,11 +122,12 @@ MemBuffer::MemBuffer(int size)
__m128i zero = _mm_setzero_si128(); __m128i zero = _mm_setzero_si128();
for(long i = 0;i < size;i += page_size,ptr+=page_size) for(long i = 0;i < size;i += page_size,ptr+=page_size)
{ {
if(size_t(size - page_size) > sizeof(__m128i)) if(size_t(size - i) >= sizeof(__m128i))
_mm_store_si128((__m128i*)ptr,zero); _mm_store_si128((__m128i*)ptr,zero);
else else
*ptr = 0; *ptr = 0;
} }
_mm_empty();
} }
else else
{ {
...@@ -150,10 +151,11 @@ MemBuffer::MemBuffer(const MemBuffer& buffer) ...@@ -150,10 +151,11 @@ MemBuffer::MemBuffer(const MemBuffer& buffer)
MemBuffer::~MemBuffer() MemBuffer::~MemBuffer()
{ {
if (!m_size)
throw LIMA_COM_EXC(Error, "Deleting empty buffer");
release(); release();
} }
void MemBuffer::alloc(int size) void MemBuffer::alloc(int size)
{ {
if (m_size == size) if (m_size == size)
......
//###########################################################################
// 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 "lima/SimplePipe.h"
#include <sys/select.h>
#include <iostream>
#include <cmath>
#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
using namespace std;
//-------------------------------------------------------------
// SimpePipe
//-------------------------------------------------------------
const int Pipe::DefBuffSize = 4096;
Pipe::Pipe(int buff_size)
: m_buff_size(buff_size ? buff_size : DefBuffSize)
{
if (::pipe(m_fd) < 0) {
cerr << "Error creating pipe" << endl;
throw exception();
}
}
Pipe::~Pipe()
{
close(ReadFd);
close(WriteFd);
}
void Pipe::close(int which)
{
int& fd = m_fd[which];
if (fd)
::close(fd);
fd = 0;
}
void Pipe::write(string s)
{
if (::write(m_fd[WriteFd], s.data(), s.size()) < 0) {
cerr << "Error writing to pipe" << endl;
throw exception();
}
}
string Pipe::read(int len, double timeout)
{
char buffer[m_buff_size];
string s;
while (int(s.size()) < len) {
if (!waitForInput(timeout))
break;
ssize_t req_read = len - s.size();
if (req_read > m_buff_size)
req_read = m_buff_size;
ssize_t read_bytes = ::read(m_fd[ReadFd], buffer, req_read);
if (read_bytes < 0) {
cerr << "Error reading from pipe" << endl;
throw exception();
} else if (read_bytes == 0)
break;
s.append(buffer, read_bytes);
}
return s;
}
std::string Pipe::readLine(int len, string term, double timeout)
{
if (term.size() == 0)
return read(len, timeout);
string s;
while ((s.size() == 0) || (s.find(term) == s.npos)) {
string r = read(1, timeout);
if (r.size() == 0)
break;
s.append(r);
}
return s;
}
bool Pipe::waitForInput(double timeout)
{
int fd = m_fd[ReadFd];
fd_set rfds;
FD_ZERO(&rfds);
FD_SET(fd, &rfds);
struct timeval tout_ts = {0, 0};
if (timeout > 0) {
tout_ts.tv_sec = long(floor(timeout));
tout_ts.tv_usec = long((timeout - tout_ts.tv_sec) * 1e6);
}
struct timeval *tout_ptr = (timeout >= 0) ? &tout_ts : NULL;
int ret = select(fd + 1, &rfds, NULL, NULL, tout_ptr);
if (ret < 0) {
cerr << "Error in select-read pipe "
<< "(timeout=" << timeout << ")"
<< ": " << strerror(errno) << endl;
throw exception();
}
return (ret > 0);
}
...@@ -19,20 +19,27 @@ ...@@ -19,20 +19,27 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>. # along with this program; if not, see <http://www.gnu.org/licenses/>.
############################################################################ ############################################################################
LIMA_DIR := $(shell pwd)/../..
include $(LIMA_DIR)/control/control.inc
SRCS = testregex.cpp SRCS = testregex.cpp
CXXFLAGS = -Wall -I ../include -pthread -g CPPFLAGS = $(CT_CPPFLAGS)
LDFLAGS = -L../../build/ -Wl,--no-as-needed,-rpath=$(shell pwd)/../../build -llimacore -lpthread CXXFLAGS = $(CT_CXXFLAGS)
DEPLIBS = $(CT_DEPLIBS) $(LIMA_DIR)/build,limacore
LDFLAGS = $(CT_LDFLAGS) $(call lib-depflags,$(DEPLIBS))
LDLIBS = $(CT_LDLIBS) $(call lib-deplibs,$(DEPLIBS))
all: testregex all: testregex
testregex: testregex.o testregex: testregex.o
$(CXX) $(LDFLAGS) -o $@ $+ $(CXX) $(LDFLAGS) -o $@ $+ $(LDLIBS)
clean: clean:
rm -f *.o testregex rm -f *.o testregex
%.o : %.cpp %.o : %.cpp
$(COMPILE.cpp) -MD $(CXXFLAGS) -o $@ $< $(COMPILE.cpp) $(CPPFLAGS) -MD $(CXXFLAGS) -o $@ $<
@cp $*.d $*.P; \ @cp $*.d $*.P; \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \ -e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \
...@@ -42,4 +49,4 @@ clean: ...@@ -42,4 +49,4 @@ clean:
.PHONY: check-syntax .PHONY: check-syntax
check-syntax: check-syntax:
$(CXX) -Wall -Wextra -fsyntax-only $(CXXFLAGS) $(CHK_SOURCES) $(CXX) $(CPPFLAGS) -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/>.
############################################################################
ct-objs = CtSaving.o CtControl.o CtAcquisition.o CtBuffer.o \
CtImage.o CtSaving_Edf.o CtShutter.o CtAccumulation.o CtVideo.o \
CtEvent.o
CT_INCLS = -I$(LIMA_DIR)/common/include \
-I$(LIMA_DIR)/hardware/include \
-I$(LIMA_DIR)/control/include \
-I$(LIMA_DIR)/control/software_operation/include \
-I$(LIMA_DIR)/third-party/Processlib/core/include \
-I$(LIMA_DIR)/third-party/Processlib/tasks/include \
-I$(LIMA_DIR)/third-party/Sps/Include # \
# -I/usr/include/nexuscpp/include
CT_CPPFLAGS =
CT_CXXFLAGS =
CT_DEPLIBS = $(LIMA_DIR)/third-party/Processlib/build,processlib
CT_LDFLAGS = -pthread
CT_LDLIBS = -lrt
ifndef COMPILE_CBF_SAVING
COMPILE_CBF_SAVING = 0
endif
ifneq ($(COMPILE_CBF_SAVING),0)
ct-objs += CtSaving_Cbf.o