Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
Lima
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
62
Issues
62
List
Boards
Labels
Service Desk
Milestones
Jira
Jira
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LimaGroup
Lima
Commits
f114618a
Commit
f114618a
authored
Dec 04, 2012
by
Sebastien Petitdemange
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New Feature: load/save lima configuration
parent
e03c705f
Changes
44
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
44 changed files
with
2147 additions
and
80 deletions
+2147
-80
.gitmodules
.gitmodules
+3
-0
build/Makefile
build/Makefile
+5
-1
build/msvc/9.0/LibSimulator/LibSimulator.sln
build/msvc/9.0/LibSimulator/LibSimulator.sln
+10
-1
build/msvc/9.0/LibSimulator/LibSimulator.vcproj
build/msvc/9.0/LibSimulator/LibSimulator.vcproj
+12
-4
build/msvc/9.0/LimaCore/LimaCore.sln
build/msvc/9.0/LimaCore/LimaCore.sln
+7
-0
build/msvc/9.0/LimaCore/LimaCore.vcproj
build/msvc/9.0/LimaCore/LimaCore.vcproj
+23
-7
camera/simulator/test/Makefile
camera/simulator/test/Makefile
+4
-5
common/include/ConfigUtils.h
common/include/ConfigUtils.h
+64
-0
common/include/Constants.h
common/include/Constants.h
+12
-5
common/src/ConfigUtils.cpp
common/src/ConfigUtils.cpp
+142
-0
common/src/Constants.cpp
common/src/Constants.cpp
+172
-13
common/src/Makefile
common/src/Makefile
+11
-0
common/test/Makefile
common/test/Makefile
+2
-2
config.inc_default
config.inc_default
+2
-1
control/include/CtAccumulation.h
control/include/CtAccumulation.h
+16
-0
control/include/CtAcquisition.h
control/include/CtAcquisition.h
+34
-0
control/include/CtConfig.h
control/include/CtConfig.h
+109
-0
control/include/CtControl.h
control/include/CtControl.h
+12
-2
control/include/CtImage.h
control/include/CtImage.h
+30
-4
control/include/CtSaving.h
control/include/CtSaving.h
+125
-22
control/include/CtShutter.h
control/include/CtShutter.h
+7
-0
control/include/CtVideo.h
control/include/CtVideo.h
+17
-1
control/sip/CtAccumulation.sip
control/sip/CtAccumulation.sip
+7
-0
control/sip/CtConfig.sip
control/sip/CtConfig.sip
+289
-0
control/sip/CtControl.sip
control/sip/CtControl.sip
+1
-0
control/sip/CtVideo.sip
control/sip/CtVideo.sip
+8
-1
control/src/CtAccumulation.cpp
control/src/CtAccumulation.cpp
+39
-0
control/src/CtAcquisition.cpp
control/src/CtAcquisition.cpp
+56
-1
control/src/CtConfig.cpp
control/src/CtConfig.cpp
+415
-0
control/src/CtControl.cpp
control/src/CtControl.cpp
+32
-1
control/src/CtImage.cpp
control/src/CtImage.cpp
+112
-1
control/src/CtSaving.cpp
control/src/CtSaving.cpp
+89
-2
control/src/CtShutter.cpp
control/src/CtShutter.cpp
+53
-0
control/src/CtVideo.cpp
control/src/CtVideo.cpp
+91
-1
control/src/Makefile
control/src/Makefile
+9
-0
hardware/include/HwCap.h
hardware/include/HwCap.h
+3
-0
hardware/include/HwConfigCtrlObj.h
hardware/include/HwConfigCtrlObj.h
+43
-0
hardware/src/HwCap.cpp
hardware/src/HwCap.cpp
+4
-0
install.inc
install.inc
+7
-0
sip/configure.py
sip/configure.py
+5
-4
sip/core/limacore.sip
sip/core/limacore.sip
+35
-1
third-party/Makefile
third-party/Makefile
+28
-0
third-party/libconfig
third-party/libconfig
+1
-0
windowsInstall.py
windowsInstall.py
+1
-0
No files found.
.gitmodules
View file @
f114618a
...
...
@@ -82,3 +82,6 @@
[submodule "camera/andor3"]
path = camera/andor3
url = git://github.com/esrf-bliss/Lima-camera-andor3.git
[submodule "third-party/libconfig"]
path = third-party/libconfig
url = git://github.com/esrf-bliss/libconfig.git
build/Makefile
View file @
f114618a
...
...
@@ -56,7 +56,7 @@ create-links = \
# LIMA - CORE
############################
CORE_LDFLAGS
:=
-L
../third-party/Processlib/build
CORE_LDFLAGS
:=
-L
../third-party/Processlib/build
-Wl
,-rpath
=
$(
shell
pwd
)
/../third-party/Processlib/build
CORE_LDLIBS
:=
-lprocesslib
-lrt
ifneq
($(COMPILE_CBF_SAVING),0)
...
...
@@ -73,6 +73,10 @@ ifneq ($(COMPILE_EDFGZ_SAVING),0)
CORE_LDLIBS
+=
-lz
endif
ifneq
($(COMPILE_CONFIG),0)
CORE_LDLIBS
+=
-L
../third-party/libconfig/lib/.libs
-Wl
,-rpath
=
$(
shell
pwd
)
/../third-party/libconfig/lib/.libs
-lconfig
++
endif
ifneq
($(COMPILE_CORE),0)
core-name
:=
core
...
...
build/msvc/9.0/LibSimulator/LibSimulator.sln
View file @
f114618a
...
...
@@ -3,14 +3,19 @@ Microsoft Visual Studio Solution File, Format Version 10.00
# Visual C++ Express 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibSimulator", "LibSimulator.vcproj", "{3E1490E7-66C0-4E77-9746-0632466FF270}"
ProjectSection(ProjectDependencies) = postProject
{F6556656-D091-43AF-B46F-355F4ABA5DB6} = {F6556656-D091-43AF-B46F-355F4ABA5DB6}
{A4B703A6-C50F-442F-8952-54FB8EA51FF3} = {A4B703A6-C50F-442F-8952-54FB8EA51FF3}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibLimaCore", "..\LimaCore\LimaCore.vcproj", "{A4B703A6-C50F-442F-8952-54FB8EA51FF3}"
ProjectSection(ProjectDependencies) = postProject
{F6556656-D091-43AF-B46F-355F4ABA5DB6} = {F6556656-D091-43AF-B46F-355F4ABA5DB6}
{1A234565-926D-49B2-83E4-D56E0C38C9F2} = {1A234565-926D-49B2-83E4-D56E0C38C9F2}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libprocesslib", "..\..\..\..\third-party\Processlib\build\msvc\9.0\libprocesslib\libprocesslib.vcproj", "{F6556656-D091-43AF-B46F-355F4ABA5DB6}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libconfig", "..\..\..\..\third-party\libconfig\lib\libconfig.vcproj", "{1A234565-926D-49B2-83E4-D56E0C38C9F2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
...
...
@@ -29,6 +34,10 @@ Global
{F6556656-D091-43AF-B46F-355F4ABA5DB6}.Debug|Win32.Build.0 = Debug|Win32
{F6556656-D091-43AF-B46F-355F4ABA5DB6}.Release|Win32.ActiveCfg = Release|Win32
{F6556656-D091-43AF-B46F-355F4ABA5DB6}.Release|Win32.Build.0 = Release|Win32
{1A234565-926D-49B2-83E4-D56E0C38C9F2}.Debug|Win32.ActiveCfg = Debug|Win32
{1A234565-926D-49B2-83E4-D56E0C38C9F2}.Debug|Win32.Build.0 = Debug|Win32
{1A234565-926D-49B2-83E4-D56E0C38C9F2}.Release|Win32.ActiveCfg = Release|Win32
{1A234565-926D-49B2-83E4-D56E0C38C9F2}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
...
...
build/msvc/9.0/LibSimulator/LibSimulator.vcproj
View file @
f114618a
...
...
@@ -178,6 +178,14 @@
Filter=
"cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier=
"{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=
"..\..\..\..\camera\simulator\src\SimulatorCamera.cpp"
>
</File>
<File
RelativePath=
"..\..\..\..\camera\simulator\src\SimulatorDetInfoCtrlObj.cpp"
>
</File>
<File
RelativePath=
"..\..\..\..\camera\simulator\src\SimulatorFrameBuilder.cpp"
>
...
...
@@ -187,7 +195,7 @@
>
</File>
<File
RelativePath=
"..\..\..\..\camera\simulator\src\Simulator
Camera
.cpp"
RelativePath=
"..\..\..\..\camera\simulator\src\Simulator
SyncCtrlObj
.cpp"
>
</File>
</Filter>
...
...
@@ -197,15 +205,15 @@
UniqueIdentifier=
"{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=
"..\..\..\..\camera\simulator\include\Simulator
FrameBuilder
.h"
RelativePath=
"..\..\..\..\camera\simulator\include\Simulator
Camera
.h"
>
</File>
<File
RelativePath=
"..\..\..\..\camera\simulator\include\Simulator
Interface
.h"
RelativePath=
"..\..\..\..\camera\simulator\include\Simulator
FrameBuilder
.h"
>
</File>
<File
RelativePath=
"..\..\..\..\camera\simulator\include\Simulator
Camera
.h"
RelativePath=
"..\..\..\..\camera\simulator\include\Simulator
Interface
.h"
>
</File>
</Filter>
...
...
build/msvc/9.0/LimaCore/LimaCore.sln
View file @
f114618a
...
...
@@ -4,10 +4,13 @@ Microsoft Visual Studio Solution File, Format Version 10.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibLimaCore", "LimaCore.vcproj", "{A4B703A6-C50F-442F-8952-54FB8EA51FF3}"
ProjectSection(ProjectDependencies) = postProject
{F6556656-D091-43AF-B46F-355F4ABA5DB6} = {F6556656-D091-43AF-B46F-355F4ABA5DB6}
{A0C36CE7-D908-4573-8B69-249EEEB7D2BE} = {A0C36CE7-D908-4573-8B69-249EEEB7D2BE}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libprocesslib", "..\..\..\..\third-party\Processlib\build\msvc\9.0\libprocesslib\libprocesslib.vcproj", "{F6556656-D091-43AF-B46F-355F4ABA5DB6}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libconfig++", "..\..\..\..\third-party\libconfig\lib\libconfig++.vcproj", "{A0C36CE7-D908-4573-8B69-249EEEB7D2BE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
...
...
@@ -22,6 +25,10 @@ Global
{F6556656-D091-43AF-B46F-355F4ABA5DB6}.Debug|Win32.Build.0 = Debug|Win32
{F6556656-D091-43AF-B46F-355F4ABA5DB6}.Release|Win32.ActiveCfg = Release|Win32
{F6556656-D091-43AF-B46F-355F4ABA5DB6}.Release|Win32.Build.0 = Release|Win32
{A0C36CE7-D908-4573-8B69-249EEEB7D2BE}.Debug|Win32.ActiveCfg = Debug|Win32
{A0C36CE7-D908-4573-8B69-249EEEB7D2BE}.Debug|Win32.Build.0 = Debug|Win32
{A0C36CE7-D908-4573-8B69-249EEEB7D2BE}.Release|Win32.ActiveCfg = Release|Win32
{A0C36CE7-D908-4573-8B69-249EEEB7D2BE}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
...
...
build/msvc/9.0/LimaCore/LimaCore.vcproj
View file @
f114618a
...
...
@@ -42,8 +42,8 @@
<Tool
Name=
"VCCLCompilerTool"
Optimization=
"0"
AdditionalIncludeDirectories=
"..\..\..\..\control\src;"..\..\..\..\third-party\Processlib\tasks\include";"..\..\..\..\third-party\Processlib\core\include\WindowSpecific";"..\..\..\..\third-party\Processlib\core\include";..\..\..\..\control\software_operation\include;..\..\..\..\control\include;..\..\..\..\hardware\include;..\..\..\..\common\include"
PreprocessorDefinitions=
"WIN32;NDEBUG;_WINDOWS;_USRDLL;LIMACORE_EXPORTS;_WIN32_WINNT=0x0502"
AdditionalIncludeDirectories=
"..\..\..\..\control\src;"..\..\..\..\third-party\Processlib\tasks\include";"..\..\..\..\third-party\Processlib\core\include\WindowSpecific";"..\..\..\..\third-party\Processlib\core\include";..\..\..\..\control\software_operation\include;..\..\..\..\control\include;..\..\..\..\hardware\include;..\..\..\..\common\include
;"..\..\..\..\third-party\libconfig\lib"
"
PreprocessorDefinitions=
"WIN32;NDEBUG;_WINDOWS;_USRDLL;LIMACORE_EXPORTS;_WIN32_WINNT=0x0502
;WITH_CONFIG
"
MinimalRebuild=
"true"
BasicRuntimeChecks=
"0"
RuntimeLibrary=
"2"
...
...
@@ -65,7 +65,7 @@
/>
<Tool
Name=
"VCLinkerTool"
AdditionalDependencies=
"$(InputDir)..\..\..\..\third-party\Processlib\build\msvc\9.0\libprocesslib\Debug\libprocesslib.lib"
AdditionalDependencies=
"$(InputDir)..\..\..\..\third-party\Processlib\build\msvc\9.0\libprocesslib\Debug\libprocesslib.lib
$(InputDir)..\..\..\..\third-party\libconfig\lib\libconfig++.Debug\libconfig++_d.lib
"
OutputFile=
"$(InputDir)$(IntDir)\$(ProjectName).dll"
LinkIncremental=
"2"
AdditionalLibraryDirectories=
""..\..\..\..\third-party\Processlib\build\msvc\9.0\libprocesslib\Debug""
...
...
@@ -123,8 +123,8 @@
Name=
"VCCLCompilerTool"
Optimization=
"2"
EnableIntrinsicFunctions=
"true"
AdditionalIncludeDirectories=
"..\..\..\..\control\src;"..\..\..\..\third-party\Processlib\tasks\include";"..\..\..\..\third-party\Processlib\core\include\WindowSpecific";"..\..\..\..\third-party\Processlib\core\include";..\..\..\..\control\software_operation\include;..\..\..\..\control\include;..\..\..\..\hardware\include;..\..\..\..\common\include"
PreprocessorDefinitions=
"WIN32;NDEBUG;_WINDOWS;_USRDLL;LIMACORE_EXPORTS;_WIN32_WINNT=0x0502"
AdditionalIncludeDirectories=
"..\..\..\..\control\src;"..\..\..\..\third-party\Processlib\tasks\include";"..\..\..\..\third-party\Processlib\core\include\WindowSpecific";"..\..\..\..\third-party\Processlib\core\include";..\..\..\..\control\software_operation\include;..\..\..\..\control\include;..\..\..\..\hardware\include;..\..\..\..\common\include
;"..\..\..\..\third-party\libconfig\lib"
"
PreprocessorDefinitions=
"WIN32;NDEBUG;_WINDOWS;_USRDLL;LIMACORE_EXPORTS;_WIN32_WINNT=0x0502
;WITH_CONFIG
"
RuntimeLibrary=
"2"
EnableFunctionLevelLinking=
"true"
UsePrecompiledHeader=
"0"
...
...
@@ -145,10 +145,10 @@
/>
<Tool
Name=
"VCLinkerTool"
AdditionalDependencies=
"$(InputDir)..\..\..\..\third-party\Processlib\build\msvc\9.0\libprocesslib\Release\libprocesslib.lib"
AdditionalDependencies=
"$(InputDir)..\..\..\..\third-party\Processlib\build\msvc\9.0\libprocesslib\Release\libprocesslib.lib
$(InputDir)..\..\..\..\third-party\libconfig\lib\libconfig++.Release\libconfig++.lib
"
OutputFile=
"$(InputDir)$(IntDir)\$(ProjectName).dll"
LinkIncremental=
"1"
AdditionalLibraryDirectories=
""..\..\..\..\third-party\Processlib\build\msvc\9.0\libprocesslib\Release""
AdditionalLibraryDirectories=
""..\..\..\..\third-party\Processlib\build\msvc\9.0\libprocesslib\Release"
;"..\..\..\..\third-party\libconfig\lib\libconfig++.Release"
"
GenerateDebugInformation=
"true"
GenerateMapFile=
"true"
MapExports=
"true"
...
...
@@ -192,6 +192,10 @@
RelativePath=
"..\..\..\..\common\src\AcqState.cpp"
>
</File>
<File
RelativePath=
"..\..\..\..\common\src\ConfigUtils.cpp"
>
</File>
<File
RelativePath=
"..\..\..\..\common\src\Constants.cpp"
>
...
...
@@ -208,6 +212,10 @@
RelativePath=
"..\..\..\..\control\src\CtBuffer.cpp"
>
</File>
<File
RelativePath=
"..\..\..\..\control\src\CtConfig.cpp"
>
</File>
<File
RelativePath=
"..\..\..\..\control\src\CtControl.cpp"
>
...
...
@@ -397,6 +405,10 @@
RelativePath=
"..\..\..\..\control\include\CtBuffer.h"
>
</File>
<File
RelativePath=
"..\..\..\..\control\include\CtConfig.h"
>
</File>
<File
RelativePath=
"..\..\..\..\control\include\CtControl.h"
>
...
...
@@ -453,6 +465,10 @@
RelativePath=
"..\..\..\..\hardware\include\HwCap.h"
>
</File>
<File
RelativePath=
"..\..\..\..\hardware\include\HwConfigCtrlObj.h"
>
</File>
<File
RelativePath=
"..\..\..\..\hardware\include\HwDetInfoCtrlObj.h"
>
...
...
camera/simulator/test/Makefile
View file @
f114618a
...
...
@@ -20,28 +20,27 @@
# along with this program; if not, see <http://www.gnu.org/licenses/>.
############################################################################
std-objs
=
../../../common/src/Common.o ../../../hardware/src/Hw.o
simu-objs
=
../src/Simu.o
test-objs
=
test.o
test-ext-objs
=
$
(
simu-objs
)
testsimulator-objs
=
testsimulator.o
testsimulator-ext-objs
=
$
(
simu-objs
)
$
(
std-objs
)
testsimulator-ext-objs
=
$
(
simu-objs
)
testsimuhwinterface-objs
=
testsimuhwinterface.o
testsimuhwinterface-ext-objs
=
$
(
simu-objs
)
$
(
std-objs
)
testsimuhwinterface-ext-objs
=
$
(
simu-objs
)
SRCS
=
$
(
test-objs:.o
=
.cpp
)
$
(
testsimulator-objs:.o
=
.cpp
)
\
$
(
testsimuhwinterface-objs:.o
=
.cpp
)
INC
=
-I
../include
-I
../../../common/include
-I
../../../hardware/include
-I
../../../third-party/Processlib/core/include
CXXFLAGS
+=
$(INC)
-Wall
-pthread
-g
LDFLAGS
=
-L
../../../third-party/Processlib/build
-lprocesslib
-pthread
-lrt
LDFLAGS
=
-L
../../../third-party/Processlib/build
-lprocesslib
-
L
../../../build
-llimacore
-
pthread
-lrt
all
:
test testsimulator testsimuhwinterface
test
:
$(test-objs) $(test-ext-objs)
$(std-objs)
test
:
$(test-objs) $(test-ext-objs)
$(CXX)
-o
$@
$+
$(LDFLAGS)
testsimulator
:
$(testsimulator-objs) $(testsimulator-ext-objs)
...
...
common/include/ConfigUtils.h
0 → 100644
View file @
f114618a
//###########################################################################
// 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 CONFIGUTILS_H
#define CONFIGUTILS_H
#include "Debug.h"
#include "LimaCompatibility.h"
namespace
libconfig
{
class
Setting
;
}
namespace
lima
{
class
LIMACORE_API
Setting
{
DEB_CLASS_NAMESPC
(
DebModCommon
,
"Setting"
,
"Common"
);
public:
Setting
(
libconfig
::
Setting
*
setting
=
NULL
)
:
m_setting
(
setting
)
{}
// --- lookup
bool
get
(
const
char
*
alias
,
bool
&
value
)
const
;
bool
get
(
const
char
*
alias
,
int
&
value
)
const
;
bool
get
(
const
char
*
alias
,
long
&
value
)
const
;
bool
get
(
const
char
*
alias
,
long
long
&
value
)
const
;
bool
get
(
const
char
*
alias
,
double
&
value
)
const
;
bool
get
(
const
char
*
alias
,
const
char
*&
value
)
const
;
bool
get
(
const
char
*
alias
,
std
::
string
&
value
)
const
;
// --- modifiers
void
set
(
const
char
*
alias
,
bool
value
);
void
set
(
const
char
*
alias
,
int
value
);
void
set
(
const
char
*
alias
,
long
value
);
void
set
(
const
char
*
alias
,
long
long
value
);
void
set
(
const
char
*
alias
,
double
value
);
void
set
(
const
char
*
alias
,
const
char
*
value
);
void
set
(
const
char
*
alias
,
const
std
::
string
&
value
);
// --- child
Setting
addChild
(
const
char
*
alias
);
bool
getChild
(
const
char
*
alias
,
Setting
&
child
)
const
;
const
libconfig
::
Setting
*
get_raw_setting
()
const
{
return
m_setting
;}
private:
libconfig
::
Setting
*
m_setting
;
};
}
#endif
common/include/Constants.h
View file @
f114618a
...
...
@@ -44,13 +44,15 @@ enum ImageType {
};
LIMACORE_API
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
ImageType
image_type
);
LIMACORE_API
const
char
*
convert_2_string
(
ImageType
image_type
);
LIMACORE_API
void
convert_from_string
(
const
std
::
string
&
,
ImageType
&
);
enum
AcqMode
{
Single
,
Concatenation
,
Accumulation
,
};
LIMACORE_API
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
AcqMode
acq_mode
);
LIMACORE_API
const
char
*
convert_2_string
(
AcqMode
mode
);
LIMACORE_API
void
convert_from_string
(
const
std
::
string
&
,
AcqMode
&
);
enum
TrigMode
{
IntTrig
,
IntTrigMult
,
ExtTrigSingle
,
ExtTrigMult
,
...
...
@@ -58,7 +60,8 @@ enum TrigMode {
};
LIMACORE_API
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
TrigMode
trig_mode
);
LIMACORE_API
const
char
*
convert_2_string
(
TrigMode
trigMode
);
LIMACORE_API
void
convert_from_string
(
const
std
::
string
&
,
TrigMode
&
);
enum
BufferMode
{
Linear
,
Circular
,
};
...
...
@@ -72,7 +75,8 @@ enum ShutterMode {
typedef
std
::
vector
<
ShutterMode
>
ShutterModeList
;
LIMACORE_API
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
ShutterMode
shutter_mode
);
LIMACORE_API
const
char
*
convert_2_string
(
ShutterMode
);
LIMACORE_API
void
convert_from_string
(
const
std
::
string
&
,
ShutterMode
&
);
enum
AcqStatus
{
AcqReady
,
AcqRunning
,
AcqFault
,
AcqConfig
};
...
...
@@ -104,7 +108,8 @@ enum VideoMode {Y8,Y16,Y32,Y64,
I420
,
YUV411
,
YUV422
,
YUV444
};
LIMACORE_API
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
VideoMode
videoMode
);
LIMACORE_API
const
char
*
convert_2_string
(
VideoMode
);
LIMACORE_API
void
convert_from_string
(
const
std
::
string
&
,
VideoMode
&
);
enum
RotationMode
{
Rotation_0
,
Rotation_90
,
...
...
@@ -113,6 +118,8 @@ enum RotationMode {
};
LIMACORE_API
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
RotationMode
rotationMode
);
LIMACORE_API
const
char
*
convert_2_string
(
RotationMode
rotationMode
);
LIMACORE_API
void
convert_from_string
(
const
std
::
string
&
,
RotationMode
&
);
}
// namespace lima
#endif // CONSTANTS_H
common/src/ConfigUtils.cpp
0 → 100644
View file @
f114618a
//###########################################################################
// 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 <libconfig.h++>
#include "Exceptions.h"
#include "ConfigUtils.h"
using
namespace
lima
;
bool
Setting
::
get
(
const
char
*
alias
,
bool
&
value
)
const
{
return
m_setting
->
lookupValue
(
alias
,
value
);
}
bool
Setting
::
get
(
const
char
*
alias
,
int
&
value
)
const
{
return
m_setting
->
lookupValue
(
alias
,
value
);
}
bool
Setting
::
get
(
const
char
*
alias
,
long
&
value
)
const
{
long
long
tmpValue
;
bool
rFlag
=
m_setting
->
lookupValue
(
alias
,
tmpValue
);
if
(
rFlag
)
value
=
long
(
tmpValue
);
return
rFlag
;
}
bool
Setting
::
get
(
const
char
*
alias
,
long
long
&
value
)
const
{
return
m_setting
->
lookupValue
(
alias
,
value
);
}
bool
Setting
::
get
(
const
char
*
alias
,
double
&
value
)
const
{
return
m_setting
->
lookupValue
(
alias
,
value
);
}
bool
Setting
::
get
(
const
char
*
alias
,
const
char
*&
value
)
const
{
return
m_setting
->
lookupValue
(
alias
,
value
);
}
bool
Setting
::
get
(
const
char
*
alias
,
std
::
string
&
value
)
const
{
return
m_setting
->
lookupValue
(
alias
,
value
);
}
// --- modifiers
#define SET_VALUE(Type) \
if(m_setting->exists(alias)) \
m_setting->operator[](alias) = value; \
else \
{ \
libconfig::Setting& nSetting = m_setting->add(alias,Type); \
nSetting = value; \
}
void
Setting
::
set
(
const
char
*
alias
,
bool
value
)
{
SET_VALUE
(
libconfig
::
Setting
::
TypeBoolean
);
}
void
Setting
::
set
(
const
char
*
alias
,
int
value
)
{
SET_VALUE
(
libconfig
::
Setting
::
TypeInt
);
}
void
Setting
::
set
(
const
char
*
alias
,
long
value
)
{
SET_VALUE
(
libconfig
::
Setting
::
TypeInt64
);
}
void
Setting
::
set
(
const
char
*
alias
,
long
long
value
)
{
SET_VALUE
(
libconfig
::
Setting
::
TypeInt64
);
}
void
Setting
::
set
(
const
char
*
alias
,
double
value
)
{
SET_VALUE
(
libconfig
::
Setting
::
TypeFloat
);
}
void
Setting
::
set
(
const
char
*
alias
,
const
char
*
value
)
{
SET_VALUE
(
libconfig
::
Setting
::
TypeString
);
}
void
Setting
::
set
(
const
char
*
alias
,
const
std
::
string
&
value
)
{
SET_VALUE
(
libconfig
::
Setting
::
TypeString
);
}
// --- child management
Setting
Setting
::
addChild
(
const
char
*
alias
)
{
DEB_MEMBER_FUNCT
();
try
{
libconfig
::
Setting
&
alias_setting
=
m_setting
->
add
(
alias
,
libconfig
::
Setting
::
TypeGroup
);
return
Setting
(
&
alias_setting
);
}
catch
(
libconfig
::
SettingNameException
&
exp
)
{
THROW_COM_ERROR
(
Error
)
<<
exp
.
what
();
}
catch
(
libconfig
::
SettingTypeException
&
exp
)
{
THROW_COM_ERROR
(
Error
)
<<
exp
.
what
();
}
}
bool
Setting
::
getChild
(
const
char
*
alias
,
Setting
&
child
)
const
{
bool
returnFlag
=
m_setting
->
exists
(
alias
);
if
(
returnFlag
)
{
libconfig
::
Setting
&
alias_setting
=
m_setting
->
operator
[](
alias
);
returnFlag
=
alias_setting
.
isGroup
();
if
(
returnFlag
)
child
.
m_setting
=
&
alias_setting
;
}
return
returnFlag
;
}
common/src/Constants.cpp
View file @
f114618a
...
...
@@ -19,6 +19,10 @@
// 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 <algorithm>
#include "Debug.h"
#include "Exceptions.h"
#include "Constants.h"
using
namespace
lima
;
...
...
@@ -34,7 +38,7 @@ ostream& lima::operator <<(ostream& os, AlignDir align_dir)
return
os
<<
name
;
}
ostream
&
lima
::
operator
<<
(
ostream
&
os
,
ImageType
image_type
)
const
char
*
lima
::
convert_2_string
(
ImageType
image_type
)
{
const
char
*
name
=
"Unknown"
;
switch
(
image_type
)
{
...
...
@@ -51,21 +55,74 @@ ostream& lima::operator <<(ostream& os, ImageType image_type)
case
Bpp32
:
name
=
"Bpp32"
;
break
;
case
Bpp32S
:
name
=
"Bpp32S"
;
break
;
}
return
os
<<
name
;
return
name
;
}
void
lima
::
convert_from_string
(
const
std
::
string
&
val
,
ImageType
&
image_type
)
{
std
::
string
buffer
=
val
;
std
::
transform
(
buffer
.
begin
(),
buffer
.
end
(),
buffer
.
begin
(),
::
tolower
);
if
(
buffer
==
"bpp8"
)
image_type
=
Bpp8
;
else
if
(
buffer
==
"bpp8s"
)
image_type
=
Bpp8S
;
else
if
(
buffer
==
"bpp10"
)
image_type
=
Bpp10
;
else
if
(
buffer
==
"bpp10s"
)
image_type
=
Bpp10S
;
else
if
(
buffer
==
"bpp12"
)
image_type
=
Bpp12
;
else
if
(
buffer
==
"bpp12s"
)
image_type
=
Bpp12S
;
else
if
(
buffer
==
"bpp14"
)
image_type
=
Bpp14
;
else
if
(
buffer
==
"bpp14s"
)
image_type
=
Bpp14S
;
else
if
(
buffer
==
"bpp16"
)
image_type
=
Bpp16
;
else
if
(
buffer
==
"bpp16s"
)
image_type
=
Bpp16S
;
else
if
(
buffer
==
"bpp32"
)
image_type
=
Bpp32
;
else
if
(
buffer
==
"bpp32s"
)
image_type
=
Bpp32S
;
else
{
std
::
ostringstream
msg
;
msg
<<
"ImageType can't be:"
<<
DEB_VAR1
(
val
);
throw
LIMA_EXC
(
Common
,
InvalidValue
,
msg
.
str
());
}
}
ostream
&
lima
::
operator
<<
(
ostream
&
os
,
AcqMode
acq_mod
e
)
ostream
&
lima
::
operator
<<
(
ostream
&
os
,
ImageType
image_typ
e
)
{
const
char
*
name
=
"Unknown"
;
return
os
<<
convert_2_string
(
image_type
);
}
const
char
*
lima
::
convert_2_string
(
AcqMode
acq_mode
)
{
const
char
*
name
=
"Unknown"
;
switch
(
acq_mode
)
{
case
Single
:
name
=
"Single"
;
break
;
case
Accumulation
:
name
=
"Accumulation"
;
break
;
case
Concatenation
:
name
=
"Concatenation"
;
break
;
}
return
os
<<
name
;
return
name
;
}
void
lima
::
convert_from_string
(
const
std
::
string
&
val
,
AcqMode
&
mode
)
{
std
::
string
buffer
=
val
;
std
::
transform
(
buffer
.
begin
(),
buffer
.
end
(),
buffer
.
begin
(),
::
tolower
);
if
(
buffer
==
"single"
)
mode
=
Single
;
else
if
(
buffer
==
"accumulation"
)
mode
=
Accumulation
;
else
if
(
buffer
==
"concatenation"
)
mode
=
Concatenation
;
else
{
std
::
ostringstream
msg
;
msg
<<
"AcqMode can't be:"
<<
DEB_VAR1
(
val
);
throw
LIMA_EXC
(
Common
,
InvalidValue
,
msg
.
str
());
}
}
ostream
&
lima
::
operator
<<
(
ostream
&
os
,
AcqMode
acq_mode
)
{
return
os
<<
convert_2_string
(
acq_mode
);
}
ostream
&
lima
::
operator
<<
(
ostream
&
os
,
TrigMode
trig_mode
)
const
char
*
lima
::
convert_2_string
(
TrigMode
trig_mode
)
{
const
char
*
name
=
"Unknown"
;
switch
(
trig_mode
)
{
...
...
@@ -77,7 +134,33 @@ ostream& lima::operator <<(ostream& os, TrigMode trig_mode)
case
ExtStartStop
:
name
=
"ExtStartStop"
;
break
;
case
ExtTrigReadout
:
name
=
"ExtTrigReadout"
;
break
;
}
return
os
<<
name
;
return
name
;
}
void
lima
::
convert_from_string
(
const
std
::
string
&
val
,
TrigMode
&
trig_mode
)
{
std
::
string
buffer
=
val
;
std
::
transform
(
buffer
.
begin
(),
buffer
.
end
(),
buffer
.
begin
(),
::
tolower
);
if
(
buffer
==
"inttrig"
)
trig_mode
=
IntTrig
;
else
if
(
buffer
==
"inttrigmult"
)
trig_mode
=
IntTrigMult
;
else
if
(
buffer
==
"exttrigsingle"
)
trig_mode
=
ExtTrigSingle
;
else
if
(
buffer
==
"exttrigmult"
)
trig_mode
=
ExtTrigMult
;
else
if
(
buffer
==
"extgate"
)
trig_mode
=
ExtGate
;
else
if
(
buffer
==
"extstartstop"
)
trig_mode
=
ExtStartStop
;
else
if
(
buffer
==
"exttrigreadout"
)
trig_mode
=
ExtTrigReadout
;
else
{
std
::
ostringstream
msg
;
msg
<<
"TrigMode can't be:"
<<
DEB_VAR1
(
val
);
throw
LIMA_EXC
(
Common
,
InvalidValue
,
msg
.
str
());