mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-20 16:48:01 +02:00
Compare commits
166 Commits
2020.08.10
...
2020.09.09
Author | SHA1 | Date | |
---|---|---|---|
8bdfe7527f | |||
b33fdf4462 | |||
70386633f6 | |||
6c8443f09e | |||
bf52ec10da | |||
bdac4d133e | |||
e8156d412e | |||
8e09b50c5e | |||
aecde086a0 | |||
311cebcd00 | |||
8496f5715f | |||
f26d8e514b | |||
0b9ff70244 | |||
e82e531fb1 | |||
503f83e8e3 | |||
1a90c58d9e | |||
c467bd677e | |||
f280d033b9 | |||
c9cf845c9a | |||
63bbbfb438 | |||
5540f16116 | |||
a77833b4c7 | |||
9ee67f2cfa | |||
cf3758f155 | |||
b20720686e | |||
1edb1e8816 | |||
30e06c6386 | |||
ea601fe1f7 | |||
f0c576c779 | |||
fb8842e048 | |||
5b182469a1 | |||
a1b88d3a62 | |||
514346c3ba | |||
9218ef5a95 | |||
b124cea67b | |||
497eff6f04 | |||
92635c5bd3 | |||
a00231dab6 | |||
35c7e46d60 | |||
47da2540af | |||
891b8dbd2c | |||
89f0479318 | |||
7048a75808 | |||
a081fbbdaa | |||
22f14cacb0 | |||
6b7dee2631 | |||
6d1856daa2 | |||
7bb9696151 | |||
44335f9cf4 | |||
d62d5ef804 | |||
dbaab61ea2 | |||
180c7b7191 | |||
050f0ff8a0 | |||
658a804cca | |||
73530ddd6f | |||
abe34d573c | |||
05d5652532 | |||
38e0351068 | |||
e192cad1f2 | |||
b8350b070e | |||
3ddeea3c2b | |||
42b5ff3a62 | |||
00978a52c8 | |||
8400c686b5 | |||
adb6171e35 | |||
973b8f7106 | |||
2f81c233f5 | |||
e4274e3f95 | |||
b92f9af025 | |||
7ca1609c58 | |||
4cd81437ab | |||
7e202b6c26 | |||
e0df9fcd99 | |||
30307220e3 | |||
6a74851e0c | |||
ac30717083 | |||
bfed02b41e | |||
b5669dc921 | |||
97ee2d269d | |||
bc5cc3fa29 | |||
abd2808924 | |||
786b14e88b | |||
f19799343e | |||
2e4783f296 | |||
3954913661 | |||
7eafceb0f9 | |||
a1e06ca7a9 | |||
27c1916d63 | |||
64075c0e75 | |||
9505c51404 | |||
6d8168722a | |||
f9261c0f32 | |||
d44388a44e | |||
6a18a214ba | |||
83baf18490 | |||
ddf2085b4b | |||
508ec150f5 | |||
5eda75ebdd | |||
0253933271 | |||
0f80079d16 | |||
fd601128b7 | |||
bc09b8bfb9 | |||
e85326d415 | |||
396685e6a9 | |||
cf6a48d7a9 | |||
4f45110cda | |||
3aa75ce167 | |||
5b364b9ad8 | |||
550ab51f34 | |||
e782fcce62 | |||
a2ec86006d | |||
6399d1bdfb | |||
6cd8bbcb12 | |||
678967bfe1 | |||
ffd694eda1 | |||
ab2f929e83 | |||
4540eddd68 | |||
534c7105f4 | |||
c8a39d1d9e | |||
bd6d212f99 | |||
c4f0052ac9 | |||
5bfbc83a04 | |||
429eb8da53 | |||
f6cde374c4 | |||
1f811dfabd | |||
8ef6f32be6 | |||
a7cc2b38d8 | |||
9b26f5a6c8 | |||
c4fde7f7bc | |||
5f23a664fa | |||
209c97f44c | |||
d631fda2c7 | |||
caff89a040 | |||
42067b3de3 | |||
a287ce46b1 | |||
7212a0d433 | |||
9bae97ec4c | |||
096b0c424d | |||
39c2ab4743 | |||
57e0fd805e | |||
071a1c9f98 | |||
0cb418a89b | |||
4e9c99d65d | |||
dd918fb326 | |||
7ea86dec43 | |||
eeb386fef5 | |||
afabc9a503 | |||
1d8f9a5aed | |||
d4e11e56ea | |||
de69e666a9 | |||
28ffad223d | |||
f0d0e9ab1f | |||
854d8d4ae2 | |||
16af67924e | |||
d822600c68 | |||
816e5200b2 | |||
9c58b4802c | |||
0c7759d7e4 | |||
690947ec3a | |||
45182283d1 | |||
03ac0910cd | |||
b6c94b2ab4 | |||
336dfcae60 | |||
d47f0feb17 | |||
784628589e | |||
21995b3d4a |
32
.github/ISSUE_TEMPLATE/bug_report.md
vendored
32
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@ -5,40 +5,22 @@ title: New Bug Report
|
|||||||
labels: action - Bug, priority - Unclassified, status - Pending
|
labels: action - Bug, priority - Unclassified, status - Pending
|
||||||
template: bug_report.md
|
template: bug_report.md
|
||||||
---
|
---
|
||||||
|
<!-- Preview changes before submitting -->
|
||||||
<!-- Check an option by - [x], Uncheck an option by - [ ] -->
|
|
||||||
<!-- Please preview to see your option has been selected -->
|
|
||||||
|
|
||||||
<!-- Please fill out everything with an *, as this report will be discarded otherwise -->
|
<!-- Please fill out everything with an *, as this report will be discarded otherwise -->
|
||||||
|
<!-- This is a comment, the syntax is a bit different from c++ or bash -->
|
||||||
|
|
||||||
##### *Distribution:
|
##### *Distribution:
|
||||||
- [x] RHEL7
|
<!-- RHEL7, RHEL6, Fedora, etc -->
|
||||||
- [ ] RHEL6
|
|
||||||
- [ ] Fedora
|
|
||||||
- [ ] Other
|
|
||||||
|
|
||||||
##### *Detector type:
|
##### *Detector type:
|
||||||
- [x] Not applicable
|
<!-- If applicable, Eiger, Jungfrau, Mythen3, Gotthard2, Gotthard, Moench, ChipTestBoard -->
|
||||||
- [ ] Eiger
|
|
||||||
- [ ] Jungfrau
|
|
||||||
- [ ] Mythen3
|
|
||||||
- [ ] Gotthard2
|
|
||||||
- [ ] Gotthard
|
|
||||||
- [ ] Moench
|
|
||||||
- [ ] ChipTestBoard
|
|
||||||
|
|
||||||
##### *Software Package Version:
|
##### *Software Package Version:
|
||||||
- [ ] developer
|
<!-- developer, 4.2.0, 4.1.1, etc -->
|
||||||
- [ ] 4.2.0
|
|
||||||
- [ ] 4.1.1
|
|
||||||
<!-- If others, please describe -->
|
|
||||||
|
|
||||||
##### Priority:
|
##### Priority:
|
||||||
- [ ] Super Low
|
<!-- Super Low, Low, Medium, High, Super High -->
|
||||||
- [ ] Low
|
|
||||||
- [ ] Medium
|
|
||||||
- [ ] High
|
|
||||||
- [ ] Super High
|
|
||||||
|
|
||||||
##### *Describe the bug
|
##### *Describe the bug
|
||||||
<!-- A clear and concise description of what the bug is -->
|
<!-- A clear and concise description of what the bug is -->
|
||||||
|
26
.github/ISSUE_TEMPLATE/change_request.md
vendored
26
.github/ISSUE_TEMPLATE/change_request.md
vendored
@ -5,34 +5,18 @@ title: New Change Request
|
|||||||
labels: action - Change, priority - Unclassified, status - Pending
|
labels: action - Change, priority - Unclassified, status - Pending
|
||||||
template: change_request.md
|
template: change_request.md
|
||||||
---
|
---
|
||||||
|
<!-- Preview changes before submitting -->
|
||||||
<!-- Check an option by - [x], Uncheck an option by - [ ] -->
|
|
||||||
<!-- Please preview to see your option has been selected -->
|
|
||||||
|
|
||||||
<!-- Please fill out everything with an *, as this report will be discarded otherwise -->
|
<!-- Please fill out everything with an *, as this report will be discarded otherwise -->
|
||||||
|
<!-- This is a comment, the syntax is a bit different from c++ or bash -->
|
||||||
|
|
||||||
##### *Detector type:
|
##### *Detector type:
|
||||||
- [x] Not applicable
|
<!-- If applicable, Eiger, Jungfrau, Mythen3, Gotthard2, Gotthard, Moench, ChipTestBoard -->
|
||||||
- [ ] Eiger
|
|
||||||
- [ ] Jungfrau
|
|
||||||
- [ ] Mythen3
|
|
||||||
- [ ] Gotthard2
|
|
||||||
- [ ] Gotthard
|
|
||||||
- [ ] Moench
|
|
||||||
- [ ] ChipTestBoard
|
|
||||||
|
|
||||||
##### *Software Package Version:
|
##### *Software Package Version:
|
||||||
- [ ] developer
|
<!-- developer, 4.2.0, 4.1.1, etc -->
|
||||||
- [ ] 4.2.0
|
|
||||||
- [ ] 4.1.1
|
|
||||||
<!-- If others, please describe -->
|
|
||||||
|
|
||||||
##### Priority:
|
##### Priority:
|
||||||
- [ ] Super Low
|
<!-- Super Low, Low, Medium, High, Super High -->
|
||||||
- [ ] Low
|
|
||||||
- [ ] Medium
|
|
||||||
- [ ] High
|
|
||||||
- [ ] Super High
|
|
||||||
|
|
||||||
##### *State the change request:
|
##### *State the change request:
|
||||||
<!-- A clear and concise description of what the change is to an existing feature -->
|
<!-- A clear and concise description of what the change is to an existing feature -->
|
||||||
|
28
.github/ISSUE_TEMPLATE/feature_request.md
vendored
28
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@ -1,38 +1,22 @@
|
|||||||
---
|
---
|
||||||
name: Feature Request
|
name: Feature Request
|
||||||
about: Suggest a feature
|
about: Suggest a feature, documentation or submit a question
|
||||||
title: New Feature Request
|
title: New Feature Request
|
||||||
labels: action - Enhancement, priority - Unclassified, status - Pending
|
labels: action - Enhancement, priority - Unclassified, status - Pending
|
||||||
template: feature_request.md
|
template: feature_request.md
|
||||||
---
|
---
|
||||||
|
<!-- Preview changes before submitting -->
|
||||||
<!-- Check an option by - [x], Uncheck an option by - [ ] -->
|
|
||||||
<!-- Please preview to see your option has been selected -->
|
|
||||||
|
|
||||||
<!-- Please fill out everything with an *, as this report will be discarded otherwise -->
|
<!-- Please fill out everything with an *, as this report will be discarded otherwise -->
|
||||||
|
<!-- This is a comment, the syntax is a bit different from c++ or bash -->
|
||||||
|
|
||||||
##### *Detector type:
|
##### *Detector type:
|
||||||
- [x] Not applicable
|
<!-- If applicable, Eiger, Jungfrau, Mythen3, Gotthard2, Gotthard, Moench, ChipTestBoard -->
|
||||||
- [ ] Eiger
|
|
||||||
- [ ] Jungfrau
|
|
||||||
- [ ] Mythen3
|
|
||||||
- [ ] Gotthard2
|
|
||||||
- [ ] Gotthard
|
|
||||||
- [ ] Moench
|
|
||||||
- [ ] ChipTestBoard
|
|
||||||
|
|
||||||
##### *Software Package Version:
|
##### *Software Package Version:
|
||||||
- [ ] developer
|
<!-- developer, 4.2.0, 4.1.1, etc -->
|
||||||
- [ ] 4.2.0
|
|
||||||
- [ ] 4.1.1
|
|
||||||
<!-- If others, please describe -->
|
|
||||||
|
|
||||||
##### Priority:
|
##### Priority:
|
||||||
- [ ] Super Low
|
<!-- Super Low, Low, Medium, High, Super High -->
|
||||||
- [ ] Low
|
|
||||||
- [ ] Medium
|
|
||||||
- [ ] High
|
|
||||||
- [ ] Super High
|
|
||||||
|
|
||||||
##### *State the feature:
|
##### *State the feature:
|
||||||
<!-- A clear and concise description of what the feature is -->
|
<!-- A clear and concise description of what the feature is -->
|
||||||
|
@ -63,17 +63,18 @@ find_package(ClangFormat)
|
|||||||
check_ipo_supported(RESULT SLS_LTO_AVAILABLE)
|
check_ipo_supported(RESULT SLS_LTO_AVAILABLE)
|
||||||
|
|
||||||
|
|
||||||
# Use ld.gold if it is available and isn't disabled explicitly
|
# # Use ld.gold if it is available and isn't disabled explicitly
|
||||||
option(SLS_USE_LD_GOLD "Use GNU gold linker" ON)
|
# option(SLS_USE_LD_GOLD "Use GNU gold linker" ON)
|
||||||
if (SLS_USE_LD_GOLD)
|
# if (SLS_USE_LD_GOLD)
|
||||||
execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
|
# execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
|
||||||
if ("${LD_VERSION}" MATCHES "GNU gold")
|
# if ("${LD_VERSION}" MATCHES "GNU gold")
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fuse-ld=gold")
|
# set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=gold")
|
# set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
|
||||||
else ()
|
# set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
|
||||||
message(WARNING "GNU gold linker isn't available, using the default system linker.")
|
# else ()
|
||||||
endif ()
|
# message(WARNING "GNU gold linker isn't available, using the default system linker.")
|
||||||
endif ()
|
# endif ()
|
||||||
|
# endif ()
|
||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
|
||||||
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||||
@ -240,7 +241,7 @@ if(SLS_MASTER_PROJECT)
|
|||||||
# Set install dir CMake packages
|
# Set install dir CMake packages
|
||||||
set(CMAKE_INSTALL_DIR "share/cmake/${PROJECT_NAME}")
|
set(CMAKE_INSTALL_DIR "share/cmake/${PROJECT_NAME}")
|
||||||
# Set the list of exported targets
|
# Set the list of exported targets
|
||||||
set(PROJECT_LIBRARIES slsSupportLib slsDetectorShared slsReceiverShared)
|
set(PROJECT_LIBRARIES slsSupportShared slsDetectorShared slsReceiverShared)
|
||||||
# Generate and install package config file and version
|
# Generate and install package config file and version
|
||||||
include(cmake/package_config.cmake)
|
include(cmake/package_config.cmake)
|
||||||
endif()
|
endif()
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#Look for an executable called sphinx-build
|
#Look for an executable called sphinx-build
|
||||||
find_program(SPHINX_EXECUTABLE
|
find_program(SPHINX_EXECUTABLE
|
||||||
NAMES sphinx-build
|
NAMES sphinx-build sphinx-build-3.6
|
||||||
DOC "Path to sphinx-build executable")
|
DOC "Path to sphinx-build executable")
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
include(FindPackageHandleStandardArgs)
|
||||||
|
23
cmk.sh
23
cmk.sh
@ -12,6 +12,7 @@ TESTS=0
|
|||||||
SIMULATOR=0
|
SIMULATOR=0
|
||||||
CTBGUI=0
|
CTBGUI=0
|
||||||
MANUALS=0
|
MANUALS=0
|
||||||
|
MANUALS_ONLY_RST=0
|
||||||
MOENCHZMQ=0
|
MOENCHZMQ=0
|
||||||
|
|
||||||
|
|
||||||
@ -21,7 +22,7 @@ CMAKE_PRE=""
|
|||||||
CMAKE_POST=""
|
CMAKE_POST=""
|
||||||
|
|
||||||
usage() { echo -e "
|
usage() { echo -e "
|
||||||
Usage: $0 [-c] [-b] [-p] [e] [t] [r] [g] [s] [u] [i] [m] [-h] [z] [-d <HDF5 directory>] [-j] <Number of threads>
|
Usage: $0 [-c] [-b] [-p] [e] [t] [r] [g] [s] [u] [i] [m] [n] [-h] [z] [-d <HDF5 directory>] [-j] <Number of threads>
|
||||||
-[no option]: only make
|
-[no option]: only make
|
||||||
-c: Clean
|
-c: Clean
|
||||||
-b: Builds/Rebuilds CMake files normal mode
|
-b: Builds/Rebuilds CMake files normal mode
|
||||||
@ -37,6 +38,7 @@ Usage: $0 [-c] [-b] [-p] [e] [t] [r] [g] [s] [u] [i] [m] [-h] [z] [-d <HDF5 dire
|
|||||||
-e: Debug mode
|
-e: Debug mode
|
||||||
-i: Builds tests
|
-i: Builds tests
|
||||||
-m: Manuals
|
-m: Manuals
|
||||||
|
-n: Manuals without compiling doxygen (only rst)
|
||||||
-z: Moench zmq processor
|
-z: Moench zmq processor
|
||||||
|
|
||||||
Rebuild when you switch to a new build and compile in parallel:
|
Rebuild when you switch to a new build and compile in parallel:
|
||||||
@ -73,7 +75,7 @@ For rebuilding only certain sections
|
|||||||
|
|
||||||
" ; exit 1; }
|
" ; exit 1; }
|
||||||
|
|
||||||
while getopts ":bpchd:j:trgeisumz" opt ; do
|
while getopts ":bpchd:j:trgeisumnz" opt ; do
|
||||||
case $opt in
|
case $opt in
|
||||||
b)
|
b)
|
||||||
echo "Building of CMake files Required"
|
echo "Building of CMake files Required"
|
||||||
@ -132,6 +134,10 @@ while getopts ":bpchd:j:trgeisumz" opt ; do
|
|||||||
echo "Compiling Manuals"
|
echo "Compiling Manuals"
|
||||||
MANUALS=1
|
MANUALS=1
|
||||||
;;
|
;;
|
||||||
|
n)
|
||||||
|
echo "Compiling Manuals (Only RST)"
|
||||||
|
MANUALS_ONLY_RST=1
|
||||||
|
;;
|
||||||
z)
|
z)
|
||||||
echo "Compiling Moench Zmq Processor"
|
echo "Compiling Moench Zmq Processor"
|
||||||
MOENCHZMQ=1
|
MOENCHZMQ=1
|
||||||
@ -268,20 +274,33 @@ fi
|
|||||||
|
|
||||||
#make
|
#make
|
||||||
if [ $COMPILERTHREADS -gt 0 ]; then
|
if [ $COMPILERTHREADS -gt 0 ]; then
|
||||||
|
if [ $MANUALS -eq 0 ] && [ $MANUALS_ONLY_RST -eq 0 ]; then
|
||||||
BUILDCOMMAND="make -j$COMPILERTHREADS"
|
BUILDCOMMAND="make -j$COMPILERTHREADS"
|
||||||
echo $BUILDCOMMAND
|
echo $BUILDCOMMAND
|
||||||
eval $BUILDCOMMAND
|
eval $BUILDCOMMAND
|
||||||
|
else
|
||||||
if [ $MANUALS -eq 1 ]; then
|
if [ $MANUALS -eq 1 ]; then
|
||||||
BUILDCOMMAND="make docs -j$COMPILERTHREADS"
|
BUILDCOMMAND="make docs -j$COMPILERTHREADS"
|
||||||
echo $BUILDCOMMAND
|
echo $BUILDCOMMAND
|
||||||
eval $BUILDCOMMAND
|
eval $BUILDCOMMAND
|
||||||
|
else
|
||||||
|
BUILDCOMMAND="make rst -j$COMPILERTHREADS"
|
||||||
|
echo $BUILDCOMMAND
|
||||||
|
eval $BUILDCOMMAND
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
if [ $MANUALS -eq 0 ] && [ $MANUALS_ONLY_RST -eq 0 ]; then
|
||||||
echo "make"
|
echo "make"
|
||||||
make
|
make
|
||||||
|
else
|
||||||
if [ $MANUALS -eq 1 ]; then
|
if [ $MANUALS -eq 1 ]; then
|
||||||
echo "make docs"
|
echo "make docs"
|
||||||
make docs
|
make docs
|
||||||
|
else
|
||||||
|
echo "make rst"
|
||||||
|
make rst
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -33,6 +33,7 @@ requirements:
|
|||||||
- {{ cdt('libselinux') }} # [linux]
|
- {{ cdt('libselinux') }} # [linux]
|
||||||
- {{ cdt('libxdamage') }} # [linux]
|
- {{ cdt('libxdamage') }} # [linux]
|
||||||
- {{ cdt('libxxf86vm') }} # [linux]
|
- {{ cdt('libxxf86vm') }} # [linux]
|
||||||
|
- expat
|
||||||
|
|
||||||
host:
|
host:
|
||||||
- libstdcxx-ng
|
- libstdcxx-ng
|
||||||
@ -45,6 +46,7 @@ requirements:
|
|||||||
- xorg-libxau
|
- xorg-libxau
|
||||||
- xorg-libxrender
|
- xorg-libxrender
|
||||||
- xorg-libxfixes
|
- xorg-libxfixes
|
||||||
|
- expat
|
||||||
|
|
||||||
run:
|
run:
|
||||||
- zeromq
|
- zeromq
|
||||||
@ -96,3 +98,4 @@ outputs:
|
|||||||
- {{ pin_subpackage('slsdetlib', exact=True) }}
|
- {{ pin_subpackage('slsdetlib', exact=True) }}
|
||||||
- qwt 6.*
|
- qwt 6.*
|
||||||
- qt 4.8.*
|
- qt 4.8.*
|
||||||
|
- expat
|
||||||
|
@ -59,14 +59,13 @@ set( HEADERS
|
|||||||
#set(ROOT_INCLUDE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
|
#set(ROOT_INCLUDE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
# ROOT dictionary generation
|
# ROOT dictionary generation
|
||||||
include("${ROOT_DIR}/modules/RootNewMacros.cmake")
|
include("${ROOT_DIR}/RootMacros.cmake")
|
||||||
root_generate_dictionary(ctbDict ${HEADERS} LINKDEF ctbLinkDef.h)
|
root_generate_dictionary(ctbDict ${HEADERS} LINKDEF ctbLinkDef.h)
|
||||||
add_library(ctbRootLib SHARED ctbDict.cxx)
|
add_library(ctbRootLib SHARED ctbDict.cxx)
|
||||||
target_include_directories(ctbRootLib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
target_include_directories(ctbRootLib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
target_link_libraries(ctbRootLib PUBLIC
|
target_link_libraries(ctbRootLib PUBLIC
|
||||||
ROOT::Core
|
ROOT::Core
|
||||||
slsDetectorShared
|
slsDetectorShared
|
||||||
slsSupportLib
|
|
||||||
${ROOT_LIBRARIES}
|
${ROOT_LIBRARIES}
|
||||||
${ROOT_EXE_LINKER_FLAGS}
|
${ROOT_EXE_LINKER_FLAGS}
|
||||||
)
|
)
|
||||||
@ -78,7 +77,6 @@ set_target_properties(
|
|||||||
|
|
||||||
target_link_libraries(ctbGui PUBLIC
|
target_link_libraries(ctbGui PUBLIC
|
||||||
slsDetectorShared
|
slsDetectorShared
|
||||||
slsSupportLib
|
|
||||||
ctbRootLib
|
ctbRootLib
|
||||||
${TIFF_LIBRARIES}
|
${TIFF_LIBRARIES}
|
||||||
)
|
)
|
||||||
|
@ -43,6 +43,7 @@ set(SPHINX_SOURCE_FILES
|
|||||||
src/type_traits.rst
|
src/type_traits.rst
|
||||||
src/ToString.rst
|
src/ToString.rst
|
||||||
src/examples.rst
|
src/examples.rst
|
||||||
|
src/pygettingstarted.rst
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ int main() {
|
|||||||
auto tmp = os.str().erase(0, cmd.size());
|
auto tmp = os.str().erase(0, cmd.size());
|
||||||
auto usage = tmp.substr(0, tmp.find_first_of('\n'));
|
auto usage = tmp.substr(0, tmp.find_first_of('\n'));
|
||||||
tmp.erase(0, usage.size());
|
tmp.erase(0, usage.size());
|
||||||
auto help = replace_all(tmp, "\n\t", "\n\t\t");
|
auto help = replace_all(tmp, "\n\t", "\n\t\t| ");
|
||||||
fs << '\t' << cmd << usage << help << "\n";
|
fs << '\t' << cmd << usage << help << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -32,6 +32,7 @@ Welcome to slsDetectorPackage's documentation!
|
|||||||
:caption: Python API
|
:caption: Python API
|
||||||
:maxdepth: 2
|
:maxdepth: 2
|
||||||
|
|
||||||
|
pygettingstarted
|
||||||
pydetector
|
pydetector
|
||||||
pyenums
|
pyenums
|
||||||
pyexamples
|
pyexamples
|
||||||
|
@ -7,3 +7,4 @@ Detector
|
|||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
:inherited-members:
|
@ -4,6 +4,31 @@ Enums
|
|||||||
These enums are defined in slsDetectorDefs in the C++ package and
|
These enums are defined in slsDetectorDefs in the C++ package and
|
||||||
exposed to Python through pybind11.
|
exposed to Python through pybind11.
|
||||||
|
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
# Most settings are represented as enums that can be
|
||||||
|
# explicitly imported
|
||||||
|
|
||||||
|
from slsdet import Detector, fileFormat
|
||||||
|
d = Detector()
|
||||||
|
d.fformat = fileFormat.BINARY
|
||||||
|
|
||||||
|
# Altough not recommended for convenience all enums
|
||||||
|
# and some other things can be impored using *
|
||||||
|
|
||||||
|
from slsdet import *
|
||||||
|
d.speed = speedLevel.FULL_SPEED
|
||||||
|
|
||||||
|
# To list the available enums, use dir()
|
||||||
|
|
||||||
|
import slsdet.enums
|
||||||
|
for enum in dir(slsdet.enums):
|
||||||
|
# filter out special memebers
|
||||||
|
if not enum.startswith('_'):
|
||||||
|
print(enum)
|
||||||
|
|
||||||
|
|
||||||
.. py:currentmodule:: slsdet
|
.. py:currentmodule:: slsdet
|
||||||
|
|
||||||
.. autoclass:: runStatus
|
.. autoclass:: runStatus
|
||||||
|
@ -1,7 +1,73 @@
|
|||||||
Examples
|
Examples
|
||||||
================
|
================
|
||||||
|
|
||||||
Some short hints on how to use the detector
|
Some short examples on how to use slsdet. If something is missing don't hesitate to
|
||||||
|
open an issue in our our `github repo
|
||||||
|
<https://github.com/slsdetectorgroup/slsDetectorPackage>`_.
|
||||||
|
|
||||||
|
|
||||||
|
------------------------------------
|
||||||
|
Setting exposure time
|
||||||
|
------------------------------------
|
||||||
|
|
||||||
|
Setting and reading back exposure time can be done either using a Python datetime.timedelta
|
||||||
|
or by setting the time in seconds.
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
# Set exposure time to 1.2 seconds
|
||||||
|
>>> d.exptime = 1.2
|
||||||
|
|
||||||
|
# Setting exposure time using timedelta
|
||||||
|
import datetime as dt
|
||||||
|
>>> d.exptime = dt.timedelta(seconds = 1.2)
|
||||||
|
|
||||||
|
# With timedelta any arbitrary combination of units can be used
|
||||||
|
>>> t = dt.timedelta(microseconds = 100, seconds = 5.3, minutes = .3)
|
||||||
|
|
||||||
|
# To set exposure time for individual detector one have to resort
|
||||||
|
# to the C++ style API.
|
||||||
|
# Sets exposure time to 1.2 seconds for module 0, 6 and 12
|
||||||
|
>>> d.setExptime(1.2, [0, 6, 12])
|
||||||
|
>>> d.setExptime(dt.timedelta(seconds = 1.2), [0, 6, 12])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
------------------------------------
|
||||||
|
Converting numbers to hex
|
||||||
|
------------------------------------
|
||||||
|
|
||||||
|
Python support entering numbers in format by using the 0x prefix. However, when reading
|
||||||
|
back you will get a normal integer. This can then be converted to a hex string representation
|
||||||
|
using the built in hex() function.
|
||||||
|
|
||||||
|
.. code-block :: python
|
||||||
|
|
||||||
|
from slsdet import Detector
|
||||||
|
>>> d = Detector()
|
||||||
|
>>> d.patwait0 = 0xaa
|
||||||
|
>>> d.patwait0
|
||||||
|
170
|
||||||
|
|
||||||
|
# Convert to string
|
||||||
|
>>> hex(d.patwait0)
|
||||||
|
'0xaa'
|
||||||
|
|
||||||
|
For multiple values one can use a list comprehension to loop over the values.
|
||||||
|
|
||||||
|
.. code-block :: python
|
||||||
|
|
||||||
|
>>> values = [1,2,3,4,5]
|
||||||
|
>>> [(v) for v in values]
|
||||||
|
['0x1', '0x2', '0x3', '0x4', '0x5']
|
||||||
|
|
||||||
|
# or to a single string by passing the list to .join
|
||||||
|
>>> ', '.join([hex(v) for v in values])
|
||||||
|
'0x1, 0x2, 0x3, 0x4, 0x5'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
------------------------
|
------------------------
|
||||||
Simple threshold scan
|
Simple threshold scan
|
||||||
@ -74,37 +140,39 @@ But lets start looking at the at the manual way:
|
|||||||
::
|
::
|
||||||
|
|
||||||
import time
|
import time
|
||||||
from slsdet import Eiger
|
from slsdet import Detector, runStatus
|
||||||
d = Eiger()
|
|
||||||
|
|
||||||
n = 10
|
|
||||||
t = 1
|
|
||||||
|
|
||||||
d.exposure_time = t
|
n_frames = 10
|
||||||
d.n_frames = n
|
t_exp = 1
|
||||||
d.reset_frames_caught()
|
|
||||||
|
|
||||||
#Start the measurement
|
# Set exposure time and number of frames
|
||||||
|
d = Detector()
|
||||||
|
d.exptime = t_exp
|
||||||
|
d.frames = n_frames
|
||||||
|
|
||||||
|
# Start the measurement
|
||||||
t0 = time.time()
|
t0 = time.time()
|
||||||
d.start_receiver()
|
d.startDetector()
|
||||||
d.start_detector()
|
d.startReceiver()
|
||||||
|
|
||||||
#Wait for the detector to be ready or do other important stuff
|
# Wait for the detector to be ready or do other important stuff
|
||||||
time.sleep(t*n)
|
time.sleep(t_exp * n_frames)
|
||||||
|
|
||||||
#check if the detector is ready otherwise wait a bit longer
|
# check if the detector is ready otherwise wait a bit longer
|
||||||
while d.status != 'idle':
|
while d.status != runStatus.IDLE:
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
|
|
||||||
#Stop the receiver after we got the frames
|
# Stop the receiver after we got the frames
|
||||||
#Detector is already idle so we don't need to stop it
|
# Detector is already idle so we don't need to stop it
|
||||||
d.stop_receiver()
|
d.stopReceiver()
|
||||||
|
|
||||||
|
lost = d.rx_framescaught - n_frames
|
||||||
|
print(
|
||||||
|
f"{n_frames} frames of {t_exp}s took {time.time()-t0:{.3}}s with {lost} frames lost "
|
||||||
|
)
|
||||||
|
|
||||||
lost = d.frames_caught - n
|
|
||||||
print(f'{n} frames of {t}s took {time.time()-t0:{.3}}s with {lost} frames lost ')
|
|
||||||
|
|
||||||
#Reset to not interfere with a potential next measurement
|
|
||||||
d.reset_frames_caught()
|
|
||||||
|
|
||||||
Instead launching d.acq() from a different process is a bit easier since the control of receiver and detector
|
Instead launching d.acq() from a different process is a bit easier since the control of receiver and detector
|
||||||
is handled in the acq call. However, you need to join the process used otherwise a lot of zombie processes would
|
is handled in the acq call. However, you need to join the process used otherwise a lot of zombie processes would
|
||||||
@ -114,30 +182,104 @@ hang around until the main process exits.
|
|||||||
|
|
||||||
import time
|
import time
|
||||||
from multiprocessing import Process
|
from multiprocessing import Process
|
||||||
from slsdet import Eiger
|
from slsdet import Detector, runStatus
|
||||||
|
|
||||||
def acquire():
|
|
||||||
"""
|
|
||||||
Create a new Eiger object that still referes to the same actual detector
|
|
||||||
and same shared memory. Then launch acq.
|
|
||||||
"""
|
|
||||||
detector = Eiger()
|
|
||||||
detector.acq()
|
|
||||||
|
|
||||||
#This is the detector we use throughout the session
|
d = Detector()
|
||||||
d = Eiger()
|
|
||||||
|
|
||||||
#Process to run acquire
|
#Create a separate process to run acquire in
|
||||||
p = Process(target=acquire)
|
p = Process(target=d.acquire)
|
||||||
|
|
||||||
#Start the thread and short sleep to allow the acq to start
|
#Start the thread and short sleep to allow the acq to start
|
||||||
p.start()
|
p.start()
|
||||||
time.sleep(0.01)
|
time.sleep(0.01)
|
||||||
|
|
||||||
#Do some other work
|
#Do some other work
|
||||||
while d.busy is True:
|
while d.status != runStatus.IDLE:
|
||||||
print(d.busy)
|
print("Working")
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
|
|
||||||
#Join the process
|
#Join the process
|
||||||
p.join()
|
p.join()
|
||||||
|
|
||||||
|
|
||||||
|
------------------------------
|
||||||
|
Setting and getting times
|
||||||
|
------------------------------
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
import datetime as dt
|
||||||
|
from slsdet import Detector
|
||||||
|
from slsdet.utils import element_if_equal
|
||||||
|
|
||||||
|
d = Detector()
|
||||||
|
|
||||||
|
# The simplest way is to set the exposure time in
|
||||||
|
# seconds by using the exptime property
|
||||||
|
# This sets the exposure time for all modules
|
||||||
|
d.exptime = 0.5
|
||||||
|
|
||||||
|
# exptime also accepts a python datetime.timedelta
|
||||||
|
# which can be used to set the time in almost any unit
|
||||||
|
t = dt.timedelta(milliseconds = 2.3)
|
||||||
|
d.exptime = t
|
||||||
|
|
||||||
|
# or combination of units
|
||||||
|
t = dt.timedelta(minutes = 3, seconds = 1.23)
|
||||||
|
d.exptime = t
|
||||||
|
|
||||||
|
# exptime however always returns the time in seconds
|
||||||
|
>>> d.exptime
|
||||||
|
181.23
|
||||||
|
|
||||||
|
# To get back the exposure time for each module
|
||||||
|
# it's possible to use getExptime, this also returns
|
||||||
|
# the values as datetime.timedelta
|
||||||
|
|
||||||
|
>>> d.getExptime()
|
||||||
|
[datetime.timedelta(seconds=181, microseconds=230000), datetime.timedelta(seconds=181, microseconds=230000)]
|
||||||
|
|
||||||
|
# In case the values are the same it's possible to use the
|
||||||
|
# element_if_equal function to reduce the values to a single
|
||||||
|
# value
|
||||||
|
|
||||||
|
>>> t = d.getExptime()
|
||||||
|
>>> element_if_equal(t)
|
||||||
|
datetime.timedelta(seconds=1)
|
||||||
|
|
||||||
|
--------------
|
||||||
|
Reading dacs
|
||||||
|
--------------
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
from slsdet import Detector, Eiger, dacIndex
|
||||||
|
|
||||||
|
#using the specialized class
|
||||||
|
e = Eiger()
|
||||||
|
>>> e.dacs
|
||||||
|
========== DACS =========
|
||||||
|
vsvp : 0 0
|
||||||
|
vtrim : 2480 2480
|
||||||
|
vrpreamp : 3300 3300
|
||||||
|
vrshaper : 1400 1400
|
||||||
|
vsvn : 4000 4000
|
||||||
|
vtgstv : 2556 2556
|
||||||
|
vcmp_ll : 1000 1000
|
||||||
|
vcmp_lr : 1000 1000
|
||||||
|
vcal : 0 0
|
||||||
|
vcmp_rl : 1000 1000
|
||||||
|
rxb_rb : 1100 1100
|
||||||
|
rxb_lb : 1100 1100
|
||||||
|
vcmp_rr : 1000 1000
|
||||||
|
vcp : 1000 1000
|
||||||
|
vcn : 2000 2000
|
||||||
|
vishaper : 1550 1550
|
||||||
|
iodelay : 650 650
|
||||||
|
|
||||||
|
# or using the general class and the list
|
||||||
|
d = Detector()
|
||||||
|
for dac in d.daclist:
|
||||||
|
r = d.getDAC(dac, False)
|
||||||
|
print(f'{dac.name:10s} {r}')
|
||||||
|
228
docs/src/pygettingstarted.rst
Normal file
228
docs/src/pygettingstarted.rst
Normal file
@ -0,0 +1,228 @@
|
|||||||
|
Getting Started
|
||||||
|
==================
|
||||||
|
|
||||||
|
|
||||||
|
--------------------
|
||||||
|
Which Python?
|
||||||
|
--------------------
|
||||||
|
|
||||||
|
We require at lest Python 3.6 and strongly recommended that you don't use the system
|
||||||
|
Python installation. The examples in this documentation uses `conda
|
||||||
|
<https://docs.conda.io/en/latest/miniconda.html>`_ since it provides good support
|
||||||
|
also for non Python packages but there are also other alternatives like, pyenv.
|
||||||
|
|
||||||
|
Using something like conda also allows you to quickly switch beteen different Python
|
||||||
|
environments.
|
||||||
|
|
||||||
|
.. warning ::
|
||||||
|
|
||||||
|
If you use conda avoid also installing packages with pip.
|
||||||
|
|
||||||
|
---------------------
|
||||||
|
PYTHONPATH
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
If you install slsdet using conda everything is set up and you can
|
||||||
|
directly start using the Python bindings. However, if you build
|
||||||
|
from source you need to tell Python where to find slsdet. This
|
||||||
|
is be done by adding your build/bin directory to PYTHONPATH.
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
export PYTHONPATH = /path/to/your/build/bin:$PYTHONPATH
|
||||||
|
|
||||||
|
.. note ::
|
||||||
|
|
||||||
|
Don't forget to compile with the option SLS_USE_PYTHON=ON to enable
|
||||||
|
the Python bindings or if you use the cmk.sh script -p.
|
||||||
|
|
||||||
|
--------------------------------------
|
||||||
|
Which detector class should I use?
|
||||||
|
--------------------------------------
|
||||||
|
|
||||||
|
We provide a generic class called Detector and detector specific
|
||||||
|
versions like, Eiger, Jungfrau etc. The most or all functionality
|
||||||
|
is there in the base class except the convenient access to dacs
|
||||||
|
and temperatures.
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
from slsdet import Detector, Eiger
|
||||||
|
|
||||||
|
d = Detector()
|
||||||
|
e = Eiger()
|
||||||
|
|
||||||
|
# Both classes can be used to control an Eiger detector
|
||||||
|
d.exptime = 0.5
|
||||||
|
e.period = 1
|
||||||
|
|
||||||
|
# But Eiger gives a simpler interface to the dacs
|
||||||
|
>>> e.dacs
|
||||||
|
========== DACS =========
|
||||||
|
vsvp : 0
|
||||||
|
vtrim : 2480
|
||||||
|
vrpreamp : 3300
|
||||||
|
vrshaper : 1400
|
||||||
|
vsvn : 4000
|
||||||
|
vtgstv : 2556
|
||||||
|
vcmp_ll : 1000
|
||||||
|
vcmp_lr : 1000
|
||||||
|
vcal : 0
|
||||||
|
vcmp_rl : 1000
|
||||||
|
rxb_rb : 1100
|
||||||
|
rxb_lb : 1100
|
||||||
|
vcmp_rr : 1000
|
||||||
|
vcp : 1000
|
||||||
|
vcn : 2000
|
||||||
|
vishaper : 1550
|
||||||
|
iodelay : 650
|
||||||
|
|
||||||
|
|
||||||
|
.. note ::
|
||||||
|
|
||||||
|
Depending on user feedback we might move some detector specific
|
||||||
|
functionality to the specialized classes.
|
||||||
|
|
||||||
|
|
||||||
|
----------------------------------
|
||||||
|
Hey, there seems to be two APIs?
|
||||||
|
----------------------------------
|
||||||
|
|
||||||
|
To make the Python API approachable, both if you come from the command line
|
||||||
|
or are using the C++ API, we provide two interfaces to the detector.
|
||||||
|
One is property based and tries to stay as close to the command line syntax
|
||||||
|
as is possible, and the other one directly maps the C++ API found in Detector.h.
|
||||||
|
There is also an underlying design reason for the two APIs since we auto
|
||||||
|
generate the bindings to the C++ code using a mix of pybind11 and clang-tools.
|
||||||
|
The property based API covers most of the functionality but in some cases
|
||||||
|
you have to reach for the C++ like interface.
|
||||||
|
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
d = Detector()
|
||||||
|
|
||||||
|
# C++ like API
|
||||||
|
d.setExptime(0.1)
|
||||||
|
|
||||||
|
# or a bit more pythonic
|
||||||
|
d.exptime = 0.1
|
||||||
|
|
||||||
|
The c++ style API offers more control over access to individual modules
|
||||||
|
in a large detector.
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
# Set exposure time for module 1, 5 and 7
|
||||||
|
d.setExptime(0.1, [1,5,7])
|
||||||
|
|
||||||
|
--------------------
|
||||||
|
Finding functions
|
||||||
|
--------------------
|
||||||
|
|
||||||
|
To find out which properties and methods that a Python object have you
|
||||||
|
can use dir()
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
>>> from slsdet import Detector
|
||||||
|
>>> d = Detector()
|
||||||
|
>>> dir(d)
|
||||||
|
['__class__', '__delattr__', '__dict__', '__dir__', '__doc__',
|
||||||
|
'__eq__', '__format__', '__ge__', '__getattribute__', '__gt__',
|
||||||
|
'__hash__', '__init__', '__init_subclass__', '__le__', '__len__',
|
||||||
|
'__lt__', '__module__', '__ne__', '__new__', '__reduce__',
|
||||||
|
'__reduce_ex__', '__repr__', '__setattr__', '__sizeof__',
|
||||||
|
'__str__', '__subclasshook__', '_adc_register', '_frozen',
|
||||||
|
'_register', 'acquire', 'adcclk', 'adcphase', 'adcpipeline',
|
||||||
|
'adcreg', 'asamples', 'auto_comp_disable', 'clearAcquiringFlag',
|
||||||
|
'clearBit', 'clearROI', 'client_version', 'config', 'copyDetectorServer',
|
||||||
|
'counters', 'daclist', 'dacvalues', 'dbitclk', 'dbitphase' ...
|
||||||
|
|
||||||
|
Since the list for Detector is rather long it's an good idea to filter it.
|
||||||
|
The following example gives you properties and methods containing time in
|
||||||
|
their name.
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
>>> [item for item in dir(d) if 'time' in item]
|
||||||
|
['exptime', 'getExptime', 'getExptimeForAllGates', 'getExptimeLeft',
|
||||||
|
'getSubExptime', 'patwaittime0', 'patwaittime1', 'patwaittime2',
|
||||||
|
'setExptime', 'setSubExptime', 'subdeadtime', 'subexptime']
|
||||||
|
|
||||||
|
The above method works on any Python object but for convenience we also
|
||||||
|
included two functions to find names. View prints the names one per line
|
||||||
|
while find returns a list of names.
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
from slsdet.lookup import view, find
|
||||||
|
|
||||||
|
>>> view('exptime')
|
||||||
|
exptime
|
||||||
|
getExptime
|
||||||
|
getExptimeForAllGates
|
||||||
|
getExptimeLeft
|
||||||
|
getSubExptime
|
||||||
|
setExptime
|
||||||
|
setSubExptime
|
||||||
|
subexptime
|
||||||
|
|
||||||
|
>>> find('exptime')
|
||||||
|
['exptime', 'getExptime', 'getExptimeForAllGates', 'getExptimeLeft',
|
||||||
|
'getSubExptime', 'setExptime', 'setSubExptime', 'subexptime']
|
||||||
|
|
||||||
|
|
||||||
|
------------------------------------
|
||||||
|
Finding out what the function does
|
||||||
|
------------------------------------
|
||||||
|
|
||||||
|
To access the documentation of a function directly from the Python prompt use help().
|
||||||
|
|
||||||
|
.. code-block :: python
|
||||||
|
|
||||||
|
>>> help(Detector.period)
|
||||||
|
Help on property:
|
||||||
|
|
||||||
|
Period between frames, accepts either a value in seconds or datetime.timedelta
|
||||||
|
|
||||||
|
Note
|
||||||
|
-----
|
||||||
|
:getter: always returns in seconds. To get in datetime.delta, use getPeriod
|
||||||
|
|
||||||
|
Examples
|
||||||
|
-----------
|
||||||
|
>>> d.period = 1.05
|
||||||
|
>>> d.period = datetime.timedelta(minutes = 3, seconds = 1.23)
|
||||||
|
>>> d.period
|
||||||
|
181.23
|
||||||
|
>>> d.getPeriod()
|
||||||
|
[datetime.timedelta(seconds=181, microseconds=230000)]
|
||||||
|
|
||||||
|
|
||||||
|
----------------------
|
||||||
|
Where are the ENUMs?
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
To set some of the detector settings like file format you have
|
||||||
|
to pass in an enum.
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
>>> d.setFileFormat(fileFormat.BINARY)
|
||||||
|
|
||||||
|
The enums can be found in slsdet.enums
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
import slsdet
|
||||||
|
>>> [e for e in dir(slsdet.enums) if not e.startswith('_')]
|
||||||
|
['burstMode', 'clockIndex', 'dacIndex', 'detectorModeType',
|
||||||
|
'detectorSettings', 'detectorType', 'dimension', 'externalSignalFlag',
|
||||||
|
'fileFormat', 'frameDiscardPolicy', 'frameModeType', 'masterFlags',
|
||||||
|
'readoutMode', 'runStatus', 'speedLevel', 'timingMode',
|
||||||
|
'timingSourceType']
|
||||||
|
|
||||||
|
# Even though importing using * is not recommended one could
|
||||||
|
# get all the enums like this:
|
||||||
|
>>> from slsdet.enums import *
|
@ -154,21 +154,39 @@ threaded 1
|
|||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
|
|
||||||
In the config file, if client, receiver and detector commands are on 1Gb, but detector data to receiver are sent using \textbf{10GbE} the following lines are mandatory (see slsDetectorsPackage/examples/eiger\_10Gb.config):
|
In the config file, if client, receiver and detector commands are on 1Gb, but detector data to receiver are sent using \textbf{10GbE} the following lines are mandatory (see slsDetectorsPackage/examples/eiger\_10Gb.config):
|
||||||
|
It has been adapted to the the new 5.0 major release change:
|
||||||
|
\begin{verbatim}
|
||||||
|
detsize 1024 512
|
||||||
|
hostname beb059+beb058+
|
||||||
|
rx_hostname pc1875:1955+pc1875:1956+
|
||||||
|
0:udp_dstport 50011
|
||||||
|
0:udp_dstport2 50012
|
||||||
|
0:udp_dstip 10.0.30.210
|
||||||
|
0:udp_srcip 10.0.30.100
|
||||||
|
1:flippeddatax 1
|
||||||
|
1:udp_dstport 50013
|
||||||
|
1:udp_dstport2 50014
|
||||||
|
1:udp_dstip 0.0.40.210
|
||||||
|
1:udp_srcip 10.0.40.101
|
||||||
|
fpath /sls/X12SA/data/x12saop/Data10/Eiger0.5M
|
||||||
|
\end{verbatim}
|
||||||
|
In the old 3.x and 4.x release it was:
|
||||||
\begin{verbatim}
|
\begin{verbatim}
|
||||||
detsizechan 1024 512 #detector geometry, long side of the module first
|
detsizechan 1024 512 #detector geometry, long side of the module first
|
||||||
hostname beb059+beb058+ #1Gb detector hostname for controls
|
hostname beb059+beb058+ #1Gb detector hostname for controls
|
||||||
0:rx_tcpport 1991 #tcpport for the first halfmodule
|
0:rx_tcpport 1955 #tcpport for the first halfmodule
|
||||||
0:rx_udpport 50011 #udp port first quadrant, first halfmodule
|
0:rx_udpport 50011 #udp port first quadrant, first halfmodule
|
||||||
0:rx_udpport2 50012 #udp port second quadrant, first halfmodule
|
0:rx_udpport2 50012 #udp port second quadrant, first halfmodule
|
||||||
0:rx_udpip 10.0.30.210 #udp IP of the receiver over 10Gb
|
0:rx_udpip 10.0.30.210 #udp IP of the receiver over 10Gb
|
||||||
0:detectorip 10.0.30.100 #first half module 10 Gb IP
|
0:detectorip 10.0.30.100 #first half module 10 Gb IP
|
||||||
1:rx_tcpport 1992 #tcpport for the second halfmodule
|
1:flippeddatax 1
|
||||||
|
1:rx_tcpport 1956 #tcpport for the second halfmodule
|
||||||
1:rx_udpport 50013 #udp port first quadrant, second halfmodule
|
1:rx_udpport 50013 #udp port first quadrant, second halfmodule
|
||||||
1:rx_udpport2 50014 #udp port second quadrant, second halfmodule
|
1:rx_udpport2 50014 #udp port second quadrant, second halfmodule
|
||||||
1:rx_udpip 10.0.40.210 #udp IP of the receiver over 10Gb,
|
1:rx_udpip 10.0.40.210 #udp IP of the receiver over 10Gb,
|
||||||
can be the same or different from 0:rx_udpip
|
can be the same or different from 0:rx_udpip
|
||||||
1:detectorip 10.0.40.101 #second half module 10 Gb IP
|
1:detectorip 10.0.40.101 #second half module 10 Gb IP
|
||||||
rx_hostname x12sa-vcons #1Gb receiver pc hostname
|
rx_hostname pc1875 #1Gb receiver pc hostname
|
||||||
outdir /sls/X12SA/data/x12saop/Data10/Eiger0.5M
|
outdir /sls/X12SA/data/x12saop/Data10/Eiger0.5M
|
||||||
threaded 1
|
threaded 1
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
@ -269,11 +287,11 @@ In this acquisition 10 consecutive 1~s frames will be acquired. Note that {\tt{p
|
|||||||
|
|
||||||
You need to setup where the files will be written to
|
You need to setup where the files will be written to
|
||||||
\begin{verbatim}
|
\begin{verbatim}
|
||||||
sls_detector_put 0-outdir /scratch
|
sls_detector_put 0-outdir /scratch (\textcolor{red}{0-fpath})
|
||||||
sls_detector_put 0-fname run
|
sls_detector_put 0-fname run
|
||||||
sls_detector_put 0-index 0
|
sls_detector_put 0-index 0 (\textcolor{red}{0-findex})
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
this way your files will all be named /scratch/run\_dj\_i.raw where $j$ is relative to each specific half module, $i$ in the {\tt{index}} starts from 0 when starting the detector the first time and is automatically incremented. The next acquisition {\tt{index}} will be 1. One can reset the {\tt{index}} to what wished.
|
this way your files will all be named /scratch/run\_dj\_i.raw where $j$ is relative to each specific half module, $i$ in the {\tt{index}} starts from 0 when starting the detector the first time and is automatically incremented. The next acquisition {\tt{index}} will be 1. One can reset the {\tt{index}} (\tt{\textcolor{red}{findex}}) to what wished.
|
||||||
|
|
||||||
To acquire simply type:
|
To acquire simply type:
|
||||||
\begin{verbatim}
|
\begin{verbatim}
|
||||||
@ -792,7 +810,7 @@ Extremely advanced options allow to:
|
|||||||
\begin{itemize}
|
\begin{itemize}
|
||||||
\item Activate the flow control for 10~Gb/s~E (by default the 1~Gb/s~E is always active and cannot be switched off:
|
\item Activate the flow control for 10~Gb/s~E (by default the 1~Gb/s~E is always active and cannot be switched off:
|
||||||
\begin{verbatim}
|
\begin{verbatim}
|
||||||
./sls_detector_put flowcontrol_10g 1
|
./sls_detector_put flowcontrol_10g 1 (\textcolor{red}{flowcontrol10g})
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
\item Delay the transmission of the left port. This delay option is useful in the case of many simultaneous receivers running, such that it reduces the throughput to the receivers all at the same time. To be used board by board (i.e {\tt{X:, Y:,etc..}} with different units:
|
\item Delay the transmission of the left port. This delay option is useful in the case of many simultaneous receivers running, such that it reduces the throughput to the receivers all at the same time. To be used board by board (i.e {\tt{X:, Y:,etc..}} with different units:
|
||||||
\begin{verbatim}
|
\begin{verbatim}
|
||||||
@ -885,7 +903,7 @@ NOTE THAT THIS SETTINGS WILL BE LOST IF YOU REBOOT THE COMPUTER.
|
|||||||
|
|
||||||
Very important is to activate the flow control in 10Gb (in 1Gb it is on by default and not configurable)
|
Very important is to activate the flow control in 10Gb (in 1Gb it is on by default and not configurable)
|
||||||
\begin{verbatim}
|
\begin{verbatim}
|
||||||
./sls_detector_put flowcontrol_10g 1
|
./sls_detector_put flowcontrol_10g 1 (\textcolor{red}{flowcontrol10g 1})
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
You ned to check that flow control is setup on the reeceiving interfaces. Check with:
|
You ned to check that flow control is setup on the reeceiving interfaces. Check with:
|
||||||
\begin{verbatim}
|
\begin{verbatim}
|
||||||
@ -1174,10 +1192,10 @@ In 500k--2M pixel systems there is a hardware temperature safety switch, which w
|
|||||||
|
|
||||||
The HV can also be set and read through the software:
|
The HV can also be set and read through the software:
|
||||||
\begin{verbatim}
|
\begin{verbatim}
|
||||||
./sls_detector_put highvoltage 150
|
./sls_detector_put vhighvoltage 150 (\textcolor{red}{highvoltage})
|
||||||
./sls_detector_get highvoltage
|
./sls_detector_get vhighvoltage (\textcolor{red}{highvoltage})
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
Note that the get {\tt{highvoltage}} would return the measured HV from the master module only. If getting the highvoltage for individual halfmodules, only the master will have a value different from -999.
|
Note that the get {\tt{vhighvoltage}}(\tt{\textcolor{red}{highvoltage}}) would return the measured HV from the master module only. If getting the highvoltage for individual halfmodules, only the master will have a value different from -999.
|
||||||
|
|
||||||
\appendix
|
\appendix
|
||||||
|
|
||||||
@ -1333,10 +1351,10 @@ We have also been requested if we could speed up the threshold scan. At the mome
|
|||||||
\begin{verbatim}
|
\begin{verbatim}
|
||||||
./sls_detector_put exptime 0.01
|
./sls_detector_put exptime 0.01
|
||||||
./sls_detector_put timing trigger
|
./sls_detector_put timing trigger
|
||||||
./sls_detector_put enablefwrite 0
|
./sls_detector_put enablefwrite 0 (\textcolor{red}{fwrite} 0)
|
||||||
./sls_detector_put resetframescaught 0
|
./sls_detector_put resetframescaught 0 (\textcolor{red}{not needed anymore})
|
||||||
./sls_detector_put index 0
|
./sls_detector_put index 0 (\textcolor{red}{findex} 0)
|
||||||
./sls_detector_put cycles 21 (\textcolor{red}{triggers})
|
./sls_detector_put cycles 21 (\textcolor{red}{triggers} 21)
|
||||||
./sls_detector_put receiver start
|
./sls_detector_put receiver start
|
||||||
./sls_detector_put status start
|
./sls_detector_put status start
|
||||||
for i in $(seq 0 20);
|
for i in $(seq 0 20);
|
||||||
|
@ -11,7 +11,7 @@ pybind11_add_module(_slsdet
|
|||||||
target_link_libraries(_slsdet PUBLIC
|
target_link_libraries(_slsdet PUBLIC
|
||||||
slsDetectorShared
|
slsDetectorShared
|
||||||
slsReceiverShared
|
slsReceiverShared
|
||||||
slsSupportLib
|
slsSupportShared
|
||||||
${ZeroMQ_LIBRARIES}
|
${ZeroMQ_LIBRARIES}
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -30,11 +30,17 @@ set( PYTHON_FILES
|
|||||||
detector_property.py
|
detector_property.py
|
||||||
detector.py
|
detector.py
|
||||||
eiger.py
|
eiger.py
|
||||||
|
enums.py
|
||||||
errors.py
|
errors.py
|
||||||
|
gotthard.py
|
||||||
|
gotthard2.py
|
||||||
|
moench.py
|
||||||
|
jsonproxy.py
|
||||||
ctb.py
|
ctb.py
|
||||||
jungfrau.py
|
jungfrau.py
|
||||||
mythen3.py
|
mythen3.py
|
||||||
registers.py
|
registers.py
|
||||||
|
temperature.py
|
||||||
lookup.py
|
lookup.py
|
||||||
utils.py
|
utils.py
|
||||||
|
|
||||||
|
42
python/examples/exposure_time.py
Normal file
42
python/examples/exposure_time.py
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
"""
|
||||||
|
Example showing how to set and get exposure times
|
||||||
|
"""
|
||||||
|
|
||||||
|
import datetime as dt
|
||||||
|
from slsdet import Detector
|
||||||
|
from slsdet.utils import element_if_equal
|
||||||
|
|
||||||
|
d = Detector()
|
||||||
|
|
||||||
|
# The simplest way is to set the exposure time in
|
||||||
|
# seconds by using the exptime property
|
||||||
|
# This sets the exposure time for all modules
|
||||||
|
d.exptime = 0.5
|
||||||
|
|
||||||
|
# exptime also accepts a python datetime.timedelta
|
||||||
|
# which can be used to set the time in almost any unit
|
||||||
|
t = dt.timedelta(milliseconds = 2.3)
|
||||||
|
d.exptime = t
|
||||||
|
|
||||||
|
# or combination of units
|
||||||
|
t = dt.timedelta(minutes = 3, seconds = 1.23)
|
||||||
|
d.exptime = t
|
||||||
|
|
||||||
|
#exptime however always returns the time in seconds
|
||||||
|
# >>> d.exptime
|
||||||
|
# 181.23
|
||||||
|
|
||||||
|
# To get back the exposure time for each module
|
||||||
|
# it's possible to use getExptime, this also returns
|
||||||
|
# the values as datetime.timedelta
|
||||||
|
|
||||||
|
# >>> d.getExptime()
|
||||||
|
# [datetime.timedelta(seconds=181, microseconds=230000), datetime.timedelta(seconds=181, microseconds=230000)]
|
||||||
|
|
||||||
|
# In case the values are the same it's possible to use the
|
||||||
|
# element_if_equal function to reduce the values to a single
|
||||||
|
# value
|
||||||
|
|
||||||
|
# >>> t = d.getExptime()
|
||||||
|
# >>> element_if_equal(t)
|
||||||
|
# datetime.timedelta(seconds=1)
|
21
python/examples/non-blocking-acquire-process.py
Normal file
21
python/examples/non-blocking-acquire-process.py
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
import time
|
||||||
|
from multiprocessing import Process
|
||||||
|
from slsdet import Detector, runStatus
|
||||||
|
|
||||||
|
|
||||||
|
d = Detector()
|
||||||
|
|
||||||
|
#Create a separate process to run acquire in
|
||||||
|
p = Process(target=d.acquire)
|
||||||
|
|
||||||
|
#Start the thread and short sleep to allow the acq to start
|
||||||
|
p.start()
|
||||||
|
time.sleep(0.01)
|
||||||
|
|
||||||
|
#Do some other work
|
||||||
|
while d.status != runStatus.IDLE:
|
||||||
|
print("Working")
|
||||||
|
time.sleep(0.1)
|
||||||
|
|
||||||
|
#Join the process
|
||||||
|
p.join()
|
33
python/examples/non-blocking-acquire.py
Normal file
33
python/examples/non-blocking-acquire.py
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
import time
|
||||||
|
from slsdet import Detector, runStatus
|
||||||
|
|
||||||
|
|
||||||
|
n_frames = 10
|
||||||
|
t_exp = 1
|
||||||
|
|
||||||
|
# Set exposure time and number of frames
|
||||||
|
d = Detector()
|
||||||
|
d.exptime = t_exp
|
||||||
|
d.frames = n_frames
|
||||||
|
|
||||||
|
# Start the measurement
|
||||||
|
t0 = time.time()
|
||||||
|
d.startDetector()
|
||||||
|
d.startReceiver()
|
||||||
|
|
||||||
|
# Wait for the detector to be ready or do other important stuff
|
||||||
|
time.sleep(t_exp * n_frames)
|
||||||
|
|
||||||
|
# check if the detector is ready otherwise wait a bit longer
|
||||||
|
while d.status != runStatus.IDLE:
|
||||||
|
time.sleep(0.1)
|
||||||
|
|
||||||
|
# Stop the receiver after we got the frames
|
||||||
|
# Detector is already idle so we don't need to stop it
|
||||||
|
d.stopReceiver()
|
||||||
|
|
||||||
|
lost = d.rx_framescaught - n_frames
|
||||||
|
print(
|
||||||
|
f"{n_frames} frames of {t_exp}s took {time.time()-t0:{.3}}s with {lost} frames lost "
|
||||||
|
)
|
||||||
|
|
32
python/examples/reading_dacs.py
Normal file
32
python/examples/reading_dacs.py
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
from slsdet import Detector, Eiger, dacIndex
|
||||||
|
|
||||||
|
|
||||||
|
#using the specialized class
|
||||||
|
|
||||||
|
e = Eiger()
|
||||||
|
e.dacs
|
||||||
|
# >>> e.dacs
|
||||||
|
# ========== DACS =========
|
||||||
|
# vsvp : 0 0
|
||||||
|
# vtrim : 2480 2480
|
||||||
|
# vrpreamp : 3300 3300
|
||||||
|
# vrshaper : 1400 1400
|
||||||
|
# vsvn : 4000 4000
|
||||||
|
# vtgstv : 2556 2556
|
||||||
|
# vcmp_ll : 1000 1000
|
||||||
|
# vcmp_lr : 1000 1000
|
||||||
|
# vcal : 0 0
|
||||||
|
# vcmp_rl : 1000 1000
|
||||||
|
# rxb_rb : 1100 1100
|
||||||
|
# rxb_lb : 1100 1100
|
||||||
|
# vcmp_rr : 1000 1000
|
||||||
|
# vcp : 1000 1000
|
||||||
|
# vcn : 2000 2000
|
||||||
|
# vishaper : 1550 1550
|
||||||
|
# iodelay : 650 650
|
||||||
|
|
||||||
|
# or using the general class and the list
|
||||||
|
d = Detector()
|
||||||
|
for dac in d.daclist:
|
||||||
|
r = d.getDAC(dac, False)
|
||||||
|
print(f'{dac.name:10s} {r}')
|
45
python/examples/reading_temperature.py
Normal file
45
python/examples/reading_temperature.py
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
from slsdet import Detector, Eiger, dacIndex
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#Using the general detector class and calling with an index
|
||||||
|
d = Detector()
|
||||||
|
fpga_temp = d.getTemperature(dacIndex.TEMPERATURE_FPGA)
|
||||||
|
print(f'fpga_temp: {fpga_temp}\n')
|
||||||
|
|
||||||
|
#Using the specialized detector class
|
||||||
|
e = Eiger()
|
||||||
|
print("All temperatures for Eiger\n")
|
||||||
|
print(e.temp)
|
||||||
|
# >>> e.temp
|
||||||
|
# temp_fpga : 54°C 60°C
|
||||||
|
# temp_fpgaext : 49°C 52°C
|
||||||
|
# temp_10ge : 47°C 45°C
|
||||||
|
# temp_dcdc : 52°C 53°C
|
||||||
|
# temp_sodl : 51°C 53°C
|
||||||
|
# temp_sodl : 51°C 51°C
|
||||||
|
# temp_fpgafl : 45°C 49°C
|
||||||
|
# temp_fpgafr : 39°C 42°C
|
||||||
|
|
||||||
|
# The temperatures can also be returned in a dictionary
|
||||||
|
t = e.temp.to_dict()
|
||||||
|
print(t)
|
||||||
|
# >>> e.temp.to_dict()
|
||||||
|
# {'fpga': array([55, 60]), 'fpgaext': array([49, 52]),
|
||||||
|
# 't10ge': array([47, 45]), 'dcdc': array([52, 53]),
|
||||||
|
# 'sodl': array([51, 53]), 'sodr': array([51, 51]), '
|
||||||
|
# temp_fpgafl': array([45, 49]),
|
||||||
|
# 'temp_fpgafr': array([39, 42])}
|
||||||
|
|
||||||
|
# or in a numpy array
|
||||||
|
t = e.temp.to_array()
|
||||||
|
print(t)
|
||||||
|
# >>> e.temp.to_array()
|
||||||
|
# array([[55, 60],
|
||||||
|
# [49, 52],
|
||||||
|
# [47, 45],
|
||||||
|
# [52, 53],
|
||||||
|
# [51, 53],
|
||||||
|
# [51, 51],
|
||||||
|
# [45, 49],
|
||||||
|
# [40, 43]])
|
8
python/examples/threshold_scan.py
Normal file
8
python/examples/threshold_scan.py
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
from slsdet import Eiger
|
||||||
|
|
||||||
|
d = Eiger()
|
||||||
|
threshold = range(0, 2000, 200)
|
||||||
|
for th in threshold:
|
||||||
|
print(f'{th=}')
|
||||||
|
d.vthreshold = th
|
||||||
|
d.acquire()
|
20
python/examples/use_enum.py
Normal file
20
python/examples/use_enum.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# Most settings are represented as enums that can be
|
||||||
|
# explicitly imported
|
||||||
|
|
||||||
|
from slsdet import Detector, fileFormat
|
||||||
|
d = Detector()
|
||||||
|
d.fformat = fileFormat.BINARY
|
||||||
|
|
||||||
|
# Altough not recommended for convenience all enums
|
||||||
|
# and some other things can be impored using *
|
||||||
|
|
||||||
|
from slsdet import *
|
||||||
|
d.speed = speedLevel.FULL_SPEED
|
||||||
|
|
||||||
|
# To list the available enums, use dir()
|
||||||
|
|
||||||
|
import slsdet.enums
|
||||||
|
for enum in dir(slsdet.enums):
|
||||||
|
# filter out special memebers
|
||||||
|
if not enum.startswith('_'):
|
||||||
|
print(enum)
|
@ -3,13 +3,15 @@ import sys
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
sys.path.append(os.path.join(os.getcwd(), 'bin'))
|
sys.path.append(os.path.join(os.getcwd(), 'bin'))
|
||||||
|
|
||||||
from slsdet import Detector, Mythen3, Eiger, Jungfrau, DetectorDacs, Dac, Ctb
|
from slsdet import Detector, Mythen3, Eiger, Jungfrau, DetectorDacs, Dac, Ctb, Gotthard2, Moench
|
||||||
from slsdet import dacIndex, readoutMode
|
from slsdet import dacIndex, readoutMode
|
||||||
from slsdet.lookup import view, find
|
from slsdet.lookup import view, find
|
||||||
|
|
||||||
d = Detector()
|
d = Detector()
|
||||||
# e = Eiger()
|
e = Eiger()
|
||||||
c = Ctb()
|
c = Ctb()
|
||||||
|
g = Gotthard2()
|
||||||
# j = Jungfrau()
|
# j = Jungfrau()
|
||||||
# m = Mythen3()
|
# m = Mythen3()
|
||||||
|
m = Moench()
|
||||||
|
|
||||||
|
@ -15,8 +15,80 @@ pycmd += ['vrf', 'vtr', 'vrs', 'vtgstv', 'vsvn', 'vtrim',
|
|||||||
'vpreamp', 'vref_comp', 'vref_comp_fe vref_ds', 'vref_h_adc',
|
'vpreamp', 'vref_comp', 'vref_comp_fe vref_ds', 'vref_h_adc',
|
||||||
'vref_l_adc', 'iodelay', 'list', 'vref_ds', 'vis', 'vpl',
|
'vref_l_adc', 'iodelay', 'list', 'vref_ds', 'vis', 'vpl',
|
||||||
'vref_comp_fe', 'vph', 'vout_cm', 'vcp', 'vcn', 'vcmp_ll', 'vcmp_lr'
|
'vref_comp_fe', 'vph', 'vout_cm', 'vcp', 'vcn', 'vcmp_ll', 'vcmp_lr'
|
||||||
, 'vcmp_rl', 'vcmp_rr', 'daclist', 'dacvalues', 'vcal', 'vcas']
|
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
# dacs are in general not included in the python commands and we expect to
|
||||||
|
# set them from the specialized class or using an enum
|
||||||
|
dacs = [
|
||||||
|
'vicin',
|
||||||
|
'vcassh',
|
||||||
|
'vcal_n',
|
||||||
|
'vcal_p'
|
||||||
|
'vipre_out',
|
||||||
|
'vipre_cds',
|
||||||
|
'vdd_prot',
|
||||||
|
'vcmp_rl',
|
||||||
|
'vcmp_rr',
|
||||||
|
'vcal', 'vcas',
|
||||||
|
'vipre',
|
||||||
|
'vin_com',
|
||||||
|
'vin_cm',
|
||||||
|
'vrshaper',
|
||||||
|
'vrshaper_n',
|
||||||
|
'vrpreamp',
|
||||||
|
'vishaper',
|
||||||
|
'vipre_out',
|
||||||
|
'vcom_adc1',
|
||||||
|
'vcom_adc2',
|
||||||
|
'vcom_cds',
|
||||||
|
'vdcsh',
|
||||||
|
'v_chip',
|
||||||
|
'vb_comp',
|
||||||
|
'vb_comp_adc',
|
||||||
|
'vb_comp_fe',
|
||||||
|
'vb_cs',
|
||||||
|
'vb_ds',
|
||||||
|
'vb_opa_1st',
|
||||||
|
'vb_opa_fd',
|
||||||
|
'vb_pixbuf',
|
||||||
|
'vb_sda',
|
||||||
|
'vbp_colbuf',
|
||||||
|
'vcal_p',
|
||||||
|
'vcasc_out',
|
||||||
|
'vcasc_sfp',
|
||||||
|
'vcascn_pb',
|
||||||
|
'vcascp_pb',
|
||||||
|
'vchip_comp_adc',
|
||||||
|
'vchip_comp_fe',
|
||||||
|
'vchip_cs',
|
||||||
|
'vchip_opa_1st',
|
||||||
|
'vchip_opa_fd',
|
||||||
|
'vchip_ref_comp_fe',
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
intentionally_missing = [
|
||||||
|
'temp_10ge', #temperatures already available from enum or specialized class
|
||||||
|
'temp_adc',
|
||||||
|
'temp_dcdc',
|
||||||
|
'temp_fpga',
|
||||||
|
'temp_fpgaext',
|
||||||
|
'temp_fpgafl',
|
||||||
|
'temp_fpgafr',
|
||||||
|
'temp_slowadc',
|
||||||
|
'temp_sodl',
|
||||||
|
'temp_sodr',
|
||||||
|
'trigger', #use sendSoftwareTrigger
|
||||||
|
'update', #use updateServerAndFirmare
|
||||||
|
'udp_validate', #use validateUdpConfiguration
|
||||||
|
'udp_reconfigure', #use reconfigureUdpDestination
|
||||||
|
'emin', #use rx_jsonpara
|
||||||
|
]
|
||||||
|
|
||||||
|
pycmd += intentionally_missing
|
||||||
|
pycmd += dacs
|
||||||
missing = []
|
missing = []
|
||||||
for c in cmd:
|
for c in cmd:
|
||||||
if c not in pycmd:
|
if c not in pycmd:
|
||||||
|
@ -5,32 +5,34 @@ from .dacs import DetectorDacs, Dac
|
|||||||
from .detector import Detector
|
from .detector import Detector
|
||||||
from .jungfrau import Jungfrau
|
from .jungfrau import Jungfrau
|
||||||
from .mythen3 import Mythen3
|
from .mythen3 import Mythen3
|
||||||
|
from .gotthard2 import Gotthard2
|
||||||
|
from .gotthard import Gotthard
|
||||||
|
from .moench import Moench
|
||||||
# from .jungfrau_ctb import JungfrauCTB
|
# from .jungfrau_ctb import JungfrauCTB
|
||||||
# from _slsdet import DetectorApi
|
# from _slsdet import DetectorApi
|
||||||
|
|
||||||
import _slsdet
|
import _slsdet
|
||||||
|
|
||||||
defs = _slsdet.slsDetectorDefs
|
defs = _slsdet.slsDetectorDefs
|
||||||
runStatus = _slsdet.slsDetectorDefs.runStatus
|
|
||||||
speedLevel = _slsdet.slsDetectorDefs.speedLevel
|
|
||||||
|
|
||||||
|
from .enums import *
|
||||||
detectorType = _slsdet.slsDetectorDefs.detectorType
|
# runStatus = _slsdet.slsDetectorDefs.runStatus
|
||||||
frameDiscardPolicy = _slsdet.slsDetectorDefs.frameDiscardPolicy
|
# speedLevel = _slsdet.slsDetectorDefs.speedLevel
|
||||||
fileFormat = _slsdet.slsDetectorDefs.fileFormat
|
# detectorType = _slsdet.slsDetectorDefs.detectorType
|
||||||
dimension = _slsdet.slsDetectorDefs.dimension
|
# frameDiscardPolicy = _slsdet.slsDetectorDefs.frameDiscardPolicy
|
||||||
externalSignalFlag = _slsdet.slsDetectorDefs.externalSignalFlag
|
# fileFormat = _slsdet.slsDetectorDefs.fileFormat
|
||||||
timingMode = _slsdet.slsDetectorDefs.timingMode
|
# dimension = _slsdet.slsDetectorDefs.dimension
|
||||||
dacIndex = _slsdet.slsDetectorDefs.dacIndex
|
# externalSignalFlag = _slsdet.slsDetectorDefs.externalSignalFlag
|
||||||
detectorSettings = _slsdet.slsDetectorDefs.detectorSettings
|
# timingMode = _slsdet.slsDetectorDefs.timingMode
|
||||||
clockIndex = _slsdet.slsDetectorDefs.clockIndex
|
# dacIndex = _slsdet.slsDetectorDefs.dacIndex
|
||||||
readoutMode = _slsdet.slsDetectorDefs.readoutMode
|
# detectorSettings = _slsdet.slsDetectorDefs.detectorSettings
|
||||||
masterFlags = _slsdet.slsDetectorDefs.masterFlags
|
# clockIndex = _slsdet.slsDetectorDefs.clockIndex
|
||||||
|
# readoutMode = _slsdet.slsDetectorDefs.readoutMode
|
||||||
frameModeType = _slsdet.slsDetectorDefs.frameModeType
|
# masterFlags = _slsdet.slsDetectorDefs.masterFlags
|
||||||
detectorModeType = _slsdet.slsDetectorDefs.detectorModeType
|
# frameModeType = _slsdet.slsDetectorDefs.frameModeType
|
||||||
burstMode = _slsdet.slsDetectorDefs.burstMode
|
# detectorModeType = _slsdet.slsDetectorDefs.detectorModeType
|
||||||
timingSourceType = _slsdet.slsDetectorDefs.timingSourceType
|
# burstMode = _slsdet.slsDetectorDefs.burstMode
|
||||||
|
# timingSourceType = _slsdet.slsDetectorDefs.timingSourceType
|
||||||
|
|
||||||
|
|
||||||
IpAddr = _slsdet.IpAddr
|
IpAddr = _slsdet.IpAddr
|
||||||
|
@ -1,23 +1,33 @@
|
|||||||
from functools import partial
|
from functools import partial
|
||||||
class Adc:
|
class Adc:
|
||||||
def __init__(self, name, detector):
|
def __init__(self, name, enum, detector):
|
||||||
self.name = name
|
self.name = name
|
||||||
|
self.enum = enum
|
||||||
self._detector = detector
|
self._detector = detector
|
||||||
self.get_nmod = self._detector._api.getNumberOfDetectors
|
self.get_nmod = self._detector.size
|
||||||
# Bind functions to get and set the dac
|
# Bind functions to get and set the dac
|
||||||
self.get = partial(self._detector._api.getAdc, self.name)
|
self.get = partial(self._detector.getAdc, self.enum)
|
||||||
|
|
||||||
|
|
||||||
def __getitem__(self, key):
|
def __getitem__(self, key):
|
||||||
"""
|
|
||||||
Get dacs either by slice, key or list
|
|
||||||
"""
|
|
||||||
if key == slice(None, None, None):
|
if key == slice(None, None, None):
|
||||||
return [self.get(i) / 1000 for i in range(self.get_nmod())]
|
return self.get()
|
||||||
elif isinstance(key, Iterable):
|
elif isinstance(key, Iterable):
|
||||||
return [self.get(k) / 1000 for k in key]
|
return self.get(list(key))
|
||||||
else:
|
else:
|
||||||
return self.get(key) / 1000
|
return self.get([key])[0] #No list for single value
|
||||||
|
|
||||||
|
|
||||||
|
# def __getitem__(self, key):
|
||||||
|
# """
|
||||||
|
# Get dacs either by slice, key or list
|
||||||
|
# """
|
||||||
|
# if key == slice(None, None, None):
|
||||||
|
# return [self.get(i) / 1000 for i in range(self.get_nmod())]
|
||||||
|
# elif isinstance(key, Iterable):
|
||||||
|
# return [self.get(k) / 1000 for k in key]
|
||||||
|
# else:
|
||||||
|
# return self.get(key) / 1000
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
"""String representation for a single adc in all modules"""
|
"""String representation for a single adc in all modules"""
|
||||||
|
@ -32,10 +32,9 @@ class Dac(DetectorProperty):
|
|||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
"""String representation for a single dac in all modules"""
|
"""String representation for a single dac in all modules"""
|
||||||
dacstr = ''.join([f'{item:5d}' for item in self.get()])
|
dacstr = ''.join([f'{item:5d}' for item in self.get()])
|
||||||
return f'{self.__name__:10s}:{dacstr}'
|
return f'{self.__name__:15s}:{dacstr}'
|
||||||
|
|
||||||
|
|
||||||
# a = Dac('vrf', dacIndex.VRF, 0, 4000, 2500, d )
|
|
||||||
# @freeze
|
|
||||||
class DetectorDacs:
|
class DetectorDacs:
|
||||||
_dacs = []
|
_dacs = []
|
||||||
_dacnames = [_d[0] for _d in _dacs]
|
_dacnames = [_d[0] for _d in _dacs]
|
||||||
@ -93,6 +92,9 @@ class DetectorDacs:
|
|||||||
dac_array[i,:] = _d[:]
|
dac_array[i,:] = _d[:]
|
||||||
return dac_array
|
return dac_array
|
||||||
|
|
||||||
|
def to_array(self):
|
||||||
|
return self.get_asarray()
|
||||||
|
|
||||||
def set_from_array(self, dac_array):
|
def set_from_array(self, dac_array):
|
||||||
"""
|
"""
|
||||||
Set the dacs from an numpy array with dac values. [ndacs, nmodules]
|
Set the dacs from an numpy array with dac values. [ndacs, nmodules]
|
||||||
@ -101,6 +103,9 @@ class DetectorDacs:
|
|||||||
for i, _d in enumerate(self):
|
for i, _d in enumerate(self):
|
||||||
_d[:] = dac_array[i]
|
_d[:] = dac_array[i]
|
||||||
|
|
||||||
|
def from_array(self, dac_array):
|
||||||
|
self.set_from_array(dac_array)
|
||||||
|
|
||||||
def set_default(self):
|
def set_default(self):
|
||||||
"""
|
"""
|
||||||
Set all dacs to their default values
|
Set all dacs to their default values
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -6,22 +6,17 @@ Created on Wed Dec 6 11:51:18 2017
|
|||||||
@author: l_frojdh
|
@author: l_frojdh
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
from .detector import Detector
|
from .detector import Detector
|
||||||
|
from .temperature import Temperature, DetectorTemperature
|
||||||
# from .adcs import Adc, DetectorAdcs
|
|
||||||
from .dacs import DetectorDacs
|
from .dacs import DetectorDacs
|
||||||
import _slsdet
|
import _slsdet
|
||||||
dacIndex = _slsdet.slsDetectorDefs.dacIndex
|
dacIndex = _slsdet.slsDetectorDefs.dacIndex
|
||||||
from .detector_property import DetectorProperty
|
from .detector_property import DetectorProperty
|
||||||
# from .utils import element_if_equal
|
|
||||||
# from sls_detector.errors import DetectorValueError, DetectorError
|
|
||||||
|
|
||||||
class EigerVcmp:
|
class EigerVcmp:
|
||||||
"""
|
"""
|
||||||
Convenience class to be able to loop over vcmp for Eiger
|
Convenience class to be able to loop over vcmp for Eiger
|
||||||
|
|
||||||
|
|
||||||
.. todo::
|
.. todo::
|
||||||
|
|
||||||
Support single assignment and perhaps unify with Dac class
|
Support single assignment and perhaps unify with Dac class
|
||||||
@ -79,58 +74,6 @@ class EigerDacs(DetectorDacs):
|
|||||||
('iodelay', dacIndex.IO_DELAY,0, 4000, 660)]
|
('iodelay', dacIndex.IO_DELAY,0, 4000, 660)]
|
||||||
_dacnames = [_d[0] for _d in _dacs]
|
_dacnames = [_d[0] for _d in _dacs]
|
||||||
|
|
||||||
# # noinspection PyProtectedMember
|
|
||||||
# class DetectorDelays:
|
|
||||||
# _delaynames = ['frame', 'left', 'right']
|
|
||||||
|
|
||||||
# def __init__(self, detector):
|
|
||||||
# # We need to at least initially know which detector we are connected to
|
|
||||||
# self._detector = detector
|
|
||||||
|
|
||||||
# setattr(self, '_frame', DetectorProperty(detector._api.getDelayFrame,
|
|
||||||
# detector._api.setDelayFrame,
|
|
||||||
# detector._api.getNumberOfDetectors,
|
|
||||||
# 'frame'))
|
|
||||||
|
|
||||||
# setattr(self, '_left', DetectorProperty(detector._api.getDelayLeft,
|
|
||||||
# detector._api.setDelayLeft,
|
|
||||||
# detector._api.getNumberOfDetectors,
|
|
||||||
# 'left'))
|
|
||||||
|
|
||||||
# setattr(self, '_right', DetectorProperty(detector._api.getDelayRight,
|
|
||||||
# detector._api.setDelayRight,
|
|
||||||
# detector._api.getNumberOfDetectors,
|
|
||||||
# 'right'))
|
|
||||||
# # Index to support iteration
|
|
||||||
# self._current = 0
|
|
||||||
|
|
||||||
# def __getattr__(self, name):
|
|
||||||
# return self.__getattribute__('_' + name)
|
|
||||||
|
|
||||||
# def __setattr__(self, name, value):
|
|
||||||
# if name in self._delaynames:
|
|
||||||
# return self.__getattribute__('_' + name).__setitem__(slice(None, None, None), value)
|
|
||||||
# else:
|
|
||||||
# super().__setattr__(name, value)
|
|
||||||
|
|
||||||
# def __next__(self):
|
|
||||||
# if self._current >= len(self._delaynames):
|
|
||||||
# self._current = 0
|
|
||||||
# raise StopIteration
|
|
||||||
# else:
|
|
||||||
# self._current += 1
|
|
||||||
# return self.__getattr__(self._delaynames[self._current-1])
|
|
||||||
|
|
||||||
# def __iter__(self):
|
|
||||||
# return self
|
|
||||||
|
|
||||||
# def __repr__(self):
|
|
||||||
# hn = self._detector.hostname
|
|
||||||
# r_str = ['Transmission delay [ns]\n'
|
|
||||||
# '{:11s}{:>8s}{:>8s}{:>8s}'.format('', 'left', 'right', 'frame')]
|
|
||||||
# for i in range(self._detector.n_modules):
|
|
||||||
# r_str.append('{:2d}:{:8s}{:>8d}{:>8d}{:>8d}'.format(i, hn[i], self.left[i], self.right[i], self.frame[i]))
|
|
||||||
# return '\n'.join(r_str)
|
|
||||||
|
|
||||||
from .detector import freeze
|
from .detector import freeze
|
||||||
|
|
||||||
@ -152,76 +95,18 @@ class Eiger(Detector):
|
|||||||
self._dacs = EigerDacs(self)
|
self._dacs = EigerDacs(self)
|
||||||
self._vcmp = EigerVcmp(self)
|
self._vcmp = EigerVcmp(self)
|
||||||
|
|
||||||
# self._active = DetectorProperty(self.getActive,
|
# Eiger specific adcs
|
||||||
# self.setActive,
|
self._temp = DetectorTemperature()
|
||||||
# self.size,
|
self._temp.fpga = Temperature('temp_fpga', dacIndex.TEMPERATURE_FPGA, self)
|
||||||
# 'active')
|
self._temp.fpgaext = Temperature('temp_fpgaext', dacIndex.TEMPERATURE_FPGAEXT, self)
|
||||||
|
self._temp.t10ge = Temperature('temp_10ge', dacIndex.TEMPERATURE_10GE, self)
|
||||||
|
self._temp.dcdc = Temperature('temp_dcdc', dacIndex.TEMPERATURE_DCDC, self)
|
||||||
|
self._temp.sodl = Temperature('temp_sodl', dacIndex.TEMPERATURE_SODL, self)
|
||||||
|
self._temp.sodr = Temperature('temp_sodl', dacIndex.TEMPERATURE_SODR, self)
|
||||||
|
self._temp.temp_fpgafl = Temperature('temp_fpgafl', dacIndex.TEMPERATURE_FPGA2, self)
|
||||||
|
self._temp.temp_fpgafr = Temperature('temp_fpgafr', dacIndex.TEMPERATURE_FPGA3, self)
|
||||||
|
|
||||||
# self._trimbit_limits = namedtuple('trimbit_limits', ['min', 'max'])(0, 63)
|
|
||||||
# self._delay = DetectorDelays(self)
|
|
||||||
|
|
||||||
# # Eiger specific adcs
|
|
||||||
# self._temp = DetectorAdcs()
|
|
||||||
# self._temp.fpga = Adc('temp_fpga', self)
|
|
||||||
# self._temp.fpgaext = Adc('temp_fpgaext', self)
|
|
||||||
# self._temp.t10ge = Adc('temp_10ge', self)
|
|
||||||
# self._temp.dcdc = Adc('temp_dcdc', self)
|
|
||||||
# self._temp.sodl = Adc('temp_sodl', self)
|
|
||||||
# self._temp.sodr = Adc('temp_sodr', self)
|
|
||||||
# self._temp.fpgafl = Adc('temp_fpgafl', self)
|
|
||||||
# self._temp.fpgafr = Adc('temp_fpgafr', self)
|
|
||||||
|
|
||||||
# @property
|
|
||||||
# def active(self):
|
|
||||||
# """
|
|
||||||
# Is the detector active? Can be used to enable or disable a detector
|
|
||||||
# module
|
|
||||||
|
|
||||||
# Examples
|
|
||||||
# ----------
|
|
||||||
|
|
||||||
# ::
|
|
||||||
|
|
||||||
# d.active
|
|
||||||
# >> active: [True, True]
|
|
||||||
|
|
||||||
# d.active[1] = False
|
|
||||||
# >> active: [True, False]
|
|
||||||
# """
|
|
||||||
# return self._active
|
|
||||||
|
|
||||||
# @active.setter
|
|
||||||
# def active(self, value):
|
|
||||||
# self._active[:] = value
|
|
||||||
|
|
||||||
# @property
|
|
||||||
# def measured_period(self):
|
|
||||||
# return self._api.getMeasuredPeriod()
|
|
||||||
|
|
||||||
# @property
|
|
||||||
# def measured_subperiod(self):
|
|
||||||
# return self._api.getMeasuredSubPeriod()
|
|
||||||
|
|
||||||
# @property
|
|
||||||
# def add_gappixels(self):
|
|
||||||
# """Enable or disable the (virual) pixels between ASICs
|
|
||||||
|
|
||||||
# Examples
|
|
||||||
# ----------
|
|
||||||
|
|
||||||
# ::
|
|
||||||
|
|
||||||
# d.add_gappixels = True
|
|
||||||
|
|
||||||
# d.add_gappixels
|
|
||||||
# >> True
|
|
||||||
|
|
||||||
# """
|
|
||||||
# return self._api.getGapPixels()
|
|
||||||
|
|
||||||
# @add_gappixels.setter
|
|
||||||
# def add_gappixels(self, value):
|
|
||||||
# self._api.setGapPixels(value)
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def dacs(self):
|
def dacs(self):
|
||||||
@ -284,68 +169,6 @@ class Eiger(Detector):
|
|||||||
"""
|
"""
|
||||||
return self._dacs
|
return self._dacs
|
||||||
|
|
||||||
# @property
|
|
||||||
# def tx_delay(self):
|
|
||||||
# """
|
|
||||||
# Transmission delay of the modules to allow running the detector
|
|
||||||
# in a network not supporting the full speed of the detector.
|
|
||||||
|
|
||||||
|
|
||||||
# ::
|
|
||||||
|
|
||||||
# d.tx_delay
|
|
||||||
# >>
|
|
||||||
# Transmission delay [ns]
|
|
||||||
# left right frame
|
|
||||||
# 0:beb048 0 15000 0
|
|
||||||
# 1:beb049 100 190000 100
|
|
||||||
|
|
||||||
# d.tx_delay.left = [2000,5000]
|
|
||||||
# """
|
|
||||||
# return self._delay
|
|
||||||
|
|
||||||
# def pulse_all_pixels(self, n):
|
|
||||||
# """
|
|
||||||
# Pulse each pixel of the chip **n** times using the analog test pulses.
|
|
||||||
# The pulse height is set using d.dacs.vcall with 4000 being 0 and 0 being
|
|
||||||
# the highest pulse.
|
|
||||||
|
|
||||||
# ::
|
|
||||||
|
|
||||||
# #Pulse all pixels ten times
|
|
||||||
# d.pulse_all_pixels(10)
|
|
||||||
|
|
||||||
# #Avoid resetting before acq
|
|
||||||
# d.eiger_matrix_reset = False
|
|
||||||
|
|
||||||
# d.acq() #take frame
|
|
||||||
|
|
||||||
# #Restore normal behaviour
|
|
||||||
# d.eiger_matrix_reset = True
|
|
||||||
|
|
||||||
|
|
||||||
# """
|
|
||||||
# self._api.pulseAllPixels(n)
|
|
||||||
|
|
||||||
|
|
||||||
# def pulse_diagonal(self, n):
|
|
||||||
# """
|
|
||||||
# Pulse pixels in super colums in a diagonal fashion. Used for calibration
|
|
||||||
# of vcall. Saves time compared to pulsing all pixels.
|
|
||||||
# """
|
|
||||||
# self._api.pulseDiagonal(n)
|
|
||||||
|
|
||||||
|
|
||||||
# def pulse_chip(self, n):
|
|
||||||
# """
|
|
||||||
# Advance the counter by toggling enable. Gives 2*n+2 int the counter
|
|
||||||
|
|
||||||
# """
|
|
||||||
# n = int(n)
|
|
||||||
# if n >= -1:
|
|
||||||
# self._api.pulseChip(n)
|
|
||||||
# else:
|
|
||||||
# raise ValueError('n must be equal or larger than -1')
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def vcmp(self):
|
def vcmp(self):
|
||||||
@ -437,40 +260,33 @@ class Eiger(Detector):
|
|||||||
# else:
|
# else:
|
||||||
# self._api.setReceiverStreamingPort(port, -1)
|
# self._api.setReceiverStreamingPort(port, -1)
|
||||||
|
|
||||||
# @property
|
@property
|
||||||
# def temp(self):
|
def temp(self):
|
||||||
# """
|
"""
|
||||||
# An instance of DetectorAdcs used to read the temperature
|
An instance of DetectorAdcs used to read the temperature
|
||||||
# of different components
|
of different components
|
||||||
|
|
||||||
# Examples
|
Examples
|
||||||
# -----------
|
-----------
|
||||||
|
|
||||||
# ::
|
::
|
||||||
|
|
||||||
# detector.temp
|
detector.temp
|
||||||
# >>
|
>>
|
||||||
# temp_fpga : 36.90°C, 45.60°C
|
temp_fpga : 36.90°C, 45.60°C
|
||||||
# temp_fpgaext : 31.50°C, 32.50°C
|
temp_fpgaext : 31.50°C, 32.50°C
|
||||||
# temp_10ge : 0.00°C, 0.00°C
|
temp_10ge : 0.00°C, 0.00°C
|
||||||
# temp_dcdc : 36.00°C, 36.00°C
|
temp_dcdc : 36.00°C, 36.00°C
|
||||||
# temp_sodl : 33.00°C, 34.50°C
|
temp_sodl : 33.00°C, 34.50°C
|
||||||
# temp_sodr : 33.50°C, 34.00°C
|
temp_sodr : 33.50°C, 34.00°C
|
||||||
# temp_fpgafl : 33.81°C, 30.93°C
|
temp_fpgafl : 33.81°C, 30.93°C
|
||||||
# temp_fpgafr : 27.88°C, 29.15°C
|
temp_fpgafr : 27.88°C, 29.15°C
|
||||||
|
|
||||||
# a = detector.temp.fpga[:]
|
a = detector.temp.fpga[:]
|
||||||
# a
|
a
|
||||||
# >> [36.568, 45.542]
|
>> [36.568, 45.542]
|
||||||
|
|
||||||
|
|
||||||
# """
|
"""
|
||||||
# return self._temp
|
return self._temp
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# def set_delays(self, delta):
|
|
||||||
# self.tx_delay.left = [delta*(i*2) for i in range(self.n_modules)]
|
|
||||||
# self.tx_delay.right = [delta*(i*2+1) for i in range(self.n_modules)]
|
|
||||||
|
|
||||||
|
|
||||||
|
19
python/slsdet/enums.py
Normal file
19
python/slsdet/enums.py
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
|
||||||
|
import _slsdet
|
||||||
|
runStatus = _slsdet.slsDetectorDefs.runStatus
|
||||||
|
speedLevel = _slsdet.slsDetectorDefs.speedLevel
|
||||||
|
detectorType = _slsdet.slsDetectorDefs.detectorType
|
||||||
|
frameDiscardPolicy = _slsdet.slsDetectorDefs.frameDiscardPolicy
|
||||||
|
fileFormat = _slsdet.slsDetectorDefs.fileFormat
|
||||||
|
dimension = _slsdet.slsDetectorDefs.dimension
|
||||||
|
externalSignalFlag = _slsdet.slsDetectorDefs.externalSignalFlag
|
||||||
|
timingMode = _slsdet.slsDetectorDefs.timingMode
|
||||||
|
dacIndex = _slsdet.slsDetectorDefs.dacIndex
|
||||||
|
detectorSettings = _slsdet.slsDetectorDefs.detectorSettings
|
||||||
|
clockIndex = _slsdet.slsDetectorDefs.clockIndex
|
||||||
|
readoutMode = _slsdet.slsDetectorDefs.readoutMode
|
||||||
|
masterFlags = _slsdet.slsDetectorDefs.masterFlags
|
||||||
|
frameModeType = _slsdet.slsDetectorDefs.frameModeType
|
||||||
|
detectorModeType = _slsdet.slsDetectorDefs.detectorModeType
|
||||||
|
burstMode = _slsdet.slsDetectorDefs.burstMode
|
||||||
|
timingSourceType = _slsdet.slsDetectorDefs.timingSourceType
|
51
python/slsdet/gotthard.py
Normal file
51
python/slsdet/gotthard.py
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
"""
|
||||||
|
This file contains the specialization for the Moench detector
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
from .detector import Detector, freeze
|
||||||
|
from .dacs import DetectorDacs
|
||||||
|
import _slsdet
|
||||||
|
dacIndex = _slsdet.slsDetectorDefs.dacIndex
|
||||||
|
from .detector_property import DetectorProperty
|
||||||
|
|
||||||
|
# @freeze
|
||||||
|
|
||||||
|
# vref_ds, vcascn_pb, vcascp_pb, vout_cm, vcasc_out, vin_cm, vref_comp, ib_test_c
|
||||||
|
class GotthardDacs(DetectorDacs):
|
||||||
|
_dacs = [('vref_ds', dacIndex.VREF_DS, 0, 4000, 660),
|
||||||
|
('vcascn_pb', dacIndex.VCASCN_PB, 0, 4000, 650),
|
||||||
|
('vcascp_pb,', dacIndex.VCASCP_PB, 0, 4000, 1480),
|
||||||
|
('vout_cm', dacIndex.VOUT_CM, 0, 4000, 1520),
|
||||||
|
('vcasc_out', dacIndex.VCASC_OUT, 0, 4000, 1320),
|
||||||
|
('vin_cm', dacIndex.VIN_CM, 0, 4000, 1350),
|
||||||
|
('vref_comp', dacIndex.VREF_COMP, 0, 4000, 350),
|
||||||
|
('ib_test_c', dacIndex.IB_TESTC, 0, 4000, 2001),
|
||||||
|
]
|
||||||
|
_dacnames = [_d[0] for _d in _dacs]
|
||||||
|
|
||||||
|
#vthreshold??
|
||||||
|
|
||||||
|
|
||||||
|
@freeze
|
||||||
|
class Gotthard(Detector):
|
||||||
|
"""
|
||||||
|
Subclassing Detector to set up correct dacs and detector specific
|
||||||
|
functions.
|
||||||
|
"""
|
||||||
|
_detector_dynamic_range = [16]
|
||||||
|
|
||||||
|
|
||||||
|
_settings = ['standard', 'highgain', 'lowgain', 'veryhighgain', 'verylowgain']
|
||||||
|
"""available settings for Eiger, note almost always standard"""
|
||||||
|
|
||||||
|
def __init__(self, id=0):
|
||||||
|
super().__init__(id)
|
||||||
|
self._frozen = False
|
||||||
|
self._dacs = GotthardDacs(self)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def dacs(self):
|
||||||
|
return self._dacs
|
61
python/slsdet/gotthard2.py
Normal file
61
python/slsdet/gotthard2.py
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
"""
|
||||||
|
This file contains the specialization for the Jungfrau detector
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
from .detector import Detector, freeze
|
||||||
|
|
||||||
|
# from .adcs import Adc, DetectorAdcs
|
||||||
|
from .dacs import DetectorDacs
|
||||||
|
import _slsdet
|
||||||
|
dacIndex = _slsdet.slsDetectorDefs.dacIndex
|
||||||
|
from .detector_property import DetectorProperty
|
||||||
|
|
||||||
|
|
||||||
|
# @freeze
|
||||||
|
class Gotthard2Dacs(DetectorDacs):
|
||||||
|
"""
|
||||||
|
Gotthard2 specific DACs
|
||||||
|
"""
|
||||||
|
_dacs = [('vref_h_adc', dacIndex.VREF_H_ADC, 0, 4000, 2116),
|
||||||
|
('vb_comp_fe', dacIndex.VB_COMP_FE, 0, 4000, 0),
|
||||||
|
('vb_comp_adc', dacIndex.VB_COMP_ADC, 0, 4000, 0),
|
||||||
|
('vcom_cds', dacIndex.VCOM_CDS, 0, 4000, 705),
|
||||||
|
('vref_rstore', dacIndex.VREF_RSTORE, 0, 4000, 205),
|
||||||
|
('vb_opa_1st', dacIndex.VB_OPA_1ST, 0, 4000, 0),
|
||||||
|
('vref_comp_fe', dacIndex.VREF_COMP_FE, 0, 4000, 0),
|
||||||
|
('vcom_adc1', dacIndex.VCOM_ADC1, 0, 4000, 705),
|
||||||
|
('vref_prech', dacIndex.VREF_PRECH, 0, 4000, 900),
|
||||||
|
('vref_l_adc', dacIndex.VREF_L_ADC, 0, 4000, 700),
|
||||||
|
('vref_cds', dacIndex.VREF_CDS, 0, 4000, 600),
|
||||||
|
('vb_cs', dacIndex.VB_CS, 0, 4000, 2799),
|
||||||
|
('vb_opa_fd', dacIndex.VB_OPA_FD, 0, 4000, 0),
|
||||||
|
('vcom_adc2', dacIndex.VCOM_ADC2, 0, 4000, 704),
|
||||||
|
]
|
||||||
|
_dacnames = [_d[0] for _d in _dacs]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@freeze
|
||||||
|
class Gotthard2(Detector):
|
||||||
|
"""
|
||||||
|
Subclassing Detector to set up correct dacs and detector specific
|
||||||
|
functions.
|
||||||
|
"""
|
||||||
|
_detector_dynamic_range = [16]
|
||||||
|
|
||||||
|
|
||||||
|
_settings = ['standard', 'highgain', 'lowgain', 'veryhighgain', 'verylowgain']
|
||||||
|
"""available settings for Eiger, note almost always standard"""
|
||||||
|
|
||||||
|
def __init__(self, id=0):
|
||||||
|
super().__init__(id)
|
||||||
|
self._frozen = False
|
||||||
|
self._dacs = Gotthard2Dacs(self)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def dacs(self):
|
||||||
|
return self._dacs
|
30
python/slsdet/jsonproxy.py
Normal file
30
python/slsdet/jsonproxy.py
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
from .utils import element_if_equal
|
||||||
|
|
||||||
|
class JsonProxy:
|
||||||
|
"""
|
||||||
|
Proxy class to allow for intuitive setting and getting of rx_jsonpara
|
||||||
|
This class is returned by Detectr.rx_jsonpara
|
||||||
|
"""
|
||||||
|
def __init__(self, det):
|
||||||
|
self.det = det
|
||||||
|
|
||||||
|
def __getitem__(self, key):
|
||||||
|
return element_if_equal(self.det.getAdditionalJsonParameter(key))
|
||||||
|
|
||||||
|
def __setitem__(self, key, value):
|
||||||
|
self.det.setAdditionalJsonParameter(key, str(value))
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
r = element_if_equal(self.det.getAdditionalJsonHeader())
|
||||||
|
if isinstance(r, list):
|
||||||
|
rstr = ''
|
||||||
|
for i, list_item in enumerate(r):
|
||||||
|
list_item = dict(list_item)
|
||||||
|
rstr += ''.join([f'{i}:{key}: {value}\n' for key, value in list_item.items()])
|
||||||
|
|
||||||
|
return rstr.strip('\n')
|
||||||
|
else:
|
||||||
|
r = dict(r)
|
||||||
|
return '\n'.join([f'{key}: {value}' for key, value in r.items()])
|
||||||
|
|
||||||
|
|
52
python/slsdet/moench.py
Normal file
52
python/slsdet/moench.py
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
"""
|
||||||
|
This file contains the specialization for the Moench detector
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
from .detector import Detector, freeze
|
||||||
|
from .dacs import DetectorDacs
|
||||||
|
import _slsdet
|
||||||
|
dacIndex = _slsdet.slsDetectorDefs.dacIndex
|
||||||
|
from .detector_property import DetectorProperty
|
||||||
|
|
||||||
|
# @freeze
|
||||||
|
class MoenchDacs(DetectorDacs):
|
||||||
|
"""
|
||||||
|
Jungfrau specific DACs
|
||||||
|
"""
|
||||||
|
_dacs = [('vbp_colbuf', dacIndex.VBP_COLBUF, 0, 4000, 1300),
|
||||||
|
('vipre', dacIndex.VIPRE, 0, 4000, 1000),
|
||||||
|
('vin_cm,', dacIndex.VIN_CM, 0, 4000, 1400),
|
||||||
|
('vb_sda', dacIndex.VB_SDA, 0, 4000, 680),
|
||||||
|
('vcasc_sfp', dacIndex.VCASC_SFP, 0, 4000, 1428),
|
||||||
|
('vout_cm', dacIndex.VOUT_CM, 0, 4000, 1200),
|
||||||
|
('vipre_cds', dacIndex.VIPRE_CDS, 0, 4000, 800),
|
||||||
|
('ibias_sfp', dacIndex.IBIAS_SFP, 0, 4000, 900),
|
||||||
|
]
|
||||||
|
_dacnames = [_d[0] for _d in _dacs]
|
||||||
|
|
||||||
|
#vthreshold??
|
||||||
|
|
||||||
|
|
||||||
|
@freeze
|
||||||
|
class Moench(Detector):
|
||||||
|
"""
|
||||||
|
Subclassing Detector to set up correct dacs and detector specific
|
||||||
|
functions.
|
||||||
|
"""
|
||||||
|
_detector_dynamic_range = [16]
|
||||||
|
|
||||||
|
|
||||||
|
_settings = ['standard', 'highgain', 'lowgain', 'veryhighgain', 'verylowgain']
|
||||||
|
"""available settings for Eiger, note almost always standard"""
|
||||||
|
|
||||||
|
def __init__(self, id=0):
|
||||||
|
super().__init__(id)
|
||||||
|
self._frozen = False
|
||||||
|
self._dacs = MoenchDacs(self)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def dacs(self):
|
||||||
|
return self._dacs
|
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
"""
|
"""
|
||||||
This file contains the specialization for the Jungfrau detector
|
This file contains the specialization for the Mythen3 detector
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
50
python/slsdet/temperature.py
Normal file
50
python/slsdet/temperature.py
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
from functools import partial
|
||||||
|
from collections.abc import Iterable
|
||||||
|
import numpy as np
|
||||||
|
class Temperature:
|
||||||
|
degree_sign = u"\N{DEGREE SIGN}"
|
||||||
|
|
||||||
|
def __init__(self, name, enum, detector):
|
||||||
|
self.name = name
|
||||||
|
self.enum = enum
|
||||||
|
self._detector = detector
|
||||||
|
self.get_nmod = self._detector.size
|
||||||
|
# Bind functions to get and set the dac
|
||||||
|
self.get = partial(self._detector.getTemperature, self.enum)
|
||||||
|
|
||||||
|
def __getitem__(self, key):
|
||||||
|
if key == slice(None, None, None):
|
||||||
|
return self.get()
|
||||||
|
elif isinstance(key, Iterable):
|
||||||
|
return self.get(list(key))
|
||||||
|
else:
|
||||||
|
return self.get([key])[0] # No list for single value
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
"""String representation for a single temperature in all modules"""
|
||||||
|
|
||||||
|
tempstr = ''.join([f'{item:5d}{self.degree_sign}C' for item in self.get()])
|
||||||
|
return f'{self.name:15s}:{tempstr}'
|
||||||
|
|
||||||
|
class DetectorTemperature:
|
||||||
|
"""
|
||||||
|
Interface to temperatures on the readout board
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __iter__(self):
|
||||||
|
for attr, value in self.__dict__.items():
|
||||||
|
yield value
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
"""String representation of all temps all mods"""
|
||||||
|
r_str = '\n'.join([repr(temp) for temp in self])
|
||||||
|
return r_str
|
||||||
|
|
||||||
|
def to_dict(self):
|
||||||
|
"""Get temperatures as a dictionary with numpy arrays"""
|
||||||
|
return {attr:np.array(value.get()) for attr, value in self.__dict__.items()}
|
||||||
|
|
||||||
|
def to_array(self):
|
||||||
|
"""Get all temperatures as a numpy array"""
|
||||||
|
t = self.to_dict()
|
||||||
|
return np.vstack([value for key, value in t.items()])
|
@ -8,6 +8,8 @@ from collections import namedtuple
|
|||||||
import _slsdet #C++ lib
|
import _slsdet #C++ lib
|
||||||
import functools
|
import functools
|
||||||
import datetime as dt
|
import datetime as dt
|
||||||
|
import pathlib
|
||||||
|
import os
|
||||||
|
|
||||||
Geometry = namedtuple('Geometry', ['x', 'y'])
|
Geometry = namedtuple('Geometry', ['x', 'y'])
|
||||||
|
|
||||||
@ -77,6 +79,7 @@ def element(func):
|
|||||||
return element_if_equal(func(self, *args, **kwargs))
|
return element_if_equal(func(self, *args, **kwargs))
|
||||||
return wrapper
|
return wrapper
|
||||||
|
|
||||||
|
|
||||||
def eiger_register_to_time(register):
|
def eiger_register_to_time(register):
|
||||||
"""
|
"""
|
||||||
Decode register value and return time in s. Values are stored in
|
Decode register value and return time in s. Values are stored in
|
||||||
@ -93,3 +96,34 @@ def make_timedelta(t):
|
|||||||
return t
|
return t
|
||||||
else:
|
else:
|
||||||
return dt.timedelta(seconds=t)
|
return dt.timedelta(seconds=t)
|
||||||
|
|
||||||
|
def make_string_path(path):
|
||||||
|
"""
|
||||||
|
Accepts either a pathlib.Path or a string, expands ~ to user and convert
|
||||||
|
Path to str
|
||||||
|
"""
|
||||||
|
if isinstance(path, pathlib.Path):
|
||||||
|
return path.expanduser().as_posix()
|
||||||
|
elif isinstance(path, str):
|
||||||
|
return os.path.expanduser(path)
|
||||||
|
else:
|
||||||
|
raise ValueError("Cannot convert argument to posix path")
|
||||||
|
|
||||||
|
|
||||||
|
def set_using_dict(func, args):
|
||||||
|
if isinstance(args, dict):
|
||||||
|
for key, value in args.items():
|
||||||
|
func(value, [key])
|
||||||
|
else:
|
||||||
|
func(args)
|
||||||
|
|
||||||
|
def set_time_using_dict(func, args):
|
||||||
|
if isinstance(args, dict):
|
||||||
|
for key, value in args.items():
|
||||||
|
if isinstance(value, int):
|
||||||
|
value = float(value)
|
||||||
|
func(value, [key])
|
||||||
|
else:
|
||||||
|
if isinstance(args, int):
|
||||||
|
args = float(args)
|
||||||
|
func(args)
|
@ -36,6 +36,10 @@ void init_det(py::module &m) {
|
|||||||
(void (Detector::*)(const std::string &)) &
|
(void (Detector::*)(const std::string &)) &
|
||||||
Detector::loadParameters,
|
Detector::loadParameters,
|
||||||
py::arg())
|
py::arg())
|
||||||
|
.def("loadParameters",
|
||||||
|
(void (Detector::*)(const std::vector<std::string> &)) &
|
||||||
|
Detector::loadParameters,
|
||||||
|
py::arg())
|
||||||
.def("getHostname",
|
.def("getHostname",
|
||||||
(Result<std::string>(Detector::*)(sls::Positions) const) &
|
(Result<std::string>(Detector::*)(sls::Positions) const) &
|
||||||
Detector::getHostname,
|
Detector::getHostname,
|
||||||
@ -180,6 +184,14 @@ void init_det(py::module &m) {
|
|||||||
(Result<sls::ns>(Detector::*)(sls::Positions) const) &
|
(Result<sls::ns>(Detector::*)(sls::Positions) const) &
|
||||||
Detector::getDelayAfterTriggerLeft,
|
Detector::getDelayAfterTriggerLeft,
|
||||||
py::arg() = Positions{})
|
py::arg() = Positions{})
|
||||||
|
.def("getDynamicRange",
|
||||||
|
(Result<int>(Detector::*)(sls::Positions) const) &
|
||||||
|
Detector::getDynamicRange,
|
||||||
|
py::arg() = Positions{})
|
||||||
|
.def("setDynamicRange",
|
||||||
|
(void (Detector::*)(int)) & Detector::setDynamicRange, py::arg())
|
||||||
|
.def("getDynamicRangeList", (std::vector<int>(Detector::*)() const) &
|
||||||
|
Detector::getDynamicRangeList)
|
||||||
.def("getTimingMode",
|
.def("getTimingMode",
|
||||||
(Result<defs::timingMode>(Detector::*)(sls::Positions) const) &
|
(Result<defs::timingMode>(Detector::*)(sls::Positions) const) &
|
||||||
Detector::getTimingMode,
|
Detector::getTimingMode,
|
||||||
@ -188,6 +200,9 @@ void init_det(py::module &m) {
|
|||||||
(void (Detector::*)(defs::timingMode, sls::Positions)) &
|
(void (Detector::*)(defs::timingMode, sls::Positions)) &
|
||||||
Detector::setTimingMode,
|
Detector::setTimingMode,
|
||||||
py::arg(), py::arg() = Positions{})
|
py::arg(), py::arg() = Positions{})
|
||||||
|
.def("getTimingModeList",
|
||||||
|
(std::vector<defs::timingMode>(Detector::*)() const) &
|
||||||
|
Detector::getTimingModeList)
|
||||||
.def("getSpeed",
|
.def("getSpeed",
|
||||||
(Result<defs::speedLevel>(Detector::*)(sls::Positions) const) &
|
(Result<defs::speedLevel>(Detector::*)(sls::Positions) const) &
|
||||||
Detector::getSpeed,
|
Detector::getSpeed,
|
||||||
@ -294,6 +309,9 @@ void init_det(py::module &m) {
|
|||||||
(void (Detector::*)(const int, sls::Positions)) &
|
(void (Detector::*)(const int, sls::Positions)) &
|
||||||
Detector::setImageTestMode,
|
Detector::setImageTestMode,
|
||||||
py::arg(), py::arg() = Positions{})
|
py::arg(), py::arg() = Positions{})
|
||||||
|
.def("getTemperatureList",
|
||||||
|
(std::vector<defs::dacIndex>(Detector::*)() const) &
|
||||||
|
Detector::getTemperatureList)
|
||||||
.def("getTemperature",
|
.def("getTemperature",
|
||||||
(Result<int>(Detector::*)(defs::dacIndex, sls::Positions) const) &
|
(Result<int>(Detector::*)(defs::dacIndex, sls::Positions) const) &
|
||||||
Detector::getTemperature,
|
Detector::getTemperature,
|
||||||
@ -364,6 +382,18 @@ void init_det(py::module &m) {
|
|||||||
(void (Detector::*)(sls::Positions)) &
|
(void (Detector::*)(sls::Positions)) &
|
||||||
Detector::sendSoftwareTrigger,
|
Detector::sendSoftwareTrigger,
|
||||||
py::arg() = Positions{})
|
py::arg() = Positions{})
|
||||||
|
.def("getScan",
|
||||||
|
(Result<defs::scanParameters>(Detector::*)(sls::Positions) const) &
|
||||||
|
Detector::getScan,
|
||||||
|
py::arg() = Positions{})
|
||||||
|
.def("setScan",
|
||||||
|
(void (Detector::*)(const defs::scanParameters)) &
|
||||||
|
Detector::setScan,
|
||||||
|
py::arg())
|
||||||
|
.def("getScanErrorMessage",
|
||||||
|
(Result<std::string>(Detector::*)(sls::Positions) const) &
|
||||||
|
Detector::getScanErrorMessage,
|
||||||
|
py::arg() = Positions{})
|
||||||
.def("getNumberofUDPInterfaces",
|
.def("getNumberofUDPInterfaces",
|
||||||
(Result<int>(Detector::*)(sls::Positions) const) &
|
(Result<int>(Detector::*)(sls::Positions) const) &
|
||||||
Detector::getNumberofUDPInterfaces,
|
Detector::getNumberofUDPInterfaces,
|
||||||
@ -458,6 +488,14 @@ void init_det(py::module &m) {
|
|||||||
.def("setDestinationUDPPort2",
|
.def("setDestinationUDPPort2",
|
||||||
(void (Detector::*)(int, int)) & Detector::setDestinationUDPPort2,
|
(void (Detector::*)(int, int)) & Detector::setDestinationUDPPort2,
|
||||||
py::arg(), py::arg())
|
py::arg(), py::arg())
|
||||||
|
.def("reconfigureUDPDestination",
|
||||||
|
(void (Detector::*)(sls::Positions)) &
|
||||||
|
Detector::reconfigureUDPDestination,
|
||||||
|
py::arg() = Positions{})
|
||||||
|
.def("validateUDPConfiguration",
|
||||||
|
(void (Detector::*)(sls::Positions)) &
|
||||||
|
Detector::validateUDPConfiguration,
|
||||||
|
py::arg() = Positions{})
|
||||||
.def("printRxConfiguration",
|
.def("printRxConfiguration",
|
||||||
(Result<std::string>(Detector::*)(sls::Positions) const) &
|
(Result<std::string>(Detector::*)(sls::Positions) const) &
|
||||||
Detector::printRxConfiguration,
|
Detector::printRxConfiguration,
|
||||||
@ -670,6 +708,14 @@ void init_det(py::module &m) {
|
|||||||
(void (Detector::*)(int, sls::Positions)) &
|
(void (Detector::*)(int, sls::Positions)) &
|
||||||
Detector::setRxZmqTimer,
|
Detector::setRxZmqTimer,
|
||||||
py::arg(), py::arg() = Positions{})
|
py::arg(), py::arg() = Positions{})
|
||||||
|
.def("getRxZmqStartingFrame",
|
||||||
|
(Result<int>(Detector::*)(sls::Positions) const) &
|
||||||
|
Detector::getRxZmqStartingFrame,
|
||||||
|
py::arg() = Positions{})
|
||||||
|
.def("setRxZmqStartingFrame",
|
||||||
|
(void (Detector::*)(int, sls::Positions)) &
|
||||||
|
Detector::setRxZmqStartingFrame,
|
||||||
|
py::arg(), py::arg() = Positions{})
|
||||||
.def("getRxZmqPort",
|
.def("getRxZmqPort",
|
||||||
(Result<int>(Detector::*)(sls::Positions) const) &
|
(Result<int>(Detector::*)(sls::Positions) const) &
|
||||||
Detector::getRxZmqPort,
|
Detector::getRxZmqPort,
|
||||||
@ -700,12 +746,6 @@ void init_det(py::module &m) {
|
|||||||
(void (Detector::*)(const sls::IpAddr, sls::Positions)) &
|
(void (Detector::*)(const sls::IpAddr, sls::Positions)) &
|
||||||
Detector::setClientZmqIp,
|
Detector::setClientZmqIp,
|
||||||
py::arg(), py::arg() = Positions{})
|
py::arg(), py::arg() = Positions{})
|
||||||
.def("getDynamicRange",
|
|
||||||
(Result<int>(Detector::*)(sls::Positions) const) &
|
|
||||||
Detector::getDynamicRange,
|
|
||||||
py::arg() = Positions{})
|
|
||||||
.def("setDynamicRange",
|
|
||||||
(void (Detector::*)(int)) & Detector::setDynamicRange, py::arg())
|
|
||||||
.def("getSubExptime",
|
.def("getSubExptime",
|
||||||
(Result<sls::ns>(Detector::*)(sls::Positions) const) &
|
(Result<sls::ns>(Detector::*)(sls::Positions) const) &
|
||||||
Detector::getSubExptime,
|
Detector::getSubExptime,
|
||||||
@ -939,11 +979,11 @@ void init_det(py::module &m) {
|
|||||||
(void (Detector::*)(const int, const int, sls::Positions)) &
|
(void (Detector::*)(const int, const int, sls::Positions)) &
|
||||||
Detector::setInjectChannel,
|
Detector::setInjectChannel,
|
||||||
py::arg(), py::arg(), py::arg() = Positions{})
|
py::arg(), py::arg(), py::arg() = Positions{})
|
||||||
.def(
|
.def("getVetoPhoton",
|
||||||
"getVetoPhoton",
|
(void (Detector::*)(const int, const std::string &,
|
||||||
(Result<std::vector<int>>(Detector::*)(const int, sls::Positions)) &
|
sls::Positions)) &
|
||||||
Detector::getVetoPhoton,
|
Detector::getVetoPhoton,
|
||||||
py::arg(), py::arg() = Positions{})
|
py::arg(), py::arg(), py::arg() = Positions{})
|
||||||
.def("setVetoPhoton",
|
.def("setVetoPhoton",
|
||||||
(void (Detector::*)(const int, const int, const int,
|
(void (Detector::*)(const int, const int, const int,
|
||||||
const std::string &, sls::Positions)) &
|
const std::string &, sls::Positions)) &
|
||||||
@ -954,6 +994,11 @@ void init_det(py::module &m) {
|
|||||||
(void (Detector::*)(const int, const int, sls::Positions)) &
|
(void (Detector::*)(const int, const int, sls::Positions)) &
|
||||||
Detector::setVetoReference,
|
Detector::setVetoReference,
|
||||||
py::arg(), py::arg(), py::arg() = Positions{})
|
py::arg(), py::arg(), py::arg() = Positions{})
|
||||||
|
.def("setVetoFile",
|
||||||
|
(void (Detector::*)(const int, const std::string &,
|
||||||
|
sls::Positions)) &
|
||||||
|
Detector::setVetoFile,
|
||||||
|
py::arg(), py::arg(), py::arg() = Positions{})
|
||||||
.def("getBurstMode",
|
.def("getBurstMode",
|
||||||
(Result<defs::burstMode>(Detector::*)(sls::Positions)) &
|
(Result<defs::burstMode>(Detector::*)(sls::Positions)) &
|
||||||
Detector::getBurstMode,
|
Detector::getBurstMode,
|
||||||
@ -962,6 +1007,20 @@ void init_det(py::module &m) {
|
|||||||
(void (Detector::*)(defs::burstMode, sls::Positions)) &
|
(void (Detector::*)(defs::burstMode, sls::Positions)) &
|
||||||
Detector::setBurstMode,
|
Detector::setBurstMode,
|
||||||
py::arg(), py::arg() = Positions{})
|
py::arg(), py::arg() = Positions{})
|
||||||
|
.def("getCDSGain",
|
||||||
|
(Result<bool>(Detector::*)(sls::Positions) const) &
|
||||||
|
Detector::getCDSGain,
|
||||||
|
py::arg() = Positions{})
|
||||||
|
.def("setCDSGain",
|
||||||
|
(void (Detector::*)(bool, sls::Positions)) & Detector::setCDSGain,
|
||||||
|
py::arg(), py::arg() = Positions{})
|
||||||
|
.def("getFilter",
|
||||||
|
(Result<int>(Detector::*)(sls::Positions) const) &
|
||||||
|
Detector::getFilter,
|
||||||
|
py::arg() = Positions{})
|
||||||
|
.def("setFilter",
|
||||||
|
(void (Detector::*)(int, sls::Positions)) & Detector::setFilter,
|
||||||
|
py::arg(), py::arg() = Positions{})
|
||||||
.def("getCurrentSource",
|
.def("getCurrentSource",
|
||||||
(Result<bool>(Detector::*)(sls::Positions) const) &
|
(Result<bool>(Detector::*)(sls::Positions) const) &
|
||||||
Detector::getCurrentSource,
|
Detector::getCurrentSource,
|
||||||
@ -987,6 +1046,24 @@ void init_det(py::module &m) {
|
|||||||
(void (Detector::*)(const bool, sls::Positions)) &
|
(void (Detector::*)(const bool, sls::Positions)) &
|
||||||
Detector::setVeto,
|
Detector::setVeto,
|
||||||
py::arg(), py::arg() = Positions{})
|
py::arg(), py::arg() = Positions{})
|
||||||
|
.def("getADCConfiguration",
|
||||||
|
(Result<int>(Detector::*)(const int, const int, sls::Positions)
|
||||||
|
const) &
|
||||||
|
Detector::getADCConfiguration,
|
||||||
|
py::arg(), py::arg(), py::arg() = Positions{})
|
||||||
|
.def("setADCConfiguration",
|
||||||
|
(void (Detector::*)(const int, const int, const int,
|
||||||
|
sls::Positions)) &
|
||||||
|
Detector::setADCConfiguration,
|
||||||
|
py::arg(), py::arg(), py::arg(), py::arg() = Positions{})
|
||||||
|
.def("getBadChannels",
|
||||||
|
(void (Detector::*)(const std::string &, sls::Positions) const) &
|
||||||
|
Detector::getBadChannels,
|
||||||
|
py::arg(), py::arg() = Positions{})
|
||||||
|
.def("setBadChannels",
|
||||||
|
(void (Detector::*)(const std::string &, sls::Positions)) &
|
||||||
|
Detector::setBadChannels,
|
||||||
|
py::arg(), py::arg() = Positions{})
|
||||||
.def("getCounterMask",
|
.def("getCounterMask",
|
||||||
(Result<uint32_t>(Detector::*)(sls::Positions) const) &
|
(Result<uint32_t>(Detector::*)(sls::Positions) const) &
|
||||||
Detector::getCounterMask,
|
Detector::getCounterMask,
|
||||||
|
@ -274,9 +274,12 @@ void init_enums(py::module &m) {
|
|||||||
.export_values();
|
.export_values();
|
||||||
|
|
||||||
py::enum_<slsDetectorDefs::burstMode>(Defs, "burstMode")
|
py::enum_<slsDetectorDefs::burstMode>(Defs, "burstMode")
|
||||||
.value("BURST_OFF", slsDetectorDefs::burstMode::BURST_OFF)
|
|
||||||
.value("BURST_INTERNAL", slsDetectorDefs::burstMode::BURST_INTERNAL)
|
.value("BURST_INTERNAL", slsDetectorDefs::burstMode::BURST_INTERNAL)
|
||||||
.value("BURST_EXTERNAL", slsDetectorDefs::burstMode::BURST_EXTERNAL)
|
.value("BURST_EXTERNAL", slsDetectorDefs::burstMode::BURST_EXTERNAL)
|
||||||
|
.value("CONTINUOUS_INTERNAL",
|
||||||
|
slsDetectorDefs::burstMode::CONTINUOUS_INTERNAL)
|
||||||
|
.value("CONTINUOUS_EXTERNAL",
|
||||||
|
slsDetectorDefs::burstMode::CONTINUOUS_EXTERNAL)
|
||||||
.value("NUM_BURST_MODES", slsDetectorDefs::burstMode::NUM_BURST_MODES)
|
.value("NUM_BURST_MODES", slsDetectorDefs::burstMode::NUM_BURST_MODES)
|
||||||
.export_values();
|
.export_values();
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ Testing functions from utils.py
|
|||||||
import pytest
|
import pytest
|
||||||
from slsdet.utils import *
|
from slsdet.utils import *
|
||||||
import datetime as dt
|
import datetime as dt
|
||||||
|
import pathlib
|
||||||
|
|
||||||
def test_iterable():
|
def test_iterable():
|
||||||
assert is_iterable(5) == False
|
assert is_iterable(5) == False
|
||||||
@ -94,3 +95,22 @@ def test_make_timedelta_from_timedelta():
|
|||||||
r = make_timedelta(t)
|
r = make_timedelta(t)
|
||||||
assert 60 == r.total_seconds()
|
assert 60 == r.total_seconds()
|
||||||
assert r == dt.timedelta(minutes=1)
|
assert r == dt.timedelta(minutes=1)
|
||||||
|
|
||||||
|
|
||||||
|
def test_make_string_path_from_Path():
|
||||||
|
pathstr = "/some/temp/path"
|
||||||
|
p = pathlib.Path(pathstr)
|
||||||
|
r = make_string_path(p)
|
||||||
|
assert isinstance(r, str)
|
||||||
|
assert r == p.as_posix()
|
||||||
|
assert r == pathstr
|
||||||
|
|
||||||
|
def test_make_string_path_expand_user():
|
||||||
|
pathstr = "~/tmp/virtual.config"
|
||||||
|
home = pathlib.Path.home()
|
||||||
|
expanded_str = pathstr.replace('~', home.as_posix())
|
||||||
|
p = pathlib.Path(pathstr)
|
||||||
|
rp = make_string_path(p)
|
||||||
|
rs = make_string_path(pathstr)
|
||||||
|
assert rp == expanded_str
|
||||||
|
assert rs == expanded_str
|
@ -1,6 +1,6 @@
|
|||||||
add_executable(using_logger using_logger.cpp)
|
add_executable(using_logger using_logger.cpp)
|
||||||
target_link_libraries(using_logger
|
target_link_libraries(using_logger
|
||||||
slsSupportLib
|
slsSupportShared
|
||||||
pthread
|
pthread
|
||||||
rt
|
rt
|
||||||
)
|
)
|
||||||
@ -22,7 +22,7 @@ set_target_properties(using_logger PROPERTIES
|
|||||||
# add_executable(udp udp.cpp)
|
# add_executable(udp udp.cpp)
|
||||||
# target_link_libraries(udp
|
# target_link_libraries(udp
|
||||||
# slsDetectorShared
|
# slsDetectorShared
|
||||||
# slsSupportLib
|
# slsSupportShared
|
||||||
# pthread
|
# pthread
|
||||||
# rt
|
# rt
|
||||||
# fmt
|
# fmt
|
||||||
|
@ -23,7 +23,7 @@ foreach(exe ${MOENCH_EXECUTABLES})
|
|||||||
|
|
||||||
target_link_libraries(${exe}
|
target_link_libraries(${exe}
|
||||||
PUBLIC
|
PUBLIC
|
||||||
slsSupportLib
|
slsSupportShared
|
||||||
${ZeroMQ_LIBRARIES}
|
${ZeroMQ_LIBRARIES}
|
||||||
pthread
|
pthread
|
||||||
tiff
|
tiff
|
||||||
|
@ -241,7 +241,7 @@ int main(int argc, char *argv[]) {
|
|||||||
#endif
|
#endif
|
||||||
if (zmqsocket->Connect()) {
|
if (zmqsocket->Connect()) {
|
||||||
cprintf(RED, "Error: Could not connect to socket %s\n",
|
cprintf(RED, "Error: Could not connect to socket %s\n",
|
||||||
zmqsocket->GetZmqServerAddress());
|
(zmqsocket->GetZmqServerAddress()).c_str());
|
||||||
delete zmqsocket;
|
delete zmqsocket;
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
} else
|
} else
|
||||||
@ -281,12 +281,12 @@ int main(int argc, char *argv[]) {
|
|||||||
#endif
|
#endif
|
||||||
if (zmqsocket2->Connect()) {
|
if (zmqsocket2->Connect()) {
|
||||||
cprintf(RED, "BBB Error: Could not connect to socket %s\n",
|
cprintf(RED, "BBB Error: Could not connect to socket %s\n",
|
||||||
zmqsocket2->GetZmqServerAddress());
|
zmqsocket2->GetZmqServerAddress().c_str());
|
||||||
// delete zmqsocket2;
|
// delete zmqsocket2;
|
||||||
send = false;
|
send = false;
|
||||||
// return EXIT_FAILURE;
|
// return EXIT_FAILURE;
|
||||||
} else
|
} else
|
||||||
printf("Zmq Client at %s\n", zmqsocket2->GetZmqServerAddress());
|
printf("Zmq Client at %s\n", zmqsocket2->GetZmqServerAddress().c_str());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -388,6 +388,7 @@ int main(int argc, char *argv[]) {
|
|||||||
while (mt->isBusy()) {;}//wait until all data are processed from the queues
|
while (mt->isBusy()) {;}//wait until all data are processed from the queues
|
||||||
|
|
||||||
if (of) {
|
if (of) {
|
||||||
|
mt->setFilePointer(NULL);
|
||||||
fclose(of);
|
fclose(of);
|
||||||
of=NULL;
|
of=NULL;
|
||||||
}
|
}
|
||||||
|
@ -602,6 +602,7 @@ int *getClusters(char *data, int *ph=NULL) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static void writeClusters(FILE *f, single_photon_hit *cl, int nph, int fn=0){
|
static void writeClusters(FILE *f, single_photon_hit *cl, int nph, int fn=0){
|
||||||
|
if (f) {
|
||||||
if (nph>0) {
|
if (nph>0) {
|
||||||
#ifndef OLDFORMAT
|
#ifndef OLDFORMAT
|
||||||
if (fwrite((void*)&fn, 1, sizeof(int), f))
|
if (fwrite((void*)&fn, 1, sizeof(int), f))
|
||||||
@ -609,6 +610,7 @@ int *getClusters(char *data, int *ph=NULL) {
|
|||||||
#endif
|
#endif
|
||||||
for (int i=0; i<nph; i++) (cl+i)->write(f);
|
for (int i=0; i<nph; i++) (cl+i)->write(f);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -88,6 +88,7 @@ target_include_directories(slsDetectorGui PUBLIC
|
|||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(slsDetectorGui PUBLIC
|
target_link_libraries(slsDetectorGui PUBLIC
|
||||||
|
slsProjectOptions
|
||||||
slsProjectWarnings
|
slsProjectWarnings
|
||||||
slsDetectorShared
|
slsDetectorShared
|
||||||
${QT_QTCORE_LIBRARIES}
|
${QT_QTCORE_LIBRARIES}
|
||||||
@ -97,6 +98,7 @@ target_link_libraries(slsDetectorGui PUBLIC
|
|||||||
ZLIB::ZLIB
|
ZLIB::ZLIB
|
||||||
Qt4::QtOpenGL
|
Qt4::QtOpenGL
|
||||||
Qt4::QtSvg
|
Qt4::QtSvg
|
||||||
|
expat
|
||||||
)
|
)
|
||||||
|
|
||||||
set_target_properties(slsDetectorGui PROPERTIES
|
set_target_properties(slsDetectorGui PROPERTIES
|
||||||
@ -104,10 +106,10 @@ set_target_properties(slsDetectorGui PROPERTIES
|
|||||||
)
|
)
|
||||||
|
|
||||||
install(TARGETS slsDetectorGui
|
install(TARGETS slsDetectorGui
|
||||||
# EXPORT "${TARGETS_EXPORT_NAME}"
|
EXPORT "${TARGETS_EXPORT_NAME}"
|
||||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
# LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
# ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
# PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
# PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -52,6 +52,9 @@
|
|||||||
<height>25</height>
|
<height>25</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="keyboardTracking">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<double>-1.000000000000000</double>
|
<double>-1.000000000000000</double>
|
||||||
</property>
|
</property>
|
||||||
|
@ -98,6 +98,9 @@
|
|||||||
<height>25</height>
|
<height>25</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="keyboardTracking">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<number>-1</number>
|
<number>-1</number>
|
||||||
</property>
|
</property>
|
||||||
|
@ -413,129 +413,47 @@ Directory where one saves the data.
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QGroupBox" name="boxCorrection_2">
|
|
||||||
<property name="title">
|
|
||||||
<string>Options</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QRadioButton" name="radioDefaultDeadtime">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Default Dead Time</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QCheckBox" name="chkTenGiga">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string><nobr>
|
|
||||||
Compression using Root. Available only for Gotthard in Expert Mode.
|
|
||||||
</nobr><br><nobr>
|
|
||||||
#r_compression#
|
|
||||||
</nobr></string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>10GbE</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="4">
|
|
||||||
<widget class="QSpinBox" name="spinCustomDeadTime">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>25</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="suffix">
|
|
||||||
<string>ns</string>
|
|
||||||
</property>
|
|
||||||
<property name="minimum">
|
|
||||||
<number>-1</number>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>200000000</number>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QCheckBox" name="chkRate">
|
<spacer name="verticalSpacer">
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Rate:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="2">
|
|
||||||
<spacer name="horizontalSpacer_2">
|
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeType">
|
<property name="sizeType">
|
||||||
<enum>QSizePolicy::Fixed</enum>
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>10</width>
|
<width>20</width>
|
||||||
<height>20</height>
|
<height>10</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="3">
|
<item row="2" column="0">
|
||||||
<widget class="QRadioButton" name="radioCustomDeadtime">
|
<widget class="QGroupBox" name="boxCorrection_2">
|
||||||
|
<property name="title">
|
||||||
|
<string>Options</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="2" column="0">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="lblClkDivider">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>105</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Custom Dead Time:</string>
|
<string>Clock Divider:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="5">
|
<item>
|
||||||
<spacer name="horizontalSpacer_7">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Expanding</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>10</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0" colspan="6">
|
|
||||||
<widget class="QWidget" name="widgetEiger" native="true">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="gridEiger">
|
|
||||||
<item row="0" column="1">
|
|
||||||
<spacer name="horizontalSpacer_4">
|
<spacer name="horizontalSpacer_4">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
@ -551,8 +469,11 @@ Compression using Root. Available only for Gotthard in Expert Mode.
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="2">
|
<item>
|
||||||
<widget class="QComboBox" name="comboEigerClkDivider">
|
<widget class="QComboBox" name="comboClkDivider">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>0</width>
|
<width>0</width>
|
||||||
@ -582,8 +503,8 @@ Compression using Root. Available only for Gotthard in Expert Mode.
|
|||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="4">
|
<item>
|
||||||
<spacer name="horizontalSpacer_6">
|
<spacer name="horizontalSpacer_8">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
@ -598,80 +519,142 @@ Compression using Root. Available only for Gotthard in Expert Mode.
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="lblEigerFlags">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>105</width>
|
|
||||||
<height>16777215</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Flags:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="lblClkDivider">
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>105</width>
|
|
||||||
<height>16777215</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Clock Divider:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="2">
|
|
||||||
<widget class="QComboBox" name="comboEigerParallelFlag">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>25</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>200</width>
|
|
||||||
<height>16777215</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<widget class="QCheckBox" name="chkParallel">
|
||||||
<string>Parallel</string>
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Non Parallel</string>
|
<string>Parallel Readout</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0">
|
||||||
|
<widget class="QCheckBox" name="chkTenGiga">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><nobr>
|
||||||
|
Compression using Root. Available only for Gotthard in Expert Mode.
|
||||||
|
</nobr><br><nobr>
|
||||||
|
#r_compression#
|
||||||
|
</nobr></string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>10GbE</string>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
<item row="3" column="0">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="chkRate">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Rate:</string>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item>
|
||||||
<spacer name="verticalSpacer">
|
<widget class="QRadioButton" name="radioDefaultDeadtime">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Default Dead Time</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_2">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeType">
|
<property name="sizeType">
|
||||||
<enum>QSizePolicy::Fixed</enum>
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>20</width>
|
<width>10</width>
|
||||||
<height>10</height>
|
<height>20</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="radioCustomDeadtime">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Custom Dead Time:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QSpinBox" name="spinCustomDeadTime">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="keyboardTracking">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="suffix">
|
||||||
|
<string>ns</string>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>-1</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>200000000</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_7">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Expanding</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>10</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
@ -680,12 +663,6 @@ Compression using Root. Available only for Gotthard in Expert Mode.
|
|||||||
<tabstop>btnOutputBrowse</tabstop>
|
<tabstop>btnOutputBrowse</tabstop>
|
||||||
<tabstop>comboFileFormat</tabstop>
|
<tabstop>comboFileFormat</tabstop>
|
||||||
<tabstop>chkOverwriteEnable</tabstop>
|
<tabstop>chkOverwriteEnable</tabstop>
|
||||||
<tabstop>chkTenGiga</tabstop>
|
|
||||||
<tabstop>chkRate</tabstop>
|
|
||||||
<tabstop>radioDefaultDeadtime</tabstop>
|
|
||||||
<tabstop>radioCustomDeadtime</tabstop>
|
|
||||||
<tabstop>spinCustomDeadTime</tabstop>
|
|
||||||
<tabstop>comboEigerClkDivider</tabstop>
|
|
||||||
</tabstops>
|
</tabstops>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../include/icons.qrc"/>
|
<include location="../include/icons.qrc"/>
|
||||||
|
@ -180,6 +180,9 @@
|
|||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string><html><head/><body><p>High Voltage. Range: 60 - 200V. Swich off high voltage by setting to 0.</p><p>-1 corresponds to different values from detectors.</p><p>#highvoltage#</p></body></html></string>
|
<string><html><head/><body><p>High Voltage. Range: 60 - 200V. Swich off high voltage by setting to 0.</p><p>-1 corresponds to different values from detectors.</p><p>#highvoltage#</p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="keyboardTracking">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<number>-1</number>
|
<number>-1</number>
|
||||||
</property>
|
</property>
|
||||||
|
@ -432,7 +432,7 @@
|
|||||||
<property name="verticalSpacing">
|
<property name="verticalSpacing">
|
||||||
<number>4</number>
|
<number>4</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="5" column="0">
|
<item row="6" column="0">
|
||||||
<widget class="QStackedWidget" name="stackedLblTriggerBurst">
|
<widget class="QStackedWidget" name="stackedLblTriggerBurst">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
@ -503,7 +503,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="3">
|
<item row="5" column="3">
|
||||||
<widget class="QComboBox" name="comboPeriodUnit">
|
<widget class="QComboBox" name="comboPeriodUnit">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
@ -572,7 +572,7 @@ Frame period between exposures.
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="2" colspan="2">
|
<item row="2" column="2" colspan="2">
|
||||||
<widget class="QSpinBox" name="spinNumMeasurements">
|
<widget class="QSpinBox" name="spinNumMeasurements">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
@ -616,7 +616,7 @@ Frame period between exposures.
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QLabel" name="label_5">
|
<widget class="QLabel" name="label_5">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
@ -674,7 +674,7 @@ Frame period between exposures.
|
|||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="2">
|
<item row="4" column="2">
|
||||||
<widget class="QDoubleSpinBox" name="spinExpTime">
|
<widget class="QDoubleSpinBox" name="spinExpTime">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
@ -718,7 +718,7 @@ Exposure Time of a frame.
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0">
|
<item row="5" column="0">
|
||||||
<widget class="QLabel" name="lblPeriod">
|
<widget class="QLabel" name="lblPeriod">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
@ -735,7 +735,7 @@ Frame period between exposures.
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="3" column="0">
|
||||||
<widget class="QLabel" name="lblNumFrames">
|
<widget class="QLabel" name="lblNumFrames">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
@ -745,7 +745,7 @@ Frame period between exposures.
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
<item row="4" column="0">
|
||||||
<widget class="QLabel" name="lblExpTime">
|
<widget class="QLabel" name="lblExpTime">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
@ -762,7 +762,7 @@ Exposure Time of a frame.
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="2" colspan="2">
|
<item row="3" column="2" colspan="2">
|
||||||
<widget class="QSpinBox" name="spinNumFrames">
|
<widget class="QSpinBox" name="spinNumFrames">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
@ -809,7 +809,7 @@ Exposure Time of a frame.
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="3">
|
<item row="4" column="3">
|
||||||
<widget class="QComboBox" name="comboExpUnit">
|
<widget class="QComboBox" name="comboExpUnit">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
@ -871,7 +871,7 @@ Exposure Time of a frame.
|
|||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="2">
|
<item row="5" column="2">
|
||||||
<widget class="QDoubleSpinBox" name="spinPeriod">
|
<widget class="QDoubleSpinBox" name="spinPeriod">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
@ -931,7 +931,7 @@ Frame period between exposures.
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="2">
|
<item row="6" column="2">
|
||||||
<widget class="QStackedWidget" name="stackedSpinTriggerBurst">
|
<widget class="QStackedWidget" name="stackedSpinTriggerBurst">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
@ -1070,7 +1070,7 @@ Frame period between exposures.
|
|||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="0">
|
<item row="7" column="0">
|
||||||
<widget class="QStackedWidget" name="stackedLblDelayBurstPeriod">
|
<widget class="QStackedWidget" name="stackedLblDelayBurstPeriod">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
@ -1141,7 +1141,7 @@ Frame period between exposures.
|
|||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="2">
|
<item row="7" column="2">
|
||||||
<widget class="QStackedWidget" name="stackedSpinDelayBurstPeriod">
|
<widget class="QStackedWidget" name="stackedSpinDelayBurstPeriod">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
@ -1268,7 +1268,7 @@ Frame period between exposures.
|
|||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="3">
|
<item row="7" column="3">
|
||||||
<widget class="QStackedWidget" name="stackedComboDelayBurstPeriod">
|
<widget class="QStackedWidget" name="stackedComboDelayBurstPeriod">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
@ -1431,7 +1431,7 @@ Frame period between exposures.
|
|||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="0">
|
<item row="8" column="0">
|
||||||
<widget class="QStackedWidget" name="stackedLblSamplesGates">
|
<widget class="QStackedWidget" name="stackedLblSamplesGates">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
@ -1502,7 +1502,7 @@ Frame period between exposures.
|
|||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="2">
|
<item row="8" column="2">
|
||||||
<widget class="QStackedWidget" name="stackedSpinSamplesGates">
|
<widget class="QStackedWidget" name="stackedSpinSamplesGates">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
@ -1639,6 +1639,53 @@ Frame period between exposures.
|
|||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="lblBurstMode">
|
||||||
|
<property name="text">
|
||||||
|
<string>Burst Mode:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="2" colspan="2">
|
||||||
|
<widget class="QComboBox" name="comboBurstMode">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Timing Mode of the detector.
|
||||||
|
#timing#</string>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Burst Internal</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Burst External</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Continuous Internal</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Continuous External</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -2169,7 +2169,7 @@ Displays minimum, maximum and sum of values for each plot.
|
|||||||
<item row="0" column="2">
|
<item row="0" column="2">
|
||||||
<widget class="QStackedWidget" name="stackedTimeInterval">
|
<widget class="QStackedWidget" name="stackedTimeInterval">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="pageTimeGap">
|
<widget class="QWidget" name="pageTimeGap">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_14">
|
<layout class="QHBoxLayout" name="horizontalLayout_14">
|
||||||
@ -2181,6 +2181,9 @@ Displays minimum, maximum and sum of values for each plot.
|
|||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="keyboardTracking">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
<property name="decimals">
|
<property name="decimals">
|
||||||
<number>3</number>
|
<number>3</number>
|
||||||
</property>
|
</property>
|
||||||
@ -2249,6 +2252,9 @@ Displays minimum, maximum and sum of values for each plot.
|
|||||||
<height>0</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="keyboardTracking">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<number>1</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
|
@ -19,7 +19,7 @@ class qDrawPlot : public QWidget, private Ui::PlotObject {
|
|||||||
~qDrawPlot();
|
~qDrawPlot();
|
||||||
bool GetIsRunning();
|
bool GetIsRunning();
|
||||||
void SetRunning(bool enable);
|
void SetRunning(bool enable);
|
||||||
int GetProgress();
|
double GetProgress();
|
||||||
int64_t GetCurrentFrameIndex();
|
int64_t GetCurrentFrameIndex();
|
||||||
void Select1dPlot(bool enable);
|
void Select1dPlot(bool enable);
|
||||||
void SetPlotTitlePrefix(QString title);
|
void SetPlotTitlePrefix(QString title);
|
||||||
@ -152,7 +152,7 @@ class qDrawPlot : public QWidget, private Ui::PlotObject {
|
|||||||
bool disableZoom{false};
|
bool disableZoom{false};
|
||||||
int numDiscardBits{0};
|
int numDiscardBits{0};
|
||||||
|
|
||||||
int progress{0};
|
double progress{0};
|
||||||
int64_t currentFrame{0};
|
int64_t currentFrame{0};
|
||||||
mutable std::mutex mPlots;
|
mutable std::mutex mPlots;
|
||||||
int64_t currentAcqIndex{0};
|
int64_t currentAcqIndex{0};
|
||||||
|
@ -18,17 +18,24 @@ class qTabAdvanced : public QWidget, private Ui::TabAdvancedObject {
|
|||||||
void SetDetector();
|
void SetDetector();
|
||||||
void SetControlPort(int port);
|
void SetControlPort(int port);
|
||||||
void SetStopPort(int port);
|
void SetStopPort(int port);
|
||||||
void SetDetectorUDPIP();
|
void SetDetectorUDPIP(bool force = false);
|
||||||
void SetDetectorUDPMAC();
|
void ForceSetDetectorUDPIP();
|
||||||
|
void SetDetectorUDPMAC(bool force = false);
|
||||||
|
void ForceSetDetectorUDPMAC();
|
||||||
void SetCltZMQPort(int port);
|
void SetCltZMQPort(int port);
|
||||||
void SetCltZMQIP();
|
void SetCltZMQIP(bool force = false);
|
||||||
void SetRxrHostname();
|
void ForceSetCltZMQIP();
|
||||||
|
void SetRxrHostname(bool force = false);
|
||||||
|
void ForceSetRxrHostname();
|
||||||
void SetRxrTCPPort(int port);
|
void SetRxrTCPPort(int port);
|
||||||
void SetRxrUDPPort(int port);
|
void SetRxrUDPPort(int port);
|
||||||
void SetRxrUDPIP();
|
void SetRxrUDPIP(bool force = false);
|
||||||
void SetRxrUDPMAC();
|
void ForceSetRxrUDPIP();
|
||||||
|
void SetRxrUDPMAC(bool force = false);
|
||||||
|
void ForceSetRxrUDPMAC();
|
||||||
void SetRxrZMQPort(int port);
|
void SetRxrZMQPort(int port);
|
||||||
void SetRxrZMQIP();
|
void SetRxrZMQIP(bool force = false);
|
||||||
|
void ForceSetRxrZMQIP();
|
||||||
void GetROI();
|
void GetROI();
|
||||||
void ClearROI();
|
void ClearROI();
|
||||||
void SetROI();
|
void SetROI();
|
||||||
|
@ -13,14 +13,15 @@ class qTabDataOutput : public QWidget, private Ui::TabDataOutputObject {
|
|||||||
private slots:
|
private slots:
|
||||||
void GetOutputDir();
|
void GetOutputDir();
|
||||||
void BrowseOutputDir();
|
void BrowseOutputDir();
|
||||||
void SetOutputDir();
|
void SetOutputDir(bool force = false);
|
||||||
|
void ForceSetOutputDir();
|
||||||
void SetFileFormat(int format);
|
void SetFileFormat(int format);
|
||||||
void SetOverwriteEnable(bool enable);
|
void SetOverwriteEnable(bool enable);
|
||||||
void SetTenGigaEnable(bool enable);
|
void SetTenGigaEnable(bool enable);
|
||||||
void EnableRateCorrection();
|
void EnableRateCorrection();
|
||||||
void SetRateCorrection();
|
void SetRateCorrection();
|
||||||
void SetSpeed(int speed);
|
void SetSpeed(int speed);
|
||||||
void SetFlags();
|
void SetParallel(bool enable);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void SetupWidgetWindow();
|
void SetupWidgetWindow();
|
||||||
@ -34,11 +35,9 @@ class qTabDataOutput : public QWidget, private Ui::TabDataOutputObject {
|
|||||||
void GetTenGigaEnable();
|
void GetTenGigaEnable();
|
||||||
void GetRateCorrection();
|
void GetRateCorrection();
|
||||||
void GetSpeed();
|
void GetSpeed();
|
||||||
void GetFlags();
|
void GetParallel();
|
||||||
|
|
||||||
sls::Detector *det;
|
sls::Detector *det;
|
||||||
// Button group for radiobuttons for rate
|
// Button group for radiobuttons for rate
|
||||||
QButtonGroup *btnGroupRate;
|
QButtonGroup *btnGroupRate;
|
||||||
// enum for the Eiger Parallel flag
|
|
||||||
enum { PARALLEL, NONPARALLEL };
|
|
||||||
};
|
};
|
||||||
|
@ -20,6 +20,7 @@ class qTabMeasurement : public QWidget, private Ui::TabMeasurementObject {
|
|||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void SetTimingMode(int val);
|
void SetTimingMode(int val);
|
||||||
|
void SetBurstMode(int val);
|
||||||
void SetNumMeasurements(int val);
|
void SetNumMeasurements(int val);
|
||||||
void SetNumFrames(int val);
|
void SetNumFrames(int val);
|
||||||
void SetNumTriggers(int val);
|
void SetNumTriggers(int val);
|
||||||
@ -31,7 +32,8 @@ class qTabMeasurement : public QWidget, private Ui::TabMeasurementObject {
|
|||||||
void SetDelay();
|
void SetDelay();
|
||||||
void SetBurstPeriod();
|
void SetBurstPeriod();
|
||||||
void SetFileWrite(bool val);
|
void SetFileWrite(bool val);
|
||||||
void SetFileName();
|
void SetFileName(bool force = false);
|
||||||
|
void ForceSetFileName();
|
||||||
void SetRunIndex(int val);
|
void SetRunIndex(int val);
|
||||||
void SetStartingFrameNumber(int val);
|
void SetStartingFrameNumber(int val);
|
||||||
void UpdateProgress();
|
void UpdateProgress();
|
||||||
@ -51,6 +53,7 @@ class qTabMeasurement : public QWidget, private Ui::TabMeasurementObject {
|
|||||||
void EnableWidgetsforTimingMode();
|
void EnableWidgetsforTimingMode();
|
||||||
|
|
||||||
void GetTimingMode();
|
void GetTimingMode();
|
||||||
|
void GetBurstMode();
|
||||||
void GetNumFrames();
|
void GetNumFrames();
|
||||||
void GetNumTriggers();
|
void GetNumTriggers();
|
||||||
void GetNumBursts();
|
void GetNumBursts();
|
||||||
|
@ -24,6 +24,12 @@ class qTabPlot : public QWidget, private Ui::TabPlotObject {
|
|||||||
void SetBinary();
|
void SetBinary();
|
||||||
void SetGapPixels(bool enable);
|
void SetGapPixels(bool enable);
|
||||||
void SetTitles();
|
void SetTitles();
|
||||||
|
void isXMinModified();
|
||||||
|
void isXMaxModified();
|
||||||
|
void isYMinModified();
|
||||||
|
void isYMaxModified();
|
||||||
|
void isZMinModified();
|
||||||
|
void isZMaxModified();
|
||||||
void SetXRange();
|
void SetXRange();
|
||||||
void SetYRange();
|
void SetYRange();
|
||||||
void CheckAspectRatio();
|
void CheckAspectRatio();
|
||||||
|
@ -26,7 +26,7 @@ void qDacWidget::SetupWidgetWindow(std::string name) {
|
|||||||
|
|
||||||
void qDacWidget::Initialization() {
|
void qDacWidget::Initialization() {
|
||||||
if (isDac) {
|
if (isDac) {
|
||||||
connect(spinDac, SIGNAL(editingFinished()), this, SLOT(SetDac()));
|
connect(spinDac, SIGNAL(valueChanged(double)), this, SLOT(SetDac()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ void qDacWidget::SetDetectorIndex(int id) {
|
|||||||
void qDacWidget::GetDac() {
|
void qDacWidget::GetDac() {
|
||||||
LOG(logDEBUG) << "Getting Dac " << index;
|
LOG(logDEBUG) << "Getting Dac " << index;
|
||||||
|
|
||||||
disconnect(spinDac, SIGNAL(editingFinished()), this, SLOT(SetDac()));
|
disconnect(spinDac, SIGNAL(valueChanged(double)), this, SLOT(SetDac()));
|
||||||
try {
|
try {
|
||||||
// dac units
|
// dac units
|
||||||
auto retval = det->getDAC(index, 0, {detectorIndex}).squash(-1);
|
auto retval = det->getDAC(index, 0, {detectorIndex}).squash(-1);
|
||||||
@ -52,7 +52,7 @@ void qDacWidget::GetDac() {
|
|||||||
CATCH_DISPLAY(std::string("Could not get dac ") + std::to_string(index),
|
CATCH_DISPLAY(std::string("Could not get dac ") + std::to_string(index),
|
||||||
"qDacWidget::GetDac")
|
"qDacWidget::GetDac")
|
||||||
|
|
||||||
connect(spinDac, SIGNAL(editingFinished()), this, SLOT(SetDac()));
|
connect(spinDac, SIGNAL(valueChanged(double)), this, SLOT(SetDac()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void qDacWidget::SetDac() {
|
void qDacWidget::SetDac() {
|
||||||
|
@ -222,12 +222,12 @@ void qDetectorMain::SetUpDetector(const std::string &config_file, int multiID) {
|
|||||||
actionLoadTrimbits->setEnabled(false);
|
actionLoadTrimbits->setEnabled(false);
|
||||||
switch (detType) {
|
switch (detType) {
|
||||||
case slsDetectorDefs::EIGER:
|
case slsDetectorDefs::EIGER:
|
||||||
|
case slsDetectorDefs::MYTHEN3:
|
||||||
actionLoadTrimbits->setEnabled(true);
|
actionLoadTrimbits->setEnabled(true);
|
||||||
break;
|
break;
|
||||||
case slsDetectorDefs::GOTTHARD:
|
case slsDetectorDefs::GOTTHARD:
|
||||||
case slsDetectorDefs::JUNGFRAU:
|
case slsDetectorDefs::JUNGFRAU:
|
||||||
case slsDetectorDefs::MOENCH:
|
case slsDetectorDefs::MOENCH:
|
||||||
case slsDetectorDefs::MYTHEN3:
|
|
||||||
case slsDetectorDefs::GOTTHARD2:
|
case slsDetectorDefs::GOTTHARD2:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -334,7 +334,8 @@ void qDetectorMain::EnableModes(QAction *action) {
|
|||||||
|
|
||||||
tabs->setTabEnabled(ADVANCED, enable);
|
tabs->setTabEnabled(ADVANCED, enable);
|
||||||
actionLoadTrimbits->setVisible(enable &&
|
actionLoadTrimbits->setVisible(enable &&
|
||||||
detType == slsDetectorDefs::EIGER);
|
(detType == slsDetectorDefs::EIGER ||
|
||||||
|
detType == slsDetectorDefs::MYTHEN3));
|
||||||
LOG(logINFO) << "Expert Mode: " << qDefs::stringEnable(enable);
|
LOG(logINFO) << "Expert Mode: " << qDefs::stringEnable(enable);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -400,11 +401,8 @@ void qDetectorMain::ExecuteUtilities(QAction *action) {
|
|||||||
this, tr("Load Detector Trimbits"), fName,
|
this, tr("Load Detector Trimbits"), fName,
|
||||||
tr("Trimbit files (*.trim noise.sn*);;All Files(*)"));
|
tr("Trimbit files (*.trim noise.sn*);;All Files(*)"));
|
||||||
fileDialog->setFileMode(QFileDialog::AnyFile);
|
fileDialog->setFileMode(QFileDialog::AnyFile);
|
||||||
if (fileDialog->exec() == QDialog::Accepted)
|
if (fileDialog->exec() == QDialog::Accepted) {
|
||||||
fName = fileDialog->selectedFiles()[0];
|
fName = fileDialog->selectedFiles()[0];
|
||||||
|
|
||||||
// Gets called when cancelled as well
|
|
||||||
if (!fName.isEmpty()) {
|
|
||||||
det->loadTrimbits(std::string(fName.toAscii().constData()));
|
det->loadTrimbits(std::string(fName.toAscii().constData()));
|
||||||
qDefs::Message(qDefs::INFORMATION,
|
qDefs::Message(qDefs::INFORMATION,
|
||||||
"The Trimbits have been loaded successfully.",
|
"The Trimbits have been loaded successfully.",
|
||||||
|
@ -248,7 +248,7 @@ bool qDrawPlot::GetIsRunning() { return isRunning; }
|
|||||||
|
|
||||||
void qDrawPlot::SetRunning(bool enable) { isRunning = enable; }
|
void qDrawPlot::SetRunning(bool enable) { isRunning = enable; }
|
||||||
|
|
||||||
int qDrawPlot::GetProgress() { return progress; }
|
double qDrawPlot::GetProgress() { return progress; }
|
||||||
|
|
||||||
int64_t qDrawPlot::GetCurrentFrameIndex() { return currentFrame; }
|
int64_t qDrawPlot::GetCurrentFrameIndex() { return currentFrame; }
|
||||||
|
|
||||||
@ -717,7 +717,7 @@ void qDrawPlot::AcquisitionFinished(double currentProgress,
|
|||||||
LOG(logERROR) << "Acquisition finished [Status: ERROR]";
|
LOG(logERROR) << "Acquisition finished [Status: ERROR]";
|
||||||
} else {
|
} else {
|
||||||
LOG(logINFO) << "Acquisition finished [ Status:" << status
|
LOG(logINFO) << "Acquisition finished [ Status:" << status
|
||||||
<< ", Progress: " << currentProgress << " ]";
|
<< ", Progress: " << currentProgress << "% ]";
|
||||||
}
|
}
|
||||||
emit AcquireFinishedSignal();
|
emit AcquireFinishedSignal();
|
||||||
}
|
}
|
||||||
@ -741,10 +741,10 @@ void qDrawPlot::GetData(detectorData *data, uint64_t frameIndex,
|
|||||||
<< " \t complete image: " << data->completeImage << std::endl
|
<< " \t complete image: " << data->completeImage << std::endl
|
||||||
<< " ]";
|
<< " ]";
|
||||||
|
|
||||||
progress = (int)data->progressIndex;
|
progress = data->progressIndex;
|
||||||
currentAcqIndex = data->fileIndex;
|
currentAcqIndex = data->fileIndex;
|
||||||
currentFrame = frameIndex;
|
currentFrame = frameIndex;
|
||||||
LOG(logDEBUG) << "[ Progress:" << progress << ", Frame:" << currentFrame
|
LOG(logDEBUG) << "[ Progress:" << progress << "%, Frame:" << currentFrame
|
||||||
<< " ]";
|
<< " ]";
|
||||||
|
|
||||||
// 1d check if npixelX has changed (m3 for different counters enabled)
|
// 1d check if npixelX has changed (m3 for different counters enabled)
|
||||||
|
@ -29,6 +29,7 @@ void qTabAdvanced::SetupWidgetWindow() {
|
|||||||
tab_roi->setEnabled(true);
|
tab_roi->setEnabled(true);
|
||||||
break;
|
break;
|
||||||
case slsDetectorDefs::MYTHEN3:
|
case slsDetectorDefs::MYTHEN3:
|
||||||
|
tab_trimming->setEnabled(true);
|
||||||
lblDiscardBits->setEnabled(true);
|
lblDiscardBits->setEnabled(true);
|
||||||
spinDiscardBits->setEnabled(true);
|
spinDiscardBits->setEnabled(true);
|
||||||
lblGateIndex->setEnabled(true);
|
lblGateIndex->setEnabled(true);
|
||||||
@ -65,8 +66,7 @@ void qTabAdvanced::Initialization() {
|
|||||||
|
|
||||||
// trimming
|
// trimming
|
||||||
if (tab_trimming->isEnabled()) {
|
if (tab_trimming->isEnabled()) {
|
||||||
// editingFinished to not set trimbits for every character input
|
connect(spinSetAllTrimbits, SIGNAL(valueChanged(int)), this,
|
||||||
connect(spinSetAllTrimbits, SIGNAL(editingFinished()), this,
|
|
||||||
SLOT(SetAllTrimbits()));
|
SLOT(SetAllTrimbits()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,23 +79,36 @@ void qTabAdvanced::Initialization() {
|
|||||||
SLOT(SetStopPort(int)));
|
SLOT(SetStopPort(int)));
|
||||||
connect(dispDetectorUDPIP, SIGNAL(editingFinished()), this,
|
connect(dispDetectorUDPIP, SIGNAL(editingFinished()), this,
|
||||||
SLOT(SetDetectorUDPIP()));
|
SLOT(SetDetectorUDPIP()));
|
||||||
|
connect(dispDetectorUDPIP, SIGNAL(returnPressed()), this,
|
||||||
|
SLOT(ForceSetDetectorUDPIP()));
|
||||||
connect(dispDetectorUDPMAC, SIGNAL(editingFinished()), this,
|
connect(dispDetectorUDPMAC, SIGNAL(editingFinished()), this,
|
||||||
SLOT(SetDetectorUDPMAC()));
|
SLOT(SetDetectorUDPMAC()));
|
||||||
|
connect(dispDetectorUDPMAC, SIGNAL(returnPressed()), this,
|
||||||
|
SLOT(ForceSetDetectorUDPMAC()));
|
||||||
connect(spinZMQPort, SIGNAL(valueChanged(int)), this,
|
connect(spinZMQPort, SIGNAL(valueChanged(int)), this,
|
||||||
SLOT(SetCltZMQPort(int)));
|
SLOT(SetCltZMQPort(int)));
|
||||||
connect(dispZMQIP, SIGNAL(editingFinished()), this, SLOT(SetCltZMQIP()));
|
connect(dispZMQIP, SIGNAL(editingFinished()), this, SLOT(SetCltZMQIP()));
|
||||||
|
connect(dispZMQIP, SIGNAL(returnPressed()), this, SLOT(ForceSetCltZMQIP()));
|
||||||
connect(dispRxrHostname, SIGNAL(editingFinished()), this,
|
connect(dispRxrHostname, SIGNAL(editingFinished()), this,
|
||||||
SLOT(SetRxrHostname()));
|
SLOT(SetRxrHostname()));
|
||||||
|
connect(dispRxrHostname, SIGNAL(returnPressed()), this,
|
||||||
|
SLOT(ForceSetRxrHostname()));
|
||||||
connect(spinRxrTCPPort, SIGNAL(valueChanged(int)), this,
|
connect(spinRxrTCPPort, SIGNAL(valueChanged(int)), this,
|
||||||
SLOT(SetRxrTCPPort(int)));
|
SLOT(SetRxrTCPPort(int)));
|
||||||
connect(spinRxrUDPPort, SIGNAL(valueChanged(int)), this,
|
connect(spinRxrUDPPort, SIGNAL(valueChanged(int)), this,
|
||||||
SLOT(SetRxrUDPPort(int)));
|
SLOT(SetRxrUDPPort(int)));
|
||||||
connect(dispRxrUDPIP, SIGNAL(editingFinished()), this, SLOT(SetRxrUDPIP()));
|
connect(dispRxrUDPIP, SIGNAL(editingFinished()), this, SLOT(SetRxrUDPIP()));
|
||||||
|
connect(dispRxrUDPIP, SIGNAL(returnPressed()), this,
|
||||||
|
SLOT(ForceSetRxrUDPIP()));
|
||||||
connect(dispRxrUDPMAC, SIGNAL(editingFinished()), this,
|
connect(dispRxrUDPMAC, SIGNAL(editingFinished()), this,
|
||||||
SLOT(SetRxrUDPMAC()));
|
SLOT(SetRxrUDPMAC()));
|
||||||
|
connect(dispRxrUDPMAC, SIGNAL(returnPressed()), this,
|
||||||
|
SLOT(ForceSetRxrUDPMAC()));
|
||||||
connect(spinRxrZMQPort, SIGNAL(valueChanged(int)), this,
|
connect(spinRxrZMQPort, SIGNAL(valueChanged(int)), this,
|
||||||
SLOT(SetRxrZMQPort(int)));
|
SLOT(SetRxrZMQPort(int)));
|
||||||
connect(dispRxrZMQIP, SIGNAL(editingFinished()), this, SLOT(SetRxrZMQIP()));
|
connect(dispRxrZMQIP, SIGNAL(editingFinished()), this, SLOT(SetRxrZMQIP()));
|
||||||
|
connect(dispRxrZMQIP, SIGNAL(returnPressed()), this,
|
||||||
|
SLOT(ForceSetRxrZMQIP()));
|
||||||
|
|
||||||
// roi
|
// roi
|
||||||
if (tab_roi->isEnabled()) {
|
if (tab_roi->isEnabled()) {
|
||||||
@ -421,28 +434,42 @@ void qTabAdvanced::SetStopPort(int port) {
|
|||||||
&qTabAdvanced::GetStopPort)
|
&qTabAdvanced::GetStopPort)
|
||||||
}
|
}
|
||||||
|
|
||||||
void qTabAdvanced::SetDetectorUDPIP() {
|
void qTabAdvanced::SetDetectorUDPIP(bool force) {
|
||||||
|
// return forces modification (inconsistency from command line)
|
||||||
|
if (dispDetectorUDPIP->isModified() || force) {
|
||||||
|
dispDetectorUDPIP->setModified(false);
|
||||||
std::string s = dispDetectorUDPIP->text().toAscii().constData();
|
std::string s = dispDetectorUDPIP->text().toAscii().constData();
|
||||||
LOG(logINFO) << "Setting Detector UDP IP:" << s;
|
LOG(logINFO) << "Setting Detector UDP IP:" << s;
|
||||||
try {
|
try {
|
||||||
det->setSourceUDPIP(sls::IpAddr{s}, {comboDetector->currentIndex()});
|
det->setSourceUDPIP(sls::IpAddr{s},
|
||||||
|
{comboDetector->currentIndex()});
|
||||||
}
|
}
|
||||||
CATCH_HANDLE("Could not set Detector UDP IP.",
|
CATCH_HANDLE("Could not set Detector UDP IP.",
|
||||||
"qTabAdvanced::SetDetectorUDPIP", this,
|
"qTabAdvanced::SetDetectorUDPIP", this,
|
||||||
&qTabAdvanced::GetDetectorUDPIP)
|
&qTabAdvanced::GetDetectorUDPIP)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void qTabAdvanced::SetDetectorUDPMAC() {
|
void qTabAdvanced::ForceSetDetectorUDPIP() { SetDetectorUDPIP(true); };
|
||||||
|
|
||||||
|
void qTabAdvanced::SetDetectorUDPMAC(bool force) {
|
||||||
|
// return forces modification (inconsistency from command line)
|
||||||
|
if (dispDetectorUDPMAC->isModified() || force) {
|
||||||
|
dispDetectorUDPMAC->setModified(false);
|
||||||
std::string s = dispDetectorUDPMAC->text().toAscii().constData();
|
std::string s = dispDetectorUDPMAC->text().toAscii().constData();
|
||||||
LOG(logINFO) << "Setting Detector UDP MAC:" << s;
|
LOG(logINFO) << "Setting Detector UDP MAC:" << s;
|
||||||
try {
|
try {
|
||||||
det->setSourceUDPMAC(sls::MacAddr{s}, {comboDetector->currentIndex()});
|
det->setSourceUDPMAC(sls::MacAddr{s},
|
||||||
|
{comboDetector->currentIndex()});
|
||||||
}
|
}
|
||||||
CATCH_HANDLE("Could not set Detector UDP MAC.",
|
CATCH_HANDLE("Could not set Detector UDP MAC.",
|
||||||
"qTabAdvanced::SetDetectorUDPMAC", this,
|
"qTabAdvanced::SetDetectorUDPMAC", this,
|
||||||
&qTabAdvanced::GetDetectorUDPMAC)
|
&qTabAdvanced::GetDetectorUDPMAC)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void qTabAdvanced::ForceSetDetectorUDPMAC() { SetDetectorUDPMAC(true); }
|
||||||
|
|
||||||
void qTabAdvanced::SetCltZMQPort(int port) {
|
void qTabAdvanced::SetCltZMQPort(int port) {
|
||||||
LOG(logINFO) << "Setting Client ZMQ Port:" << port;
|
LOG(logINFO) << "Setting Client ZMQ Port:" << port;
|
||||||
try {
|
try {
|
||||||
@ -453,29 +480,44 @@ void qTabAdvanced::SetCltZMQPort(int port) {
|
|||||||
&qTabAdvanced::GetCltZMQPort)
|
&qTabAdvanced::GetCltZMQPort)
|
||||||
}
|
}
|
||||||
|
|
||||||
void qTabAdvanced::SetCltZMQIP() {
|
void qTabAdvanced::SetCltZMQIP(bool force) {
|
||||||
|
// return forces modification (inconsistency from command line)
|
||||||
|
if (dispZMQIP->isModified() || force) {
|
||||||
|
dispZMQIP->setModified(false);
|
||||||
std::string s = dispZMQIP->text().toAscii().constData();
|
std::string s = dispZMQIP->text().toAscii().constData();
|
||||||
LOG(logINFO) << "Setting Client ZMQ IP:" << s;
|
LOG(logINFO) << "Setting Client ZMQ IP:" << s;
|
||||||
try {
|
try {
|
||||||
det->setClientZmqIp(sls::IpAddr{s}, {comboDetector->currentIndex()});
|
det->setClientZmqIp(sls::IpAddr{s},
|
||||||
|
{comboDetector->currentIndex()});
|
||||||
|
}
|
||||||
|
CATCH_HANDLE("Could not set Client ZMQ IP.",
|
||||||
|
"qTabAdvanced::SetCltZMQIP", this,
|
||||||
|
&qTabAdvanced::GetCltZMQIP)
|
||||||
}
|
}
|
||||||
CATCH_HANDLE("Could not set Client ZMQ IP.", "qTabAdvanced::SetCltZMQIP",
|
|
||||||
this, &qTabAdvanced::GetCltZMQIP)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void qTabAdvanced::SetRxrHostname() {
|
void qTabAdvanced::ForceSetCltZMQIP() { SetCltZMQIP(true); }
|
||||||
std::string s = dispZMQIP->text().toAscii().constData();
|
|
||||||
|
void qTabAdvanced::SetRxrHostname(bool force) {
|
||||||
|
// return forces modification (inconsistency from command line)
|
||||||
|
if (dispRxrHostname->isModified() || force) {
|
||||||
|
dispRxrHostname->setModified(false);
|
||||||
|
std::string s = dispRxrHostname->text().toAscii().constData();
|
||||||
LOG(logINFO) << "Setting Receiver Hostname:" << s;
|
LOG(logINFO) << "Setting Receiver Hostname:" << s;
|
||||||
try {
|
try {
|
||||||
det->setRxHostname(s, {comboDetector->currentIndex()});
|
det->setRxHostname(s, {comboDetector->currentIndex()});
|
||||||
}
|
}
|
||||||
CATCH_HANDLE("Could not set Client ZMQ IP.", "qTabAdvanced::SetRxrHostname",
|
CATCH_HANDLE("Could not set Client ZMQ IP.",
|
||||||
this, &qTabAdvanced::GetRxrHostname)
|
"qTabAdvanced::SetRxrHostname", this,
|
||||||
|
&qTabAdvanced::GetRxrHostname)
|
||||||
|
|
||||||
// update all network widgets (receiver mainly)
|
// update all network widgets (receiver mainly)
|
||||||
SetDetector();
|
SetDetector();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void qTabAdvanced::ForceSetRxrHostname() { SetRxrHostname(true); }
|
||||||
|
|
||||||
void qTabAdvanced::SetRxrTCPPort(int port) {
|
void qTabAdvanced::SetRxrTCPPort(int port) {
|
||||||
LOG(logINFO) << "Setting Receiver TCP Port:" << port;
|
LOG(logINFO) << "Setting Receiver TCP Port:" << port;
|
||||||
try {
|
try {
|
||||||
@ -496,18 +538,28 @@ void qTabAdvanced::SetRxrUDPPort(int port) {
|
|||||||
&qTabAdvanced::GetRxrUDPPort)
|
&qTabAdvanced::GetRxrUDPPort)
|
||||||
}
|
}
|
||||||
|
|
||||||
void qTabAdvanced::SetRxrUDPIP() {
|
void qTabAdvanced::SetRxrUDPIP(bool force) {
|
||||||
|
// return forces modification (inconsistency from command line)
|
||||||
|
if (dispRxrUDPIP->isModified() || force) {
|
||||||
|
dispRxrUDPIP->setModified(false);
|
||||||
std::string s = dispRxrUDPIP->text().toAscii().constData();
|
std::string s = dispRxrUDPIP->text().toAscii().constData();
|
||||||
LOG(logINFO) << "Setting Receiver UDP IP:" << s;
|
LOG(logINFO) << "Setting Receiver UDP IP:" << s;
|
||||||
try {
|
try {
|
||||||
det->setDestinationUDPIP(sls::IpAddr{s},
|
det->setDestinationUDPIP(sls::IpAddr{s},
|
||||||
{comboDetector->currentIndex()});
|
{comboDetector->currentIndex()});
|
||||||
}
|
}
|
||||||
CATCH_HANDLE("Could not set Receiver UDP IP.", "qTabAdvanced::SetRxrUDPIP",
|
CATCH_HANDLE("Could not set Receiver UDP IP.",
|
||||||
this, &qTabAdvanced::GetRxrUDPIP)
|
"qTabAdvanced::SetRxrUDPIP", this,
|
||||||
|
&qTabAdvanced::GetRxrUDPIP)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void qTabAdvanced::SetRxrUDPMAC() {
|
void qTabAdvanced::ForceSetRxrUDPIP() { SetRxrUDPIP(true); }
|
||||||
|
|
||||||
|
void qTabAdvanced::SetRxrUDPMAC(bool force) {
|
||||||
|
// return forces modification (inconsistency from command line)
|
||||||
|
if (dispRxrUDPMAC->isModified() || force) {
|
||||||
|
dispRxrUDPMAC->setModified(false);
|
||||||
std::string s = dispRxrUDPMAC->text().toAscii().constData();
|
std::string s = dispRxrUDPMAC->text().toAscii().constData();
|
||||||
LOG(logINFO) << "Setting Receiver UDP MAC:" << s;
|
LOG(logINFO) << "Setting Receiver UDP MAC:" << s;
|
||||||
try {
|
try {
|
||||||
@ -517,8 +569,11 @@ void qTabAdvanced::SetRxrUDPMAC() {
|
|||||||
CATCH_HANDLE("Could not set Receiver UDP MAC.",
|
CATCH_HANDLE("Could not set Receiver UDP MAC.",
|
||||||
"qTabAdvanced::SetRxrUDPMAC", this,
|
"qTabAdvanced::SetRxrUDPMAC", this,
|
||||||
&qTabAdvanced::GetRxrUDPMAC)
|
&qTabAdvanced::GetRxrUDPMAC)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void qTabAdvanced::ForceSetRxrUDPMAC() { SetRxrUDPMAC(true); }
|
||||||
|
|
||||||
void qTabAdvanced::SetRxrZMQPort(int port) {
|
void qTabAdvanced::SetRxrZMQPort(int port) {
|
||||||
LOG(logINFO) << "Setting Receiver ZMQ Port:" << port;
|
LOG(logINFO) << "Setting Receiver ZMQ Port:" << port;
|
||||||
try {
|
try {
|
||||||
@ -529,16 +584,23 @@ void qTabAdvanced::SetRxrZMQPort(int port) {
|
|||||||
&qTabAdvanced::GetRxrZMQPort)
|
&qTabAdvanced::GetRxrZMQPort)
|
||||||
}
|
}
|
||||||
|
|
||||||
void qTabAdvanced::SetRxrZMQIP() {
|
void qTabAdvanced::SetRxrZMQIP(bool force) {
|
||||||
|
// return forces modification (inconsistency from command line)
|
||||||
|
if (dispRxrZMQIP->isModified() || force) {
|
||||||
|
dispRxrZMQIP->setModified(false);
|
||||||
std::string s = dispRxrZMQIP->text().toAscii().constData();
|
std::string s = dispRxrZMQIP->text().toAscii().constData();
|
||||||
LOG(logINFO) << "Setting Receiver ZMQ IP:" << s;
|
LOG(logINFO) << "Setting Receiver ZMQ IP:" << s;
|
||||||
try {
|
try {
|
||||||
det->setRxZmqIP(sls::IpAddr{s}, {comboDetector->currentIndex()});
|
det->setRxZmqIP(sls::IpAddr{s}, {comboDetector->currentIndex()});
|
||||||
}
|
}
|
||||||
CATCH_HANDLE("Could not set Receiver ZMQ IP.", "qTabAdvanced::SetRxrZMQIP",
|
CATCH_HANDLE("Could not set Receiver ZMQ IP.",
|
||||||
this, &qTabAdvanced::GetRxrZMQIP)
|
"qTabAdvanced::SetRxrZMQIP", this,
|
||||||
|
&qTabAdvanced::GetRxrZMQIP)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void qTabAdvanced::ForceSetRxrZMQIP() { SetRxrZMQIP(true); }
|
||||||
|
|
||||||
void qTabAdvanced::GetROI() {
|
void qTabAdvanced::GetROI() {
|
||||||
LOG(logDEBUG) << "Getting ROI";
|
LOG(logDEBUG) << "Getting ROI";
|
||||||
try {
|
try {
|
||||||
@ -575,7 +637,7 @@ void qTabAdvanced::SetROI() {
|
|||||||
|
|
||||||
void qTabAdvanced::GetAllTrimbits() {
|
void qTabAdvanced::GetAllTrimbits() {
|
||||||
LOG(logDEBUG) << "Getting all trimbits value";
|
LOG(logDEBUG) << "Getting all trimbits value";
|
||||||
disconnect(spinSetAllTrimbits, SIGNAL(editingFinished()), this,
|
disconnect(spinSetAllTrimbits, SIGNAL(valueChanged(int)), this,
|
||||||
SLOT(SetAllTrimbits()));
|
SLOT(SetAllTrimbits()));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -584,7 +646,7 @@ void qTabAdvanced::GetAllTrimbits() {
|
|||||||
}
|
}
|
||||||
CATCH_DISPLAY("Could not get all trimbits.", "qTabAdvanced::GetAllTrimbits")
|
CATCH_DISPLAY("Could not get all trimbits.", "qTabAdvanced::GetAllTrimbits")
|
||||||
|
|
||||||
connect(spinSetAllTrimbits, SIGNAL(editingFinished()), this,
|
connect(spinSetAllTrimbits, SIGNAL(valueChanged(int)), this,
|
||||||
SLOT(SetAllTrimbits()));
|
SLOT(SetAllTrimbits()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,12 +32,20 @@ void qTabDataOutput::SetupWidgetWindow() {
|
|||||||
radioDefaultDeadtime->setEnabled(true);
|
radioDefaultDeadtime->setEnabled(true);
|
||||||
radioCustomDeadtime->setEnabled(true);
|
radioCustomDeadtime->setEnabled(true);
|
||||||
// flags and speed
|
// flags and speed
|
||||||
widgetEiger->setVisible(true);
|
lblClkDivider->setEnabled(true);
|
||||||
widgetEiger->setEnabled(true);
|
comboClkDivider->setEnabled(true);
|
||||||
|
chkParallel->setEnabled(true);
|
||||||
break;
|
break;
|
||||||
case slsDetectorDefs::MOENCH:
|
case slsDetectorDefs::MOENCH:
|
||||||
chkTenGiga->setEnabled(true);
|
chkTenGiga->setEnabled(true);
|
||||||
break;
|
break;
|
||||||
|
case slsDetectorDefs::MYTHEN3:
|
||||||
|
chkParallel->setEnabled(true);
|
||||||
|
break;
|
||||||
|
case slsDetectorDefs::JUNGFRAU:
|
||||||
|
lblClkDivider->setEnabled(true);
|
||||||
|
comboClkDivider->setEnabled(true);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -54,6 +62,8 @@ void qTabDataOutput::Initialization() {
|
|||||||
SLOT(GetOutputDir()));
|
SLOT(GetOutputDir()));
|
||||||
connect(dispOutputDir, SIGNAL(editingFinished()), this,
|
connect(dispOutputDir, SIGNAL(editingFinished()), this,
|
||||||
SLOT(SetOutputDir()));
|
SLOT(SetOutputDir()));
|
||||||
|
connect(dispOutputDir, SIGNAL(returnPressed()), this,
|
||||||
|
SLOT(ForceSetOutputDir()));
|
||||||
connect(btnOutputBrowse, SIGNAL(clicked()), this, SLOT(BrowseOutputDir()));
|
connect(btnOutputBrowse, SIGNAL(clicked()), this, SLOT(BrowseOutputDir()));
|
||||||
connect(comboFileFormat, SIGNAL(currentIndexChanged(int)), this,
|
connect(comboFileFormat, SIGNAL(currentIndexChanged(int)), this,
|
||||||
SLOT(SetFileFormat(int)));
|
SLOT(SetFileFormat(int)));
|
||||||
@ -69,15 +79,18 @@ void qTabDataOutput::Initialization() {
|
|||||||
SLOT(EnableRateCorrection()));
|
SLOT(EnableRateCorrection()));
|
||||||
connect(btnGroupRate, SIGNAL(buttonClicked(int)), this,
|
connect(btnGroupRate, SIGNAL(buttonClicked(int)), this,
|
||||||
SLOT(SetRateCorrection()));
|
SLOT(SetRateCorrection()));
|
||||||
connect(spinCustomDeadTime, SIGNAL(editingFinished()), this,
|
connect(spinCustomDeadTime, SIGNAL(valueChanged(int)), this,
|
||||||
SLOT(SetRateCorrection()));
|
SLOT(SetRateCorrection()));
|
||||||
}
|
}
|
||||||
// flags, speed
|
// parallel
|
||||||
if (widgetEiger->isEnabled()) {
|
if (chkParallel->isEnabled()) {
|
||||||
connect(comboEigerClkDivider, SIGNAL(currentIndexChanged(int)), this,
|
connect(chkParallel, SIGNAL(toggled(bool)), this,
|
||||||
|
SLOT(SetParallel(bool)));
|
||||||
|
}
|
||||||
|
// speed
|
||||||
|
if (comboClkDivider->isEnabled()) {
|
||||||
|
connect(comboClkDivider, SIGNAL(currentIndexChanged(int)), this,
|
||||||
SLOT(SetSpeed(int)));
|
SLOT(SetSpeed(int)));
|
||||||
connect(comboEigerParallelFlag, SIGNAL(currentIndexChanged(int)), this,
|
|
||||||
SLOT(SetFlags()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -169,7 +182,10 @@ void qTabDataOutput::BrowseOutputDir() {
|
|||||||
dispOutputDir->setText(directory);
|
dispOutputDir->setText(directory);
|
||||||
}
|
}
|
||||||
|
|
||||||
void qTabDataOutput::SetOutputDir() {
|
void qTabDataOutput::SetOutputDir(bool force) {
|
||||||
|
// return forces modification (inconsistency from command line)
|
||||||
|
if (dispOutputDir->isModified() || force) {
|
||||||
|
dispOutputDir->setModified(false);
|
||||||
QString path = dispOutputDir->text();
|
QString path = dispOutputDir->text();
|
||||||
LOG(logDEBUG) << "Setting output directory to "
|
LOG(logDEBUG) << "Setting output directory to "
|
||||||
<< path.toAscii().constData();
|
<< path.toAscii().constData();
|
||||||
@ -196,8 +212,11 @@ void qTabDataOutput::SetOutputDir() {
|
|||||||
"qTabDataOutput::SetOutputDir", this,
|
"qTabDataOutput::SetOutputDir", this,
|
||||||
&qTabDataOutput::GetOutputDir)
|
&qTabDataOutput::GetOutputDir)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void qTabDataOutput::ForceSetOutputDir() { SetOutputDir(true); };
|
||||||
|
|
||||||
void qTabDataOutput::GetFileFormat() {
|
void qTabDataOutput::GetFileFormat() {
|
||||||
LOG(logDEBUG) << "Getting File Format";
|
LOG(logDEBUG) << "Getting File Format";
|
||||||
disconnect(comboFileFormat, SIGNAL(currentIndexChanged(int)), this,
|
disconnect(comboFileFormat, SIGNAL(currentIndexChanged(int)), this,
|
||||||
@ -288,7 +307,7 @@ void qTabDataOutput::GetRateCorrection() {
|
|||||||
SLOT(EnableRateCorrection()));
|
SLOT(EnableRateCorrection()));
|
||||||
disconnect(btnGroupRate, SIGNAL(buttonClicked(int)), this,
|
disconnect(btnGroupRate, SIGNAL(buttonClicked(int)), this,
|
||||||
SLOT(SetRateCorrection()));
|
SLOT(SetRateCorrection()));
|
||||||
disconnect(spinCustomDeadTime, SIGNAL(editingFinished()), this,
|
disconnect(spinCustomDeadTime, SIGNAL(valueChanged(int)), this,
|
||||||
SLOT(SetRateCorrection()));
|
SLOT(SetRateCorrection()));
|
||||||
try {
|
try {
|
||||||
spinCustomDeadTime->setValue(-1);
|
spinCustomDeadTime->setValue(-1);
|
||||||
@ -305,7 +324,7 @@ void qTabDataOutput::GetRateCorrection() {
|
|||||||
connect(chkRate, SIGNAL(toggled(bool)), this, SLOT(EnableRateCorrection()));
|
connect(chkRate, SIGNAL(toggled(bool)), this, SLOT(EnableRateCorrection()));
|
||||||
connect(btnGroupRate, SIGNAL(buttonClicked(int)), this,
|
connect(btnGroupRate, SIGNAL(buttonClicked(int)), this,
|
||||||
SLOT(SetRateCorrection()));
|
SLOT(SetRateCorrection()));
|
||||||
connect(spinCustomDeadTime, SIGNAL(editingFinished()), this,
|
connect(spinCustomDeadTime, SIGNAL(valueChanged(int)), this,
|
||||||
SLOT(SetRateCorrection()));
|
SLOT(SetRateCorrection()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -351,22 +370,21 @@ void qTabDataOutput::SetRateCorrection() {
|
|||||||
|
|
||||||
void qTabDataOutput::GetSpeed() {
|
void qTabDataOutput::GetSpeed() {
|
||||||
LOG(logDEBUG) << "Getting Speed";
|
LOG(logDEBUG) << "Getting Speed";
|
||||||
disconnect(comboEigerClkDivider, SIGNAL(currentIndexChanged(int)), this,
|
disconnect(comboClkDivider, SIGNAL(currentIndexChanged(int)), this,
|
||||||
SLOT(SetSpeed(int)));
|
SLOT(SetSpeed(int)));
|
||||||
try {
|
try {
|
||||||
auto retval =
|
auto retval =
|
||||||
det->getSpeed().tsquash("Speed is inconsistent for all detectors.");
|
det->getSpeed().tsquash("Speed is inconsistent for all detectors.");
|
||||||
comboEigerClkDivider->setCurrentIndex(static_cast<int>(retval));
|
comboClkDivider->setCurrentIndex(static_cast<int>(retval));
|
||||||
}
|
}
|
||||||
CATCH_DISPLAY("Could not get speed.", "qTabDataOutput::GetSpeed")
|
CATCH_DISPLAY("Could not get speed.", "qTabDataOutput::GetSpeed")
|
||||||
connect(comboEigerClkDivider, SIGNAL(currentIndexChanged(int)), this,
|
connect(comboClkDivider, SIGNAL(currentIndexChanged(int)), this,
|
||||||
SLOT(SetSpeed(int)));
|
SLOT(SetSpeed(int)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void qTabDataOutput::SetSpeed(int speed) {
|
void qTabDataOutput::SetSpeed(int speed) {
|
||||||
LOG(logINFO) << "Setting Speed to "
|
LOG(logINFO) << "Setting Speed to "
|
||||||
<< comboEigerClkDivider->currentText().toAscii().data();
|
<< comboClkDivider->currentText().toAscii().data();
|
||||||
;
|
|
||||||
try {
|
try {
|
||||||
det->setSpeed(static_cast<slsDetectorDefs::speedLevel>(speed));
|
det->setSpeed(static_cast<slsDetectorDefs::speedLevel>(speed));
|
||||||
}
|
}
|
||||||
@ -374,34 +392,28 @@ void qTabDataOutput::SetSpeed(int speed) {
|
|||||||
&qTabDataOutput::GetSpeed)
|
&qTabDataOutput::GetSpeed)
|
||||||
}
|
}
|
||||||
|
|
||||||
void qTabDataOutput::GetFlags() {
|
void qTabDataOutput::GetParallel() {
|
||||||
LOG(logDEBUG) << "Getting readout flags";
|
LOG(logDEBUG) << "Getting parallel readout";
|
||||||
disconnect(comboEigerParallelFlag, SIGNAL(currentIndexChanged(int)), this,
|
disconnect(chkParallel, SIGNAL(toggled(bool)), this,
|
||||||
SLOT(SetFlags()));
|
SLOT(SetParallel(bool)));
|
||||||
try {
|
try {
|
||||||
auto retval = det->getParallelMode().tsquash(
|
auto retval = det->getParallelMode().tsquash(
|
||||||
"Parallel Flag is inconsistent for all detectors.");
|
"Parallel Flag is inconsistent for all detectors.");
|
||||||
// parallel or non parallel
|
chkParallel->setChecked(retval);
|
||||||
if (retval)
|
|
||||||
comboEigerParallelFlag->setCurrentIndex(PARALLEL);
|
|
||||||
else
|
|
||||||
comboEigerParallelFlag->setCurrentIndex(NONPARALLEL);
|
|
||||||
}
|
}
|
||||||
CATCH_DISPLAY("Could not get flags.", "qTabDataOutput::GetFlags")
|
CATCH_DISPLAY("Could not get parallel readout.",
|
||||||
connect(comboEigerParallelFlag, SIGNAL(currentIndexChanged(int)), this,
|
"qTabDataOutput::GetParallel")
|
||||||
SLOT(SetFlags()));
|
connect(chkParallel, SIGNAL(toggled(bool)), this, SLOT(SetParallel(bool)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void qTabDataOutput::SetFlags() {
|
void qTabDataOutput::SetParallel(bool enable) {
|
||||||
auto mode =
|
LOG(logINFO) << "Setting PArallel readout to " << enable;
|
||||||
comboEigerParallelFlag->currentIndex() == PARALLEL ? true : false;
|
|
||||||
try {
|
try {
|
||||||
LOG(logINFO) << "Setting Readout Flags to "
|
det->setParallelMode(enable);
|
||||||
<< comboEigerParallelFlag->currentText().toAscii().data();
|
|
||||||
det->setParallelMode(mode);
|
|
||||||
}
|
}
|
||||||
CATCH_HANDLE("Could not set readout flags.", "qTabDataOutput::SetFlags",
|
CATCH_HANDLE("Could not set parallel readout.",
|
||||||
this, &qTabDataOutput::GetFlags)
|
"qTabDataOutput::SetParallel", this,
|
||||||
|
&qTabDataOutput::GetParallel)
|
||||||
}
|
}
|
||||||
|
|
||||||
void qTabDataOutput::Refresh() {
|
void qTabDataOutput::Refresh() {
|
||||||
@ -419,9 +431,11 @@ void qTabDataOutput::Refresh() {
|
|||||||
if (chkTenGiga->isEnabled()) {
|
if (chkTenGiga->isEnabled()) {
|
||||||
GetTenGigaEnable();
|
GetTenGigaEnable();
|
||||||
}
|
}
|
||||||
if (widgetEiger->isEnabled()) {
|
if (chkParallel->isEnabled()) {
|
||||||
|
GetParallel();
|
||||||
|
}
|
||||||
|
if (comboClkDivider->isEnabled()) {
|
||||||
GetSpeed();
|
GetSpeed();
|
||||||
GetFlags();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG(logDEBUG) << "**Updated DataOutput Tab";
|
LOG(logDEBUG) << "**Updated DataOutput Tab";
|
||||||
|
@ -290,7 +290,7 @@ void qTabDeveloper::Initialization() {
|
|||||||
SLOT(Refresh()));
|
SLOT(Refresh()));
|
||||||
connect(comboHV, SIGNAL(currentIndexChanged(int)), this,
|
connect(comboHV, SIGNAL(currentIndexChanged(int)), this,
|
||||||
SLOT(SetHighVoltage()));
|
SLOT(SetHighVoltage()));
|
||||||
connect(spinHV, SIGNAL(editingFinished()), this, SLOT(SetHighVoltage()));
|
connect(spinHV, SIGNAL(valueChanged(int)), this, SLOT(SetHighVoltage()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void qTabDeveloper::PopulateDetectors() {
|
void qTabDeveloper::PopulateDetectors() {
|
||||||
@ -312,7 +312,7 @@ void qTabDeveloper::GetHighVoltage() {
|
|||||||
if (!comboHV->isVisible() && !spinHV->isVisible())
|
if (!comboHV->isVisible() && !spinHV->isVisible())
|
||||||
return;
|
return;
|
||||||
LOG(logDEBUG) << "Getting High Voltage";
|
LOG(logDEBUG) << "Getting High Voltage";
|
||||||
disconnect(spinHV, SIGNAL(editingFinished()), this, SLOT(SetHighVoltage()));
|
disconnect(spinHV, SIGNAL(valueChanged(int)), this, SLOT(SetHighVoltage()));
|
||||||
disconnect(comboHV, SIGNAL(currentIndexChanged(int)), this,
|
disconnect(comboHV, SIGNAL(currentIndexChanged(int)), this,
|
||||||
SLOT(SetHighVoltage()));
|
SLOT(SetHighVoltage()));
|
||||||
try {
|
try {
|
||||||
@ -359,7 +359,7 @@ void qTabDeveloper::GetHighVoltage() {
|
|||||||
}
|
}
|
||||||
CATCH_DISPLAY("Could not get high voltage.",
|
CATCH_DISPLAY("Could not get high voltage.",
|
||||||
"qTabDeveloper::GetHighVoltage")
|
"qTabDeveloper::GetHighVoltage")
|
||||||
connect(spinHV, SIGNAL(editingFinished()), this, SLOT(SetHighVoltage()));
|
connect(spinHV, SIGNAL(valueChanged(int)), this, SLOT(SetHighVoltage()));
|
||||||
connect(comboHV, SIGNAL(currentIndexChanged(int)), this,
|
connect(comboHV, SIGNAL(currentIndexChanged(int)), this,
|
||||||
SLOT(SetHighVoltage()));
|
SLOT(SetHighVoltage()));
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,8 @@ void qTabMeasurement::SetupWidgetWindow() {
|
|||||||
ShowGates();
|
ShowGates();
|
||||||
|
|
||||||
// enabling according to det type
|
// enabling according to det type
|
||||||
|
lblBurstMode->hide();
|
||||||
|
comboBurstMode->hide();
|
||||||
switch (det->getDetectorType().squash()) {
|
switch (det->getDetectorType().squash()) {
|
||||||
case slsDetectorDefs::MOENCH:
|
case slsDetectorDefs::MOENCH:
|
||||||
lblNumSamples->setEnabled(true);
|
lblNumSamples->setEnabled(true);
|
||||||
@ -64,6 +66,8 @@ void qTabMeasurement::SetupWidgetWindow() {
|
|||||||
startingFnumImplemented = true;
|
startingFnumImplemented = true;
|
||||||
break;
|
break;
|
||||||
case slsDetectorDefs::GOTTHARD2:
|
case slsDetectorDefs::GOTTHARD2:
|
||||||
|
lblBurstMode->show();
|
||||||
|
comboBurstMode->show();
|
||||||
lblNumBursts->setEnabled(true);
|
lblNumBursts->setEnabled(true);
|
||||||
spinNumBursts->setEnabled(true);
|
spinNumBursts->setEnabled(true);
|
||||||
lblBurstPeriod->setEnabled(true);
|
lblBurstPeriod->setEnabled(true);
|
||||||
@ -89,6 +93,10 @@ void qTabMeasurement::SetupWidgetWindow() {
|
|||||||
void qTabMeasurement::Initialization() {
|
void qTabMeasurement::Initialization() {
|
||||||
connect(comboTimingMode, SIGNAL(currentIndexChanged(int)), this,
|
connect(comboTimingMode, SIGNAL(currentIndexChanged(int)), this,
|
||||||
SLOT(SetTimingMode(int)));
|
SLOT(SetTimingMode(int)));
|
||||||
|
if (comboBurstMode->isVisible()) {
|
||||||
|
connect(comboBurstMode, SIGNAL(currentIndexChanged(int)), this,
|
||||||
|
SLOT(SetBurstMode(int)));
|
||||||
|
}
|
||||||
connect(spinNumMeasurements, SIGNAL(valueChanged(int)), this,
|
connect(spinNumMeasurements, SIGNAL(valueChanged(int)), this,
|
||||||
SLOT(SetNumMeasurements(int)));
|
SLOT(SetNumMeasurements(int)));
|
||||||
connect(spinNumFrames, SIGNAL(valueChanged(int)), this,
|
connect(spinNumFrames, SIGNAL(valueChanged(int)), this,
|
||||||
@ -129,6 +137,8 @@ void qTabMeasurement::Initialization() {
|
|||||||
}
|
}
|
||||||
connect(chkFile, SIGNAL(toggled(bool)), this, SLOT(SetFileWrite(bool)));
|
connect(chkFile, SIGNAL(toggled(bool)), this, SLOT(SetFileWrite(bool)));
|
||||||
connect(dispFileName, SIGNAL(editingFinished()), this, SLOT(SetFileName()));
|
connect(dispFileName, SIGNAL(editingFinished()), this, SLOT(SetFileName()));
|
||||||
|
connect(dispFileName, SIGNAL(returnPressed()), this,
|
||||||
|
SLOT(ForceSetFileName()));
|
||||||
connect(spinIndex, SIGNAL(valueChanged(int)), this, SLOT(SetRunIndex(int)));
|
connect(spinIndex, SIGNAL(valueChanged(int)), this, SLOT(SetRunIndex(int)));
|
||||||
if (startingFnumImplemented) {
|
if (startingFnumImplemented) {
|
||||||
connect(spinStartingFrameNumber, SIGNAL(valueChanged(int)), this,
|
connect(spinStartingFrameNumber, SIGNAL(valueChanged(int)), this,
|
||||||
@ -142,19 +152,16 @@ void qTabMeasurement::Initialization() {
|
|||||||
void qTabMeasurement::ShowTriggerDelay() {
|
void qTabMeasurement::ShowTriggerDelay() {
|
||||||
bool showTrigger = true;
|
bool showTrigger = true;
|
||||||
if (det->getDetectorType().squash() == slsDetectorDefs::GOTTHARD2) {
|
if (det->getDetectorType().squash() == slsDetectorDefs::GOTTHARD2) {
|
||||||
try {
|
// burst and auto
|
||||||
LOG(logDEBUG) << "Getting burst mode";
|
if ((comboBurstMode->currentIndex() ==
|
||||||
auto retval = det->getBurstMode().tsquash(
|
slsDetectorDefs::BURST_INTERNAL ||
|
||||||
"Inconsistent burst mode for all detectors.");
|
comboBurstMode->currentIndex() ==
|
||||||
// burst mode and auto timing mode
|
slsDetectorDefs::BURST_EXTERNAL) &&
|
||||||
if (retval != slsDetectorDefs::BURST_OFF &&
|
(comboTimingMode->currentIndex() == AUTO)) {
|
||||||
comboTimingMode->currentIndex() == AUTO) {
|
// show burst, burstperiod, not trigger or delay
|
||||||
showTrigger = false;
|
showTrigger = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CATCH_DISPLAY("Could not get burst mode.",
|
|
||||||
"qTabMeasurement::ShowTriggerDelay")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (showTrigger) {
|
if (showTrigger) {
|
||||||
stackedLblTriggerBurst->setCurrentWidget(pageLblTrigger);
|
stackedLblTriggerBurst->setCurrentWidget(pageLblTrigger);
|
||||||
@ -246,7 +253,7 @@ void qTabMeasurement::EnableWidgetsforTimingMode() {
|
|||||||
spinPeriod->setEnabled(true);
|
spinPeriod->setEnabled(true);
|
||||||
comboPeriodUnit->setEnabled(true);
|
comboPeriodUnit->setEnabled(true);
|
||||||
if (det->getDetectorType().squash() == slsDetectorDefs::GOTTHARD2) {
|
if (det->getDetectorType().squash() == slsDetectorDefs::GOTTHARD2) {
|
||||||
ShowTriggerDelay();
|
GetBurstMode(); // also decides to show trigger or burst mode
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TRIGGER:
|
case TRIGGER:
|
||||||
@ -270,7 +277,7 @@ void qTabMeasurement::EnableWidgetsforTimingMode() {
|
|||||||
spinDelay->setEnabled(true);
|
spinDelay->setEnabled(true);
|
||||||
comboDelayUnit->setEnabled(true);
|
comboDelayUnit->setEnabled(true);
|
||||||
if (det->getDetectorType().squash() == slsDetectorDefs::GOTTHARD2) {
|
if (det->getDetectorType().squash() == slsDetectorDefs::GOTTHARD2) {
|
||||||
ShowTriggerDelay();
|
GetBurstMode(); // also decides to show trigger or burst mode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -357,6 +364,42 @@ void qTabMeasurement::SetTimingMode(int val) {
|
|||||||
this, &qTabMeasurement::GetTimingMode)
|
this, &qTabMeasurement::GetTimingMode)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void qTabMeasurement::GetBurstMode() {
|
||||||
|
LOG(logDEBUG) << "Getting burst mode";
|
||||||
|
disconnect(comboBurstMode, SIGNAL(currentIndexChanged(int)), this,
|
||||||
|
SLOT(SetBurstMode(int)));
|
||||||
|
try {
|
||||||
|
auto retval = det->getBurstMode().tsquash(
|
||||||
|
"Inconsistent burst mode for all detectors.");
|
||||||
|
switch (retval) {
|
||||||
|
case slsDetectorDefs::BURST_INTERNAL:
|
||||||
|
case slsDetectorDefs::BURST_EXTERNAL:
|
||||||
|
case slsDetectorDefs::CONTINUOUS_INTERNAL:
|
||||||
|
case slsDetectorDefs::CONTINUOUS_EXTERNAL:
|
||||||
|
comboBurstMode->setCurrentIndex((int)retval);
|
||||||
|
ShowTriggerDelay();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw sls::RuntimeError(std::string("Unknown burst mode: ") +
|
||||||
|
std::to_string(retval));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CATCH_DISPLAY("Could not get burst mode.", "qTabMeasurement::GetBurstMode")
|
||||||
|
connect(comboBurstMode, SIGNAL(currentIndexChanged(int)), this,
|
||||||
|
SLOT(SetBurstMode(int)));
|
||||||
|
}
|
||||||
|
|
||||||
|
void qTabMeasurement::SetBurstMode(int val) {
|
||||||
|
LOG(logINFO) << "Setting burst mode:"
|
||||||
|
<< comboBurstMode->currentText().toAscii().data();
|
||||||
|
try {
|
||||||
|
det->setBurstMode(static_cast<slsDetectorDefs::burstMode>(val));
|
||||||
|
ShowTriggerDelay();
|
||||||
|
}
|
||||||
|
CATCH_HANDLE("Could not set burst mode.", "qTabMeasurement::SetBurstMode",
|
||||||
|
this, &qTabMeasurement::GetBurstMode)
|
||||||
|
}
|
||||||
|
|
||||||
void qTabMeasurement::SetNumMeasurements(int val) {
|
void qTabMeasurement::SetNumMeasurements(int val) {
|
||||||
LOG(logINFO) << "Setting Number of Measurements to " << val;
|
LOG(logINFO) << "Setting Number of Measurements to " << val;
|
||||||
numMeasurements = val;
|
numMeasurements = val;
|
||||||
@ -723,8 +766,12 @@ void qTabMeasurement::GetFileName() {
|
|||||||
connect(dispFileName, SIGNAL(editingFinished()), this, SLOT(SetFileName()));
|
connect(dispFileName, SIGNAL(editingFinished()), this, SLOT(SetFileName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void qTabMeasurement::SetFileName() {
|
void qTabMeasurement::SetFileName(bool force) {
|
||||||
std::string val = std::string(dispFileName->text().toAscii().constData());
|
// return forces modification (inconsistency from command line)
|
||||||
|
if (dispFileName->isModified() || force) {
|
||||||
|
dispFileName->setModified(false);
|
||||||
|
std::string val =
|
||||||
|
std::string(dispFileName->text().toAscii().constData());
|
||||||
LOG(logINFO) << "Setting File Name Prefix:" << val;
|
LOG(logINFO) << "Setting File Name Prefix:" << val;
|
||||||
try {
|
try {
|
||||||
det->setFileNamePrefix(val);
|
det->setFileNamePrefix(val);
|
||||||
@ -734,8 +781,11 @@ void qTabMeasurement::SetFileName() {
|
|||||||
&qTabMeasurement::GetFileName)
|
&qTabMeasurement::GetFileName)
|
||||||
|
|
||||||
emit FileNameChangedSignal(dispFileName->text());
|
emit FileNameChangedSignal(dispFileName->text());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void qTabMeasurement::ForceSetFileName() { SetFileName(true); }
|
||||||
|
|
||||||
void qTabMeasurement::GetRunIndex() {
|
void qTabMeasurement::GetRunIndex() {
|
||||||
LOG(logDEBUG) << "Getting Acquisition File index";
|
LOG(logDEBUG) << "Getting Acquisition File index";
|
||||||
disconnect(spinIndex, SIGNAL(valueChanged(int)), this,
|
disconnect(spinIndex, SIGNAL(valueChanged(int)), this,
|
||||||
@ -904,6 +954,9 @@ void qTabMeasurement::Refresh() {
|
|||||||
|
|
||||||
if (!plot->GetIsRunning()) {
|
if (!plot->GetIsRunning()) {
|
||||||
GetTimingMode();
|
GetTimingMode();
|
||||||
|
if (comboBurstMode->isVisible()) {
|
||||||
|
GetBurstMode();
|
||||||
|
}
|
||||||
GetNumFrames();
|
GetNumFrames();
|
||||||
GetExposureTime();
|
GetExposureTime();
|
||||||
GetAcquisitionPeriod();
|
GetAcquisitionPeriod();
|
||||||
|
@ -87,9 +87,9 @@ void qTabPlot::Initialization() {
|
|||||||
SLOT(SetStreamingFrequency()));
|
SLOT(SetStreamingFrequency()));
|
||||||
connect(comboTimeGapUnit, SIGNAL(currentIndexChanged(int)), this,
|
connect(comboTimeGapUnit, SIGNAL(currentIndexChanged(int)), this,
|
||||||
SLOT(SetStreamingFrequency()));
|
SLOT(SetStreamingFrequency()));
|
||||||
connect(spinTimeGap, SIGNAL(editingFinished()), this,
|
connect(spinTimeGap, SIGNAL(valueChanged(double)), this,
|
||||||
SLOT(SetStreamingFrequency()));
|
SLOT(SetStreamingFrequency()));
|
||||||
connect(spinNthFrame, SIGNAL(editingFinished()), this,
|
connect(spinNthFrame, SIGNAL(valueChanged(int)), this,
|
||||||
SLOT(SetStreamingFrequency()));
|
SLOT(SetStreamingFrequency()));
|
||||||
|
|
||||||
// navigation buttons for options
|
// navigation buttons for options
|
||||||
@ -174,17 +174,17 @@ void qTabPlot::Initialization() {
|
|||||||
connect(chkXMax, SIGNAL(toggled(bool)), this, SLOT(SetXRange()));
|
connect(chkXMax, SIGNAL(toggled(bool)), this, SLOT(SetXRange()));
|
||||||
connect(chkYMin, SIGNAL(toggled(bool)), this, SLOT(SetYRange()));
|
connect(chkYMin, SIGNAL(toggled(bool)), this, SLOT(SetYRange()));
|
||||||
connect(chkYMax, SIGNAL(toggled(bool)), this, SLOT(SetYRange()));
|
connect(chkYMax, SIGNAL(toggled(bool)), this, SLOT(SetYRange()));
|
||||||
connect(dispXMin, SIGNAL(editingFinished()), this, SLOT(SetXRange()));
|
connect(dispXMin, SIGNAL(editingFinished()), this, SLOT(isXMinModified()));
|
||||||
connect(dispXMax, SIGNAL(editingFinished()), this, SLOT(SetXRange()));
|
connect(dispXMax, SIGNAL(editingFinished()), this, SLOT(isXMaxModified()));
|
||||||
connect(dispYMin, SIGNAL(editingFinished()), this, SLOT(SetYRange()));
|
connect(dispYMin, SIGNAL(editingFinished()), this, SLOT(isYMinModified()));
|
||||||
connect(dispYMax, SIGNAL(editingFinished()), this, SLOT(SetYRange()));
|
connect(dispYMax, SIGNAL(editingFinished()), this, SLOT(isYMaxModified()));
|
||||||
connect(chkAspectRatio, SIGNAL(toggled(bool)), this,
|
connect(chkAspectRatio, SIGNAL(toggled(bool)), this,
|
||||||
SLOT(CheckAspectRatio()));
|
SLOT(CheckAspectRatio()));
|
||||||
|
|
||||||
connect(chkZMin, SIGNAL(toggled(bool)), this, SLOT(SetZRange()));
|
connect(chkZMin, SIGNAL(toggled(bool)), this, SLOT(SetZRange()));
|
||||||
connect(chkZMax, SIGNAL(toggled(bool)), this, SLOT(SetZRange()));
|
connect(chkZMax, SIGNAL(toggled(bool)), this, SLOT(SetZRange()));
|
||||||
connect(dispZMin, SIGNAL(editingFinished()), this, SLOT(SetZRange()));
|
connect(dispZMin, SIGNAL(editingFinished()), this, SLOT(isZMinModified()));
|
||||||
connect(dispZMax, SIGNAL(editingFinished()), this, SLOT(SetZRange()));
|
connect(dispZMax, SIGNAL(editingFinished()), this, SLOT(isZMaxModified()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void qTabPlot::Select1DPlot(bool enable) {
|
void qTabPlot::Select1DPlot(bool enable) {
|
||||||
@ -389,6 +389,48 @@ void qTabPlot::SetTitles() {
|
|||||||
SLOT(SetTitles()));
|
SLOT(SetTitles()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void qTabPlot::isXMinModified() {
|
||||||
|
if (dispXMin->isModified()) {
|
||||||
|
dispXMin->setModified(false);
|
||||||
|
SetXRange();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void qTabPlot::isXMaxModified() {
|
||||||
|
if (dispXMax->isModified()) {
|
||||||
|
dispXMax->setModified(false);
|
||||||
|
SetXRange();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void qTabPlot::isYMinModified() {
|
||||||
|
if (dispYMin->isModified()) {
|
||||||
|
dispYMin->setModified(false);
|
||||||
|
SetYRange();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void qTabPlot::isYMaxModified() {
|
||||||
|
if (dispYMax->isModified()) {
|
||||||
|
dispYMax->setModified(false);
|
||||||
|
SetYRange();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void qTabPlot::isZMinModified() {
|
||||||
|
if (dispZMin->isModified()) {
|
||||||
|
dispZMin->setModified(false);
|
||||||
|
SetZRange();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void qTabPlot::isZMaxModified() {
|
||||||
|
if (dispZMax->isModified()) {
|
||||||
|
dispZMax->setModified(false);
|
||||||
|
SetZRange();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void qTabPlot::SetXRange() {
|
void qTabPlot::SetXRange() {
|
||||||
LOG(logDEBUG) << "Enable X axis range";
|
LOG(logDEBUG) << "Enable X axis range";
|
||||||
|
|
||||||
@ -452,10 +494,14 @@ void qTabPlot::MaintainAspectRatio(int dimension) {
|
|||||||
disconnect(chkXMax, SIGNAL(toggled(bool)), this, SLOT(SetXRange()));
|
disconnect(chkXMax, SIGNAL(toggled(bool)), this, SLOT(SetXRange()));
|
||||||
disconnect(chkYMin, SIGNAL(toggled(bool)), this, SLOT(SetYRange()));
|
disconnect(chkYMin, SIGNAL(toggled(bool)), this, SLOT(SetYRange()));
|
||||||
disconnect(chkYMax, SIGNAL(toggled(bool)), this, SLOT(SetYRange()));
|
disconnect(chkYMax, SIGNAL(toggled(bool)), this, SLOT(SetYRange()));
|
||||||
disconnect(dispXMin, SIGNAL(editingFinished()), this, SLOT(SetXRange()));
|
disconnect(dispXMin, SIGNAL(editingFinished()), this,
|
||||||
disconnect(dispXMax, SIGNAL(editingFinished()), this, SLOT(SetXRange()));
|
SLOT(isXMinModified()));
|
||||||
disconnect(dispYMin, SIGNAL(editingFinished()), this, SLOT(SetYRange()));
|
disconnect(dispXMax, SIGNAL(editingFinished()), this,
|
||||||
disconnect(dispYMax, SIGNAL(editingFinished()), this, SLOT(SetYRange()));
|
SLOT(isXMaxModified()));
|
||||||
|
disconnect(dispYMin, SIGNAL(editingFinished()), this,
|
||||||
|
SLOT(isYMinModified()));
|
||||||
|
disconnect(dispYMax, SIGNAL(editingFinished()), this,
|
||||||
|
SLOT(isYMaxModified()));
|
||||||
|
|
||||||
// check all, fill all
|
// check all, fill all
|
||||||
chkXMin->setChecked(true);
|
chkXMin->setChecked(true);
|
||||||
@ -550,10 +596,10 @@ void qTabPlot::MaintainAspectRatio(int dimension) {
|
|||||||
connect(chkXMax, SIGNAL(toggled(bool)), this, SLOT(SetXRange()));
|
connect(chkXMax, SIGNAL(toggled(bool)), this, SLOT(SetXRange()));
|
||||||
connect(chkYMin, SIGNAL(toggled(bool)), this, SLOT(SetYRange()));
|
connect(chkYMin, SIGNAL(toggled(bool)), this, SLOT(SetYRange()));
|
||||||
connect(chkYMax, SIGNAL(toggled(bool)), this, SLOT(SetYRange()));
|
connect(chkYMax, SIGNAL(toggled(bool)), this, SLOT(SetYRange()));
|
||||||
connect(dispXMin, SIGNAL(editingFinished()), this, SLOT(SetXRange()));
|
connect(dispXMin, SIGNAL(editingFinished()), this, SLOT(isXMinModified()));
|
||||||
connect(dispXMax, SIGNAL(editingFinished()), this, SLOT(SetXRange()));
|
connect(dispXMax, SIGNAL(editingFinished()), this, SLOT(isXMaxModified()));
|
||||||
connect(dispYMin, SIGNAL(editingFinished()), this, SLOT(SetYRange()));
|
connect(dispYMin, SIGNAL(editingFinished()), this, SLOT(isYMinModified()));
|
||||||
connect(dispYMax, SIGNAL(editingFinished()), this, SLOT(SetYRange()));
|
connect(dispYMax, SIGNAL(editingFinished()), this, SLOT(isYMaxModified()));
|
||||||
|
|
||||||
bool isRange[4]{true, true, true, true};
|
bool isRange[4]{true, true, true, true};
|
||||||
plot->SetXYRangeChanged(true, ranges, isRange);
|
plot->SetXYRangeChanged(true, ranges, isRange);
|
||||||
@ -583,9 +629,9 @@ void qTabPlot::GetStreamingFrequency() {
|
|||||||
SLOT(SetStreamingFrequency()));
|
SLOT(SetStreamingFrequency()));
|
||||||
disconnect(comboTimeGapUnit, SIGNAL(currentIndexChanged(int)), this,
|
disconnect(comboTimeGapUnit, SIGNAL(currentIndexChanged(int)), this,
|
||||||
SLOT(SetStreamingFrequency()));
|
SLOT(SetStreamingFrequency()));
|
||||||
disconnect(spinTimeGap, SIGNAL(editingFinished()), this,
|
disconnect(spinTimeGap, SIGNAL(valueChanged(double)), this,
|
||||||
SLOT(SetStreamingFrequency()));
|
SLOT(SetStreamingFrequency()));
|
||||||
disconnect(spinNthFrame, SIGNAL(editingFinished()), this,
|
disconnect(spinNthFrame, SIGNAL(valueChanged(int)), this,
|
||||||
SLOT(SetStreamingFrequency()));
|
SLOT(SetStreamingFrequency()));
|
||||||
try {
|
try {
|
||||||
int freq = det->getRxZmqFrequency().tsquash(
|
int freq = det->getRxZmqFrequency().tsquash(
|
||||||
@ -621,9 +667,9 @@ void qTabPlot::GetStreamingFrequency() {
|
|||||||
SLOT(SetStreamingFrequency()));
|
SLOT(SetStreamingFrequency()));
|
||||||
connect(comboTimeGapUnit, SIGNAL(currentIndexChanged(int)), this,
|
connect(comboTimeGapUnit, SIGNAL(currentIndexChanged(int)), this,
|
||||||
SLOT(SetStreamingFrequency()));
|
SLOT(SetStreamingFrequency()));
|
||||||
connect(spinTimeGap, SIGNAL(editingFinished()), this,
|
connect(spinTimeGap, SIGNAL(valueChanged(double)), this,
|
||||||
SLOT(SetStreamingFrequency()));
|
SLOT(SetStreamingFrequency()));
|
||||||
connect(spinNthFrame, SIGNAL(editingFinished()), this,
|
connect(spinNthFrame, SIGNAL(valueChanged(int)), this,
|
||||||
SLOT(SetStreamingFrequency()));
|
SLOT(SetStreamingFrequency()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Binary file not shown.
@ -2347,7 +2347,7 @@ int stopStateMachine() {
|
|||||||
sharedMemory_setStop(1);
|
sharedMemory_setStop(1);
|
||||||
// read till status is idle
|
// read till status is idle
|
||||||
while (sharedMemory_getStatus() == RUNNING)
|
while (sharedMemory_getStatus() == RUNNING)
|
||||||
;
|
usleep(500);
|
||||||
sharedMemory_setStop(0);
|
sharedMemory_setStop(0);
|
||||||
LOG(logINFO, ("Stopped State Machine\n"));
|
LOG(logINFO, ("Stopped State Machine\n"));
|
||||||
return OK;
|
return OK;
|
||||||
|
@ -39,6 +39,10 @@ uint64_t Beb_deactivatedStartFrameNumber = 0;
|
|||||||
int Beb_quadEnable = 0;
|
int Beb_quadEnable = 0;
|
||||||
int Beb_positions[2] = {0, 0};
|
int Beb_positions[2] = {0, 0};
|
||||||
int Beb_readNLines = MAX_ROWS_PER_READOUT;
|
int Beb_readNLines = MAX_ROWS_PER_READOUT;
|
||||||
|
int Beb_deactivated_transmission_flowcontrol_10g = 0;
|
||||||
|
int Beb_deactivated_transmission_delay_frame = 0;
|
||||||
|
int Beb_deactivated_transmission_delay_left = 0;
|
||||||
|
int Beb_deactivated_transmission_delay_right = 0;
|
||||||
|
|
||||||
void BebInfo_BebInfo(struct BebInfo *bebInfo, unsigned int beb_num) {
|
void BebInfo_BebInfo(struct BebInfo *bebInfo, unsigned int beb_num) {
|
||||||
bebInfo->beb_number = beb_num;
|
bebInfo->beb_number = beb_num;
|
||||||
@ -180,6 +184,11 @@ void Beb_GetModuleConfiguration(int *master, int *top, int *normal) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int Beb_IsTransmitting(int *retval, int tengiga, int waitForDelay) {
|
int Beb_IsTransmitting(int *retval, int tengiga, int waitForDelay) {
|
||||||
|
if (!Beb_activated) {
|
||||||
|
// not transmitting
|
||||||
|
*retval = 0;
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
// mapping new memory
|
// mapping new memory
|
||||||
u_int32_t *csp0base = 0;
|
u_int32_t *csp0base = 0;
|
||||||
int addr_l_txndelaycounter = 0, addr_l_framedelaycounter = 0;
|
int addr_l_txndelaycounter = 0, addr_l_framedelaycounter = 0;
|
||||||
@ -482,6 +491,9 @@ int Beb_Set32bitOverflow(int val) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int Beb_GetTenGigaFlowControl() {
|
int Beb_GetTenGigaFlowControl() {
|
||||||
|
if (!Beb_activated)
|
||||||
|
return Beb_deactivated_transmission_flowcontrol_10g;
|
||||||
|
|
||||||
u_int32_t offset = FLOW_REG_OFFSET;
|
u_int32_t offset = FLOW_REG_OFFSET;
|
||||||
u_int32_t *csp0base = 0;
|
u_int32_t *csp0base = 0;
|
||||||
int fd = Beb_open(&csp0base, XPAR_PLB_GPIO_SYS_BASEADDR);
|
int fd = Beb_open(&csp0base, XPAR_PLB_GPIO_SYS_BASEADDR);
|
||||||
@ -501,6 +513,11 @@ int Beb_GetTenGigaFlowControl() {
|
|||||||
|
|
||||||
int Beb_SetTenGigaFlowControl(int value) {
|
int Beb_SetTenGigaFlowControl(int value) {
|
||||||
LOG(logINFO, ("Setting ten giga flow control to %d\n", value));
|
LOG(logINFO, ("Setting ten giga flow control to %d\n", value));
|
||||||
|
if (!Beb_activated) {
|
||||||
|
Beb_deactivated_transmission_flowcontrol_10g = value;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
value = value == 0 ? 0 : 1;
|
value = value == 0 ? 0 : 1;
|
||||||
u_int32_t offset = FLOW_REG_OFFSET;
|
u_int32_t offset = FLOW_REG_OFFSET;
|
||||||
u_int32_t *csp0base = 0;
|
u_int32_t *csp0base = 0;
|
||||||
@ -521,12 +538,17 @@ int Beb_SetTenGigaFlowControl(int value) {
|
|||||||
retval | ((value << FLOW_REG_TXM_FLOW_CNTRL_10G_OFST) &
|
retval | ((value << FLOW_REG_TXM_FLOW_CNTRL_10G_OFST) &
|
||||||
FLOW_REG_TXM_FLOW_CNTRL_10G_MSK));
|
FLOW_REG_TXM_FLOW_CNTRL_10G_MSK));
|
||||||
|
|
||||||
|
Beb_deactivated_transmission_flowcontrol_10g = value;
|
||||||
Beb_close(fd, csp0base);
|
Beb_close(fd, csp0base);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int Beb_GetTransmissionDelayFrame() {
|
int Beb_GetTransmissionDelayFrame() {
|
||||||
|
if (!Beb_activated) {
|
||||||
|
return Beb_deactivated_transmission_delay_frame;
|
||||||
|
}
|
||||||
|
|
||||||
u_int32_t offset = TXM_DELAY_FRAME_OFFSET;
|
u_int32_t offset = TXM_DELAY_FRAME_OFFSET;
|
||||||
u_int32_t *csp0base = 0;
|
u_int32_t *csp0base = 0;
|
||||||
int fd = Beb_open(&csp0base, XPAR_PLB_GPIO_SYS_BASEADDR);
|
int fd = Beb_open(&csp0base, XPAR_PLB_GPIO_SYS_BASEADDR);
|
||||||
@ -547,6 +569,10 @@ int Beb_SetTransmissionDelayFrame(int value) {
|
|||||||
LOG(logERROR, ("Invalid transmission delay frame value %d\n", value));
|
LOG(logERROR, ("Invalid transmission delay frame value %d\n", value));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
if (!Beb_activated) {
|
||||||
|
Beb_deactivated_transmission_delay_frame = value;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
u_int32_t offset = TXM_DELAY_FRAME_OFFSET;
|
u_int32_t offset = TXM_DELAY_FRAME_OFFSET;
|
||||||
u_int32_t *csp0base = 0;
|
u_int32_t *csp0base = 0;
|
||||||
int fd = Beb_open(&csp0base, XPAR_PLB_GPIO_SYS_BASEADDR);
|
int fd = Beb_open(&csp0base, XPAR_PLB_GPIO_SYS_BASEADDR);
|
||||||
@ -556,12 +582,16 @@ int Beb_SetTransmissionDelayFrame(int value) {
|
|||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
Beb_Write32(csp0base, offset, value);
|
Beb_Write32(csp0base, offset, value);
|
||||||
|
Beb_deactivated_transmission_delay_frame = value;
|
||||||
Beb_close(fd, csp0base);
|
Beb_close(fd, csp0base);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int Beb_GetTransmissionDelayLeft() {
|
int Beb_GetTransmissionDelayLeft() {
|
||||||
|
if (!Beb_activated) {
|
||||||
|
return Beb_deactivated_transmission_delay_left;
|
||||||
|
}
|
||||||
u_int32_t offset = TXM_DELAY_LEFT_OFFSET;
|
u_int32_t offset = TXM_DELAY_LEFT_OFFSET;
|
||||||
u_int32_t *csp0base = 0;
|
u_int32_t *csp0base = 0;
|
||||||
int fd = Beb_open(&csp0base, XPAR_PLB_GPIO_SYS_BASEADDR);
|
int fd = Beb_open(&csp0base, XPAR_PLB_GPIO_SYS_BASEADDR);
|
||||||
@ -582,6 +612,10 @@ int Beb_SetTransmissionDelayLeft(int value) {
|
|||||||
LOG(logERROR, ("Invalid transmission delay left value %d\n", value));
|
LOG(logERROR, ("Invalid transmission delay left value %d\n", value));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
if (!Beb_activated) {
|
||||||
|
Beb_deactivated_transmission_delay_left = value;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
u_int32_t offset = TXM_DELAY_LEFT_OFFSET;
|
u_int32_t offset = TXM_DELAY_LEFT_OFFSET;
|
||||||
u_int32_t *csp0base = 0;
|
u_int32_t *csp0base = 0;
|
||||||
int fd = Beb_open(&csp0base, XPAR_PLB_GPIO_SYS_BASEADDR);
|
int fd = Beb_open(&csp0base, XPAR_PLB_GPIO_SYS_BASEADDR);
|
||||||
@ -591,12 +625,17 @@ int Beb_SetTransmissionDelayLeft(int value) {
|
|||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
Beb_Write32(csp0base, offset, value);
|
Beb_Write32(csp0base, offset, value);
|
||||||
|
Beb_deactivated_transmission_delay_left = value;
|
||||||
Beb_close(fd, csp0base);
|
Beb_close(fd, csp0base);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int Beb_GetTransmissionDelayRight() {
|
int Beb_GetTransmissionDelayRight() {
|
||||||
|
if (!Beb_activated) {
|
||||||
|
return Beb_deactivated_transmission_delay_right;
|
||||||
|
}
|
||||||
|
|
||||||
u_int32_t offset = TXM_DELAY_RIGHT_OFFSET;
|
u_int32_t offset = TXM_DELAY_RIGHT_OFFSET;
|
||||||
u_int32_t *csp0base = 0;
|
u_int32_t *csp0base = 0;
|
||||||
int fd = Beb_open(&csp0base, XPAR_PLB_GPIO_SYS_BASEADDR);
|
int fd = Beb_open(&csp0base, XPAR_PLB_GPIO_SYS_BASEADDR);
|
||||||
@ -617,6 +656,10 @@ int Beb_SetTransmissionDelayRight(int value) {
|
|||||||
LOG(logERROR, ("Invalid transmission delay right value %d\n", value));
|
LOG(logERROR, ("Invalid transmission delay right value %d\n", value));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
if (!Beb_activated) {
|
||||||
|
Beb_deactivated_transmission_delay_right = value;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
u_int32_t offset = TXM_DELAY_RIGHT_OFFSET;
|
u_int32_t offset = TXM_DELAY_RIGHT_OFFSET;
|
||||||
u_int32_t *csp0base = 0;
|
u_int32_t *csp0base = 0;
|
||||||
int fd = Beb_open(&csp0base, XPAR_PLB_GPIO_SYS_BASEADDR);
|
int fd = Beb_open(&csp0base, XPAR_PLB_GPIO_SYS_BASEADDR);
|
||||||
@ -626,57 +669,12 @@ int Beb_SetTransmissionDelayRight(int value) {
|
|||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
Beb_Write32(csp0base, offset, value);
|
Beb_Write32(csp0base, offset, value);
|
||||||
|
Beb_deactivated_transmission_delay_right = value;
|
||||||
Beb_close(fd, csp0base);
|
Beb_close(fd, csp0base);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int Beb_SetNetworkParameter(enum NETWORKINDEX mode, int val) {
|
|
||||||
|
|
||||||
if (!Beb_activated)
|
|
||||||
return val;
|
|
||||||
|
|
||||||
// mapping new memory
|
|
||||||
u_int32_t *csp0base = 0;
|
|
||||||
u_int32_t valueread = 0;
|
|
||||||
u_int32_t offset = TXM_DELAY_LEFT_OFFSET;
|
|
||||||
char modename[100] = "";
|
|
||||||
|
|
||||||
switch (mode) {
|
|
||||||
case TXN_LEFT:
|
|
||||||
offset = TXM_DELAY_LEFT_OFFSET;
|
|
||||||
strcpy(modename, "Transmission Delay Left");
|
|
||||||
break;
|
|
||||||
case TXN_RIGHT:
|
|
||||||
offset = TXM_DELAY_RIGHT_OFFSET;
|
|
||||||
strcpy(modename, "Transmission Delay Right");
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
LOG(logERROR, ("Unrecognized mode in network parameter: %d\n", mode));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
// open file pointer
|
|
||||||
int fd = Beb_open(&csp0base, XPAR_PLB_GPIO_SYS_BASEADDR);
|
|
||||||
if (fd < 0) {
|
|
||||||
LOG(logERROR,
|
|
||||||
("Could not read register to set network parameter. FAIL\n"));
|
|
||||||
return -1;
|
|
||||||
} else {
|
|
||||||
if (val > -1) {
|
|
||||||
valueread = Beb_Read32(csp0base, offset);
|
|
||||||
Beb_Write32(csp0base, offset, val);
|
|
||||||
}
|
|
||||||
|
|
||||||
valueread = Beb_Read32(csp0base, offset);
|
|
||||||
}
|
|
||||||
// close file pointer
|
|
||||||
if (fd > 0)
|
|
||||||
Beb_close(fd, csp0base);
|
|
||||||
|
|
||||||
return valueread;
|
|
||||||
}
|
|
||||||
|
|
||||||
u_int32_t Beb_GetFirmwareRevision() {
|
u_int32_t Beb_GetFirmwareRevision() {
|
||||||
// mapping new memory
|
// mapping new memory
|
||||||
u_int32_t *csp0base = 0;
|
u_int32_t *csp0base = 0;
|
||||||
|
@ -986,11 +986,16 @@ int Feb_Control_StartAcquisition() {
|
|||||||
int Feb_Control_StopAcquisition() { return Feb_Control_Reset(); }
|
int Feb_Control_StopAcquisition() { return Feb_Control_Reset(); }
|
||||||
|
|
||||||
int Feb_Control_SoftwareTrigger() {
|
int Feb_Control_SoftwareTrigger() {
|
||||||
unsigned int orig_value = 0;
|
|
||||||
Feb_Interface_ReadRegister(Feb_Control_AddressToAll(), DAQ_REG_CHIP_CMDS,
|
|
||||||
&orig_value);
|
|
||||||
unsigned int cmd = orig_value | DAQ_REG_CHIP_CMDS_INT_TRIGGER;
|
|
||||||
if (Feb_Control_activated) {
|
if (Feb_Control_activated) {
|
||||||
|
unsigned int orig_value = 0;
|
||||||
|
if (!Feb_Interface_ReadRegister(Feb_Control_AddressToAll(),
|
||||||
|
DAQ_REG_CHIP_CMDS, &orig_value)) {
|
||||||
|
LOG(logERROR, ("Could not read DAQ_REG_CHIP_CMDS to send software "
|
||||||
|
"trigger\n"));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
unsigned int cmd = orig_value | DAQ_REG_CHIP_CMDS_INT_TRIGGER;
|
||||||
|
|
||||||
// set trigger bit
|
// set trigger bit
|
||||||
LOG(logDEBUG1, ("Setting Trigger, Register:0x%x\n", cmd));
|
LOG(logDEBUG1, ("Setting Trigger, Register:0x%x\n", cmd));
|
||||||
if (!Feb_Interface_WriteRegister(Feb_Control_AddressToAll(),
|
if (!Feb_Interface_WriteRegister(Feb_Control_AddressToAll(),
|
||||||
@ -1862,9 +1867,16 @@ int Feb_Control_PrintCorrectedValues() {
|
|||||||
// So if software says now 40.00 you neeed to convert to mdegrees 40000(call it
|
// So if software says now 40.00 you neeed to convert to mdegrees 40000(call it
|
||||||
// A1) and then A1/65536/0.00198421639-273.15
|
// A1) and then A1/65536/0.00198421639-273.15
|
||||||
int Feb_Control_GetLeftFPGATemp() {
|
int Feb_Control_GetLeftFPGATemp() {
|
||||||
|
if (!Feb_Control_activated) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
unsigned int temperature = 0;
|
unsigned int temperature = 0;
|
||||||
Feb_Interface_ReadRegister(Feb_Control_leftAddress, FEB_REG_STATUS,
|
if (!Feb_Interface_ReadRegister(Feb_Control_leftAddress, FEB_REG_STATUS,
|
||||||
&temperature);
|
&temperature)) {
|
||||||
|
LOG(logERROR, ("Trouble reading FEB_REG_STATUS reg to get left feb "
|
||||||
|
"temperature\n"));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
temperature = temperature >> 16;
|
temperature = temperature >> 16;
|
||||||
temperature =
|
temperature =
|
||||||
@ -1875,9 +1887,16 @@ int Feb_Control_GetLeftFPGATemp() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int Feb_Control_GetRightFPGATemp() {
|
int Feb_Control_GetRightFPGATemp() {
|
||||||
|
if (!Feb_Control_activated) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
unsigned int temperature = 0;
|
unsigned int temperature = 0;
|
||||||
Feb_Interface_ReadRegister(Feb_Control_rightAddress, FEB_REG_STATUS,
|
if (!Feb_Interface_ReadRegister(Feb_Control_rightAddress, FEB_REG_STATUS,
|
||||||
&temperature);
|
&temperature)) {
|
||||||
|
LOG(logERROR, ("Trouble reading FEB_REG_STATUS reg to get right feb "
|
||||||
|
"temperature\n"));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
temperature = temperature >> 16;
|
temperature = temperature >> 16;
|
||||||
temperature =
|
temperature =
|
||||||
((((float)(temperature) / 65536.0f) / 0.00198421639f) - 273.15f) *
|
((((float)(temperature) / 65536.0f) / 0.00198421639f) - 273.15f) *
|
||||||
@ -1887,15 +1906,29 @@ int Feb_Control_GetRightFPGATemp() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int64_t Feb_Control_GetMeasuredPeriod() {
|
int64_t Feb_Control_GetMeasuredPeriod() {
|
||||||
|
if (!Feb_Control_activated) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
unsigned int value = 0;
|
unsigned int value = 0;
|
||||||
Feb_Interface_ReadRegister(Feb_Control_leftAddress, MEAS_PERIOD_REG,
|
if (!Feb_Interface_ReadRegister(Feb_Control_leftAddress, MEAS_PERIOD_REG,
|
||||||
&value);
|
&value)) {
|
||||||
|
LOG(logERROR,
|
||||||
|
("Trouble reading MEAS_PERIOD_REG reg to get measured period\n"));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
return (int64_t)value * 10;
|
return (int64_t)value * 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t Feb_Control_GetSubMeasuredPeriod() {
|
int64_t Feb_Control_GetSubMeasuredPeriod() {
|
||||||
|
if (!Feb_Control_activated) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
unsigned int value = 0;
|
unsigned int value = 0;
|
||||||
Feb_Interface_ReadRegister(Feb_Control_leftAddress, MEAS_SUBPERIOD_REG,
|
if (!Feb_Interface_ReadRegister(Feb_Control_leftAddress, MEAS_SUBPERIOD_REG,
|
||||||
&value);
|
&value)) {
|
||||||
|
LOG(logERROR, ("Trouble reading MEAS_SUBPERIOD_REG reg to get measured "
|
||||||
|
"sub period\n"));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
return (int64_t)value * 10;
|
return (int64_t)value * 10;
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
@ -2048,11 +2048,12 @@ void *start_timer(void *arg) {
|
|||||||
int colRight = top ? eiger_virtual_detPos[1] + 1 : eiger_virtual_detPos[1];
|
int colRight = top ? eiger_virtual_detPos[1] + 1 : eiger_virtual_detPos[1];
|
||||||
int ntotpixels = 256 * 256 * 4;
|
int ntotpixels = 256 * 256 * 4;
|
||||||
|
|
||||||
LOG(logDEBUG1, (" dr:%d\n bytesperpixel:%f\n tgenable:%d\n datasize:%d\n "
|
LOG(logDEBUG1,
|
||||||
|
(" dr:%d\n bytesperpixel:%f\n tgenable:%d\n datasize:%d\n "
|
||||||
"packetsize:%d\n numpackes:%d\n npixelsx:%d\n databytes:%d\n "
|
"packetsize:%d\n numpackes:%d\n npixelsx:%d\n databytes:%d\n "
|
||||||
"ntotpixels:%d\n",
|
"ntotpixels:%d\n",
|
||||||
dr, bytesPerPixel, tgEnable, datasize, packetsize,
|
dr, bytesPerPixel, tgEnable, datasize, packetsize, numPacketsPerFrame,
|
||||||
numPacketsPerFrame, npixelsx, databytes, ntotpixels));
|
npixelsx, databytes, ntotpixels));
|
||||||
|
|
||||||
// Generate data
|
// Generate data
|
||||||
char imageData[databytes * 2];
|
char imageData[databytes * 2];
|
||||||
@ -2181,7 +2182,8 @@ void *start_timer(void *arg) {
|
|||||||
usleep(eiger_virtual_transmission_delay_right);
|
usleep(eiger_virtual_transmission_delay_right);
|
||||||
sendUDPPacket(1, packetData2, packetsize);
|
sendUDPPacket(1, packetData2, packetsize);
|
||||||
}
|
}
|
||||||
LOG(logINFO, ("Sent frame: %d[%lld]\n", iframes, (long long unsigned int)(frameNr + iframes)));
|
LOG(logINFO, ("Sent frame: %d[%lld]\n", iframes,
|
||||||
|
(long long unsigned int)(frameNr + iframes)));
|
||||||
clock_gettime(CLOCK_REALTIME, &end);
|
clock_gettime(CLOCK_REALTIME, &end);
|
||||||
int64_t timeNs = ((end.tv_sec - begin.tv_sec) * 1E9 +
|
int64_t timeNs = ((end.tv_sec - begin.tv_sec) * 1E9 +
|
||||||
(end.tv_nsec - begin.tv_nsec));
|
(end.tv_nsec - begin.tv_nsec));
|
||||||
@ -2215,7 +2217,7 @@ int stopStateMachine() {
|
|||||||
sharedMemory_setStop(1);
|
sharedMemory_setStop(1);
|
||||||
// read till status is idle
|
// read till status is idle
|
||||||
while (sharedMemory_getStatus() == RUNNING)
|
while (sharedMemory_getStatus() == RUNNING)
|
||||||
;
|
usleep(500);
|
||||||
sharedMemory_setStop(0);
|
sharedMemory_setStop(0);
|
||||||
LOG(logINFO, ("Stopped State Machine\n"));
|
LOG(logINFO, ("Stopped State Machine\n"));
|
||||||
return OK;
|
return OK;
|
||||||
|
@ -121,9 +121,10 @@
|
|||||||
|
|
||||||
#define ASIC_CONFIG_RUN_MODE_OFST (0)
|
#define ASIC_CONFIG_RUN_MODE_OFST (0)
|
||||||
#define ASIC_CONFIG_RUN_MODE_MSK (0x00000003 << ASIC_CONFIG_RUN_MODE_OFST)
|
#define ASIC_CONFIG_RUN_MODE_MSK (0x00000003 << ASIC_CONFIG_RUN_MODE_OFST)
|
||||||
#define ASIC_CONFIG_RUN_MODE_INT_BURST_VAL ((0x1 << ASIC_CONFIG_RUN_MODE_OFST) & ASIC_CONFIG_RUN_MODE_MSK)
|
#define ASIC_CONFIG_RUN_MODE_INT_BURST_VAL ((0x0 << ASIC_CONFIG_RUN_MODE_OFST) & ASIC_CONFIG_RUN_MODE_MSK)
|
||||||
#define ASIC_CONFIG_RUN_MODE_CONT_VAL ((0x2 << ASIC_CONFIG_RUN_MODE_OFST) & ASIC_CONFIG_RUN_MODE_MSK)
|
#define ASIC_CONFIG_RUN_MODE_EXT_BURST_VAL ((0x1 << ASIC_CONFIG_RUN_MODE_OFST) & ASIC_CONFIG_RUN_MODE_MSK)
|
||||||
#define ASIC_CONFIG_RUN_MODE_EXT_BURST_VAL ((0x3 << ASIC_CONFIG_RUN_MODE_OFST) & ASIC_CONFIG_RUN_MODE_MSK)
|
#define ASIC_CONFIG_RUN_MODE_INT_CONT_VAL ((0x2 << ASIC_CONFIG_RUN_MODE_OFST) & ASIC_CONFIG_RUN_MODE_MSK)
|
||||||
|
#define ASIC_CONFIG_RUN_MODE_EXT_CONT_VAL ((0x3 << ASIC_CONFIG_RUN_MODE_OFST) & ASIC_CONFIG_RUN_MODE_MSK)
|
||||||
#define ASIC_CONFIG_GAIN_OFST (4)
|
#define ASIC_CONFIG_GAIN_OFST (4)
|
||||||
#define ASIC_CONFIG_GAIN_MSK (0x00000003 << ASIC_CONFIG_GAIN_OFST)
|
#define ASIC_CONFIG_GAIN_MSK (0x00000003 << ASIC_CONFIG_GAIN_OFST)
|
||||||
#define ASIC_CONFIG_DYNAMIC_GAIN_VAL ((0x0 << ASIC_CONFIG_GAIN_OFST) & ASIC_CONFIG_GAIN_MSK)
|
#define ASIC_CONFIG_DYNAMIC_GAIN_VAL ((0x0 << ASIC_CONFIG_GAIN_OFST) & ASIC_CONFIG_GAIN_MSK)
|
||||||
|
Binary file not shown.
@ -809,11 +809,15 @@ int setDynamicRange(int dr) { return DYNAMIC_RANGE; }
|
|||||||
/* parameters - timer */
|
/* parameters - timer */
|
||||||
void setNumFrames(int64_t val) {
|
void setNumFrames(int64_t val) {
|
||||||
if (val > 0) {
|
if (val > 0) {
|
||||||
if (burstMode == BURST_OFF) {
|
// continuous
|
||||||
|
if (burstMode == CONTINUOUS_INTERNAL ||
|
||||||
|
burstMode == CONTINUOUS_EXTERNAL) {
|
||||||
LOG(logINFO,
|
LOG(logINFO,
|
||||||
("Setting number of frames %lld [Continuous mode]\n", val));
|
("Setting number of frames %lld [Continuous mode]\n", val));
|
||||||
set64BitReg(val, SET_FRAMES_LSB_REG, SET_FRAMES_MSB_REG);
|
set64BitReg(val, SET_FRAMES_LSB_REG, SET_FRAMES_MSB_REG);
|
||||||
} else {
|
}
|
||||||
|
// burst
|
||||||
|
else {
|
||||||
LOG(logINFO,
|
LOG(logINFO,
|
||||||
("Setting number of frames %d [Burst mode]\n", (int)val));
|
("Setting number of frames %d [Burst mode]\n", (int)val));
|
||||||
bus_w(ASIC_INT_FRAMES_REG,
|
bus_w(ASIC_INT_FRAMES_REG,
|
||||||
@ -826,9 +830,12 @@ void setNumFrames(int64_t val) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int64_t getNumFrames() {
|
int64_t getNumFrames() {
|
||||||
if (burstMode == BURST_OFF) {
|
// continuous
|
||||||
|
if (burstMode == CONTINUOUS_INTERNAL || burstMode == CONTINUOUS_EXTERNAL) {
|
||||||
return get64BitReg(SET_FRAMES_LSB_REG, SET_FRAMES_MSB_REG);
|
return get64BitReg(SET_FRAMES_LSB_REG, SET_FRAMES_MSB_REG);
|
||||||
} else {
|
}
|
||||||
|
// burst
|
||||||
|
else {
|
||||||
return ((bus_r(ASIC_INT_FRAMES_REG) & ASIC_INT_FRAMES_MSK) >>
|
return ((bus_r(ASIC_INT_FRAMES_REG) & ASIC_INT_FRAMES_MSK) >>
|
||||||
ASIC_INT_FRAMES_OFST);
|
ASIC_INT_FRAMES_OFST);
|
||||||
}
|
}
|
||||||
@ -856,9 +863,13 @@ int64_t getNumTriggers() {
|
|||||||
void setNumBursts(int64_t val) {
|
void setNumBursts(int64_t val) {
|
||||||
if (val > 0) {
|
if (val > 0) {
|
||||||
LOG(logINFO, ("Setting number of bursts %lld\n", val));
|
LOG(logINFO, ("Setting number of bursts %lld\n", val));
|
||||||
if (burstMode != BURST_OFF && getTiming() == AUTO_TIMING) {
|
// burst and auto
|
||||||
|
if ((burstMode == BURST_INTERNAL || burstMode == BURST_EXTERNAL) &&
|
||||||
|
getTiming() == AUTO_TIMING) {
|
||||||
set64BitReg(val, SET_FRAMES_LSB_REG, SET_FRAMES_MSB_REG);
|
set64BitReg(val, SET_FRAMES_LSB_REG, SET_FRAMES_MSB_REG);
|
||||||
} else {
|
}
|
||||||
|
// burst-trigger or continuous
|
||||||
|
else {
|
||||||
LOG(logINFO,
|
LOG(logINFO,
|
||||||
("\tNot (Burst and Auto mode): not writing to register\n"));
|
("\tNot (Burst and Auto mode): not writing to register\n"));
|
||||||
numBurstsReg = val;
|
numBurstsReg = val;
|
||||||
@ -867,9 +878,12 @@ void setNumBursts(int64_t val) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int64_t getNumBursts() {
|
int64_t getNumBursts() {
|
||||||
if (burstMode != BURST_OFF && getTiming() == AUTO_TIMING) {
|
// burst and auto
|
||||||
|
if ((burstMode == BURST_INTERNAL || burstMode == BURST_EXTERNAL) &&
|
||||||
|
getTiming() == AUTO_TIMING) {
|
||||||
return get64BitReg(SET_FRAMES_LSB_REG, SET_FRAMES_MSB_REG);
|
return get64BitReg(SET_FRAMES_LSB_REG, SET_FRAMES_MSB_REG);
|
||||||
}
|
}
|
||||||
|
// burst-trigger or continuous
|
||||||
return numBurstsReg;
|
return numBurstsReg;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -901,12 +915,16 @@ int setPeriod(int64_t val) {
|
|||||||
LOG(logERROR, ("Invalid period: %lld ns\n", val));
|
LOG(logERROR, ("Invalid period: %lld ns\n", val));
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
val *= (1E-9 * systemFrequency);
|
// continuous
|
||||||
if (burstMode == BURST_OFF) {
|
if (burstMode == CONTINUOUS_INTERNAL || burstMode == CONTINUOUS_EXTERNAL) {
|
||||||
LOG(logINFO, ("Setting period %lld ns [Continuous mode]\n", val));
|
LOG(logINFO, ("Setting period %lld ns [Continuous mode]\n", val));
|
||||||
|
val *= (1E-9 * systemFrequency);
|
||||||
set64BitReg(val, SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG);
|
set64BitReg(val, SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG);
|
||||||
} else {
|
}
|
||||||
|
// burst
|
||||||
|
else {
|
||||||
LOG(logINFO, ("Setting period %lld ns [Burst mode]\n", val));
|
LOG(logINFO, ("Setting period %lld ns [Burst mode]\n", val));
|
||||||
|
val *= (1E-9 * systemFrequency);
|
||||||
set64BitReg(val, ASIC_INT_PERIOD_LSB_REG, ASIC_INT_PERIOD_MSB_REG);
|
set64BitReg(val, ASIC_INT_PERIOD_LSB_REG, ASIC_INT_PERIOD_MSB_REG);
|
||||||
}
|
}
|
||||||
// validate for tolerance
|
// validate for tolerance
|
||||||
@ -919,10 +937,13 @@ int setPeriod(int64_t val) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int64_t getPeriod() {
|
int64_t getPeriod() {
|
||||||
if (burstMode == BURST_OFF) {
|
// continuous
|
||||||
|
if (burstMode == CONTINUOUS_INTERNAL || burstMode == CONTINUOUS_EXTERNAL) {
|
||||||
return get64BitReg(SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG) /
|
return get64BitReg(SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG) /
|
||||||
(1E-9 * systemFrequency);
|
(1E-9 * systemFrequency);
|
||||||
} else {
|
}
|
||||||
|
// burst
|
||||||
|
else {
|
||||||
return get64BitReg(ASIC_INT_PERIOD_LSB_REG, ASIC_INT_PERIOD_MSB_REG) /
|
return get64BitReg(ASIC_INT_PERIOD_LSB_REG, ASIC_INT_PERIOD_MSB_REG) /
|
||||||
(1E-9 * systemFrequency);
|
(1E-9 * systemFrequency);
|
||||||
}
|
}
|
||||||
@ -965,9 +986,13 @@ int setBurstPeriod(int64_t val) {
|
|||||||
}
|
}
|
||||||
LOG(logINFO, ("Setting burst period %lld ns\n", val));
|
LOG(logINFO, ("Setting burst period %lld ns\n", val));
|
||||||
val *= (1E-9 * systemFrequency);
|
val *= (1E-9 * systemFrequency);
|
||||||
if (burstMode != BURST_OFF && getTiming() == AUTO_TIMING) {
|
// burst and auto
|
||||||
|
if ((burstMode == BURST_INTERNAL || burstMode == BURST_EXTERNAL) &&
|
||||||
|
getTiming() == AUTO_TIMING) {
|
||||||
set64BitReg(val, SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG);
|
set64BitReg(val, SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG);
|
||||||
} else {
|
}
|
||||||
|
// burst-trigger, continuous
|
||||||
|
else {
|
||||||
LOG(logINFO,
|
LOG(logINFO,
|
||||||
("\tNot (Burst and Auto mode): not writing to register\n"));
|
("\tNot (Burst and Auto mode): not writing to register\n"));
|
||||||
burstPeriodReg = val;
|
burstPeriodReg = val;
|
||||||
@ -983,10 +1008,13 @@ int setBurstPeriod(int64_t val) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int64_t getBurstPeriod() {
|
int64_t getBurstPeriod() {
|
||||||
if (burstMode != BURST_OFF && getTiming() == AUTO_TIMING) {
|
// burst and auto
|
||||||
|
if ((burstMode == BURST_INTERNAL || burstMode == BURST_EXTERNAL) &&
|
||||||
|
getTiming() == AUTO_TIMING) {
|
||||||
return get64BitReg(SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG) /
|
return get64BitReg(SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG) /
|
||||||
(1E-9 * systemFrequency);
|
(1E-9 * systemFrequency);
|
||||||
}
|
}
|
||||||
|
// burst-trigger, continuous
|
||||||
return burstPeriodReg / (1E-9 * systemFrequency);
|
return burstPeriodReg / (1E-9 * systemFrequency);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1210,7 +1238,7 @@ void setTiming(enum timingMode arg) {
|
|||||||
get64BitReg(SET_TRIGGER_DELAY_LSB_REG, SET_TRIGGER_DELAY_MSB_REG);
|
get64BitReg(SET_TRIGGER_DELAY_LSB_REG, SET_TRIGGER_DELAY_MSB_REG);
|
||||||
}
|
}
|
||||||
// auto and burst
|
// auto and burst
|
||||||
else if (burstMode != BURST_OFF) {
|
else if (burstMode == BURST_INTERNAL || burstMode == BURST_EXTERNAL) {
|
||||||
numBurstsReg = get64BitReg(SET_FRAMES_LSB_REG, SET_FRAMES_MSB_REG);
|
numBurstsReg = get64BitReg(SET_FRAMES_LSB_REG, SET_FRAMES_MSB_REG);
|
||||||
burstPeriodReg = get64BitReg(SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG);
|
burstPeriodReg = get64BitReg(SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG);
|
||||||
}
|
}
|
||||||
@ -1237,7 +1265,7 @@ void setTiming(enum timingMode arg) {
|
|||||||
LOG(logINFO, ("\tTriggers reg: %lld, Delay reg: %lldns\n",
|
LOG(logINFO, ("\tTriggers reg: %lld, Delay reg: %lldns\n",
|
||||||
getNumTriggers(), getDelayAfterTrigger()));
|
getNumTriggers(), getDelayAfterTrigger()));
|
||||||
// burst
|
// burst
|
||||||
if (burstMode != BURST_OFF) {
|
if (burstMode == BURST_INTERNAL || burstMode == BURST_EXTERNAL) {
|
||||||
LOG(logINFO, ("\tFrame reg: 1, Period reg: 0\n"))
|
LOG(logINFO, ("\tFrame reg: 1, Period reg: 0\n"))
|
||||||
set64BitReg(1, SET_FRAMES_LSB_REG, SET_FRAMES_MSB_REG);
|
set64BitReg(1, SET_FRAMES_LSB_REG, SET_FRAMES_MSB_REG);
|
||||||
set64BitReg(0, SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG);
|
set64BitReg(0, SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG);
|
||||||
@ -1249,7 +1277,7 @@ void setTiming(enum timingMode arg) {
|
|||||||
set64BitReg(1, SET_CYCLES_LSB_REG, SET_CYCLES_MSB_REG);
|
set64BitReg(1, SET_CYCLES_LSB_REG, SET_CYCLES_MSB_REG);
|
||||||
set64BitReg(0, SET_TRIGGER_DELAY_LSB_REG, SET_TRIGGER_DELAY_MSB_REG);
|
set64BitReg(0, SET_TRIGGER_DELAY_LSB_REG, SET_TRIGGER_DELAY_MSB_REG);
|
||||||
// burst
|
// burst
|
||||||
if (burstMode != BURST_OFF) {
|
if (burstMode == BURST_INTERNAL || burstMode == BURST_EXTERNAL) {
|
||||||
set64BitReg(numBurstsReg, SET_FRAMES_LSB_REG, SET_FRAMES_MSB_REG);
|
set64BitReg(numBurstsReg, SET_FRAMES_LSB_REG, SET_FRAMES_MSB_REG);
|
||||||
set64BitReg(burstPeriodReg, SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG);
|
set64BitReg(burstPeriodReg, SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG);
|
||||||
LOG(logINFO, ("\tFrames reg (bursts): %lld, Period reg(burst "
|
LOG(logINFO, ("\tFrames reg (bursts): %lld, Period reg(burst "
|
||||||
@ -1818,7 +1846,8 @@ int configureASICVetoReference(int chipIndex, int *gainIndices, int *values) {
|
|||||||
("Unknown gain index %d for channel %d\n", gainIndices[i], i));
|
("Unknown gain index %d for channel %d\n", gainIndices[i], i));
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
revValues[NCHAN - 1 - i] |= gainValue; // reversed list, so NCHAN - 1 - i
|
revValues[NCHAN - 1 - i] |=
|
||||||
|
gainValue; // reversed list, so NCHAN - 1 - i
|
||||||
LOG(logDEBUG2, ("Values[%d]: 0x%x\n", i, revValues[i]));
|
LOG(logDEBUG2, ("Values[%d]: 0x%x\n", i, revValues[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2051,15 +2080,18 @@ int setBurstModeinFPGA(enum burstMode value) {
|
|||||||
uint32_t addr = ASIC_CONFIG_REG;
|
uint32_t addr = ASIC_CONFIG_REG;
|
||||||
uint32_t runmode = 0;
|
uint32_t runmode = 0;
|
||||||
switch (value) {
|
switch (value) {
|
||||||
case BURST_OFF:
|
|
||||||
runmode = ASIC_CONFIG_RUN_MODE_CONT_VAL;
|
|
||||||
break;
|
|
||||||
case BURST_INTERNAL:
|
case BURST_INTERNAL:
|
||||||
runmode = ASIC_CONFIG_RUN_MODE_INT_BURST_VAL;
|
runmode = ASIC_CONFIG_RUN_MODE_INT_BURST_VAL;
|
||||||
break;
|
break;
|
||||||
case BURST_EXTERNAL:
|
case BURST_EXTERNAL:
|
||||||
runmode = ASIC_CONFIG_RUN_MODE_EXT_BURST_VAL;
|
runmode = ASIC_CONFIG_RUN_MODE_EXT_BURST_VAL;
|
||||||
break;
|
break;
|
||||||
|
case CONTINUOUS_INTERNAL:
|
||||||
|
runmode = ASIC_CONFIG_RUN_MODE_INT_CONT_VAL;
|
||||||
|
break;
|
||||||
|
case CONTINUOUS_EXTERNAL:
|
||||||
|
runmode = ASIC_CONFIG_RUN_MODE_EXT_CONT_VAL;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
LOG(logERROR, ("Unknown burst mode %d\n", value));
|
LOG(logERROR, ("Unknown burst mode %d\n", value));
|
||||||
return FAIL;
|
return FAIL;
|
||||||
@ -2073,16 +2105,20 @@ int setBurstModeinFPGA(enum burstMode value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int setBurstMode(enum burstMode burst) {
|
int setBurstMode(enum burstMode burst) {
|
||||||
LOG(logINFO, ("Setting burst mode to %s\n",
|
LOG(logINFO,
|
||||||
burst == BURST_OFF
|
("Setting burst mode to %s\n",
|
||||||
? "off"
|
(burst == BURST_INTERNAL
|
||||||
: (burst == BURST_INTERNAL ? "internal" : "external")));
|
? "burst_internal"
|
||||||
|
: (burst == BURST_EXTERNAL ? "burst external"
|
||||||
|
: (burst == CONTINUOUS_INTERNAL
|
||||||
|
? "continuous internal"
|
||||||
|
: "continuous external")))));
|
||||||
|
|
||||||
// update
|
// update
|
||||||
int64_t framesReg = 0;
|
int64_t framesReg = 0;
|
||||||
int64_t periodReg = 0;
|
int64_t periodReg = 0;
|
||||||
// burst
|
// burst
|
||||||
if (burstMode != BURST_OFF) {
|
if (burstMode == BURST_INTERNAL || burstMode == BURST_EXTERNAL) {
|
||||||
framesReg = ((bus_r(ASIC_INT_FRAMES_REG) & ASIC_INT_FRAMES_MSK) >>
|
framesReg = ((bus_r(ASIC_INT_FRAMES_REG) & ASIC_INT_FRAMES_MSK) >>
|
||||||
ASIC_INT_FRAMES_OFST);
|
ASIC_INT_FRAMES_OFST);
|
||||||
periodReg =
|
periodReg =
|
||||||
@ -2106,7 +2142,7 @@ int setBurstMode(enum burstMode burst) {
|
|||||||
|
|
||||||
LOG(logINFO, ("\tUpdating registers\n"));
|
LOG(logINFO, ("\tUpdating registers\n"));
|
||||||
// continuous
|
// continuous
|
||||||
if (burstMode == BURST_OFF) {
|
if (burstMode == CONTINUOUS_INTERNAL || burstMode == CONTINUOUS_EXTERNAL) {
|
||||||
set64BitReg(framesReg, SET_FRAMES_LSB_REG, SET_FRAMES_MSB_REG);
|
set64BitReg(framesReg, SET_FRAMES_LSB_REG, SET_FRAMES_MSB_REG);
|
||||||
set64BitReg(periodReg, SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG);
|
set64BitReg(periodReg, SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG);
|
||||||
LOG(logINFO, ("\tFrames reg: %lld, Period reg: %lldns\n",
|
LOG(logINFO, ("\tFrames reg: %lld, Period reg: %lldns\n",
|
||||||
@ -2156,14 +2192,17 @@ int configureASICGlobalSettings() {
|
|||||||
int value = ((filter << ASIC_FILTER_OFST) & ASIC_FILTER_MSK) |
|
int value = ((filter << ASIC_FILTER_OFST) & ASIC_FILTER_MSK) |
|
||||||
((cdsGain << ASIC_CDS_GAIN_OFST) & ASIC_CDS_GAIN_MSK);
|
((cdsGain << ASIC_CDS_GAIN_OFST) & ASIC_CDS_GAIN_MSK);
|
||||||
switch (burstMode) {
|
switch (burstMode) {
|
||||||
case BURST_OFF:
|
|
||||||
value |= (ASIC_CONT_MODE_MSK | ASIC_EXT_TIMING_MSK);
|
|
||||||
break;
|
|
||||||
case BURST_INTERNAL:
|
case BURST_INTERNAL:
|
||||||
break;
|
break;
|
||||||
case BURST_EXTERNAL:
|
case BURST_EXTERNAL:
|
||||||
value |= ASIC_EXT_TIMING_MSK;
|
value |= ASIC_EXT_TIMING_MSK;
|
||||||
break;
|
break;
|
||||||
|
case CONTINUOUS_INTERNAL:
|
||||||
|
value |= ASIC_CONT_MODE_MSK;
|
||||||
|
break;
|
||||||
|
case CONTINUOUS_EXTERNAL:
|
||||||
|
value |= (ASIC_CONT_MODE_MSK | ASIC_EXT_TIMING_MSK);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
LOG(logINFO, ("\tSending Global Chip settings:0x%x (filter:%d, "
|
LOG(logINFO, ("\tSending Global Chip settings:0x%x (filter:%d, "
|
||||||
"cdsgain:%d)\n",
|
"cdsgain:%d)\n",
|
||||||
@ -2212,15 +2251,18 @@ enum burstMode getBurstMode() {
|
|||||||
uint32_t addr = ASIC_CONFIG_REG;
|
uint32_t addr = ASIC_CONFIG_REG;
|
||||||
int runmode = bus_r(addr) & ASIC_CONFIG_RUN_MODE_MSK;
|
int runmode = bus_r(addr) & ASIC_CONFIG_RUN_MODE_MSK;
|
||||||
switch (runmode) {
|
switch (runmode) {
|
||||||
case ASIC_CONFIG_RUN_MODE_CONT_VAL:
|
|
||||||
burstMode = BURST_OFF;
|
|
||||||
break;
|
|
||||||
case ASIC_CONFIG_RUN_MODE_INT_BURST_VAL:
|
case ASIC_CONFIG_RUN_MODE_INT_BURST_VAL:
|
||||||
burstMode = BURST_INTERNAL;
|
burstMode = BURST_INTERNAL;
|
||||||
break;
|
break;
|
||||||
case ASIC_CONFIG_RUN_MODE_EXT_BURST_VAL:
|
case ASIC_CONFIG_RUN_MODE_EXT_BURST_VAL:
|
||||||
burstMode = BURST_EXTERNAL;
|
burstMode = BURST_EXTERNAL;
|
||||||
break;
|
break;
|
||||||
|
case ASIC_CONFIG_RUN_MODE_INT_CONT_VAL:
|
||||||
|
burstMode = CONTINUOUS_INTERNAL;
|
||||||
|
break;
|
||||||
|
case ASIC_CONFIG_RUN_MODE_EXT_CONT_VAL:
|
||||||
|
burstMode = CONTINUOUS_EXTERNAL;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
LOG(logERROR, ("Unknown run mode read from FPGA %d\n", runmode));
|
LOG(logERROR, ("Unknown run mode read from FPGA %d\n", runmode));
|
||||||
return -1;
|
return -1;
|
||||||
@ -2429,9 +2471,13 @@ void *start_timer(void *arg) {
|
|||||||
|
|
||||||
int numRepeats = getNumTriggers();
|
int numRepeats = getNumTriggers();
|
||||||
if (getTiming() == AUTO_TIMING) {
|
if (getTiming() == AUTO_TIMING) {
|
||||||
if (burstMode == BURST_OFF) {
|
// continuous
|
||||||
|
if (burstMode == CONTINUOUS_INTERNAL ||
|
||||||
|
burstMode == CONTINUOUS_EXTERNAL) {
|
||||||
numRepeats = 1;
|
numRepeats = 1;
|
||||||
} else {
|
}
|
||||||
|
// burst
|
||||||
|
else {
|
||||||
numRepeats = getNumBursts();
|
numRepeats = getNumBursts();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2509,8 +2555,8 @@ void *start_timer(void *arg) {
|
|||||||
sendUDPPacket(1, packetData2, vetopacketsize);
|
sendUDPPacket(1, packetData2, vetopacketsize);
|
||||||
}
|
}
|
||||||
LOG(logINFO,
|
LOG(logINFO,
|
||||||
("Sent frame: %d (bursts: %d) [%lld]\n", frameNr, repeatNr,
|
("Sent frame: %d (bursts/ triggers: %d) [%lld]\n", frameNr,
|
||||||
(long long unsigned int)virtual_currentFrameNumber));
|
repeatNr, (long long unsigned int)virtual_currentFrameNumber));
|
||||||
clock_gettime(CLOCK_REALTIME, &end);
|
clock_gettime(CLOCK_REALTIME, &end);
|
||||||
int64_t timeNs = ((end.tv_sec - begin.tv_sec) * 1E9 +
|
int64_t timeNs = ((end.tv_sec - begin.tv_sec) * 1E9 +
|
||||||
(end.tv_nsec - begin.tv_nsec));
|
(end.tv_nsec - begin.tv_nsec));
|
||||||
@ -2555,7 +2601,7 @@ int stopStateMachine() {
|
|||||||
#ifdef VIRTUAL
|
#ifdef VIRTUAL
|
||||||
sharedMemory_setStop(1);
|
sharedMemory_setStop(1);
|
||||||
while (sharedMemory_getStatus() == RUNNING)
|
while (sharedMemory_getStatus() == RUNNING)
|
||||||
;
|
usleep(500);
|
||||||
sharedMemory_setStop(0);
|
sharedMemory_setStop(0);
|
||||||
LOG(logINFO, ("Stopped State Machine\n"));
|
LOG(logINFO, ("Stopped State Machine\n"));
|
||||||
return OK;
|
return OK;
|
||||||
|
@ -46,8 +46,8 @@
|
|||||||
#define DEFAULT_CURRENT_SOURCE (0)
|
#define DEFAULT_CURRENT_SOURCE (0)
|
||||||
#define DEFAULT_TIMING_SOURCE (TIMING_INTERNAL)
|
#define DEFAULT_TIMING_SOURCE (TIMING_INTERNAL)
|
||||||
|
|
||||||
#define DEFAULT_READOUT_C0 (8) //(108333336) // rdo_clk, 108 MHz
|
#define DEFAULT_READOUT_C0 (6) //(144444448) // rdo_clk, 144 MHz
|
||||||
#define DEFAULT_READOUT_C1 (8) //(108333336) // rdo_x2_clk, 108 MHz
|
#define DEFAULT_READOUT_C1 (6) //(144444448) // rdo_x2_clk, 144 MHz
|
||||||
#define DEFAULT_SYSTEM_C0 (5) //(144444448) // run_clk, 144 MHz
|
#define DEFAULT_SYSTEM_C0 (5) //(144444448) // run_clk, 144 MHz
|
||||||
#define DEFAULT_SYSTEM_C1 (10) //(72222224) // chip_clk, 72 MHz
|
#define DEFAULT_SYSTEM_C1 (10) //(72222224) // chip_clk, 72 MHz
|
||||||
#define DEFAULT_SYSTEM_C2 (5) //(144444448) // sync_clk, 144 MHz
|
#define DEFAULT_SYSTEM_C2 (5) //(144444448) // sync_clk, 144 MHz
|
||||||
|
Binary file not shown.
@ -1630,7 +1630,7 @@ int stopStateMachine() {
|
|||||||
sharedMemory_setStop(1);
|
sharedMemory_setStop(1);
|
||||||
// read till status is idle
|
// read till status is idle
|
||||||
while (sharedMemory_getStatus() == RUNNING)
|
while (sharedMemory_getStatus() == RUNNING)
|
||||||
;
|
usleep(500);
|
||||||
sharedMemory_setStop(0);
|
sharedMemory_setStop(0);
|
||||||
LOG(logINFO, ("Stopped State Machine\n"));
|
LOG(logINFO, ("Stopped State Machine\n"));
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
@ -1818,7 +1818,7 @@ int stopStateMachine() {
|
|||||||
sharedMemory_setStop(1);
|
sharedMemory_setStop(1);
|
||||||
// read till status is idle
|
// read till status is idle
|
||||||
while (sharedMemory_getStatus() == RUNNING)
|
while (sharedMemory_getStatus() == RUNNING)
|
||||||
;
|
usleep(500);
|
||||||
sharedMemory_setStop(0);
|
sharedMemory_setStop(0);
|
||||||
LOG(logINFO, ("Stopped State Machine\n"));
|
LOG(logINFO, ("Stopped State Machine\n"));
|
||||||
return OK;
|
return OK;
|
||||||
|
Binary file not shown.
@ -1980,7 +1980,7 @@ int stopStateMachine() {
|
|||||||
sharedMemory_setStop(1);
|
sharedMemory_setStop(1);
|
||||||
// read till status is idle
|
// read till status is idle
|
||||||
while (sharedMemory_getStatus() == RUNNING)
|
while (sharedMemory_getStatus() == RUNNING)
|
||||||
;
|
usleep(500);
|
||||||
sharedMemory_setStop(0);
|
sharedMemory_setStop(0);
|
||||||
LOG(logINFO, ("Stopped State Machine\n"));
|
LOG(logINFO, ("Stopped State Machine\n"));
|
||||||
return OK;
|
return OK;
|
||||||
|
@ -49,6 +49,10 @@
|
|||||||
#define BASE_ASIC_RDO (0x00500) // 0x1806_0500 - 0x1806_050F
|
#define BASE_ASIC_RDO (0x00500) // 0x1806_0500 - 0x1806_050F
|
||||||
// https://git.psi.ch/sls_detectors_firmware/mythen_III_mcb/blob/master/code/hdl/asic_rdo/asic_rdo.vhd
|
// https://git.psi.ch/sls_detectors_firmware/mythen_III_mcb/blob/master/code/hdl/asic_rdo/asic_rdo.vhd
|
||||||
|
|
||||||
|
/** Dead time Free Controller */
|
||||||
|
#define BASE_DEADTIME_FREE_CTRL (0x00580) // 0x1806_0580 - 0x1806_0587
|
||||||
|
// https://git.psi.ch/sls_detectors_firmware/mythen_III_mcb/blob/master/code/hdl/DeadTimeFreeController/DeadTimeFreeCtrl.vhd
|
||||||
|
|
||||||
/* UDP datagram generator */
|
/* UDP datagram generator */
|
||||||
#define BASE_UDP_RAM (0x01000) // 0x1806_1000 - 0x1806_1FFF
|
#define BASE_UDP_RAM (0x01000) // 0x1806_1000 - 0x1806_1FFF
|
||||||
|
|
||||||
@ -140,6 +144,13 @@
|
|||||||
|
|
||||||
#define DTA_OFFSET_REG (0x24 * REG_OFFSET + BASE_CONTROL)
|
#define DTA_OFFSET_REG (0x24 * REG_OFFSET + BASE_CONTROL)
|
||||||
|
|
||||||
|
/* Formatting for data core -----------------------------------------------*/
|
||||||
|
#define FMT_CONFIG_REG (0x00 * REG_OFFSET + BASE_FMT)
|
||||||
|
|
||||||
|
#define FMT_CONFIG_TXN_DELAY_OFST (0)
|
||||||
|
#define FMT_CONFIG_TXN_DELAY_MSK (0x00FFFFFF << FMT_CONFIG_TXN_DELAY_OFST)
|
||||||
|
|
||||||
|
|
||||||
/* Packetizer -------------------------------------------------------------*/
|
/* Packetizer -------------------------------------------------------------*/
|
||||||
|
|
||||||
/* Packetizer Config Register */
|
/* Packetizer Config Register */
|
||||||
@ -460,4 +471,15 @@
|
|||||||
#define ASICRDO_CNFG_RESSTRG_LNGTH_OFST (0)
|
#define ASICRDO_CNFG_RESSTRG_LNGTH_OFST (0)
|
||||||
#define ASICRDO_CNFG_RESSTRG_LNGTH_MSK (0x000000FF << ASICRDO_CNFG_RESSTRG_LNGTH_OFST)
|
#define ASICRDO_CNFG_RESSTRG_LNGTH_MSK (0x000000FF << ASICRDO_CNFG_RESSTRG_LNGTH_OFST)
|
||||||
|
|
||||||
|
|
||||||
|
/** Dead time Free Controller
|
||||||
|
* --------------------------------------------------*/
|
||||||
|
|
||||||
|
#define DEADTIME_CONFIG_REG (0x00 * REG_OFFSET + BASE_DEADTIME_FREE_CTRL)
|
||||||
|
|
||||||
|
#define DEADTIME_FREE_MODE_ENBL_OFST (0)
|
||||||
|
#define DEADTIME_FREE_MODE_ENBL_MSK (0x00000001 << DEADTIME_FREE_MODE_ENBL_OFST)
|
||||||
|
#define DEADTIME_EARLY_EXP_FIN_ERR_OFST (4)
|
||||||
|
#define DEADTIME_EARLY_EXP_FIN_ERR_MSK (0x00000001 << DEADTIME_EARLY_EXP_FIN_ERR_OFST)
|
||||||
|
|
||||||
// clang-format on
|
// clang-format on
|
Binary file not shown.
@ -249,15 +249,15 @@ u_int16_t getHardwareVersionNumber() {
|
|||||||
#ifdef VIRTUAL
|
#ifdef VIRTUAL
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
return bus_r(MCB_SERIAL_NO_REG);
|
return ((bus_r(MCB_SERIAL_NO_REG) & MCB_SERIAL_NO_VRSN_MSK) >>
|
||||||
|
MCB_SERIAL_NO_VRSN_OFST);
|
||||||
}
|
}
|
||||||
|
|
||||||
u_int32_t getDetectorNumber() {
|
u_int32_t getDetectorNumber() {
|
||||||
#ifdef VIRTUAL
|
#ifdef VIRTUAL
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
return ((bus_r(MCB_SERIAL_NO_REG) & MCB_SERIAL_NO_VRSN_MSK) >>
|
return bus_r(MCB_SERIAL_NO_REG);
|
||||||
MCB_SERIAL_NO_VRSN_OFST);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
u_int64_t getDetectorMAC() {
|
u_int64_t getDetectorMAC() {
|
||||||
@ -378,6 +378,7 @@ void setupDetector() {
|
|||||||
clkDivider[SYSTEM_C0] = DEFAULT_SYSTEM_C0;
|
clkDivider[SYSTEM_C0] = DEFAULT_SYSTEM_C0;
|
||||||
clkDivider[SYSTEM_C1] = DEFAULT_SYSTEM_C1;
|
clkDivider[SYSTEM_C1] = DEFAULT_SYSTEM_C1;
|
||||||
clkDivider[SYSTEM_C2] = DEFAULT_SYSTEM_C2;
|
clkDivider[SYSTEM_C2] = DEFAULT_SYSTEM_C2;
|
||||||
|
clkDivider[SYSTEM_C3] = DEFAULT_SYSTEM_C3;
|
||||||
|
|
||||||
highvoltage = 0;
|
highvoltage = 0;
|
||||||
trimmingPrint = logINFO;
|
trimmingPrint = logINFO;
|
||||||
@ -572,239 +573,27 @@ int setDynamicRange(int dr) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* parameters - module, speed, readout */
|
/* set parameters - readout */
|
||||||
|
|
||||||
int setModule(sls_detector_module myMod, char *mess) {
|
int setParallelMode(int mode) {
|
||||||
|
if (mode < 0)
|
||||||
LOG(logINFO, ("Setting module\n"));
|
|
||||||
|
|
||||||
/* future implementation
|
|
||||||
// settings (not yet implemented)
|
|
||||||
setSettings((enum detectorSettings)myMod.reg);
|
|
||||||
if (myMod.reg >= 0) {
|
|
||||||
detectorModules->reg = myMod.reg;
|
|
||||||
}
|
|
||||||
|
|
||||||
// threshold
|
|
||||||
if (myMod.eV >= 0)
|
|
||||||
setThresholdEnergy(myMod.eV);
|
|
||||||
else {
|
|
||||||
// (loading a random trim file) (dont return fail)
|
|
||||||
setSettings(UNDEFINED);
|
|
||||||
LOG(logERROR,
|
|
||||||
("Settings has been changed to undefined (random trim
|
|
||||||
file)\n"));
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
// dacs
|
|
||||||
for (int i = 0; i < NDAC; ++i) {
|
|
||||||
// ignore dacs with -1
|
|
||||||
if (myMod.dacs[i] != -1) {
|
|
||||||
setDAC((enum DACINDEX)i, myMod.dacs[i], 0);
|
|
||||||
if (myMod.dacs[i] != detectorDacs[i]) {
|
|
||||||
sprintf(mess, "Could not set module. Could not set dac %d\n",
|
|
||||||
i);
|
|
||||||
LOG(logERROR, (mess));
|
|
||||||
// setSettings(UNDEFINED);
|
|
||||||
// LOG(logERROR, ("Settings has been changed to undefined\n"));
|
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
LOG(logINFO, ("Setting %s mode\n", (mode ? "Parallel" : "Non Parallel")));
|
||||||
}
|
uint32_t addr = DEADTIME_CONFIG_REG;
|
||||||
}
|
if (mode) {
|
||||||
|
bus_w(addr, bus_r(addr) | DEADTIME_FREE_MODE_ENBL_MSK);
|
||||||
// trimbits
|
|
||||||
if (myMod.nchan == 0) {
|
|
||||||
LOG(logINFO, ("Setting module without trimbits\n"));
|
|
||||||
} else {
|
} else {
|
||||||
// set trimbits
|
bus_w(addr, bus_r(addr) & ~DEADTIME_FREE_MODE_ENBL_MSK);
|
||||||
if (setTrimbits(myMod.chanregs) == FAIL) {
|
|
||||||
sprintf(mess, "Could not set module. Could not set trimbits\n");
|
|
||||||
LOG(logERROR, (mess));
|
|
||||||
// setSettings(UNDEFINED);
|
|
||||||
// LOG(logERROR, ("Settings has been changed to undefined (random "
|
|
||||||
// "trim file)\n"));
|
|
||||||
return FAIL;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int setBit(int ibit, int patword) { return patword |= (1 << ibit); }
|
int getParallelMode() {
|
||||||
|
return ((bus_r(DEADTIME_CONFIG_REG) & DEADTIME_FREE_MODE_ENBL_MSK) >>
|
||||||
int clearBit(int ibit, int patword) { return patword &= ~(1 << ibit); }
|
DEADTIME_FREE_MODE_ENBL_OFST);
|
||||||
|
|
||||||
int setTrimbits(int *trimbits) {
|
|
||||||
LOG(logINFOBLUE, ("Setting trimbits\n"));
|
|
||||||
|
|
||||||
// validate
|
|
||||||
for (int ichan = 0; ichan < ((detectorModules)->nchan); ++ichan) {
|
|
||||||
if (trimbits[ichan] < 0 || trimbits[ichan] > 63) {
|
|
||||||
LOG(logERROR, ("Trimbit value (%d) for channel %d is invalid\n",
|
|
||||||
trimbits[ichan], ichan));
|
|
||||||
return FAIL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
LOG(logINFO, ("Trimbits validated\n"));
|
|
||||||
trimmingPrint = logDEBUG5;
|
|
||||||
|
|
||||||
uint64_t patword = 0;
|
|
||||||
int iaddr = 0;
|
|
||||||
for (int ichip = 0; ichip < NCHIP; ichip++) {
|
|
||||||
LOG(logDEBUG1, (" Chip %d\n", ichip));
|
|
||||||
iaddr = 0;
|
|
||||||
patword = 0;
|
|
||||||
writePatternWord(iaddr++, patword);
|
|
||||||
|
|
||||||
// chip select
|
|
||||||
patword = setBit(SIGNAL_TBLoad_1 + ichip, patword);
|
|
||||||
writePatternWord(iaddr++, patword);
|
|
||||||
|
|
||||||
// reset trimbits
|
|
||||||
patword = setBit(SIGNAL_resStorage, patword);
|
|
||||||
patword = setBit(SIGNAL_resCounter, patword);
|
|
||||||
writePatternWord(iaddr++, patword);
|
|
||||||
writePatternWord(iaddr++, patword);
|
|
||||||
patword = clearBit(SIGNAL_resStorage, patword);
|
|
||||||
patword = clearBit(SIGNAL_resCounter, patword);
|
|
||||||
writePatternWord(iaddr++, patword);
|
|
||||||
writePatternWord(iaddr++, patword);
|
|
||||||
|
|
||||||
// select first channel
|
|
||||||
patword = setBit(SIGNAL_CHSserialIN, patword);
|
|
||||||
writePatternWord(iaddr++, patword);
|
|
||||||
// 1 clk pulse
|
|
||||||
patword = setBit(SIGNAL_CHSclk, patword);
|
|
||||||
writePatternWord(iaddr++, patword);
|
|
||||||
patword = clearBit(SIGNAL_CHSclk, patword);
|
|
||||||
// clear 1st channel
|
|
||||||
writePatternWord(iaddr++, patword);
|
|
||||||
patword = clearBit(SIGNAL_CHSserialIN, patword);
|
|
||||||
// 2 clk pulses
|
|
||||||
for (int i = 0; i < 2; i++) {
|
|
||||||
patword = setBit(SIGNAL_CHSclk, patword);
|
|
||||||
writePatternWord(iaddr++, patword);
|
|
||||||
patword = clearBit(SIGNAL_CHSclk, patword);
|
|
||||||
writePatternWord(iaddr++, patword);
|
|
||||||
}
|
|
||||||
|
|
||||||
// for each channel (all chips)
|
|
||||||
for (int ich = 0; ich < NCHAN_1_COUNTER; ich++) {
|
|
||||||
LOG(logDEBUG1, (" Chip %d, Channel %d\n", ichip, ich));
|
|
||||||
int val = trimbits[ichip * NCHAN_1_COUNTER * NCOUNTERS +
|
|
||||||
NCOUNTERS * ich] +
|
|
||||||
trimbits[ichip * NCHAN_1_COUNTER * NCOUNTERS +
|
|
||||||
NCOUNTERS * ich + 1] *
|
|
||||||
64 +
|
|
||||||
trimbits[ichip * NCHAN_1_COUNTER * NCOUNTERS +
|
|
||||||
NCOUNTERS * ich + 2] *
|
|
||||||
64 * 64;
|
|
||||||
|
|
||||||
// push 6 0 bits
|
|
||||||
for (int i = 0; i < 6; i++) {
|
|
||||||
patword = clearBit(SIGNAL_serialIN, patword);
|
|
||||||
patword = clearBit(SIGNAL_clk, patword);
|
|
||||||
writePatternWord(iaddr++, patword);
|
|
||||||
patword = setBit(SIGNAL_clk, patword);
|
|
||||||
writePatternWord(iaddr++, patword);
|
|
||||||
}
|
|
||||||
|
|
||||||
// deserialize
|
|
||||||
for (int i = 0; i < 18; i++) {
|
|
||||||
if (val & (1 << i)) {
|
|
||||||
patword = setBit(SIGNAL_serialIN, patword);
|
|
||||||
} else {
|
|
||||||
patword = clearBit(SIGNAL_serialIN, patword);
|
|
||||||
}
|
|
||||||
patword = clearBit(SIGNAL_clk, patword);
|
|
||||||
writePatternWord(iaddr++, patword);
|
|
||||||
|
|
||||||
patword = setBit(SIGNAL_clk, patword);
|
|
||||||
writePatternWord(iaddr++, patword);
|
|
||||||
}
|
|
||||||
writePatternWord(iaddr++, patword);
|
|
||||||
writePatternWord(iaddr++, patword);
|
|
||||||
|
|
||||||
// move to next channel
|
|
||||||
for (int i = 0; i < 3; i++) {
|
|
||||||
patword = setBit(SIGNAL_CHSclk, patword);
|
|
||||||
writePatternWord(iaddr++, patword);
|
|
||||||
patword = clearBit(SIGNAL_CHSclk, patword);
|
|
||||||
writePatternWord(iaddr++, patword);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// chip unselect
|
|
||||||
patword = clearBit(SIGNAL_TBLoad_1 + ichip, patword);
|
|
||||||
writePatternWord(iaddr++, patword);
|
|
||||||
|
|
||||||
// last iaddr check
|
|
||||||
if (iaddr >= MAX_PATTERN_LENGTH) {
|
|
||||||
LOG(logERROR, ("Addr 0x%x is past max_address_length 0x%x!\n",
|
|
||||||
iaddr, MAX_PATTERN_LENGTH));
|
|
||||||
trimmingPrint = logINFO;
|
|
||||||
return FAIL;
|
|
||||||
}
|
|
||||||
|
|
||||||
// set pattern wait address
|
|
||||||
for (int i = 0; i <= 2; i++)
|
|
||||||
setPatternWaitAddress(i, MAX_PATTERN_LENGTH - 1);
|
|
||||||
|
|
||||||
// pattern loop
|
|
||||||
for (int i = 0; i <= 2; i++) {
|
|
||||||
int stop = MAX_PATTERN_LENGTH - 1, nloop = 0;
|
|
||||||
setPatternLoop(i, &stop, &stop, &nloop);
|
|
||||||
}
|
|
||||||
|
|
||||||
// pattern limits
|
|
||||||
{
|
|
||||||
int start = 0, nloop = 0;
|
|
||||||
setPatternLoop(-1, &start, &iaddr, &nloop);
|
|
||||||
}
|
|
||||||
// send pattern to the chips
|
|
||||||
startPattern();
|
|
||||||
}
|
|
||||||
|
|
||||||
// copy trimbits locally
|
|
||||||
for (int ichan = 0; ichan < ((detectorModules)->nchan); ++ichan) {
|
|
||||||
detectorChans[ichan] = trimbits[ichan];
|
|
||||||
}
|
|
||||||
trimmingPrint = logINFO;
|
|
||||||
LOG(logINFO, ("All trimbits have been loaded\n"));
|
|
||||||
return OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int setAllTrimbits(int val) {
|
/* parameters - timer */
|
||||||
int *trimbits = malloc(sizeof(int) * ((detectorModules)->nchan));
|
|
||||||
for (int ichan = 0; ichan < ((detectorModules)->nchan); ++ichan) {
|
|
||||||
trimbits[ichan] = val;
|
|
||||||
}
|
|
||||||
if (setTrimbits(trimbits) == FAIL) {
|
|
||||||
LOG(logERROR, ("Could not set all trimbits to %d\n", val));
|
|
||||||
free(trimbits);
|
|
||||||
return FAIL;
|
|
||||||
}
|
|
||||||
// setSettings(UNDEFINED);
|
|
||||||
// LOG(logERROR, ("Settings has been changed to undefined (random "
|
|
||||||
// "trim file)\n"));
|
|
||||||
LOG(logINFO, ("All trimbits have been set to %d\n", val));
|
|
||||||
free(trimbits);
|
|
||||||
return OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
int getAllTrimbits() {
|
|
||||||
int value = detectorChans[0];
|
|
||||||
if (detectorModules) {
|
|
||||||
for (int ichan = 0; ichan < ((detectorModules)->nchan); ichan++) {
|
|
||||||
if (detectorChans[ichan] != value) {
|
|
||||||
value = -1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
LOG(logINFO, ("Value of all Trimbits: %d\n", value));
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setNumFrames(int64_t val) {
|
void setNumFrames(int64_t val) {
|
||||||
if (val > 0) {
|
if (val > 0) {
|
||||||
@ -1147,6 +936,240 @@ int64_t getMeasurementTime() {
|
|||||||
(1E-9 * FIXED_PLL_FREQUENCY);
|
(1E-9 * FIXED_PLL_FREQUENCY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* parameters - module, speed, readout */
|
||||||
|
|
||||||
|
int setModule(sls_detector_module myMod, char *mess) {
|
||||||
|
|
||||||
|
LOG(logINFO, ("Setting module\n"));
|
||||||
|
|
||||||
|
/* future implementation
|
||||||
|
// settings (not yet implemented)
|
||||||
|
setSettings((enum detectorSettings)myMod.reg);
|
||||||
|
if (myMod.reg >= 0) {
|
||||||
|
detectorModules->reg = myMod.reg;
|
||||||
|
}
|
||||||
|
|
||||||
|
// threshold
|
||||||
|
if (myMod.eV >= 0)
|
||||||
|
setThresholdEnergy(myMod.eV);
|
||||||
|
else {
|
||||||
|
// (loading a random trim file) (dont return fail)
|
||||||
|
setSettings(UNDEFINED);
|
||||||
|
LOG(logERROR,
|
||||||
|
("Settings has been changed to undefined (random trim
|
||||||
|
file)\n"));
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
// dacs
|
||||||
|
for (int i = 0; i < NDAC; ++i) {
|
||||||
|
// ignore dacs with -1
|
||||||
|
if (myMod.dacs[i] != -1) {
|
||||||
|
setDAC((enum DACINDEX)i, myMod.dacs[i], 0);
|
||||||
|
if (myMod.dacs[i] != detectorDacs[i]) {
|
||||||
|
sprintf(mess, "Could not set module. Could not set dac %d\n",
|
||||||
|
i);
|
||||||
|
LOG(logERROR, (mess));
|
||||||
|
// setSettings(UNDEFINED);
|
||||||
|
// LOG(logERROR, ("Settings has been changed to undefined\n"));
|
||||||
|
return FAIL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// trimbits
|
||||||
|
if (myMod.nchan == 0) {
|
||||||
|
LOG(logINFO, ("Setting module without trimbits\n"));
|
||||||
|
} else {
|
||||||
|
// set trimbits
|
||||||
|
if (setTrimbits(myMod.chanregs) == FAIL) {
|
||||||
|
sprintf(mess, "Could not set module. Could not set trimbits\n");
|
||||||
|
LOG(logERROR, (mess));
|
||||||
|
// setSettings(UNDEFINED);
|
||||||
|
// LOG(logERROR, ("Settings has been changed to undefined (random "
|
||||||
|
// "trim file)\n"));
|
||||||
|
return FAIL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int setBit(int ibit, int patword) { return patword |= (1 << ibit); }
|
||||||
|
|
||||||
|
int clearBit(int ibit, int patword) { return patword &= ~(1 << ibit); }
|
||||||
|
|
||||||
|
int setTrimbits(int *trimbits) {
|
||||||
|
LOG(logINFOBLUE, ("Setting trimbits\n"));
|
||||||
|
|
||||||
|
// validate
|
||||||
|
for (int ichan = 0; ichan < ((detectorModules)->nchan); ++ichan) {
|
||||||
|
if (trimbits[ichan] < 0 || trimbits[ichan] > 63) {
|
||||||
|
LOG(logERROR, ("Trimbit value (%d) for channel %d is invalid\n",
|
||||||
|
trimbits[ichan], ichan));
|
||||||
|
return FAIL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
LOG(logINFO, ("Trimbits validated\n"));
|
||||||
|
trimmingPrint = logDEBUG5;
|
||||||
|
|
||||||
|
uint64_t patword = 0;
|
||||||
|
int iaddr = 0;
|
||||||
|
for (int ichip = 0; ichip < NCHIP; ichip++) {
|
||||||
|
LOG(logDEBUG1, (" Chip %d\n", ichip));
|
||||||
|
iaddr = 0;
|
||||||
|
patword = 0;
|
||||||
|
writePatternWord(iaddr++, patword);
|
||||||
|
|
||||||
|
// chip select
|
||||||
|
patword = setBit(SIGNAL_TBLoad_1 + ichip, patword);
|
||||||
|
writePatternWord(iaddr++, patword);
|
||||||
|
|
||||||
|
// reset trimbits
|
||||||
|
patword = setBit(SIGNAL_resStorage, patword);
|
||||||
|
patword = setBit(SIGNAL_resCounter, patword);
|
||||||
|
writePatternWord(iaddr++, patword);
|
||||||
|
writePatternWord(iaddr++, patword);
|
||||||
|
patword = clearBit(SIGNAL_resStorage, patword);
|
||||||
|
patword = clearBit(SIGNAL_resCounter, patword);
|
||||||
|
writePatternWord(iaddr++, patword);
|
||||||
|
writePatternWord(iaddr++, patword);
|
||||||
|
|
||||||
|
// select first channel
|
||||||
|
patword = setBit(SIGNAL_CHSserialIN, patword);
|
||||||
|
writePatternWord(iaddr++, patword);
|
||||||
|
// 1 clk pulse
|
||||||
|
patword = setBit(SIGNAL_CHSclk, patword);
|
||||||
|
writePatternWord(iaddr++, patword);
|
||||||
|
patword = clearBit(SIGNAL_CHSclk, patword);
|
||||||
|
// clear 1st channel
|
||||||
|
writePatternWord(iaddr++, patword);
|
||||||
|
patword = clearBit(SIGNAL_CHSserialIN, patword);
|
||||||
|
// 2 clk pulses
|
||||||
|
for (int i = 0; i < 2; i++) {
|
||||||
|
patword = setBit(SIGNAL_CHSclk, patword);
|
||||||
|
writePatternWord(iaddr++, patword);
|
||||||
|
patword = clearBit(SIGNAL_CHSclk, patword);
|
||||||
|
writePatternWord(iaddr++, patword);
|
||||||
|
}
|
||||||
|
|
||||||
|
// for each channel (all chips)
|
||||||
|
for (int ich = 0; ich < NCHAN_1_COUNTER; ich++) {
|
||||||
|
LOG(logDEBUG1, (" Chip %d, Channel %d\n", ichip, ich));
|
||||||
|
int val = trimbits[ichip * NCHAN_1_COUNTER * NCOUNTERS +
|
||||||
|
NCOUNTERS * ich] +
|
||||||
|
trimbits[ichip * NCHAN_1_COUNTER * NCOUNTERS +
|
||||||
|
NCOUNTERS * ich + 1] *
|
||||||
|
64 +
|
||||||
|
trimbits[ichip * NCHAN_1_COUNTER * NCOUNTERS +
|
||||||
|
NCOUNTERS * ich + 2] *
|
||||||
|
64 * 64;
|
||||||
|
|
||||||
|
// push 6 0 bits
|
||||||
|
for (int i = 0; i < 6; i++) {
|
||||||
|
patword = clearBit(SIGNAL_serialIN, patword);
|
||||||
|
patword = clearBit(SIGNAL_clk, patword);
|
||||||
|
writePatternWord(iaddr++, patword);
|
||||||
|
patword = setBit(SIGNAL_clk, patword);
|
||||||
|
writePatternWord(iaddr++, patword);
|
||||||
|
}
|
||||||
|
|
||||||
|
// deserialize
|
||||||
|
for (int i = 0; i < 18; i++) {
|
||||||
|
if (val & (1 << i)) {
|
||||||
|
patword = setBit(SIGNAL_serialIN, patword);
|
||||||
|
} else {
|
||||||
|
patword = clearBit(SIGNAL_serialIN, patword);
|
||||||
|
}
|
||||||
|
patword = clearBit(SIGNAL_clk, patword);
|
||||||
|
writePatternWord(iaddr++, patword);
|
||||||
|
|
||||||
|
patword = setBit(SIGNAL_clk, patword);
|
||||||
|
writePatternWord(iaddr++, patword);
|
||||||
|
}
|
||||||
|
writePatternWord(iaddr++, patword);
|
||||||
|
writePatternWord(iaddr++, patword);
|
||||||
|
|
||||||
|
// move to next channel
|
||||||
|
for (int i = 0; i < 3; i++) {
|
||||||
|
patword = setBit(SIGNAL_CHSclk, patword);
|
||||||
|
writePatternWord(iaddr++, patword);
|
||||||
|
patword = clearBit(SIGNAL_CHSclk, patword);
|
||||||
|
writePatternWord(iaddr++, patword);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// chip unselect
|
||||||
|
patword = clearBit(SIGNAL_TBLoad_1 + ichip, patword);
|
||||||
|
writePatternWord(iaddr++, patword);
|
||||||
|
|
||||||
|
// last iaddr check
|
||||||
|
if (iaddr >= MAX_PATTERN_LENGTH) {
|
||||||
|
LOG(logERROR, ("Addr 0x%x is past max_address_length 0x%x!\n",
|
||||||
|
iaddr, MAX_PATTERN_LENGTH));
|
||||||
|
trimmingPrint = logINFO;
|
||||||
|
return FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
// set pattern wait address
|
||||||
|
for (int i = 0; i <= 2; i++)
|
||||||
|
setPatternWaitAddress(i, MAX_PATTERN_LENGTH - 1);
|
||||||
|
|
||||||
|
// pattern loop
|
||||||
|
for (int i = 0; i <= 2; i++) {
|
||||||
|
int stop = MAX_PATTERN_LENGTH - 1, nloop = 0;
|
||||||
|
setPatternLoop(i, &stop, &stop, &nloop);
|
||||||
|
}
|
||||||
|
|
||||||
|
// pattern limits
|
||||||
|
{
|
||||||
|
int start = 0, nloop = 0;
|
||||||
|
setPatternLoop(-1, &start, &iaddr, &nloop);
|
||||||
|
}
|
||||||
|
// send pattern to the chips
|
||||||
|
startPattern();
|
||||||
|
}
|
||||||
|
|
||||||
|
// copy trimbits locally
|
||||||
|
for (int ichan = 0; ichan < ((detectorModules)->nchan); ++ichan) {
|
||||||
|
detectorChans[ichan] = trimbits[ichan];
|
||||||
|
}
|
||||||
|
trimmingPrint = logINFO;
|
||||||
|
LOG(logINFO, ("All trimbits have been loaded\n"));
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int setAllTrimbits(int val) {
|
||||||
|
int *trimbits = malloc(sizeof(int) * ((detectorModules)->nchan));
|
||||||
|
for (int ichan = 0; ichan < ((detectorModules)->nchan); ++ichan) {
|
||||||
|
trimbits[ichan] = val;
|
||||||
|
}
|
||||||
|
if (setTrimbits(trimbits) == FAIL) {
|
||||||
|
LOG(logERROR, ("Could not set all trimbits to %d\n", val));
|
||||||
|
free(trimbits);
|
||||||
|
return FAIL;
|
||||||
|
}
|
||||||
|
// setSettings(UNDEFINED);
|
||||||
|
// LOG(logERROR, ("Settings has been changed to undefined (random "
|
||||||
|
// "trim file)\n"));
|
||||||
|
LOG(logINFO, ("All trimbits have been set to %d\n", val));
|
||||||
|
free(trimbits);
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int getAllTrimbits() {
|
||||||
|
int value = detectorChans[0];
|
||||||
|
if (detectorModules) {
|
||||||
|
for (int ichan = 0; ichan < ((detectorModules)->nchan); ichan++) {
|
||||||
|
if (detectorChans[ichan] != value) {
|
||||||
|
value = -1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
LOG(logINFO, ("Value of all Trimbits: %d\n", value));
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
/* parameters - dac, hv */
|
/* parameters - dac, hv */
|
||||||
void setDAC(enum DACINDEX ind, int val, int mV) {
|
void setDAC(enum DACINDEX ind, int val, int mV) {
|
||||||
if (val < 0) {
|
if (val < 0) {
|
||||||
@ -2044,6 +2067,7 @@ int setClockDivider(enum CLKINDEX ind, int val) {
|
|||||||
clkPhase[SYSTEM_C0] = 0;
|
clkPhase[SYSTEM_C0] = 0;
|
||||||
clkPhase[SYSTEM_C1] = 0;
|
clkPhase[SYSTEM_C1] = 0;
|
||||||
clkPhase[SYSTEM_C2] = 0;
|
clkPhase[SYSTEM_C2] = 0;
|
||||||
|
clkPhase[SYSTEM_C3] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// set the phase in degrees (reset by pll)
|
// set the phase in degrees (reset by pll)
|
||||||
@ -2067,6 +2091,28 @@ int getClockDivider(enum CLKINDEX ind) {
|
|||||||
return clkDivider[ind];
|
return clkDivider[ind];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int getTransmissionDelayFrame() {
|
||||||
|
return ((bus_r(FMT_CONFIG_REG) & FMT_CONFIG_TXN_DELAY_MSK) >>
|
||||||
|
FMT_CONFIG_TXN_DELAY_OFST);
|
||||||
|
}
|
||||||
|
|
||||||
|
int setTransmissionDelayFrame(int value) {
|
||||||
|
if (value < 0 || value > MAX_TIMESLOT_VAL) {
|
||||||
|
LOG(logERROR, ("Transmission delay %d should be in range: 0 - %d\n",
|
||||||
|
value, MAX_TIMESLOT_VAL));
|
||||||
|
return FAIL;
|
||||||
|
}
|
||||||
|
LOG(logINFO, ("Setting transmission delay: %d\n", value));
|
||||||
|
uint32_t addr = FMT_CONFIG_REG;
|
||||||
|
bus_w(addr, bus_r(addr) & ~FMT_CONFIG_TXN_DELAY_MSK);
|
||||||
|
bus_w(addr, (bus_r(addr) | ((value << FMT_CONFIG_TXN_DELAY_OFST) &
|
||||||
|
FMT_CONFIG_TXN_DELAY_MSK)));
|
||||||
|
LOG(logDEBUG1, ("Transmission delay read %d\n",
|
||||||
|
((bus_r(addr) & FMT_CONFIG_TXN_DELAY_MSK) >>
|
||||||
|
FMT_CONFIG_TXN_DELAY_OFST)));
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
/* aquisition */
|
/* aquisition */
|
||||||
|
|
||||||
int startStateMachine() {
|
int startStateMachine() {
|
||||||
@ -2239,7 +2285,7 @@ int stopStateMachine() {
|
|||||||
sharedMemory_setStop(1);
|
sharedMemory_setStop(1);
|
||||||
// read till status is idle
|
// read till status is idle
|
||||||
while (sharedMemory_getStatus() == RUNNING)
|
while (sharedMemory_getStatus() == RUNNING)
|
||||||
;
|
usleep(500);
|
||||||
sharedMemory_setStop(0);
|
sharedMemory_setStop(0);
|
||||||
LOG(logINFO, ("Stopped State Machine\n"));
|
LOG(logINFO, ("Stopped State Machine\n"));
|
||||||
}
|
}
|
||||||
@ -2294,8 +2340,17 @@ enum runStatus getRunStatus() {
|
|||||||
|
|
||||||
// not running
|
// not running
|
||||||
else {
|
else {
|
||||||
|
// error from too short exptime in parallel mode
|
||||||
|
uint32_t deadtimeReg = bus_r(DEADTIME_CONFIG_REG);
|
||||||
|
if ((deadtimeReg & DEADTIME_EARLY_EXP_FIN_ERR_MSK) >>
|
||||||
|
DEADTIME_EARLY_EXP_FIN_ERR_OFST) {
|
||||||
|
LOG(logERROR,
|
||||||
|
("Status: ERROR in Dead Time Reg (too short exptime) %08x\n",
|
||||||
|
deadtimeReg));
|
||||||
|
s = ERROR;
|
||||||
|
}
|
||||||
// stopped or error
|
// stopped or error
|
||||||
if (retval & FLOW_STATUS_FIFO_FULL_MSK) {
|
else if (retval & FLOW_STATUS_FIFO_FULL_MSK) {
|
||||||
LOG(logINFOBLUE, ("Status: STOPPED\n")); // FIFO FULL??
|
LOG(logINFOBLUE, ("Status: STOPPED\n")); // FIFO FULL??
|
||||||
s = STOPPED;
|
s = STOPPED;
|
||||||
} else if (retval & FLOW_STATUS_CSM_BUSY_MSK) {
|
} else if (retval & FLOW_STATUS_CSM_BUSY_MSK) {
|
||||||
|
@ -36,18 +36,20 @@
|
|||||||
#define DEFAULT_DELAY_AFTER_TRIGGER (0)
|
#define DEFAULT_DELAY_AFTER_TRIGGER (0)
|
||||||
#define DEFAULT_HIGH_VOLTAGE (0)
|
#define DEFAULT_HIGH_VOLTAGE (0)
|
||||||
#define DEFAULT_TIMING_MODE (AUTO_TIMING)
|
#define DEFAULT_TIMING_MODE (AUTO_TIMING)
|
||||||
#define DEFAULT_READOUT_C0 (10) //(125000000) // rdo_clk, 125 MHz
|
#define DEFAULT_READOUT_C0 (8) //(125000000) // rdo_clk, 125 MHz
|
||||||
#define DEFAULT_READOUT_C1 (10) //(125000000) // rdo_x2_clk, 125 MHz
|
#define DEFAULT_READOUT_C1 (8) //(125000000) // rdo_x2_clk, 125 MHz
|
||||||
#define DEFAULT_SYSTEM_C0 (4) //(250000000) // run_clk, 250 MHz
|
#define DEFAULT_SYSTEM_C0 (4) //(250000000) // run_clk, 250 MHz
|
||||||
#define DEFAULT_SYSTEM_C1 (8) //(125000000) // chip_clk, 125 MHz
|
#define DEFAULT_SYSTEM_C1 (8) //(125000000) // sync_clk, 125 MHz
|
||||||
#define DEFAULT_SYSTEM_C2 (8) //(125000000) // sync_clk, 125 MHz
|
#define DEFAULT_SYSTEM_C2 (8) //(125000000) // str_clk, 125 MHz
|
||||||
|
#define DEFAULT_SYSTEM_C3 (5) //(200000000) // smp_clk, 200 MHz (only for timing receiver)
|
||||||
#define DEFAULT_ASIC_LATCHING_NUM_PULSES (10)
|
#define DEFAULT_ASIC_LATCHING_NUM_PULSES (10)
|
||||||
#define DEFAULT_MSTR_OTPT_P1_NUM_PULSES (20)
|
#define DEFAULT_MSTR_OTPT_P1_NUM_PULSES (20)
|
||||||
|
|
||||||
/* Firmware Definitions */
|
/* Firmware Definitions */
|
||||||
|
#define MAX_TIMESLOT_VAL (0xFFFFFF)
|
||||||
#define IP_HEADER_SIZE (20)
|
#define IP_HEADER_SIZE (20)
|
||||||
#define FIXED_PLL_FREQUENCY (020000000) // 20MHz
|
#define FIXED_PLL_FREQUENCY (020000000) // 20MHz
|
||||||
#define READOUT_PLL_VCO_FREQ_HZ (1250000000) // 1.25GHz
|
#define READOUT_PLL_VCO_FREQ_HZ (1000000000) // 1GHz
|
||||||
#define SYSTEM_PLL_VCO_FREQ_HZ (1000000000) // 1GHz
|
#define SYSTEM_PLL_VCO_FREQ_HZ (1000000000) // 1GHz
|
||||||
#define MAX_NUM_DESERIALIZERS (40)
|
#define MAX_NUM_DESERIALIZERS (40)
|
||||||
|
|
||||||
@ -104,10 +106,11 @@ enum CLKINDEX {
|
|||||||
SYSTEM_C0,
|
SYSTEM_C0,
|
||||||
SYSTEM_C1,
|
SYSTEM_C1,
|
||||||
SYSTEM_C2,
|
SYSTEM_C2,
|
||||||
|
SYSTEM_C3,
|
||||||
NUM_CLOCKS
|
NUM_CLOCKS
|
||||||
};
|
};
|
||||||
#define CLK_NAMES \
|
#define CLK_NAMES \
|
||||||
"READOUT_C0", "READOUT_C1", "SYSTEM_C0", "SYSTEM_C1", "SYSTEM_C2"
|
"READOUT_C0", "READOUT_C1", "SYSTEM_C0", "SYSTEM_C1", "SYSTEM_C2", "SYSTEM_C3"
|
||||||
enum PLLINDEX { READOUT_PLL, SYSTEM_PLL };
|
enum PLLINDEX { READOUT_PLL, SYSTEM_PLL };
|
||||||
|
|
||||||
/* Struct Definitions */
|
/* Struct Definitions */
|
||||||
|
@ -179,9 +179,11 @@ int setExternalSampling(int val);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// parameters - readout
|
// parameters - readout
|
||||||
#ifdef EIGERD
|
#if defined(EIGERD) || defined(MYTHEN3D)
|
||||||
int setParallelMode(int mode);
|
int setParallelMode(int mode);
|
||||||
int getParallelMode();
|
int getParallelMode();
|
||||||
|
#endif
|
||||||
|
#ifdef EIGERD
|
||||||
int setOverFlowMode(int mode);
|
int setOverFlowMode(int mode);
|
||||||
int getOverFlowMode();
|
int getOverFlowMode();
|
||||||
#endif
|
#endif
|
||||||
@ -277,9 +279,9 @@ int64_t getMeasurementTime();
|
|||||||
int setModule(sls_detector_module myMod, char *mess);
|
int setModule(sls_detector_module myMod, char *mess);
|
||||||
#endif
|
#endif
|
||||||
#ifdef MYTHEN3D
|
#ifdef MYTHEN3D
|
||||||
int setTrimbits(int *trimbits);
|
|
||||||
int setBit(int ibit, int patword);
|
int setBit(int ibit, int patword);
|
||||||
int clearBit(int ibit, int patword);
|
int clearBit(int ibit, int patword);
|
||||||
|
int setTrimbits(int *trimbits);
|
||||||
int setAllTrimbits(int val);
|
int setAllTrimbits(int val);
|
||||||
int getAllTrimbits();
|
int getAllTrimbits();
|
||||||
#endif
|
#endif
|
||||||
@ -531,6 +533,8 @@ int *getBadChannels(int *nch);
|
|||||||
#if defined(JUNGFRAUD) || defined(EIGERD)
|
#if defined(JUNGFRAUD) || defined(EIGERD)
|
||||||
int getTenGigaFlowControl();
|
int getTenGigaFlowControl();
|
||||||
int setTenGigaFlowControl(int value);
|
int setTenGigaFlowControl(int value);
|
||||||
|
#endif
|
||||||
|
#if defined(JUNGFRAUD) || defined(EIGERD) || defined(MYTHEN3D)
|
||||||
int getTransmissionDelayFrame();
|
int getTransmissionDelayFrame();
|
||||||
int setTransmissionDelayFrame(int value);
|
int setTransmissionDelayFrame(int value);
|
||||||
#endif
|
#endif
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#include "sls_detector_defs.h"
|
#include "sls_detector_defs.h"
|
||||||
#include "versionAPI.h"
|
#include "versionAPI.h"
|
||||||
|
|
||||||
|
#include <getopt.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@ -36,9 +37,58 @@ void sigInterruptHandler(int p) {
|
|||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
|
|
||||||
// print version
|
// options
|
||||||
if (argc > 1 && !strcasecmp(argv[1], "-version")) {
|
int portno = DEFAULT_PORTNO;
|
||||||
|
isControlServer = 1;
|
||||||
|
debugflag = 0;
|
||||||
|
checkModuleFlag = 1;
|
||||||
int version = 0;
|
int version = 0;
|
||||||
|
|
||||||
|
// help message
|
||||||
|
char helpMessage[MAX_STR_LENGTH];
|
||||||
|
memset(helpMessage, 0, MAX_STR_LENGTH);
|
||||||
|
sprintf(
|
||||||
|
helpMessage,
|
||||||
|
"Usage: %s [arguments]\n"
|
||||||
|
"Possible arguments are:\n"
|
||||||
|
"\t-v, --version : Software version\n"
|
||||||
|
"\t-p, --port <port> : TCP communication port with client. \n"
|
||||||
|
"\t-d, --devel : Developer mode. Skips firmware checks. \n"
|
||||||
|
"\t-g, --nomodule : [Mythen3][Gotthard2] Generic or No "
|
||||||
|
"Module mode. Skips detector type checks. \n"
|
||||||
|
"\t-f, --phaseshift <value> : [Gotthard] only. Sets phase shift. \n"
|
||||||
|
"\t-s, --stopserver : Stop server. Do not use as created by "
|
||||||
|
"control server \n\n",
|
||||||
|
argv[0]);
|
||||||
|
|
||||||
|
// parse command line for config
|
||||||
|
static struct option long_options[] = {
|
||||||
|
// These options set a flag.
|
||||||
|
// These options don’t set a flag. We distinguish them by their indices.
|
||||||
|
{"help", no_argument, NULL, 'h'},
|
||||||
|
{"version", no_argument, NULL, 'v'},
|
||||||
|
{"port", required_argument, NULL, 'p'},
|
||||||
|
{"devel", no_argument, NULL, 'd'},
|
||||||
|
{"phaseshift", required_argument, NULL, 'f'},
|
||||||
|
{"nomodule", no_argument, NULL, 'g'}, // generic
|
||||||
|
{"stopserver", no_argument, NULL, 's'},
|
||||||
|
{NULL, 0, NULL, 0}};
|
||||||
|
|
||||||
|
optind = 1;
|
||||||
|
// getopt_long stores the option index here
|
||||||
|
int option_index = 0;
|
||||||
|
int c = 0;
|
||||||
|
|
||||||
|
while (c != -1) {
|
||||||
|
c = getopt_long(argc, argv, "hvp:df:gs", long_options, &option_index);
|
||||||
|
|
||||||
|
// Detect the end of the options
|
||||||
|
if (c == -1)
|
||||||
|
break;
|
||||||
|
|
||||||
|
switch (c) {
|
||||||
|
|
||||||
|
case 'v':
|
||||||
#ifdef GOTTHARDD
|
#ifdef GOTTHARDD
|
||||||
version = APIGOTTHARD;
|
version = APIGOTTHARD;
|
||||||
#elif EIGERD
|
#elif EIGERD
|
||||||
@ -49,63 +99,67 @@ int main(int argc, char *argv[]) {
|
|||||||
version = APICTB;
|
version = APICTB;
|
||||||
#elif MOENCHD
|
#elif MOENCHD
|
||||||
version = APIMOENCH;
|
version = APIMOENCH;
|
||||||
|
#elif MYTHEN3D
|
||||||
|
version = APIMYTHEN3;
|
||||||
|
#elif GOTTHARD2D
|
||||||
|
version = APIGOTTHARD2;
|
||||||
#endif
|
#endif
|
||||||
LOG(logINFO, ("SLS Detector Server %s (0x%x)\n", GITBRANCH, version));
|
LOG(logINFOBLUE, ("SLS Detector Server Version: %s (0x%x)\n",
|
||||||
}
|
GITBRANCH, version));
|
||||||
|
exit(EXIT_SUCCESS);
|
||||||
|
|
||||||
int portno = DEFAULT_PORTNO;
|
case 'p':
|
||||||
isControlServer = 1;
|
if (sscanf(optarg, "%d", &portno) != 1) {
|
||||||
debugflag = 0;
|
LOG(logERROR, ("Cannot scan port argument\n%s", helpMessage));
|
||||||
checkModuleFlag = 1;
|
exit(EXIT_FAILURE);
|
||||||
|
|
||||||
// if socket crash, ignores SISPIPE, prevents global signal handler
|
|
||||||
// subsequent read/write to socket gives error - must handle locally
|
|
||||||
signal(SIGPIPE, SIG_IGN);
|
|
||||||
|
|
||||||
// circumvent the basic tests
|
|
||||||
for (int i = 1; i < argc; ++i) {
|
|
||||||
if (!strcasecmp(argv[i], "-stopserver")) {
|
|
||||||
LOG(logINFO, ("Detected stop server\n"));
|
|
||||||
isControlServer = 0;
|
|
||||||
} else if (!strcasecmp(argv[i], "-devel")) {
|
|
||||||
LOG(logINFO, ("Detected developer mode\n"));
|
|
||||||
debugflag = 1;
|
|
||||||
} else if (!strcasecmp(argv[i], "-nomodule")) {
|
|
||||||
LOG(logINFO, ("Detected No Module mode\n"));
|
|
||||||
checkModuleFlag = 0;
|
|
||||||
} else if (!strcasecmp(argv[i], "-port")) {
|
|
||||||
if ((i + 1) >= argc) {
|
|
||||||
LOG(logERROR, ("no port value given. Exiting.\n"));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
if (sscanf(argv[i + 1], "%d", &portno) == 0) {
|
|
||||||
LOG(logERROR,
|
|
||||||
("cannot decode port value %s. Exiting.\n", argv[i + 1]));
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
LOG(logINFO, ("Detected port: %d\n", portno));
|
LOG(logINFO, ("Detected port: %d\n", portno));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'd':
|
||||||
|
LOG(logINFO, ("Detected developer mode\n"));
|
||||||
|
debugflag = 1;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'f':
|
||||||
|
#ifndef GOTTHARDD
|
||||||
|
LOG(logERROR,
|
||||||
|
("Phase shift argument not implemented for this detector\n"));
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
#else
|
||||||
|
if (sscanf(optarg, "%d", &phaseShift) != 1) {
|
||||||
|
LOG(logERROR,
|
||||||
|
("Cannot scan phase shift argument\n%s", helpMessage));
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
#ifdef GOTTHARDD
|
LOG(logINFO, ("Detected phase shift: %d\n", phaseShift));
|
||||||
else if (!strcasecmp(argv[i], "-phaseshift")) {
|
|
||||||
if ((i + 1) >= argc) {
|
|
||||||
LOG(logERROR, ("no phase shift value given. Exiting.\n"));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
if (sscanf(argv[i + 1], "%d", &phaseShift) == 0) {
|
|
||||||
LOG(logERROR, ("cannot decode phase shift value %s. Exiting.\n",
|
|
||||||
argv[i + 1]));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
LOG(logINFO, ("Detected phase shift of %d\n", phaseShift));
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'g':
|
||||||
|
LOG(logINFO, ("Detected generic mode (no module)\n"));
|
||||||
|
checkModuleFlag = 0;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 's':
|
||||||
|
LOG(logINFO, ("Detected stop server\n"));
|
||||||
|
isControlServer = 0;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'h':
|
||||||
|
printf("%s", helpMessage);
|
||||||
|
exit(EXIT_SUCCESS);
|
||||||
|
default:
|
||||||
|
printf("\n%s", helpMessage);
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// control server
|
// control server
|
||||||
if (isControlServer) {
|
if (isControlServer) {
|
||||||
LOG(logINFOBLUE, ("Control Server [%d]\n", portno));
|
LOG(logINFOBLUE, ("Control Server [%d]\n", portno));
|
||||||
|
|
||||||
// Catch signal SIGINT to destroy shm properly
|
// Catch signal SIGINT (Ctrl + c) to destroy shm properly
|
||||||
struct sigaction sa;
|
struct sigaction sa;
|
||||||
sa.sa_flags = 0; // no flags
|
sa.sa_flags = 0; // no flags
|
||||||
sa.sa_handler = sigInterruptHandler; // handler function
|
sa.sa_handler = sigInterruptHandler; // handler function
|
||||||
@ -122,9 +176,18 @@ int main(int argc, char *argv[]) {
|
|||||||
// start stop server process
|
// start stop server process
|
||||||
char cmd[MAX_STR_LENGTH];
|
char cmd[MAX_STR_LENGTH];
|
||||||
memset(cmd, 0, MAX_STR_LENGTH);
|
memset(cmd, 0, MAX_STR_LENGTH);
|
||||||
|
char portCmd[256];
|
||||||
|
memset(portCmd, 0, 256);
|
||||||
|
sprintf(portCmd, "-p%d", portno);
|
||||||
for (int i = 0; i < argc; ++i) {
|
for (int i = 0; i < argc; ++i) {
|
||||||
if (!strcasecmp(argv[i], "-port")) {
|
LOG(logINFOBLUE, ("i:%d argv[i]:%s\n", i, argv[i]));
|
||||||
i += 2;
|
// remove port argument (--port) and [value]
|
||||||
|
if (!strcasecmp(argv[i], "--port")) {
|
||||||
|
++i;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// remove port argument (-p[value])
|
||||||
|
if (!strcasecmp(argv[i], portCmd)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
@ -134,7 +197,7 @@ int main(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
char temp[50];
|
char temp[50];
|
||||||
memset(temp, 0, sizeof(temp));
|
memset(temp, 0, sizeof(temp));
|
||||||
sprintf(temp, " -stopserver -port %d &", portno + 1);
|
sprintf(temp, " --stopserver --port %d &", portno + 1);
|
||||||
strcat(cmd, temp);
|
strcat(cmd, temp);
|
||||||
|
|
||||||
LOG(logDEBUG1, ("Command to start stop server:%s\n", cmd));
|
LOG(logDEBUG1, ("Command to start stop server:%s\n", cmd));
|
||||||
@ -149,6 +212,10 @@ int main(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if socket crash, ignores SISPIPE, prevents global signal handler
|
||||||
|
// subsequent read/write to socket gives error - must handle locally
|
||||||
|
signal(SIGPIPE, SIG_IGN);
|
||||||
|
|
||||||
init_detector();
|
init_detector();
|
||||||
// bind socket
|
// bind socket
|
||||||
sockfd = bindSocket(portno);
|
sockfd = bindSocket(portno);
|
||||||
|
@ -1940,7 +1940,9 @@ int set_num_frames(int file_des) {
|
|||||||
} else {
|
} else {
|
||||||
#ifdef GOTTHARD2D
|
#ifdef GOTTHARD2D
|
||||||
// validate #frames in burst mode
|
// validate #frames in burst mode
|
||||||
if (getBurstMode() != BURST_OFF && arg > MAX_FRAMES_IN_BURST_MODE) {
|
enum burstMode mode = getBurstMode();
|
||||||
|
if ((mode == BURST_INTERNAL || mode == BURST_EXTERNAL) &&
|
||||||
|
arg > MAX_FRAMES_IN_BURST_MODE) {
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
sprintf(mess,
|
sprintf(mess,
|
||||||
"Could not set number of frames %lld. Must be <= %d in "
|
"Could not set number of frames %lld. Must be <= %d in "
|
||||||
@ -3489,12 +3491,12 @@ int set_transmission_delay_frame(int file_des) {
|
|||||||
return printSocketReadError();
|
return printSocketReadError();
|
||||||
LOG(logINFO, ("Setting transmission delay frame: %d\n", arg));
|
LOG(logINFO, ("Setting transmission delay frame: %d\n", arg));
|
||||||
|
|
||||||
#if !defined(EIGERD) && !defined(JUNGFRAUD)
|
#if !defined(EIGERD) && !defined(JUNGFRAUD) && !defined(MYTHEN3D)
|
||||||
functionNotImplemented();
|
functionNotImplemented();
|
||||||
#else
|
#else
|
||||||
// only set
|
// only set
|
||||||
if (Server_VerifyLock() == OK) {
|
if (Server_VerifyLock() == OK) {
|
||||||
#ifdef JUNGFRAUD
|
#if defined(JUNGFRAUD) || defined(MYTHEN3D)
|
||||||
if (arg > MAX_TIMESLOT_VAL) {
|
if (arg > MAX_TIMESLOT_VAL) {
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
sprintf(mess, "Transmission delay %d should be in range: 0 - %d\n",
|
sprintf(mess, "Transmission delay %d should be in range: 0 - %d\n",
|
||||||
@ -3526,7 +3528,7 @@ int get_transmission_delay_frame(int file_des) {
|
|||||||
|
|
||||||
LOG(logDEBUG1, ("Getting transmission delay frame\n"));
|
LOG(logDEBUG1, ("Getting transmission delay frame\n"));
|
||||||
|
|
||||||
#if !defined(EIGERD) && !defined(JUNGFRAUD)
|
#if !defined(EIGERD) && !defined(JUNGFRAUD) && !defined(MYTHEN3D)
|
||||||
functionNotImplemented();
|
functionNotImplemented();
|
||||||
#else
|
#else
|
||||||
// get only
|
// get only
|
||||||
@ -5425,7 +5427,7 @@ int set_parallel_mode(int file_des) {
|
|||||||
return printSocketReadError();
|
return printSocketReadError();
|
||||||
LOG(logINFO, ("Setting parallel mode: %u\n", arg));
|
LOG(logINFO, ("Setting parallel mode: %u\n", arg));
|
||||||
|
|
||||||
#ifndef EIGERD
|
#if !defined(EIGERD) && !defined(MYTHEN3D)
|
||||||
functionNotImplemented();
|
functionNotImplemented();
|
||||||
#else
|
#else
|
||||||
// only set
|
// only set
|
||||||
@ -5456,7 +5458,7 @@ int get_parallel_mode(int file_des) {
|
|||||||
|
|
||||||
LOG(logDEBUG1, ("Getting parallel mode\n"));
|
LOG(logDEBUG1, ("Getting parallel mode\n"));
|
||||||
|
|
||||||
#ifndef EIGERD
|
#if !defined(EIGERD) && !defined(MYTHEN3D)
|
||||||
functionNotImplemented();
|
functionNotImplemented();
|
||||||
#else
|
#else
|
||||||
// get only
|
// get only
|
||||||
@ -6494,7 +6496,7 @@ int set_veto_reference(int file_des) {
|
|||||||
int set_burst_mode(int file_des) {
|
int set_burst_mode(int file_des) {
|
||||||
ret = OK;
|
ret = OK;
|
||||||
memset(mess, 0, sizeof(mess));
|
memset(mess, 0, sizeof(mess));
|
||||||
enum burstMode arg = BURST_OFF;
|
enum burstMode arg = BURST_INTERNAL;
|
||||||
|
|
||||||
if (receiveData(file_des, &arg, sizeof(arg), INT32) < 0)
|
if (receiveData(file_des, &arg, sizeof(arg), INT32) < 0)
|
||||||
return printSocketReadError();
|
return printSocketReadError();
|
||||||
@ -6506,9 +6508,10 @@ int set_burst_mode(int file_des) {
|
|||||||
// only set
|
// only set
|
||||||
if (Server_VerifyLock() == OK) {
|
if (Server_VerifyLock() == OK) {
|
||||||
switch (arg) {
|
switch (arg) {
|
||||||
case BURST_OFF:
|
|
||||||
case BURST_INTERNAL:
|
case BURST_INTERNAL:
|
||||||
case BURST_EXTERNAL:
|
case BURST_EXTERNAL:
|
||||||
|
case CONTINUOUS_INTERNAL:
|
||||||
|
case CONTINUOUS_EXTERNAL:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
modeNotImplemented("Burst mode", (int)arg);
|
modeNotImplemented("Burst mode", (int)arg);
|
||||||
@ -6533,7 +6536,7 @@ int set_burst_mode(int file_des) {
|
|||||||
int get_burst_mode(int file_des) {
|
int get_burst_mode(int file_des) {
|
||||||
ret = OK;
|
ret = OK;
|
||||||
memset(mess, 0, sizeof(mess));
|
memset(mess, 0, sizeof(mess));
|
||||||
enum burstMode retval = BURST_OFF;
|
enum burstMode retval = BURST_INTERNAL;
|
||||||
|
|
||||||
LOG(logDEBUG1, ("Getting burst mode\n"));
|
LOG(logDEBUG1, ("Getting burst mode\n"));
|
||||||
|
|
||||||
@ -6938,6 +6941,16 @@ int get_receiver_parameters(int file_des) {
|
|||||||
if (n < 0)
|
if (n < 0)
|
||||||
return printSocketReadError();
|
return printSocketReadError();
|
||||||
|
|
||||||
|
// additional storage cells
|
||||||
|
#ifdef JUNGFRAUD
|
||||||
|
i32 = getNumAdditionalStorageCells();
|
||||||
|
#else
|
||||||
|
i32 = 0;
|
||||||
|
#endif
|
||||||
|
n += sendData(file_des, &i32, sizeof(i32), INT32);
|
||||||
|
if (n < 0)
|
||||||
|
return printSocketReadError();
|
||||||
|
|
||||||
// analog samples
|
// analog samples
|
||||||
#if defined(CHIPTESTBOARDD) || defined(MOENCHD)
|
#if defined(CHIPTESTBOARDD) || defined(MOENCHD)
|
||||||
i32 = getNumAnalogSamples();
|
i32 = getNumAnalogSamples();
|
||||||
@ -7015,6 +7028,26 @@ int get_receiver_parameters(int file_des) {
|
|||||||
if (n < 0)
|
if (n < 0)
|
||||||
return printSocketReadError();
|
return printSocketReadError();
|
||||||
|
|
||||||
|
// readnlines
|
||||||
|
#ifdef EIGERD
|
||||||
|
i32 = getReadNLines();
|
||||||
|
#else
|
||||||
|
i32 = 0;
|
||||||
|
#endif
|
||||||
|
n += sendData(file_des, &i32, sizeof(i32), INT32);
|
||||||
|
if (n < 0)
|
||||||
|
return printSocketReadError();
|
||||||
|
|
||||||
|
// threshold ev
|
||||||
|
#ifdef EIGERD
|
||||||
|
i32 = getThresholdEnergy();
|
||||||
|
#else
|
||||||
|
i32 = 0;
|
||||||
|
#endif
|
||||||
|
n += sendData(file_des, &i32, sizeof(i32), INT32);
|
||||||
|
if (n < 0)
|
||||||
|
return printSocketReadError();
|
||||||
|
|
||||||
// dynamic range
|
// dynamic range
|
||||||
i32 = setDynamicRange(GET_FLAG);
|
i32 = setDynamicRange(GET_FLAG);
|
||||||
n += sendData(file_des, &i32, sizeof(i32), INT32);
|
n += sendData(file_des, &i32, sizeof(i32), INT32);
|
||||||
@ -7175,6 +7208,26 @@ int get_receiver_parameters(int file_des) {
|
|||||||
if (n < 0)
|
if (n < 0)
|
||||||
return printSocketReadError();
|
return printSocketReadError();
|
||||||
|
|
||||||
|
// scan parameters
|
||||||
|
// scan enable, dac, start, stop, step
|
||||||
|
// scan dac settle time
|
||||||
|
int i32s[5] = {0, 0, 0, 0, 0};
|
||||||
|
i64 = 0;
|
||||||
|
i32s[0] = scan;
|
||||||
|
if (scan) {
|
||||||
|
i32s[1] = scanGlobalIndex;
|
||||||
|
i32s[2] = scanSteps[0];
|
||||||
|
i32s[3] = scanSteps[numScanSteps - 1];
|
||||||
|
i32s[4] = scanSteps[1] - scanSteps[0];
|
||||||
|
i64 = scanSettleTime_ns;
|
||||||
|
}
|
||||||
|
n += sendData(file_des, i32s, sizeof(i32s), INT32);
|
||||||
|
if (n < 0)
|
||||||
|
return printSocketReadError();
|
||||||
|
n += sendData(file_des, &i64, sizeof(i64), INT64);
|
||||||
|
if (n < 0)
|
||||||
|
return printSocketReadError();
|
||||||
|
|
||||||
LOG(logINFO, ("Sent %d bytes for receiver parameters\n", n));
|
LOG(logINFO, ("Sent %d bytes for receiver parameters\n", n));
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
|
@ -27,7 +27,7 @@ target_include_directories(slsDetectorShared PUBLIC
|
|||||||
|
|
||||||
target_link_libraries(slsDetectorShared
|
target_link_libraries(slsDetectorShared
|
||||||
PUBLIC
|
PUBLIC
|
||||||
slsSupportLib
|
slsSupportStatic
|
||||||
pthread
|
pthread
|
||||||
rt
|
rt
|
||||||
slsProjectOptions
|
slsProjectOptions
|
||||||
|
@ -46,14 +46,18 @@ class Detector {
|
|||||||
* belonging to it */
|
* belonging to it */
|
||||||
void freeSharedMemory();
|
void freeSharedMemory();
|
||||||
|
|
||||||
|
/** Frees shared memory before loading configuration file. Set up once
|
||||||
|
* normally */
|
||||||
void loadConfig(const std::string &fname);
|
void loadConfig(const std::string &fname);
|
||||||
|
|
||||||
|
/** Shared memory not freed prior. Set up per measurement. */
|
||||||
void loadParameters(const std::string &fname);
|
void loadParameters(const std::string &fname);
|
||||||
|
|
||||||
|
void loadParameters(const std::vector<std::string> ¶meters);
|
||||||
|
|
||||||
Result<std::string> getHostname(Positions pos = {}) const;
|
Result<std::string> getHostname(Positions pos = {}) const;
|
||||||
|
|
||||||
/* Frees shared memory, adds detectors to the list
|
/* Frees shared memory, adds detectors to the list */
|
||||||
* and updates local detector cache */
|
|
||||||
void setHostname(const std::vector<std::string> &hostname);
|
void setHostname(const std::vector<std::string> &hostname);
|
||||||
|
|
||||||
/** connects to n servers at local host starting at specific control port */
|
/** connects to n servers at local host starting at specific control port */
|
||||||
@ -102,12 +106,14 @@ class Detector {
|
|||||||
/** [Jungfrau][Gotthard][Gotthard2] */
|
/** [Jungfrau][Gotthard][Gotthard2] */
|
||||||
Result<defs::detectorSettings> getSettings(Positions pos = {}) const;
|
Result<defs::detectorSettings> getSettings(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [Jungfrau] Options:DYNAMICGAIN, DYNAMICHG0, FIXGAIN1, FIXGAIN2,
|
/** [Jungfrau] DYNAMICGAIN, DYNAMICHG0, FIXGAIN1, FIXGAIN2,
|
||||||
* FORCESWITCHG1, FORCESWITCHG2 [Gotthard] Options: DYNAMICGAIN, HIGHGAIN,
|
* FORCESWITCHG1, FORCESWITCHG2 [Gotthard] \n DYNAMICGAIN, HIGHGAIN,
|
||||||
* LOWGAIN, MEDIUMGAIN, VERYHIGHGAIN [Gotthard2] Options: DYNAMICGAIN,
|
* LOWGAIN, MEDIUMGAIN, VERYHIGHGAIN [Gotthard2] \n DYNAMICGAIN,
|
||||||
* FIXGAIN1, FIXGAIN2 [Moench] Options: G1_HIGHGAIN, G1_LOWGAIN,
|
* FIXGAIN1, FIXGAIN2 [Moench] \n G1_HIGHGAIN, G1_LOWGAIN,
|
||||||
* G2_HIGHCAP_HIGHGAIN, G2_HIGHCAP_LOWGAIN, G2_LOWCAP_HIGHGAIN,
|
* G2_HIGHCAP_HIGHGAIN, G2_HIGHCAP_LOWGAIN, G2_LOWCAP_HIGHGAIN,
|
||||||
* G2_LOWCAP_LOWGAIN, G4_HIGHGAIN, G4_LOWGAIN
|
* G2_LOWCAP_LOWGAIN, G4_HIGHGAIN, G4_LOWGAIN \n [Eiger] Use threshold
|
||||||
|
* command \n [Eiger settings loaded from file found in
|
||||||
|
* settingspath
|
||||||
*/
|
*/
|
||||||
void setSettings(defs::detectorSettings value, Positions pos = {});
|
void setSettings(defs::detectorSettings value, Positions pos = {});
|
||||||
|
|
||||||
@ -125,8 +131,8 @@ class Detector {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* [Eiger][Jungfrau]
|
* [Eiger][Jungfrau]
|
||||||
* Only in client data call back
|
* Include gap pixels in client data call back. Will not be in detector
|
||||||
* Fills in gap pixels in data
|
* streaming, receiver file or streaming. Default is disabled.
|
||||||
*/
|
*/
|
||||||
void setGapPixelsinCallback(const bool enable);
|
void setGapPixelsinCallback(const bool enable);
|
||||||
|
|
||||||
@ -167,14 +173,21 @@ class Detector {
|
|||||||
|
|
||||||
Result<int64_t> getNumberOfFrames(Positions pos = {}) const;
|
Result<int64_t> getNumberOfFrames(Positions pos = {}) const;
|
||||||
|
|
||||||
|
/** In trigger mode, number of frames per trigger. In scan mode, number of
|
||||||
|
* frames is set to number of steps */
|
||||||
void setNumberOfFrames(int64_t value);
|
void setNumberOfFrames(int64_t value);
|
||||||
|
|
||||||
Result<int64_t> getNumberOfTriggers(Positions pos = {}) const;
|
Result<int64_t> getNumberOfTriggers(Positions pos = {}) const;
|
||||||
|
|
||||||
void setNumberOfTriggers(int64_t value);
|
void setNumberOfTriggers(int64_t value);
|
||||||
|
|
||||||
|
/** [Gotthard][Jungfrau][Eiger][CTB][Moench][Gotthard2] \n
|
||||||
|
* [Mythen3] use function with gate index **/
|
||||||
Result<ns> getExptime(Positions pos = {}) const;
|
Result<ns> getExptime(Positions pos = {}) const;
|
||||||
|
|
||||||
|
/** [Gotthard][Jungfrau][Eiger][CTB][Moench][Gotthard2] \n
|
||||||
|
* [Mythen3] sets exptime for all gate signals. To specify gate index, use
|
||||||
|
* function with gate index **/
|
||||||
void setExptime(ns t, Positions pos = {});
|
void setExptime(ns t, Positions pos = {});
|
||||||
|
|
||||||
Result<ns> getPeriod(Positions pos = {}) const;
|
Result<ns> getPeriod(Positions pos = {}) const;
|
||||||
@ -206,13 +219,15 @@ class Detector {
|
|||||||
Result<int> getDynamicRange(Positions pos = {}) const;
|
Result<int> getDynamicRange(Positions pos = {}) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* [Eiger] Options: 4, 8, 16, 32
|
* [Eiger] Options: 4, 8, 16, 32. If i is 32, also sets clkdivider to 2, if
|
||||||
* [Mythen3] Options: 8, 16, 32
|
* 16, sets clkdivider to 1 \n [Mythen3] Options: 8, 16, 32 \n
|
||||||
* [Eiger] If i is 32, also sets clkdivider to 2, if 16, sets clkdivider to
|
* [Jungfrau][Gotthard][Ctb][Moench][Mythen3][Gotthard2] 16
|
||||||
* 1
|
|
||||||
*/
|
*/
|
||||||
void setDynamicRange(int value);
|
void setDynamicRange(int value);
|
||||||
|
|
||||||
|
/** list of possible dynamic ranges for this detector */
|
||||||
|
std::vector<int> getDynamicRangeList() const;
|
||||||
|
|
||||||
Result<defs::timingMode> getTimingMode(Positions pos = {}) const;
|
Result<defs::timingMode> getTimingMode(Positions pos = {}) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -223,17 +238,30 @@ class Detector {
|
|||||||
*/
|
*/
|
||||||
void setTimingMode(defs::timingMode value, Positions pos = {});
|
void setTimingMode(defs::timingMode value, Positions pos = {});
|
||||||
|
|
||||||
|
/** list of possible timing modes for this detector */
|
||||||
|
std::vector<defs::timingMode> getTimingModeList() const;
|
||||||
|
|
||||||
/** [Eiger][Jungfrau] */
|
/** [Eiger][Jungfrau] */
|
||||||
Result<defs::speedLevel> getSpeed(Positions pos = {}) const;
|
Result<defs::speedLevel> getSpeed(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [Eiger][Jungfrau]
|
/** [Eiger][Jungfrau]
|
||||||
* Options: FULL_SPEED, HALF_SPEED, QUARTER_SPEED */
|
* Options: FULL_SPEED, HALF_SPEED, QUARTER_SPEED \n
|
||||||
|
* [Jungfrau] FULL_SPEED option only available from v2.0 boards and with
|
||||||
|
* setting number of interfaces to 2. \n Also overwrites adcphase to
|
||||||
|
* recommended default.
|
||||||
|
*/
|
||||||
void setSpeed(defs::speedLevel value, Positions pos = {});
|
void setSpeed(defs::speedLevel value, Positions pos = {});
|
||||||
|
|
||||||
/** [Gotthard][Jungfrau][CTB][Moench] */
|
/** [Jungfrau][CTB][Moench] */
|
||||||
Result<int> getADCPhase(Positions pos = {}) const;
|
Result<int> getADCPhase(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [Gotthard][Jungfrau][CTB][Moench] */
|
/** [Gotthard][Jungfrau][CTB][Moench]
|
||||||
|
* [Jungfrau] Absolute phase shift. Changing Speed also resets adcphase to
|
||||||
|
* recommended defaults. \n
|
||||||
|
* [Ctb][Moench] Absolute phase shift. Changing adcclk also resets adcphase
|
||||||
|
* and sets it to previous values. \n
|
||||||
|
* [Gotthard] Relative phase shift
|
||||||
|
*/
|
||||||
void setADCPhase(int value, Positions pos = {});
|
void setADCPhase(int value, Positions pos = {});
|
||||||
|
|
||||||
/** [Jungfrau][CTB][Moench] */
|
/** [Jungfrau][CTB][Moench] */
|
||||||
@ -242,13 +270,21 @@ class Detector {
|
|||||||
/** [Gotthard][Jungfrau][CTB][Moench] */
|
/** [Gotthard][Jungfrau][CTB][Moench] */
|
||||||
Result<int> getADCPhaseInDegrees(Positions pos = {}) const;
|
Result<int> getADCPhaseInDegrees(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [Gotthard][Jungfrau][CTB][Moench] */
|
/** [Gotthard][Jungfrau][CTB][Moench]
|
||||||
|
* [Jungfrau] Absolute phase shift. Changing Speed also resets adcphase to
|
||||||
|
* recommended defaults. \n
|
||||||
|
* [Ctb][Moench] Absolute phase shift. Changing adcclk also resets adcphase
|
||||||
|
* and sets it to previous values. \n
|
||||||
|
* [Gotthard] Relative phase shift
|
||||||
|
*/
|
||||||
void setADCPhaseInDegrees(int value, Positions pos = {});
|
void setADCPhaseInDegrees(int value, Positions pos = {});
|
||||||
|
|
||||||
/** [CTB][Jungfrau] */
|
/** [CTB][Jungfrau] */
|
||||||
Result<int> getDBITPhase(Positions pos = {}) const;
|
Result<int> getDBITPhase(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [CTB][Jungfrau] */
|
/** [CTB][Jungfrau] Absolute phase shift \n
|
||||||
|
* [CTB] changing dbitclk also resets dbitphase and sets to previous values.
|
||||||
|
*/
|
||||||
void setDBITPhase(int value, Positions pos = {});
|
void setDBITPhase(int value, Positions pos = {});
|
||||||
|
|
||||||
/** [CTB][Jungfrau] */
|
/** [CTB][Jungfrau] */
|
||||||
@ -257,7 +293,9 @@ class Detector {
|
|||||||
/** [CTB][Jungfrau] */
|
/** [CTB][Jungfrau] */
|
||||||
Result<int> getDBITPhaseInDegrees(Positions pos = {}) const;
|
Result<int> getDBITPhaseInDegrees(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [CTB][Jungfrau] */
|
/** [CTB][Jungfrau] Absolute phase shift \n
|
||||||
|
* [CTB] changing dbitclk also resets dbitphase and sets to previous values.
|
||||||
|
*/
|
||||||
void setDBITPhaseInDegrees(int value, Positions pos = {});
|
void setDBITPhaseInDegrees(int value, Positions pos = {});
|
||||||
|
|
||||||
/** [Mythen3][Gotthard2] Hz */
|
/** [Mythen3][Gotthard2] Hz */
|
||||||
@ -311,6 +349,9 @@ class Detector {
|
|||||||
* Only for virtual servers */
|
* Only for virtual servers */
|
||||||
void setImageTestMode(const int value, Positions pos = {});
|
void setImageTestMode(const int value, Positions pos = {});
|
||||||
|
|
||||||
|
/** gets list of temperature indices for this detector */
|
||||||
|
std::vector<defs::dacIndex> getTemperatureList() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (Degrees)
|
* (Degrees)
|
||||||
* [Gotthard] Options: TEMPERATURE_ADC, TEMPERATURE_FPGA
|
* [Gotthard] Options: TEMPERATURE_ADC, TEMPERATURE_FPGA
|
||||||
@ -322,7 +363,7 @@ class Detector {
|
|||||||
*/
|
*/
|
||||||
Result<int> getTemperature(defs::dacIndex index, Positions pos = {}) const;
|
Result<int> getTemperature(defs::dacIndex index, Positions pos = {}) const;
|
||||||
|
|
||||||
/** gets list of dac indices for this detector */
|
/** gets list of dac enums for this detector */
|
||||||
std::vector<defs::dacIndex> getDacList() const;
|
std::vector<defs::dacIndex> getDacList() const;
|
||||||
|
|
||||||
Result<int> getDAC(defs::dacIndex index, bool mV, Positions pos = {}) const;
|
Result<int> getDAC(defs::dacIndex index, bool mV, Positions pos = {}) const;
|
||||||
@ -352,6 +393,14 @@ class Detector {
|
|||||||
void setExternalSignalFlags(int signalIndex, defs::externalSignalFlag value,
|
void setExternalSignalFlags(int signalIndex, defs::externalSignalFlag value,
|
||||||
Positions pos = {});
|
Positions pos = {});
|
||||||
|
|
||||||
|
/** [Eiger][Mythen3] */
|
||||||
|
Result<bool> getParallelMode(Positions pos = {}) const;
|
||||||
|
|
||||||
|
/** [Eiger][Mythen3]
|
||||||
|
* [Mythen3] If exposure time is too short, acquisition will return with an
|
||||||
|
* ERROR and take fewer frames than expected */
|
||||||
|
void setParallelMode(bool value, Positions pos = {});
|
||||||
|
|
||||||
/**************************************************
|
/**************************************************
|
||||||
* *
|
* *
|
||||||
* Acquisition *
|
* Acquisition *
|
||||||
@ -373,32 +422,39 @@ class Detector {
|
|||||||
* acquisition */
|
* acquisition */
|
||||||
void clearAcquiringFlag();
|
void clearAcquiringFlag();
|
||||||
|
|
||||||
/** Non Blocking: Start receiver listener*/
|
/** Non Blocking: Start receiver listener and create data file if file write
|
||||||
|
* enabled */
|
||||||
void startReceiver();
|
void startReceiver();
|
||||||
|
|
||||||
/** Non Blocking: Stop receiver listener */
|
/** Non Blocking: Stops receiver listener for detector data packets and
|
||||||
|
closes current data file (if file write enabled). */
|
||||||
void stopReceiver();
|
void stopReceiver();
|
||||||
|
|
||||||
/** Non blocking: start detector acquisition
|
/** Non blocking: start detector acquisition. Status changes to RUNNING or
|
||||||
* detector status changes from RUNNING to IDLE when finished */
|
* WAITING and automatically returns to idle at the end of acquisition. */
|
||||||
void startDetector();
|
void startDetector();
|
||||||
|
|
||||||
/** Non blocking: abort detector acquisition */
|
/** Non blocking: Abort detector acquisition. Status changes to IDLE or
|
||||||
|
* STOPPED */
|
||||||
void stopDetector();
|
void stopDetector();
|
||||||
|
|
||||||
|
/** IDLE, ERROR, WAITING, RUN_FINISHED, TRANSMITTING, RUNNING, STOPPED */
|
||||||
Result<defs::runStatus> getDetectorStatus(Positions pos = {}) const;
|
Result<defs::runStatus> getDetectorStatus(Positions pos = {}) const;
|
||||||
|
|
||||||
|
/** Options: IDLE, TRANSMITTING, RUNNING */
|
||||||
Result<defs::runStatus> getReceiverStatus(Positions pos = {}) const;
|
Result<defs::runStatus> getReceiverStatus(Positions pos = {}) const;
|
||||||
|
|
||||||
Result<int64_t> getFramesCaught(Positions pos = {}) const;
|
Result<int64_t> getFramesCaught(Positions pos = {}) const;
|
||||||
|
|
||||||
|
/** Gets the number of missing packets for each port in receiver. */
|
||||||
Result<std::vector<uint64_t>>
|
Result<std::vector<uint64_t>>
|
||||||
getNumMissingPackets(Positions pos = {}) const;
|
getNumMissingPackets(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [Eiger][Jungfrau] */
|
/** [Eiger][Jungfrau] */
|
||||||
Result<uint64_t> getStartingFrameNumber(Positions pos = {}) const;
|
Result<uint64_t> getStartingFrameNumber(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [Eiger][Jungfrau] */
|
/** [Eiger][Jungfrau] Stopping acquiistion might result in different frame
|
||||||
|
* numbers for different modules.*/
|
||||||
void setStartingFrameNumber(uint64_t value, Positions pos = {});
|
void setStartingFrameNumber(uint64_t value, Positions pos = {});
|
||||||
|
|
||||||
/** [Eiger] Sends an internal software trigger to the detector */
|
/** [Eiger] Sends an internal software trigger to the detector */
|
||||||
@ -424,10 +480,13 @@ class Detector {
|
|||||||
/** [Jungfrau][Gotthard2] */
|
/** [Jungfrau][Gotthard2] */
|
||||||
Result<int> getNumberofUDPInterfaces(Positions pos = {}) const;
|
Result<int> getNumberofUDPInterfaces(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [Jungfrau][Gotthard2] Also restarts client and receiver zmq sockets
|
/** [Jungfrau][Gotthard2] Number of udp interfaces to stream data from
|
||||||
* [Gotthard2] second interface enabled to send veto information via 10gbps
|
* detector. Default is 1. \n Also enables second interface in receiver for
|
||||||
* for debugging. By default it is sent via 2.5gbps if veto enabled
|
* listening (Writes a file per interface if writing enabled). \n Also
|
||||||
* n can be 1 or 2 */
|
* restarts client and receiver zmq sockets if zmq streaming enabled. \n
|
||||||
|
* [Gotthard2] second interface enabled to send veto information via 10Gbps
|
||||||
|
* for debugging. By default, if veto enabled, it is sent via 2.5 gbps
|
||||||
|
* interface. */
|
||||||
void setNumberofUDPInterfaces(int n, Positions pos = {});
|
void setNumberofUDPInterfaces(int n, Positions pos = {});
|
||||||
|
|
||||||
/** [Jungfrau] */
|
/** [Jungfrau] */
|
||||||
@ -521,13 +580,13 @@ class Detector {
|
|||||||
/** [Eiger][CTB][Moench][Mythen3] */
|
/** [Eiger][CTB][Moench][Mythen3] */
|
||||||
void setTenGiga(bool value, Positions pos = {});
|
void setTenGiga(bool value, Positions pos = {});
|
||||||
|
|
||||||
/** [Eiger, Jungfrau] */
|
/** [Eiger][Jungfrau] */
|
||||||
Result<bool> getTenGigaFlowControl(Positions pos = {}) const;
|
Result<bool> getTenGigaFlowControl(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [Eiger, Jungfrau] */
|
/** [Eiger][Jungfrau] */
|
||||||
void setTenGigaFlowControl(bool enable, Positions pos = {});
|
void setTenGigaFlowControl(bool enable, Positions pos = {});
|
||||||
|
|
||||||
/** [Eiger, Jungfrau] */
|
/** [Eiger][Jungfrau][Mythen3] */
|
||||||
Result<int> getTransmissionDelayFrame(Positions pos = {}) const;
|
Result<int> getTransmissionDelayFrame(Positions pos = {}) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -535,6 +594,8 @@ class Detector {
|
|||||||
* streamed out of the module. Options: 0 - 31, each value represenets 1 ms
|
* streamed out of the module. Options: 0 - 31, each value represenets 1 ms
|
||||||
* [Eiger]: Sets the transmission delay of entire frame streamed out for
|
* [Eiger]: Sets the transmission delay of entire frame streamed out for
|
||||||
* both left and right UDP ports. Options: //TODO possible values
|
* both left and right UDP ports. Options: //TODO possible values
|
||||||
|
* [Mythen3] Options: [0-16777215] Each value represents 8 ns (125 MHz
|
||||||
|
* clock), max is 134 ms.
|
||||||
*/
|
*/
|
||||||
void setTransmissionDelayFrame(int value, Positions pos = {});
|
void setTransmissionDelayFrame(int value, Positions pos = {});
|
||||||
|
|
||||||
@ -570,22 +631,24 @@ class Detector {
|
|||||||
Result<std::string> getRxHostname(Positions pos = {}) const;
|
Result<std::string> getRxHostname(Positions pos = {}) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validates and sets the receiver.
|
* Sets receiver hostname or IP address for each module. \n Used for TCP
|
||||||
* Updates local receiver cache parameters
|
* control communication between client and receiver to configure receiver.
|
||||||
* Configures the detector to the receiver as UDP destination
|
* Also updates receiver with detector parameters. \n Also resets any prior
|
||||||
* receiver is receiver hostname or IP address, can include tcp port eg.
|
* receiver property (not on detector). \n receiver is receiver hostname or
|
||||||
* hostname:port
|
* IP address, can include tcp port eg. hostname:port
|
||||||
*/
|
*/
|
||||||
void setRxHostname(const std::string &receiver, Positions pos = {});
|
void setRxHostname(const std::string &receiver, Positions pos = {});
|
||||||
|
|
||||||
/** multiple rx hostnames (same as setRxHostname) */
|
/** multiple rx hostnames. Single element will set it for all */
|
||||||
void setRxHostname(const std::vector<std::string> &name);
|
void setRxHostname(const std::vector<std::string> &name);
|
||||||
|
|
||||||
Result<int> getRxPort(Positions pos = {}) const;
|
Result<int> getRxPort(Positions pos = {}) const;
|
||||||
|
|
||||||
/** Receiver TCP port (for client communication with Receiver)
|
/** TCP port for client-receiver communication. \n
|
||||||
* module_id is -1 for all detectors, ports for each module is calculated
|
* Default is 1954. \n Must be different if multiple receivers on same pc.
|
||||||
* (increments) */
|
* \n Must be first command to set a receiver parameter to be able to
|
||||||
|
* communicate. \n Multi command will automatically increment port for
|
||||||
|
* individual modules.*/
|
||||||
void setRxPort(int port, int module_id = -1);
|
void setRxPort(int port, int module_id = -1);
|
||||||
|
|
||||||
Result<int> getRxFifoDepth(Positions pos = {}) const;
|
Result<int> getRxFifoDepth(Positions pos = {}) const;
|
||||||
@ -595,15 +658,15 @@ class Detector {
|
|||||||
|
|
||||||
Result<bool> getRxSilentMode(Positions pos = {}) const;
|
Result<bool> getRxSilentMode(Positions pos = {}) const;
|
||||||
|
|
||||||
/** receiver prints hardly any information while acquiring */
|
/** Switch on or off receiver text output during acquisition */
|
||||||
void setRxSilentMode(bool value, Positions pos = {});
|
void setRxSilentMode(bool value, Positions pos = {});
|
||||||
|
|
||||||
Result<defs::frameDiscardPolicy>
|
Result<defs::frameDiscardPolicy>
|
||||||
getRxFrameDiscardPolicy(Positions pos = {}) const;
|
getRxFrameDiscardPolicy(Positions pos = {}) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* default NO_DISCARD
|
|
||||||
* Options: NO_DISCARD, DISCARD_EMPTY_FRAMES, DISCARD_PARTIAL_FRAMES
|
* Options: NO_DISCARD, DISCARD_EMPTY_FRAMES, DISCARD_PARTIAL_FRAMES
|
||||||
|
* Default: NO_DISCARD
|
||||||
* discard partial frames is the fastest
|
* discard partial frames is the fastest
|
||||||
*/
|
*/
|
||||||
void setRxFrameDiscardPolicy(defs::frameDiscardPolicy f,
|
void setRxFrameDiscardPolicy(defs::frameDiscardPolicy f,
|
||||||
@ -611,22 +674,28 @@ class Detector {
|
|||||||
|
|
||||||
Result<bool> getPartialFramesPadding(Positions pos = {}) const;
|
Result<bool> getPartialFramesPadding(Positions pos = {}) const;
|
||||||
|
|
||||||
/** padding enabled. Disabling padding is the fastest */
|
/** Default: padding enabled. Disabling padding is the fastest */
|
||||||
void setPartialFramesPadding(bool value, Positions pos = {});
|
void setPartialFramesPadding(bool value, Positions pos = {});
|
||||||
|
|
||||||
Result<int64_t> getRxUDPSocketBufferSize(Positions pos = {}) const;
|
Result<int64_t> getRxUDPSocketBufferSize(Positions pos = {}) const;
|
||||||
|
|
||||||
|
/** UDP socket buffer size in receiver. Tune rmem_default and rmem_max
|
||||||
|
* accordingly */
|
||||||
void setRxUDPSocketBufferSize(int64_t udpsockbufsize, Positions pos = {});
|
void setRxUDPSocketBufferSize(int64_t udpsockbufsize, Positions pos = {});
|
||||||
|
|
||||||
/** TODO:
|
/** TODO:
|
||||||
* Linux kernel allocates twice the amount you set for bookkeeping purposes
|
* Gets actual udp socket buffer size. Double the size of rx_udpsocksize due
|
||||||
|
* to kernel bookkeeping.
|
||||||
*/
|
*/
|
||||||
Result<int64_t> getRxRealUDPSocketBufferSize(Positions pos = {}) const;
|
Result<int64_t> getRxRealUDPSocketBufferSize(Positions pos = {}) const;
|
||||||
|
|
||||||
Result<bool> getRxLock(Positions pos = {});
|
Result<bool> getRxLock(Positions pos = {});
|
||||||
|
|
||||||
/** locks receiver server to client IP */
|
/** Lock receiver to one client IP, 1 locks, 0 unlocks. Default is unlocked.
|
||||||
|
*/
|
||||||
void setRxLock(bool value, Positions pos = {});
|
void setRxLock(bool value, Positions pos = {});
|
||||||
|
|
||||||
|
/** Client IP Address that last communicated with the receiver */
|
||||||
Result<sls::IpAddr> getRxLastClientIP(Positions pos = {}) const;
|
Result<sls::IpAddr> getRxLastClientIP(Positions pos = {}) const;
|
||||||
|
|
||||||
Result<std::array<pid_t, NUM_RX_THREAD_IDS>>
|
Result<std::array<pid_t, NUM_RX_THREAD_IDS>>
|
||||||
@ -645,6 +714,7 @@ class Detector {
|
|||||||
|
|
||||||
Result<std::string> getFilePath(Positions pos = {}) const;
|
Result<std::string> getFilePath(Positions pos = {}) const;
|
||||||
|
|
||||||
|
/** If path does not exist, it will try to create it */
|
||||||
void setFilePath(const std::string &fpath, Positions pos = {});
|
void setFilePath(const std::string &fpath, Positions pos = {});
|
||||||
|
|
||||||
Result<std::string> getFileNamePrefix(Positions pos = {}) const;
|
Result<std::string> getFileNamePrefix(Positions pos = {}) const;
|
||||||
@ -657,16 +727,17 @@ class Detector {
|
|||||||
|
|
||||||
Result<int64_t> getAcquisitionIndex(Positions pos = {}) const;
|
Result<int64_t> getAcquisitionIndex(Positions pos = {}) const;
|
||||||
|
|
||||||
|
/** file or Acquisition index in receiver */
|
||||||
void setAcquisitionIndex(int64_t i, Positions pos = {});
|
void setAcquisitionIndex(int64_t i, Positions pos = {});
|
||||||
|
|
||||||
Result<bool> getFileWrite(Positions pos = {}) const;
|
Result<bool> getFileWrite(Positions pos = {}) const;
|
||||||
|
|
||||||
/** default writes */
|
/** default enabled */
|
||||||
void setFileWrite(bool value, Positions pos = {});
|
void setFileWrite(bool value, Positions pos = {});
|
||||||
|
|
||||||
Result<bool> getMasterFileWrite(Positions pos = {}) const;
|
Result<bool> getMasterFileWrite(Positions pos = {}) const;
|
||||||
|
|
||||||
/* default writes */
|
/* default enabled */
|
||||||
void setMasterFileWrite(bool value, Positions pos = {});
|
void setMasterFileWrite(bool value, Positions pos = {});
|
||||||
|
|
||||||
Result<bool> getFileOverWrite(Positions pos = {}) const;
|
Result<bool> getFileOverWrite(Positions pos = {}) const;
|
||||||
@ -676,7 +747,8 @@ class Detector {
|
|||||||
|
|
||||||
Result<int> getFramesPerFile(Positions pos = {}) const;
|
Result<int> getFramesPerFile(Positions pos = {}) const;
|
||||||
|
|
||||||
/** 0 will set frames per file to unlimited */
|
/** Default depends on detector type. \n 0 will set frames per file to
|
||||||
|
* unlimited */
|
||||||
void setFramesPerFile(int n, Positions pos = {});
|
void setFramesPerFile(int n, Positions pos = {});
|
||||||
|
|
||||||
/**************************************************
|
/**************************************************
|
||||||
@ -688,16 +760,22 @@ class Detector {
|
|||||||
|
|
||||||
Result<bool> getRxZmqDataStream(Positions pos = {}) const;
|
Result<bool> getRxZmqDataStream(Positions pos = {}) const;
|
||||||
|
|
||||||
|
/** Enable/ disable data streaming from receiver via zmq (eg. to GUI or to
|
||||||
|
* another process for further processing). \n This creates/ destroys zmq
|
||||||
|
* streamer threads in receiver. \n Switching to Gui automatically enables
|
||||||
|
* data streaming in receiver. \n Switching back to command line or API
|
||||||
|
* acquire will require disabling data streaming in receiver for fast
|
||||||
|
* applications (if not needed for client data call backs).
|
||||||
|
*/
|
||||||
void setRxZmqDataStream(bool value, Positions pos = {});
|
void setRxZmqDataStream(bool value, Positions pos = {});
|
||||||
|
|
||||||
Result<int> getRxZmqFrequency(Positions pos = {}) const;
|
Result<int> getRxZmqFrequency(Positions pos = {}) const;
|
||||||
|
|
||||||
/** freq is nth frame streamed out of receiver.
|
/** Frequency of frames streamed out from receiver via zmq. \n Default: 1,
|
||||||
* If 0, streaming timer is the timeout,
|
* Means every frame is streamed out. \n If 2, every second frame is
|
||||||
* after which current frame sent out. Default is 0 at 200 ms.
|
* streamed out. \n If 0, streaming timer is the timeout, after which
|
||||||
* Default is 1: send every frame.
|
* current frame is sent out. (default timeout is 200 ms). Usually used for
|
||||||
* If you want just to see some frames for gui purposes, set to 0 (200ms
|
* gui purposes.
|
||||||
* default timer).
|
|
||||||
*/
|
*/
|
||||||
void setRxZmqFrequency(int freq, Positions pos = {});
|
void setRxZmqFrequency(int freq, Positions pos = {});
|
||||||
|
|
||||||
@ -720,14 +798,21 @@ class Detector {
|
|||||||
|
|
||||||
Result<int> getRxZmqPort(Positions pos = {}) const;
|
Result<int> getRxZmqPort(Positions pos = {}) const;
|
||||||
|
|
||||||
/**
|
/** Zmq port for data to be streamed out of the receiver. \n
|
||||||
* module_id is -1 for all detectors, ports for each module is calculated
|
* Also restarts receiver zmq streaming if enabled. \n Default is 30001. \n
|
||||||
* (increments) Restarts receiver zmq sockets only if it was already enabled
|
* Modified only when using an intermediate process after receiver. \n Must
|
||||||
|
* be different for every detector (and udp port). \n module_id is -1 for
|
||||||
|
* all detectors, ports for each module is calculated (increments) Restarts
|
||||||
|
* receiver zmq sockets only if it was already enabled
|
||||||
*/
|
*/
|
||||||
void setRxZmqPort(int port, int module_id = -1);
|
void setRxZmqPort(int port, int module_id = -1);
|
||||||
|
|
||||||
Result<IpAddr> getRxZmqIP(Positions pos = {}) const;
|
Result<IpAddr> getRxZmqIP(Positions pos = {}) const;
|
||||||
|
|
||||||
|
/** Zmq Ip Address from which data is to be streamed out of the receiver. \n
|
||||||
|
* Also restarts receiver zmq streaming if enabled. \n Default is from
|
||||||
|
* rx_hostname. \n Modified only when using an intermediate process between
|
||||||
|
* receiver. */
|
||||||
void setRxZmqIP(const IpAddr ip, Positions pos = {});
|
void setRxZmqIP(const IpAddr ip, Positions pos = {});
|
||||||
|
|
||||||
Result<int> getClientZmqPort(Positions pos = {}) const;
|
Result<int> getClientZmqPort(Positions pos = {}) const;
|
||||||
@ -773,19 +858,13 @@ class Detector {
|
|||||||
/** [Eiger] */
|
/** [Eiger] */
|
||||||
Result<std::string> getSettingsPath(Positions pos = {}) const;
|
Result<std::string> getSettingsPath(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [Eiger] */
|
/** [Eiger] Directory where settings files are loaded from/to */
|
||||||
void setSettingsPath(const std::string &value, Positions pos = {});
|
void setSettingsPath(const std::string &value, Positions pos = {});
|
||||||
|
|
||||||
/** [Eiger] */
|
|
||||||
Result<bool> getParallelMode(Positions pos = {}) const;
|
|
||||||
|
|
||||||
/** [Eiger] */
|
|
||||||
void setParallelMode(bool value, Positions pos = {});
|
|
||||||
|
|
||||||
/** [Eiger] */
|
/** [Eiger] */
|
||||||
Result<bool> getOverFlowMode(Positions pos = {}) const;
|
Result<bool> getOverFlowMode(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [Eiger] */
|
/** [Eiger] Overflow in 32 bit mode. Default is disabled.*/
|
||||||
void setOverFlowMode(bool value, Positions pos = {});
|
void setOverFlowMode(bool value, Positions pos = {});
|
||||||
|
|
||||||
/** [Eiger] */
|
/** [Eiger] */
|
||||||
@ -824,7 +903,9 @@ class Detector {
|
|||||||
/** [Eiger] */
|
/** [Eiger] */
|
||||||
Result<bool> getInterruptSubframe(Positions pos = {}) const;
|
Result<bool> getInterruptSubframe(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [Eiger] when set, the last subframe is interrupted at end of acq */
|
/** [Eiger] Enable last subframe interrupt at required exposure time.
|
||||||
|
* Disabling will wait for last sub frame to finish exposing. Default is
|
||||||
|
* disabled. */
|
||||||
void setInterruptSubframe(const bool enable, Positions pos = {});
|
void setInterruptSubframe(const bool enable, Positions pos = {});
|
||||||
|
|
||||||
/** [Eiger] minimum two frames */
|
/** [Eiger] minimum two frames */
|
||||||
@ -848,8 +929,7 @@ class Detector {
|
|||||||
/** [Eiger] Advanced */
|
/** [Eiger] Advanced */
|
||||||
Result<bool> getPartialReset(Positions pos = {}) const;
|
Result<bool> getPartialReset(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [Eiger] Advanced
|
/** [Eiger] Advanced used for pulsing chips. Default is Complete reset */
|
||||||
* used for pulsing chips */
|
|
||||||
void setPartialReset(bool value, Positions pos = {});
|
void setPartialReset(bool value, Positions pos = {});
|
||||||
|
|
||||||
/** [Eiger] Advanced
|
/** [Eiger] Advanced
|
||||||
@ -909,28 +989,33 @@ class Detector {
|
|||||||
* //TODO naming
|
* //TODO naming
|
||||||
* By default, the on-chip gain switching is active during the entire
|
* By default, the on-chip gain switching is active during the entire
|
||||||
* exposure. This mode disables the on-chip gain switching comparator
|
* exposure. This mode disables the on-chip gain switching comparator
|
||||||
* automatically after 93.75% of exposure time (only for longer than 100us).
|
* automatically after 93.75% of exposure time (only for longer than
|
||||||
|
* 100us).\n
|
||||||
|
* Default is false or this mode disabled(comparator enabled throughout).
|
||||||
|
* true enables " "mode. 0 disables mode.
|
||||||
*/
|
*/
|
||||||
void setAutoCompDisable(bool value, Positions pos = {});
|
void setAutoCompDisable(bool value, Positions pos = {});
|
||||||
|
|
||||||
/** [Jungfrau] Advanced TODO naming */
|
/** [Jungfrau] Advanced TODO naming */
|
||||||
Result<int> getNumberOfAdditionalStorageCells(Positions pos = {}) const;
|
Result<int> getNumberOfAdditionalStorageCells(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [Jungfrau] Advanced */
|
/** [Jungfrau] Advanced \n
|
||||||
|
* Options: 0 - 15. Default: 0. \n
|
||||||
|
* The #images = #frames x #triggers x (#storagecells + 1) */
|
||||||
void setNumberOfAdditionalStorageCells(int value);
|
void setNumberOfAdditionalStorageCells(int value);
|
||||||
|
|
||||||
/** [Jungfrau] Advanced */
|
/** [Jungfrau] Advanced */
|
||||||
Result<int> getStorageCellStart(Positions pos = {}) const;
|
Result<int> getStorageCellStart(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [Jungfrau] Advanced. Sets the storage cell storing the first acquisition
|
/** [Jungfrau] Advanced. Sets the storage cell storing the first acquisition
|
||||||
* of the series. Options: 0-15
|
* of the series. Options: 0-15. Default: 15.
|
||||||
*/
|
*/
|
||||||
void setStorageCellStart(int cell, Positions pos = {});
|
void setStorageCellStart(int cell, Positions pos = {});
|
||||||
|
|
||||||
/** [Jungfrau] Advanced*/
|
/** [Jungfrau] Advanced*/
|
||||||
Result<ns> getStorageCellDelay(Positions pos = {}) const;
|
Result<ns> getStorageCellDelay(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [Jungfrau] Advanced
|
/** [Jungfrau] Advanced \n
|
||||||
* Options: (0-1638375 ns (resolution of 25ns) */
|
* Options: (0-1638375 ns (resolution of 25ns) */
|
||||||
void setStorageCellDelay(ns value, Positions pos = {});
|
void setStorageCellDelay(ns value, Positions pos = {});
|
||||||
|
|
||||||
@ -1004,7 +1089,8 @@ class Detector {
|
|||||||
/** [Gotthard2] */
|
/** [Gotthard2] */
|
||||||
Result<defs::burstMode> getBurstMode(Positions pos = {});
|
Result<defs::burstMode> getBurstMode(Positions pos = {});
|
||||||
|
|
||||||
/** [Gotthard2] BURST_OFF, BURST_INTERNAL (default), BURST_EXTERNAL */
|
/** [Gotthard2] BURST_INTERNAL (default), BURST_EXTERNAL,
|
||||||
|
* CONTINUOUS_INTERNAL, CONTINUOUS_EXTERNAL */
|
||||||
void setBurstMode(defs::burstMode value, Positions pos = {});
|
void setBurstMode(defs::burstMode value, Positions pos = {});
|
||||||
|
|
||||||
/** [Gotthard2] */
|
/** [Gotthard2] */
|
||||||
@ -1059,7 +1145,7 @@ class Detector {
|
|||||||
/** [Mythen3] */
|
/** [Mythen3] */
|
||||||
Result<uint32_t> getCounterMask(Positions pos = {}) const;
|
Result<uint32_t> getCounterMask(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [Mythen3] countermask bit set for each counter enabled */
|
/** [Mythen3] countermask bit set for each counter index enabled */
|
||||||
void setCounterMask(uint32_t countermask, Positions pos = {});
|
void setCounterMask(uint32_t countermask, Positions pos = {});
|
||||||
|
|
||||||
Result<int> getNumberOfGates(Positions pos = {}) const;
|
Result<int> getNumberOfGates(Positions pos = {}) const;
|
||||||
@ -1088,7 +1174,7 @@ class Detector {
|
|||||||
* (internal gating). Gate index: 0-2, -1 for all */
|
* (internal gating). Gate index: 0-2, -1 for all */
|
||||||
void setGateDelay(int gateIndex, ns t, Positions pos = {});
|
void setGateDelay(int gateIndex, ns t, Positions pos = {});
|
||||||
|
|
||||||
/** [Mythen3] gate delay for each gate signal in auto or trigger timing mode
|
/** [Mythen3] gate delay for all gates in auto or trigger timing mode
|
||||||
* (internal gating). Gate index: 0-2, -1 for all */
|
* (internal gating). Gate index: 0-2, -1 for all */
|
||||||
Result<std::array<ns, 3>> getGateDelayForAllGates(Positions pos = {}) const;
|
Result<std::array<ns, 3>> getGateDelayForAllGates(Positions pos = {}) const;
|
||||||
|
|
||||||
@ -1162,7 +1248,7 @@ class Detector {
|
|||||||
/** [CTB] */
|
/** [CTB] */
|
||||||
Result<defs::readoutMode> getReadoutMode(Positions pos = {}) const;
|
Result<defs::readoutMode> getReadoutMode(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [CTB] Options: ANALOG_ONLY = 0, DIGITAL_ONLY = 1, ANALOG_AND_DIGITAL */
|
/** [CTB] Options: ANALOG_ONLY, DIGITAL_ONLY, ANALOG_AND_DIGITAL */
|
||||||
void setReadoutMode(defs::readoutMode value, Positions pos = {});
|
void setReadoutMode(defs::readoutMode value, Positions pos = {});
|
||||||
|
|
||||||
/** [CTB] */
|
/** [CTB] */
|
||||||
@ -1207,7 +1293,8 @@ class Detector {
|
|||||||
/** [CTB] */
|
/** [CTB] */
|
||||||
Result<std::vector<int>> getRxDbitList(Positions pos = {}) const;
|
Result<std::vector<int>> getRxDbitList(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [CTB] list contains the set of bits (0-63) to save */
|
/** [CTB] list contains the set of digital signal bits (0-63) to save, must
|
||||||
|
* be non repetitive */
|
||||||
void setRxDbitList(const std::vector<int> &list, Positions pos = {});
|
void setRxDbitList(const std::vector<int> &list, Positions pos = {});
|
||||||
|
|
||||||
/** [CTB] */
|
/** [CTB] */
|
||||||
@ -1227,7 +1314,7 @@ class Detector {
|
|||||||
/** [CTB] */
|
/** [CTB] */
|
||||||
Result<bool> getLEDEnable(Positions pos = {}) const;
|
Result<bool> getLEDEnable(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [CTB] */
|
/** [CTB] Default is enabled. */
|
||||||
void setLEDEnable(bool enable, Positions pos = {});
|
void setLEDEnable(bool enable, Positions pos = {});
|
||||||
|
|
||||||
/**************************************************
|
/**************************************************
|
||||||
@ -1294,15 +1381,14 @@ class Detector {
|
|||||||
Result<uint64_t> getPatternMask(Positions pos = {});
|
Result<uint64_t> getPatternMask(Positions pos = {});
|
||||||
|
|
||||||
/** [CTB][Moench][Mythen3] Sets the mask applied to every pattern to the
|
/** [CTB][Moench][Mythen3] Sets the mask applied to every pattern to the
|
||||||
* selected bit mask */
|
* selected bits */
|
||||||
void setPatternMask(uint64_t mask, Positions pos = {});
|
void setPatternMask(uint64_t mask, Positions pos = {});
|
||||||
|
|
||||||
/** [CTB][Moench][Mythen3] */
|
/** [CTB][Moench][Mythen3] */
|
||||||
Result<uint64_t> getPatternBitMask(Positions pos = {}) const;
|
Result<uint64_t> getPatternBitMask(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [CTB][Moench][Mythen3] Sets the bitmask that the mask will be applied to
|
/** [CTB][Moench][Mythen3] Selects the bits that will have a pattern mask
|
||||||
* for every pattern
|
* applied to the selected patmask for every pattern. */
|
||||||
*/
|
|
||||||
void setPatternBitMask(uint64_t mask, Positions pos = {});
|
void setPatternBitMask(uint64_t mask, Positions pos = {});
|
||||||
|
|
||||||
/** [Mythen3] */
|
/** [Mythen3] */
|
||||||
@ -1366,26 +1452,30 @@ class Detector {
|
|||||||
* *
|
* *
|
||||||
* ************************************************/
|
* ************************************************/
|
||||||
|
|
||||||
/** [Jungfrau][CTB][Moench] fname is a pof file
|
/** Advanced user Function!
|
||||||
|
* [Jungfrau][CTB][Moench] fname is a pof file
|
||||||
* [Mythen3][Gotthard2] fname is an rbf file
|
* [Mythen3][Gotthard2] fname is an rbf file
|
||||||
*/
|
*/
|
||||||
void programFPGA(const std::string &fname, Positions pos = {});
|
void programFPGA(const std::string &fname, Positions pos = {});
|
||||||
|
|
||||||
/** [Jungfrau][CTB][Moench] */
|
/** [Jungfrau][CTB][Moench] Advanced user Function! */
|
||||||
void resetFPGA(Positions pos = {});
|
void resetFPGA(Positions pos = {});
|
||||||
|
|
||||||
/** [Jungfrau][Gotthard][CTB][Moench][Mythen3][Gotthard2]
|
/** [Jungfrau][Gotthard][CTB][Moench][Mythen3][Gotthard2]
|
||||||
|
* Advanced user Function!
|
||||||
* Copy detector server fname from tftp folder of hostname to detector
|
* Copy detector server fname from tftp folder of hostname to detector
|
||||||
* Also changes respawn server, which is effective after a reboot.
|
* Also changes respawn server, which is effective after a reboot.
|
||||||
*/
|
*/
|
||||||
void copyDetectorServer(const std::string &fname,
|
void copyDetectorServer(const std::string &fname,
|
||||||
const std::string &hostname, Positions pos = {});
|
const std::string &hostname, Positions pos = {});
|
||||||
|
|
||||||
/** [Jungfrau][Gotthard][CTB][Moench][Mythen3][Gotthard2] */
|
/** [Jungfrau][Gotthard][CTB][Moench][Mythen3][Gotthard2] Advanced user
|
||||||
|
* Function! */
|
||||||
void rebootController(Positions pos = {});
|
void rebootController(Positions pos = {});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* [Jungfrau][Gotthard][CTB][Moench]
|
* [Jungfrau][Gotthard][CTB][Moench]
|
||||||
|
* Advanced user Function!
|
||||||
* Updates the firmware, detector server and then reboots detector
|
* Updates the firmware, detector server and then reboots detector
|
||||||
* controller blackfin.
|
* controller blackfin.
|
||||||
* sname is name of detector server binary found on tftp folder of host
|
* sname is name of detector server binary found on tftp folder of host
|
||||||
@ -1397,33 +1487,43 @@ class Detector {
|
|||||||
const std::string &hostname,
|
const std::string &hostname,
|
||||||
const std::string &fname, Positions pos = {});
|
const std::string &fname, Positions pos = {});
|
||||||
|
|
||||||
|
/** Advanced user Function! \n
|
||||||
|
* [Eiger] Address is +0x100 for only left, +0x200 for only right. */
|
||||||
Result<uint32_t> readRegister(uint32_t addr, Positions pos = {}) const;
|
Result<uint32_t> readRegister(uint32_t addr, Positions pos = {}) const;
|
||||||
|
|
||||||
|
/** Advanced user Function! \n
|
||||||
|
* [Eiger] Address is +0x100 for only left, +0x200 for only right. */
|
||||||
void writeRegister(uint32_t addr, uint32_t val, Positions pos = {});
|
void writeRegister(uint32_t addr, uint32_t val, Positions pos = {});
|
||||||
|
|
||||||
|
/** Advanced user Function! */
|
||||||
void setBit(uint32_t addr, int bitnr, Positions pos = {});
|
void setBit(uint32_t addr, int bitnr, Positions pos = {});
|
||||||
|
|
||||||
|
/** Advanced user Function! */
|
||||||
void clearBit(uint32_t addr, int bitnr, Positions pos = {});
|
void clearBit(uint32_t addr, int bitnr, Positions pos = {});
|
||||||
|
|
||||||
/** [Gotthard][Jungfrau][Mythen3][Gotthard2][CTB][Moench] */
|
/** [Gotthard][Jungfrau][Mythen3][Gotthard2][CTB][Moench] Advanced user
|
||||||
|
* Function! */
|
||||||
void executeFirmwareTest(Positions pos = {});
|
void executeFirmwareTest(Positions pos = {});
|
||||||
|
|
||||||
/** [Gotthard][Jungfrau][Mythen3][Gotthard2][CTB][Moench] */
|
/** [Gotthard][Jungfrau][Mythen3][Gotthard2][CTB][Moench] Advanced user
|
||||||
|
* Function! */
|
||||||
void executeBusTest(Positions pos = {});
|
void executeBusTest(Positions pos = {});
|
||||||
|
|
||||||
/** [Gotthard][Jungfrau][CTB][Moench] not possible to read back*/
|
/** [Gotthard][Jungfrau][CTB][Moench] Advanced user Function! not possible
|
||||||
|
* to read back */
|
||||||
void writeAdcRegister(uint32_t addr, uint32_t value, Positions pos = {});
|
void writeAdcRegister(uint32_t addr, uint32_t value, Positions pos = {});
|
||||||
|
|
||||||
|
/** Advanced user Function! */
|
||||||
bool getInitialChecks() const;
|
bool getInitialChecks() const;
|
||||||
|
|
||||||
/** initial compaibility and other server start up checks
|
/** initial compaibility and other server start up checks
|
||||||
* default enabled */
|
* default enabled Advanced user Function! */
|
||||||
void setInitialChecks(const bool value);
|
void setInitialChecks(const bool value);
|
||||||
|
|
||||||
/** [CTB][Moench][Jungfrau] */
|
/** [CTB][Moench][Jungfrau] Advanced user Function! */
|
||||||
Result<uint32_t> getADCInvert(Positions pos = {}) const;
|
Result<uint32_t> getADCInvert(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [CTB][Moench][Jungfrau] */
|
/** [CTB][Moench][Jungfrau] Advanced user Function! */
|
||||||
void setADCInvert(uint32_t value, Positions pos = {});
|
void setADCInvert(uint32_t value, Positions pos = {});
|
||||||
|
|
||||||
/**************************************************
|
/**************************************************
|
||||||
@ -1446,6 +1546,7 @@ class Detector {
|
|||||||
|
|
||||||
Result<bool> getDetectorLock(Positions pos = {}) const;
|
Result<bool> getDetectorLock(Positions pos = {}) const;
|
||||||
|
|
||||||
|
/** lock detector to one client IP. default is unlocked */
|
||||||
void setDetectorLock(bool lock, Positions pos = {});
|
void setDetectorLock(bool lock, Positions pos = {});
|
||||||
|
|
||||||
/** Get last client IP saved on detector server */
|
/** Get last client IP saved on detector server */
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include "CmdProxy.h"
|
#include "CmdProxy.h"
|
||||||
#include "bit_utils.h"
|
|
||||||
#include "TimeHelper.h"
|
#include "TimeHelper.h"
|
||||||
#include "ToString.h"
|
#include "ToString.h"
|
||||||
|
#include "bit_utils.h"
|
||||||
#include "container_utils.h"
|
#include "container_utils.h"
|
||||||
#include "logger.h"
|
#include "logger.h"
|
||||||
#include "sls_detector_defs.h"
|
#include "sls_detector_defs.h"
|
||||||
@ -182,7 +182,7 @@ std::string CmdProxy::VirtualServer(int action) {
|
|||||||
std::string CmdProxy::Acquire(int action) {
|
std::string CmdProxy::Acquire(int action) {
|
||||||
std::ostringstream os;
|
std::ostringstream os;
|
||||||
if (action == defs::HELP_ACTION) {
|
if (action == defs::HELP_ACTION) {
|
||||||
os << cmd << " - Acquire the number of frames set up.\n";
|
os << cmd << "\n\tAcquire the number of frames set up.\n";
|
||||||
} else {
|
} else {
|
||||||
if (det->empty()) {
|
if (det->empty()) {
|
||||||
throw sls::RuntimeError(
|
throw sls::RuntimeError(
|
||||||
@ -203,9 +203,9 @@ std::string CmdProxy::Acquire(int action) {
|
|||||||
return os.str();
|
return os.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string CmdProxy::free(int action) {
|
std::string CmdProxy::Free(int action) {
|
||||||
// This function is purely for help, actual functionality is in the caller
|
// This function is purely for help, actual functionality is in the caller
|
||||||
return "\n\tFree detector shared memory\n";
|
return "free\n\tFree detector shared memory\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string CmdProxy::FirmwareVersion(int action) {
|
std::string CmdProxy::FirmwareVersion(int action) {
|
||||||
@ -332,31 +332,13 @@ std::string CmdProxy::DetectorSize(int action) {
|
|||||||
return os.str();
|
return os.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string CmdProxy::SettingsList(int action) {
|
|
||||||
std::ostringstream os;
|
|
||||||
os << cmd << ' ';
|
|
||||||
if (action == defs::HELP_ACTION) {
|
|
||||||
os << "\n\tList of settings implemented for this detector" << '\n';
|
|
||||||
} else if (action == defs::GET_ACTION) {
|
|
||||||
if (!args.empty()) {
|
|
||||||
WrongNumberOfParameters(0);
|
|
||||||
}
|
|
||||||
auto t = det->getSettingsList();
|
|
||||||
os << ToString(t) << "\n";
|
|
||||||
} else if (action == defs::PUT_ACTION) {
|
|
||||||
throw sls::RuntimeError("Cannot put");
|
|
||||||
} else {
|
|
||||||
throw sls::RuntimeError("Unknown action");
|
|
||||||
}
|
|
||||||
return os.str();
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string CmdProxy::GapPixels(int action) {
|
std::string CmdProxy::GapPixels(int action) {
|
||||||
std::ostringstream os;
|
std::ostringstream os;
|
||||||
os << cmd << ' ';
|
os << cmd << ' ';
|
||||||
if (action == defs::HELP_ACTION) {
|
if (action == defs::HELP_ACTION) {
|
||||||
os << "[0, 1]\n\t[Eiger][Jungfrau] Include Gap pixels only in data "
|
os << "[0, 1]\n\t[Eiger][Jungfrau] Include Gap pixels in client data "
|
||||||
"call back."
|
"call back in Detecor api. Will not be in detector streaming, "
|
||||||
|
"receiver file or streaming. Default is 0. "
|
||||||
<< '\n';
|
<< '\n';
|
||||||
} else if (action == defs::GET_ACTION) {
|
} else if (action == defs::GET_ACTION) {
|
||||||
if (det_id != -1) {
|
if (det_id != -1) {
|
||||||
@ -406,25 +388,21 @@ std::string CmdProxy::Exptime(int action) {
|
|||||||
os << "[duration] [(optional unit) "
|
os << "[duration] [(optional unit) "
|
||||||
"ns|us|ms|s]\n\t[Eiger][Jungfrau][Gotthard][Gotthard2]["
|
"ns|us|ms|s]\n\t[Eiger][Jungfrau][Gotthard][Gotthard2]["
|
||||||
"Moench][Ctb] Exposure time"
|
"Moench][Ctb] Exposure time"
|
||||||
"\n\t[Gotthard2] Uploaded to detector just before "
|
|
||||||
"acquisition starts"
|
|
||||||
"\n\t[Mythen3] Exposure time of all gate signals in auto and "
|
"\n\t[Mythen3] Exposure time of all gate signals in auto and "
|
||||||
"trigger mode (internal gating)."
|
"trigger mode (internal gating). To specify gate index, use "
|
||||||
|
"exptime1, exptime2, exptime3."
|
||||||
<< '\n';
|
<< '\n';
|
||||||
} else if (cmd == "exptime1") {
|
} else if (cmd == "exptime1") {
|
||||||
os << "[n_value]\n\t[Mythen3] Exposure time of gate signal 1 in "
|
os << "[n_value]\n\t[Mythen3] Exposure time of gate signal 1 in "
|
||||||
"auto and "
|
"auto and trigger mode (internal gating)."
|
||||||
"trigger mode (internal gating)."
|
|
||||||
<< '\n';
|
<< '\n';
|
||||||
} else if (cmd == "exptime2") {
|
} else if (cmd == "exptime2") {
|
||||||
os << "[n_value]\n\t[Mythen3] Exposure time of gate signal 2 in "
|
os << "[n_value]\n\t[Mythen3] Exposure time of gate signal 2 in "
|
||||||
"auto and "
|
"auto and trigger mode (internal gating)."
|
||||||
"trigger mode (internal gating)."
|
|
||||||
<< '\n';
|
<< '\n';
|
||||||
} else {
|
} else {
|
||||||
os << "[n_value]\n\t[Mythen3] Exposure time of gate signal 3 in "
|
os << "[n_value]\n\t[Mythen3] Exposure time of gate signal 3 in "
|
||||||
"auto and "
|
"auto and trigger mode (internal gating)."
|
||||||
"trigger mode (internal gating)."
|
|
||||||
<< '\n';
|
<< '\n';
|
||||||
}
|
}
|
||||||
} else if (action == defs::GET_ACTION) {
|
} else if (action == defs::GET_ACTION) {
|
||||||
@ -495,7 +473,8 @@ std::string CmdProxy::DynamicRange(int action) {
|
|||||||
os << "[value]\n\tDynamic Range or number of bits per "
|
os << "[value]\n\tDynamic Range or number of bits per "
|
||||||
"pixel in detector.\n\t"
|
"pixel in detector.\n\t"
|
||||||
"[Eiger] Options: 4, 8, 16, 32\n\t"
|
"[Eiger] Options: 4, 8, 16, 32\n\t"
|
||||||
"[Mythen3] Options: 8, 16, 32"
|
"[Mythen3] Options: 8, 16, 32\n\t"
|
||||||
|
"[Jungfrau][Gotthard][Ctb][Moench][Mythen3][Gotthard2] 16"
|
||||||
<< '\n';
|
<< '\n';
|
||||||
} else if (action == defs::GET_ACTION) {
|
} else if (action == defs::GET_ACTION) {
|
||||||
if (!args.empty()) {
|
if (!args.empty()) {
|
||||||
@ -525,8 +504,9 @@ std::string CmdProxy::Speed(int action) {
|
|||||||
if (action == defs::HELP_ACTION) {
|
if (action == defs::HELP_ACTION) {
|
||||||
os << "[0 or full_speed|1 or half_speed|2 or "
|
os << "[0 or full_speed|1 or half_speed|2 or "
|
||||||
"quarter_speed]\n\t[Eiger][Jungfrau] Readout speed of "
|
"quarter_speed]\n\t[Eiger][Jungfrau] Readout speed of "
|
||||||
"chip.\n\tJungfrau also overwrites adcphase to recommended "
|
"chip.\n\t[Jungfrau] FULL_SPEED option only available from v2.0 "
|
||||||
"default. "
|
"boards and with setting number of interfaces to 2. Also "
|
||||||
|
"overwrites adcphase to recommended default. "
|
||||||
<< '\n';
|
<< '\n';
|
||||||
} else {
|
} else {
|
||||||
defs::detectorType type = det->getDetectorType().squash();
|
defs::detectorType type = det->getDetectorType().squash();
|
||||||
@ -582,15 +562,13 @@ std::string CmdProxy::Adcphase(int action) {
|
|||||||
os << cmd << ' ';
|
os << cmd << ' ';
|
||||||
if (action == defs::HELP_ACTION) {
|
if (action == defs::HELP_ACTION) {
|
||||||
os << "[n_value] "
|
os << "[n_value] "
|
||||||
"[(optional)deg]\n\t[Jungfrau][Ctb][Moench][Moench][Gotthard] "
|
"[(optional)deg]\n\t[Jungfrau][Ctb][Moench][Gotthard] "
|
||||||
"Phase "
|
"Phase shift of ADC clock. \n\t[Jungfrau] Absolute phase shift. "
|
||||||
"shift of ADC clock. \n\t[Jungfrau] Absolute phase shift. If deg "
|
"If deg used, then shift in degrees. Changing Speed also resets "
|
||||||
"used, then shift in degrees. Changing Speed also resets "
|
|
||||||
"adcphase to recommended defaults.\n\t[Ctb][Moench] Absolute "
|
"adcphase to recommended defaults.\n\t[Ctb][Moench] Absolute "
|
||||||
"phase "
|
"phase shift. If deg used, then shift in degrees. Changing "
|
||||||
"shift. If deg used, then shift in degrees. Changing adcclk also "
|
"adcclk also resets adcphase and sets it to previous "
|
||||||
"resets adcphase and sets it to previous values.\n\t[Gotthard] "
|
"values.\n\t[Gotthard] Relative phase shift. Cannot get"
|
||||||
"Relative phase shift"
|
|
||||||
<< '\n';
|
<< '\n';
|
||||||
} else {
|
} else {
|
||||||
auto det_type = det->getDetectorType().squash(defs::GENERIC);
|
auto det_type = det->getDetectorType().squash(defs::GENERIC);
|
||||||
@ -641,11 +619,9 @@ std::string CmdProxy::Dbitphase(int action) {
|
|||||||
os << cmd << ' ';
|
os << cmd << ' ';
|
||||||
if (action == defs::HELP_ACTION) {
|
if (action == defs::HELP_ACTION) {
|
||||||
os << "[n_value] [(optional)deg]\n\t[Ctb][Jungfrau] Phase shift of "
|
os << "[n_value] [(optional)deg]\n\t[Ctb][Jungfrau] Phase shift of "
|
||||||
"clock to "
|
"clock to latch digital bits. Absolute phase shift. If deg used, "
|
||||||
"latch digital bits. Absolute phase shift. If deg used, then "
|
"then shift in degrees. \n\t[Ctb]Changing dbitclk also resets "
|
||||||
"shift in degrees. \n\t[Ctb]Changing dbitclk also resets "
|
"dbitphase and sets to previous values."
|
||||||
"dbitphase and "
|
|
||||||
"sets to previous values."
|
|
||||||
<< '\n';
|
<< '\n';
|
||||||
} else {
|
} else {
|
||||||
auto det_type = det->getDetectorType().squash(defs::GENERIC);
|
auto det_type = det->getDetectorType().squash(defs::GENERIC);
|
||||||
@ -873,12 +849,42 @@ std::string CmdProxy::ExternalSignal(int action) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** temperature */
|
/** temperature */
|
||||||
|
std::string CmdProxy::TemperatureValues(int action) {
|
||||||
|
std::ostringstream os;
|
||||||
|
os << cmd << ' ';
|
||||||
|
if (action == defs::HELP_ACTION) {
|
||||||
|
os << "\n\tGets the values for every temperature for this detector."
|
||||||
|
<< '\n';
|
||||||
|
} else if (action == defs::GET_ACTION) {
|
||||||
|
if (args.size() != 0) {
|
||||||
|
WrongNumberOfParameters(0);
|
||||||
|
}
|
||||||
|
auto t = det->getTemperatureList();
|
||||||
|
os << '[';
|
||||||
|
if (t.size() > 0) {
|
||||||
|
auto it = t.cbegin();
|
||||||
|
os << ToString(*it) << ' ';
|
||||||
|
os << OutString(det->getTemperature(*it++, {det_id})) << " °C";
|
||||||
|
while (it != t.cend()) {
|
||||||
|
os << ", " << ToString(*it) << ' ';
|
||||||
|
os << OutString(det->getTemperature(*it++, {det_id})) << " °C";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
os << "]\n";
|
||||||
|
} else if (action == defs::PUT_ACTION) {
|
||||||
|
throw sls::RuntimeError("Cannot put");
|
||||||
|
} else {
|
||||||
|
throw sls::RuntimeError("Unknown action");
|
||||||
|
}
|
||||||
|
return os.str();
|
||||||
|
}
|
||||||
|
|
||||||
/* dacs */
|
/* dacs */
|
||||||
std::string CmdProxy::Dac(int action) {
|
std::string CmdProxy::Dac(int action) {
|
||||||
std::ostringstream os;
|
std::ostringstream os;
|
||||||
os << cmd << ' ';
|
os << cmd << ' ';
|
||||||
if (action == defs::HELP_ACTION) {
|
if (action == defs::HELP_ACTION) {
|
||||||
os << "[dac index] [dac or mv value] [(optional unit) mv] "
|
os << "[dac index] [dac or mV value] [(optional unit) mV] "
|
||||||
"\n\t[Ctb] Dac."
|
"\n\t[Ctb] Dac."
|
||||||
<< '\n';
|
<< '\n';
|
||||||
} else if (det->getDetectorType().squash(defs::GENERIC) !=
|
} else if (det->getDetectorType().squash(defs::GENERIC) !=
|
||||||
@ -889,9 +895,9 @@ std::string CmdProxy::Dac(int action) {
|
|||||||
} else if (action == defs::GET_ACTION) {
|
} else if (action == defs::GET_ACTION) {
|
||||||
bool mv = false;
|
bool mv = false;
|
||||||
if (args.size() == 2) {
|
if (args.size() == 2) {
|
||||||
if (args[1] != "mv") {
|
if ((args[1] != "mv") && (args[1] != "mV")) {
|
||||||
throw sls::RuntimeError("Unknown argument " + args[1] +
|
throw sls::RuntimeError("Unknown argument " + args[1] +
|
||||||
". Did you mean mv?");
|
". Did you mean mV?");
|
||||||
}
|
}
|
||||||
mv = true;
|
mv = true;
|
||||||
} else if (args.size() > 2) {
|
} else if (args.size() > 2) {
|
||||||
@ -900,13 +906,13 @@ std::string CmdProxy::Dac(int action) {
|
|||||||
auto t = det->getDAC(
|
auto t = det->getDAC(
|
||||||
static_cast<defs::dacIndex>(StringTo<int>(args[0])), mv, {det_id});
|
static_cast<defs::dacIndex>(StringTo<int>(args[0])), mv, {det_id});
|
||||||
os << args[0] << ' ' << OutString(t)
|
os << args[0] << ' ' << OutString(t)
|
||||||
<< (args.size() > 1 ? " mv\n" : "\n");
|
<< (args.size() > 1 ? " mV\n" : "\n");
|
||||||
} else if (action == defs::PUT_ACTION) {
|
} else if (action == defs::PUT_ACTION) {
|
||||||
bool mv = false;
|
bool mv = false;
|
||||||
if (args.size() == 3) {
|
if (args.size() == 3) {
|
||||||
if (args[2] != "mv") {
|
if ((args[2] != "mv") && (args[2] != "mV")) {
|
||||||
throw sls::RuntimeError("Unknown argument " + args[2] +
|
throw sls::RuntimeError("Unknown argument " + args[2] +
|
||||||
". Did you mean mv?");
|
". Did you mean mV?");
|
||||||
}
|
}
|
||||||
mv = true;
|
mv = true;
|
||||||
} else if (args.size() > 3 || args.size() < 2) {
|
} else if (args.size() > 3 || args.size() < 2) {
|
||||||
@ -914,27 +920,7 @@ std::string CmdProxy::Dac(int action) {
|
|||||||
}
|
}
|
||||||
det->setDAC(static_cast<defs::dacIndex>(StringTo<int>(args[0])),
|
det->setDAC(static_cast<defs::dacIndex>(StringTo<int>(args[0])),
|
||||||
StringTo<int>(args[1]), mv, {det_id});
|
StringTo<int>(args[1]), mv, {det_id});
|
||||||
os << args[0] << ' ' << args[1] << (args.size() > 2 ? " mv\n" : "\n");
|
os << args[0] << ' ' << args[1] << (args.size() > 2 ? " mV\n" : "\n");
|
||||||
} else {
|
|
||||||
throw sls::RuntimeError("Unknown action");
|
|
||||||
}
|
|
||||||
return os.str();
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string CmdProxy::DacList(int action) {
|
|
||||||
std::ostringstream os;
|
|
||||||
os << cmd << ' ';
|
|
||||||
if (action == defs::HELP_ACTION) {
|
|
||||||
os << "\n\tGets the list of commands for every dac for this detector."
|
|
||||||
<< '\n';
|
|
||||||
} else if (action == defs::GET_ACTION) {
|
|
||||||
if (!args.empty()) {
|
|
||||||
WrongNumberOfParameters(0);
|
|
||||||
}
|
|
||||||
auto t = det->getDacList();
|
|
||||||
os << ToString(t) << '\n';
|
|
||||||
} else if (action == defs::PUT_ACTION) {
|
|
||||||
throw sls::RuntimeError("Cannot put");
|
|
||||||
} else {
|
} else {
|
||||||
throw sls::RuntimeError("Unknown action");
|
throw sls::RuntimeError("Unknown action");
|
||||||
}
|
}
|
||||||
@ -945,15 +931,15 @@ std::string CmdProxy::DacValues(int action) {
|
|||||||
std::ostringstream os;
|
std::ostringstream os;
|
||||||
os << cmd << ' ';
|
os << cmd << ' ';
|
||||||
if (action == defs::HELP_ACTION) {
|
if (action == defs::HELP_ACTION) {
|
||||||
os << "[(optional unit) mv] \n\tGets the list of commands for every "
|
os << "[(optional unit) mV] \n\tGets the values for every "
|
||||||
"dac for this detector."
|
"dac for this detector."
|
||||||
<< '\n';
|
<< '\n';
|
||||||
} else if (action == defs::GET_ACTION) {
|
} else if (action == defs::GET_ACTION) {
|
||||||
bool mv = false;
|
bool mv = false;
|
||||||
if (args.size() == 1) {
|
if (args.size() == 1) {
|
||||||
if (args[0] != "mv") {
|
if ((args[0] != "mv") && (args[0] != "mV")) {
|
||||||
throw sls::RuntimeError("Unknown argument " + args[0] +
|
throw sls::RuntimeError("Unknown argument " + args[0] +
|
||||||
". Did you mean mv?");
|
". Did you mean mV?");
|
||||||
}
|
}
|
||||||
mv = true;
|
mv = true;
|
||||||
} else if (args.size() > 1) {
|
} else if (args.size() > 1) {
|
||||||
@ -962,13 +948,13 @@ std::string CmdProxy::DacValues(int action) {
|
|||||||
auto t = det->getDacList();
|
auto t = det->getDacList();
|
||||||
os << '[';
|
os << '[';
|
||||||
auto it = t.cbegin();
|
auto it = t.cbegin();
|
||||||
os << ToString(*it) << ' '
|
os << ToString(*it) << ' ';
|
||||||
<< OutString(det->getDAC(*it++, mv, {det_id}))
|
os << OutString(det->getDAC(*it++, mv, {det_id}))
|
||||||
<< (!args.empty() ? " mv" : "");
|
<< (!args.empty() ? " mV" : "");
|
||||||
while (it != t.cend()) {
|
while (it != t.cend()) {
|
||||||
os << ", " << ToString(*it) << ' '
|
os << ", " << ToString(*it) << ' ';
|
||||||
<< OutString(det->getDAC(*it++, mv, {det_id}))
|
os << OutString(det->getDAC(*it++, mv, {det_id}))
|
||||||
<< (!args.empty() ? " mv" : "");
|
<< (!args.empty() ? " mV" : "");
|
||||||
}
|
}
|
||||||
os << "]\n";
|
os << "]\n";
|
||||||
} else if (action == defs::PUT_ACTION) {
|
} else if (action == defs::PUT_ACTION) {
|
||||||
@ -985,7 +971,8 @@ std::string CmdProxy::ReceiverStatus(int action) {
|
|||||||
std::ostringstream os;
|
std::ostringstream os;
|
||||||
os << cmd << ' ';
|
os << cmd << ' ';
|
||||||
if (action == defs::HELP_ACTION) {
|
if (action == defs::HELP_ACTION) {
|
||||||
os << "running, idle]\n\tReceiver listener status." << '\n';
|
os << "running, idle, transmitting]\n\tReceiver listener status."
|
||||||
|
<< '\n';
|
||||||
} else if (action == defs::GET_ACTION) {
|
} else if (action == defs::GET_ACTION) {
|
||||||
if (!args.empty()) {
|
if (!args.empty()) {
|
||||||
WrongNumberOfParameters(0);
|
WrongNumberOfParameters(0);
|
||||||
@ -1164,7 +1151,7 @@ std::string CmdProxy::UDPDestinationIP2(int action) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Receiver Config */
|
/* Receiver Config */
|
||||||
std::string CmdProxy::ReceiveHostname(int action) {
|
std::string CmdProxy::ReceiverHostname(int action) {
|
||||||
std::ostringstream os;
|
std::ostringstream os;
|
||||||
os << cmd << ' ';
|
os << cmd << ' ';
|
||||||
if (action == defs::HELP_ACTION) {
|
if (action == defs::HELP_ACTION) {
|
||||||
@ -1175,7 +1162,8 @@ std::string CmdProxy::ReceiveHostname(int action) {
|
|||||||
"tcp port.\n\t"
|
"tcp port.\n\t"
|
||||||
"Used for TCP control communication between client and receiver "
|
"Used for TCP control communication between client and receiver "
|
||||||
"to configure receiver. Also updates receiver with detector "
|
"to configure receiver. Also updates receiver with detector "
|
||||||
"parameters."
|
"parameters. Also resets any prior receiver property (not on "
|
||||||
|
"detector). "
|
||||||
<< '\n';
|
<< '\n';
|
||||||
} else if (action == defs::GET_ACTION) {
|
} else if (action == defs::GET_ACTION) {
|
||||||
if (!args.empty()) {
|
if (!args.empty()) {
|
||||||
@ -1327,8 +1315,8 @@ std::string CmdProxy::RateCorrection(int action) {
|
|||||||
os << cmd << ' ';
|
os << cmd << ' ';
|
||||||
if (action == defs::HELP_ACTION) {
|
if (action == defs::HELP_ACTION) {
|
||||||
os << "[n_rate (in ns)]\n\t[Eiger] Dead time correction constant in "
|
os << "[n_rate (in ns)]\n\t[Eiger] Dead time correction constant in "
|
||||||
"ns. -1 will set to default tau of settings. 0 will unset rate "
|
"ns. -1 will set to default tau of settings from trimbit file. 0 "
|
||||||
"correction."
|
"will unset rate correction."
|
||||||
<< '\n';
|
<< '\n';
|
||||||
} else if (action == defs::GET_ACTION) {
|
} else if (action == defs::GET_ACTION) {
|
||||||
if (!args.empty()) {
|
if (!args.empty()) {
|
||||||
@ -1627,7 +1615,7 @@ std::string CmdProxy::VetoPhoton(int action) {
|
|||||||
os << "[ichip] [#photons] [energy in keV] [reference "
|
os << "[ichip] [#photons] [energy in keV] [reference "
|
||||||
"file]\n\t[Gotthard2] Set veto reference for 128 channels for "
|
"file]\n\t[Gotthard2] Set veto reference for 128 channels for "
|
||||||
"chip ichip according to reference file and #photons and energy "
|
"chip ichip according to reference file and #photons and energy "
|
||||||
"in keV.\n"
|
"in keV.\n\t"
|
||||||
<< "[ichip] [output file]\n\t Get gain indices and veto reference "
|
<< "[ichip] [output file]\n\t Get gain indices and veto reference "
|
||||||
"for 128 channels for chip ichip, saved to file."
|
"for 128 channels for chip ichip, saved to file."
|
||||||
<< '\n';
|
<< '\n';
|
||||||
@ -1699,8 +1687,8 @@ std::string CmdProxy::BurstMode(int action) {
|
|||||||
std::ostringstream os;
|
std::ostringstream os;
|
||||||
os << cmd << ' ';
|
os << cmd << ' ';
|
||||||
if (action == defs::HELP_ACTION) {
|
if (action == defs::HELP_ACTION) {
|
||||||
os << "[off or 0, internal or 1, external or 2]\n\t[Gotthard2] Default "
|
os << "[burst_internal or 0, burst_external or 1, cw_internal or 2, "
|
||||||
"is burst internal type"
|
"cw_external or 3]\n\t[Gotthard2] Default is burst_internal type"
|
||||||
<< '\n';
|
<< '\n';
|
||||||
} else {
|
} else {
|
||||||
if (action == defs::GET_ACTION) {
|
if (action == defs::GET_ACTION) {
|
||||||
@ -1718,14 +1706,17 @@ std::string CmdProxy::BurstMode(int action) {
|
|||||||
int ival = StringTo<int>(args[0]);
|
int ival = StringTo<int>(args[0]);
|
||||||
switch (ival) {
|
switch (ival) {
|
||||||
case 0:
|
case 0:
|
||||||
t = defs::BURST_OFF;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
t = defs::BURST_INTERNAL;
|
t = defs::BURST_INTERNAL;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 1:
|
||||||
t = defs::BURST_EXTERNAL;
|
t = defs::BURST_EXTERNAL;
|
||||||
break;
|
break;
|
||||||
|
case 2:
|
||||||
|
t = defs::CONTINUOUS_INTERNAL;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
t = defs::CONTINUOUS_EXTERNAL;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
throw sls::RuntimeError("Unknown burst mode " + args[0]);
|
throw sls::RuntimeError("Unknown burst mode " + args[0]);
|
||||||
}
|
}
|
||||||
@ -1803,8 +1794,9 @@ std::string CmdProxy::Counters(int action) {
|
|||||||
std::ostringstream os;
|
std::ostringstream os;
|
||||||
os << cmd << ' ';
|
os << cmd << ' ';
|
||||||
if (action == defs::HELP_ACTION) {
|
if (action == defs::HELP_ACTION) {
|
||||||
os << "[i0] [i1] [i2]... \n\t[Mythen3] List of counters enabled. Each "
|
os << "[i0] [i1] [i2]... \n\t[Mythen3] List of counters indices "
|
||||||
"element in list can be 0 - 2 and must be non repetitive."
|
"enabled. Each element in list can be 0 - 2 and must be non "
|
||||||
|
"repetitive."
|
||||||
<< '\n';
|
<< '\n';
|
||||||
} else if (action == defs::GET_ACTION) {
|
} else if (action == defs::GET_ACTION) {
|
||||||
if (!args.empty()) {
|
if (!args.empty()) {
|
||||||
@ -1857,23 +1849,19 @@ std::string CmdProxy::GateDelay(int action) {
|
|||||||
if (cmd == "gatedelay") {
|
if (cmd == "gatedelay") {
|
||||||
os << "[duration] [(optional unit) "
|
os << "[duration] [(optional unit) "
|
||||||
"ns|us|ms|s]\n\t[Mythen3] Gate Delay of all gate signals in "
|
"ns|us|ms|s]\n\t[Mythen3] Gate Delay of all gate signals in "
|
||||||
"auto and "
|
"auto and trigger mode (internal gating)."
|
||||||
"trigger mode (internal gating)."
|
|
||||||
<< '\n';
|
<< '\n';
|
||||||
} else if (cmd == "gatedelay1") {
|
} else if (cmd == "gatedelay1") {
|
||||||
os << "[n_value]\n\t[Mythen3] Gate Delay of gate signal 1 in "
|
os << "[n_value]\n\t[Mythen3] Gate Delay of gate signal 1 in auto "
|
||||||
"auto and "
|
"and trigger mode (internal gating)."
|
||||||
"trigger mode (internal gating)."
|
|
||||||
<< '\n';
|
<< '\n';
|
||||||
} else if (cmd == "gatedelay2") {
|
} else if (cmd == "gatedelay2") {
|
||||||
os << "[n_value]\n\t[Mythen3] Gate Delay of gate signal 2 in "
|
os << "[n_value]\n\t[Mythen3] Gate Delay of gate signal 2 in auto "
|
||||||
"auto and "
|
"and trigger mode (internal gating)."
|
||||||
"trigger mode (internal gating)."
|
|
||||||
<< '\n';
|
<< '\n';
|
||||||
} else {
|
} else {
|
||||||
os << "[n_value]\n\t[Mythen3] Gate Delay of gate signal 3 in "
|
os << "[n_value]\n\t[Mythen3] Gate Delay of gate signal 3 in auto "
|
||||||
"auto and "
|
"and trigger mode (internal gating)."
|
||||||
"trigger mode (internal gating)."
|
|
||||||
<< '\n';
|
<< '\n';
|
||||||
}
|
}
|
||||||
} else if (action == defs::GET_ACTION) {
|
} else if (action == defs::GET_ACTION) {
|
||||||
@ -2007,8 +1995,7 @@ std::string CmdProxy::ReceiverDbitList(int action) {
|
|||||||
os << "[all] or [i0] [i1] [i2]... \n\t[Ctb] List of digital signal "
|
os << "[all] or [i0] [i1] [i2]... \n\t[Ctb] List of digital signal "
|
||||||
"bits read out. If all is used instead of a list, all digital "
|
"bits read out. If all is used instead of a list, all digital "
|
||||||
"bits (64) enabled. Each element in list can be 0 - 63 and must "
|
"bits (64) enabled. Each element in list can be 0 - 63 and must "
|
||||||
"be non "
|
"be non repetitive."
|
||||||
"repetitive."
|
|
||||||
<< '\n';
|
<< '\n';
|
||||||
} else if (action == defs::GET_ACTION) {
|
} else if (action == defs::GET_ACTION) {
|
||||||
if (!args.empty()) {
|
if (!args.empty()) {
|
||||||
@ -2124,8 +2111,7 @@ std::string CmdProxy::PatternLoopAddresses(int action) {
|
|||||||
if (action == defs::HELP_ACTION) {
|
if (action == defs::HELP_ACTION) {
|
||||||
if (cmd == "patlimits") {
|
if (cmd == "patlimits") {
|
||||||
os << "[start addr] [stop addr] \n\t[Ctb][Moench][Mythen3] Limits "
|
os << "[start addr] [stop addr] \n\t[Ctb][Moench][Mythen3] Limits "
|
||||||
"of complete "
|
"of complete pattern."
|
||||||
"pattern."
|
|
||||||
<< '\n';
|
<< '\n';
|
||||||
} else if (cmd == "patloop0") {
|
} else if (cmd == "patloop0") {
|
||||||
os << "[start addr] [stop addr] \n\t[Ctb][Moench][Mythen3] Limits "
|
os << "[start addr] [stop addr] \n\t[Ctb][Moench][Mythen3] Limits "
|
||||||
@ -2528,7 +2514,8 @@ std::string CmdProxy::Register(int action) {
|
|||||||
os << cmd << ' ';
|
os << cmd << ' ';
|
||||||
if (action == defs::HELP_ACTION) {
|
if (action == defs::HELP_ACTION) {
|
||||||
os << "[address] [32 bit value]\n\tReads/writes to a 32 bit register "
|
os << "[address] [32 bit value]\n\tReads/writes to a 32 bit register "
|
||||||
"in hex.\n\t[Eiger] +0x100 for only left, +0x200 for only right"
|
"in hex. Advanced Function!\n\t[Eiger] +0x100 for only left, "
|
||||||
|
"+0x200 for only right."
|
||||||
<< '\n';
|
<< '\n';
|
||||||
} else if (action == defs::GET_ACTION) {
|
} else if (action == defs::GET_ACTION) {
|
||||||
if (args.size() != 1) {
|
if (args.size() != 1) {
|
||||||
@ -2555,7 +2542,7 @@ std::string CmdProxy::AdcRegister(int action) {
|
|||||||
if (action == defs::HELP_ACTION) {
|
if (action == defs::HELP_ACTION) {
|
||||||
os << "[address] [value]\n\t[Jungfrau][Ctb][Moench][Gotthard] Writes "
|
os << "[address] [value]\n\t[Jungfrau][Ctb][Moench][Gotthard] Writes "
|
||||||
"to an adc "
|
"to an adc "
|
||||||
"register in hex."
|
"register in hex. Advanced user Function!"
|
||||||
<< '\n';
|
<< '\n';
|
||||||
} else if (action == defs::GET_ACTION) {
|
} else if (action == defs::GET_ACTION) {
|
||||||
throw sls::RuntimeError("Cannot get.");
|
throw sls::RuntimeError("Cannot get.");
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user