mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-16 23:07:13 +02:00
Compare commits
250 Commits
2020.08.10
...
2020.09.17
Author | SHA1 | Date | |
---|---|---|---|
d945f39142 | |||
ac1e9569b5 | |||
ea1b41c84a | |||
b0dd82c667 | |||
bf69951456 | |||
2d2e80469c | |||
5d648443fa | |||
1fb7352378 | |||
511c206787 | |||
74edb6a1c1 | |||
3376f7fa37 | |||
bfe36085f2 | |||
f061d2273a | |||
b12ae5d929 | |||
2285061623 | |||
e10ebe33d7 | |||
01921bc016 | |||
aa10c4665f | |||
f644cba244 | |||
884da7197e | |||
8ae0659478 | |||
ad95f729dc | |||
3b071cc43f | |||
2805359cd0 | |||
1515b79c97 | |||
2ab4bb1c04 | |||
5214c0f1a4 | |||
60bc3a8fa7 | |||
00f780665f | |||
ab738790e0 | |||
d4cff5b99c | |||
84f49a9b27 | |||
a4926e6ae1 | |||
cf8785ad2e | |||
be8284f5c2 | |||
3fd32b2c9c | |||
d70090967d | |||
88fe306902 | |||
d931416def | |||
6cfaa92b61 | |||
c94dfde17c | |||
b879a377ba | |||
d420451751 | |||
2bc33ad34a | |||
cb23e827bf | |||
a0f915316e | |||
2733bc5320 | |||
3b82e9fcc1 | |||
a95d8f664a | |||
11e7d89da3 | |||
34043c358f | |||
da9c7c354e | |||
4d499e231d | |||
0a7809286b | |||
00abb5e14b | |||
22c2bb0258 | |||
9d1cd09fd4 | |||
80b053eb10 | |||
3cd4f3897b | |||
d011186b9a | |||
669c14d6d5 | |||
ecabc94ade | |||
c58a2d957d | |||
1b214778a5 | |||
d5f6cbc075 | |||
52303daffd | |||
02d4769f6a | |||
a9d1a78662 | |||
3cf2160a2d | |||
4917812bb0 | |||
a0f9c6fe8c | |||
82e978e901 | |||
04bf2aca6d | |||
8bdfe7527f | |||
b33fdf4462 | |||
70386633f6 | |||
6c8443f09e | |||
bf52ec10da | |||
bdac4d133e | |||
e8156d412e | |||
97687f0f6d | |||
bfbfe204f4 | |||
67d57eb5cd | |||
f940c09290 | |||
30293b1d36 | |||
8e09b50c5e | |||
87bad38f80 | |||
67f1f9924a | |||
e1e04ee755 | |||
6e06d4307d | |||
20a959bf61 | |||
8e49a114db | |||
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
|
||||
template: bug_report.md
|
||||
---
|
||||
|
||||
<!-- Check an option by - [x], Uncheck an option by - [ ] -->
|
||||
<!-- Please preview to see your option has been selected -->
|
||||
|
||||
<!-- Preview changes before submitting -->
|
||||
<!-- 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:
|
||||
- [x] RHEL7
|
||||
- [ ] RHEL6
|
||||
- [ ] Fedora
|
||||
- [ ] Other
|
||||
<!-- RHEL7, RHEL6, Fedora, etc -->
|
||||
|
||||
|
||||
##### *Detector type:
|
||||
- [x] Not applicable
|
||||
- [ ] Eiger
|
||||
- [ ] Jungfrau
|
||||
- [ ] Mythen3
|
||||
- [ ] Gotthard2
|
||||
- [ ] Gotthard
|
||||
- [ ] Moench
|
||||
- [ ] ChipTestBoard
|
||||
<!-- If applicable, Eiger, Jungfrau, Mythen3, Gotthard2, Gotthard, Moench, ChipTestBoard -->
|
||||
|
||||
##### *Software Package Version:
|
||||
- [ ] developer
|
||||
- [ ] 4.2.0
|
||||
- [ ] 4.1.1
|
||||
<!-- If others, please describe -->
|
||||
<!-- developer, 4.2.0, 4.1.1, etc -->
|
||||
|
||||
##### Priority:
|
||||
- [ ] Super Low
|
||||
- [ ] Low
|
||||
- [ ] Medium
|
||||
- [ ] High
|
||||
- [ ] Super High
|
||||
<!-- Super Low, Low, Medium, High, Super High -->
|
||||
|
||||
##### *Describe the bug
|
||||
<!-- 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
|
||||
template: change_request.md
|
||||
---
|
||||
|
||||
<!-- Check an option by - [x], Uncheck an option by - [ ] -->
|
||||
<!-- Please preview to see your option has been selected -->
|
||||
|
||||
<!-- Preview changes before submitting -->
|
||||
<!-- 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:
|
||||
- [x] Not applicable
|
||||
- [ ] Eiger
|
||||
- [ ] Jungfrau
|
||||
- [ ] Mythen3
|
||||
- [ ] Gotthard2
|
||||
- [ ] Gotthard
|
||||
- [ ] Moench
|
||||
- [ ] ChipTestBoard
|
||||
<!-- If applicable, Eiger, Jungfrau, Mythen3, Gotthard2, Gotthard, Moench, ChipTestBoard -->
|
||||
|
||||
##### *Software Package Version:
|
||||
- [ ] developer
|
||||
- [ ] 4.2.0
|
||||
- [ ] 4.1.1
|
||||
<!-- If others, please describe -->
|
||||
<!-- developer, 4.2.0, 4.1.1, etc -->
|
||||
|
||||
##### Priority:
|
||||
- [ ] Super Low
|
||||
- [ ] Low
|
||||
- [ ] Medium
|
||||
- [ ] High
|
||||
- [ ] Super High
|
||||
<!-- Super Low, Low, Medium, High, Super High -->
|
||||
|
||||
##### *State the change request:
|
||||
<!-- 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
|
||||
about: Suggest a feature
|
||||
about: Suggest a feature, documentation or submit a question
|
||||
title: New Feature Request
|
||||
labels: action - Enhancement, priority - Unclassified, status - Pending
|
||||
template: feature_request.md
|
||||
---
|
||||
|
||||
<!-- Check an option by - [x], Uncheck an option by - [ ] -->
|
||||
<!-- Please preview to see your option has been selected -->
|
||||
|
||||
<!-- Preview changes before submitting -->
|
||||
<!-- 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:
|
||||
- [x] Not applicable
|
||||
- [ ] Eiger
|
||||
- [ ] Jungfrau
|
||||
- [ ] Mythen3
|
||||
- [ ] Gotthard2
|
||||
- [ ] Gotthard
|
||||
- [ ] Moench
|
||||
- [ ] ChipTestBoard
|
||||
<!-- If applicable, Eiger, Jungfrau, Mythen3, Gotthard2, Gotthard, Moench, ChipTestBoard -->
|
||||
|
||||
##### *Software Package Version:
|
||||
- [ ] developer
|
||||
- [ ] 4.2.0
|
||||
- [ ] 4.1.1
|
||||
<!-- If others, please describe -->
|
||||
<!-- developer, 4.2.0, 4.1.1, etc -->
|
||||
|
||||
##### Priority:
|
||||
- [ ] Super Low
|
||||
- [ ] Low
|
||||
- [ ] Medium
|
||||
- [ ] High
|
||||
- [ ] Super High
|
||||
<!-- Super Low, Low, Medium, High, Super High -->
|
||||
|
||||
##### *State the feature:
|
||||
<!-- A clear and concise description of what the feature is -->
|
||||
|
@ -63,17 +63,18 @@ find_package(ClangFormat)
|
||||
check_ipo_supported(RESULT SLS_LTO_AVAILABLE)
|
||||
|
||||
|
||||
# Use ld.gold if it is available and isn't disabled explicitly
|
||||
option(SLS_USE_LD_GOLD "Use GNU gold linker" ON)
|
||||
if (SLS_USE_LD_GOLD)
|
||||
execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
|
||||
if ("${LD_VERSION}" MATCHES "GNU gold")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fuse-ld=gold")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=gold")
|
||||
else ()
|
||||
message(WARNING "GNU gold linker isn't available, using the default system linker.")
|
||||
endif ()
|
||||
endif ()
|
||||
# # Use ld.gold if it is available and isn't disabled explicitly
|
||||
# option(SLS_USE_LD_GOLD "Use GNU gold linker" ON)
|
||||
# if (SLS_USE_LD_GOLD)
|
||||
# execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
|
||||
# if ("${LD_VERSION}" MATCHES "GNU gold")
|
||||
# set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
|
||||
# set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
|
||||
# set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
|
||||
# else ()
|
||||
# message(WARNING "GNU gold linker isn't available, using the default system linker.")
|
||||
# endif ()
|
||||
# endif ()
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||
@ -240,7 +241,7 @@ if(SLS_MASTER_PROJECT)
|
||||
# Set install dir CMake packages
|
||||
set(CMAKE_INSTALL_DIR "share/cmake/${PROJECT_NAME}")
|
||||
# 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
|
||||
include(cmake/package_config.cmake)
|
||||
endif()
|
||||
|
@ -1,6 +1,6 @@
|
||||
#Look for an executable called sphinx-build
|
||||
find_program(SPHINX_EXECUTABLE
|
||||
NAMES sphinx-build
|
||||
NAMES sphinx-build sphinx-build-3.6
|
||||
DOC "Path to sphinx-build executable")
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
43
cmk.sh
43
cmk.sh
@ -12,6 +12,7 @@ TESTS=0
|
||||
SIMULATOR=0
|
||||
CTBGUI=0
|
||||
MANUALS=0
|
||||
MANUALS_ONLY_RST=0
|
||||
MOENCHZMQ=0
|
||||
|
||||
|
||||
@ -21,7 +22,7 @@ CMAKE_PRE=""
|
||||
CMAKE_POST=""
|
||||
|
||||
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
|
||||
-c: Clean
|
||||
-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
|
||||
-i: Builds tests
|
||||
-m: Manuals
|
||||
-n: Manuals without compiling doxygen (only rst)
|
||||
-z: Moench zmq processor
|
||||
|
||||
Rebuild when you switch to a new build and compile in parallel:
|
||||
@ -73,7 +75,7 @@ For rebuilding only certain sections
|
||||
|
||||
" ; exit 1; }
|
||||
|
||||
while getopts ":bpchd:j:trgeisumz" opt ; do
|
||||
while getopts ":bpchd:j:trgeisumnz" opt ; do
|
||||
case $opt in
|
||||
b)
|
||||
echo "Building of CMake files Required"
|
||||
@ -132,6 +134,10 @@ while getopts ":bpchd:j:trgeisumz" opt ; do
|
||||
echo "Compiling Manuals"
|
||||
MANUALS=1
|
||||
;;
|
||||
n)
|
||||
echo "Compiling Manuals (Only RST)"
|
||||
MANUALS_ONLY_RST=1
|
||||
;;
|
||||
z)
|
||||
echo "Compiling Moench Zmq Processor"
|
||||
MOENCHZMQ=1
|
||||
@ -268,20 +274,33 @@ fi
|
||||
|
||||
#make
|
||||
if [ $COMPILERTHREADS -gt 0 ]; then
|
||||
BUILDCOMMAND="make -j$COMPILERTHREADS"
|
||||
echo $BUILDCOMMAND
|
||||
eval $BUILDCOMMAND
|
||||
if [ $MANUALS -eq 1 ]; then
|
||||
BUILDCOMMAND="make docs -j$COMPILERTHREADS"
|
||||
if [ $MANUALS -eq 0 ] && [ $MANUALS_ONLY_RST -eq 0 ]; then
|
||||
BUILDCOMMAND="make -j$COMPILERTHREADS"
|
||||
echo $BUILDCOMMAND
|
||||
eval $BUILDCOMMAND
|
||||
else
|
||||
if [ $MANUALS -eq 1 ]; then
|
||||
BUILDCOMMAND="make docs -j$COMPILERTHREADS"
|
||||
echo $BUILDCOMMAND
|
||||
eval $BUILDCOMMAND
|
||||
else
|
||||
BUILDCOMMAND="make rst -j$COMPILERTHREADS"
|
||||
echo $BUILDCOMMAND
|
||||
eval $BUILDCOMMAND
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo "make"
|
||||
make
|
||||
if [ $MANUALS -eq 1 ]; then
|
||||
echo "make docs"
|
||||
make docs
|
||||
if [ $MANUALS -eq 0 ] && [ $MANUALS_ONLY_RST -eq 0 ]; then
|
||||
echo "make"
|
||||
make
|
||||
else
|
||||
if [ $MANUALS -eq 1 ]; then
|
||||
echo "make docs"
|
||||
make docs
|
||||
else
|
||||
echo "make rst"
|
||||
make rst
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -33,6 +33,7 @@ requirements:
|
||||
- {{ cdt('libselinux') }} # [linux]
|
||||
- {{ cdt('libxdamage') }} # [linux]
|
||||
- {{ cdt('libxxf86vm') }} # [linux]
|
||||
- expat
|
||||
|
||||
host:
|
||||
- libstdcxx-ng
|
||||
@ -45,6 +46,7 @@ requirements:
|
||||
- xorg-libxau
|
||||
- xorg-libxrender
|
||||
- xorg-libxfixes
|
||||
- expat
|
||||
|
||||
run:
|
||||
- zeromq
|
||||
@ -96,3 +98,4 @@ outputs:
|
||||
- {{ pin_subpackage('slsdetlib', exact=True) }}
|
||||
- qwt 6.*
|
||||
- qt 4.8.*
|
||||
- expat
|
||||
|
@ -59,14 +59,13 @@ set( HEADERS
|
||||
#set(ROOT_INCLUDE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
# ROOT dictionary generation
|
||||
include("${ROOT_DIR}/modules/RootNewMacros.cmake")
|
||||
include("${ROOT_DIR}/RootMacros.cmake")
|
||||
root_generate_dictionary(ctbDict ${HEADERS} LINKDEF ctbLinkDef.h)
|
||||
add_library(ctbRootLib SHARED ctbDict.cxx)
|
||||
target_include_directories(ctbRootLib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(ctbRootLib PUBLIC
|
||||
ROOT::Core
|
||||
slsDetectorShared
|
||||
slsSupportLib
|
||||
${ROOT_LIBRARIES}
|
||||
${ROOT_EXE_LINKER_FLAGS}
|
||||
)
|
||||
@ -78,7 +77,6 @@ set_target_properties(
|
||||
|
||||
target_link_libraries(ctbGui PUBLIC
|
||||
slsDetectorShared
|
||||
slsSupportLib
|
||||
ctbRootLib
|
||||
${TIFF_LIBRARIES}
|
||||
)
|
||||
|
@ -38,11 +38,13 @@ set(SPHINX_SOURCE_FILES
|
||||
src/pydetector.rst
|
||||
src/pyenums.rst
|
||||
src/pyexamples.rst
|
||||
src/servers.rst
|
||||
src/receiver.rst
|
||||
src/result.rst
|
||||
src/type_traits.rst
|
||||
src/ToString.rst
|
||||
src/examples.rst
|
||||
src/pygettingstarted.rst
|
||||
|
||||
)
|
||||
|
||||
@ -56,8 +58,21 @@ configure_file(
|
||||
"${SPHINX_BUILD}/conf.py"
|
||||
@ONLY)
|
||||
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/gen_server_doc.py.in"
|
||||
"${SPHINX_BUILD}/gen_server_doc.py"
|
||||
@ONLY)
|
||||
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/static/extra.css"
|
||||
"${SPHINX_BUILD}/static/css/extra.css"
|
||||
@ONLY)
|
||||
|
||||
add_custom_target(server_rst python gen_server_doc.py)
|
||||
|
||||
add_custom_target(docs
|
||||
gendoc
|
||||
COMMAND python gen_server_doc.py
|
||||
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
|
||||
COMMAND ${SPHINX_EXECUTABLE} -a -b html
|
||||
-Dbreathe_projects.slsDetectorPackage=${CMAKE_CURRENT_BINARY_DIR}/xml
|
||||
@ -73,3 +88,4 @@ add_custom_target(rst
|
||||
${SPHINX_BUILD}/src
|
||||
${SPHINX_BUILD}/html
|
||||
COMMENT "Generating documentation with Sphinx")
|
||||
|
||||
|
@ -59,4 +59,8 @@ html_theme = "sphinx_rtd_theme"
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
#html_static_path = ['_static']
|
||||
html_static_path = ['static']
|
||||
|
||||
|
||||
def setup(app):
|
||||
app.add_stylesheet('css/extra.css') # may also be an URL
|
53
docs/gen_server_doc.py.in
Normal file
53
docs/gen_server_doc.py.in
Normal file
@ -0,0 +1,53 @@
|
||||
import os
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
|
||||
# @CMAKE_CURRENT_BINARY_DIR@
|
||||
|
||||
print('\n\n\n\n SERVER CSV')
|
||||
|
||||
src = Path('@CMAKE_SOURCE_DIR@')/'slsDetectorServers/'
|
||||
detectors = ['Mythen3', 'Gotthard2', 'Eiger',
|
||||
'Jungfrau', 'Moench', 'Gotthard', 'Ctb']
|
||||
|
||||
|
||||
for det in detectors:
|
||||
in_fname = src/f'{det.lower()}DetectorServer/slsDetectorServer_defs.h'
|
||||
print(f'Reading: {in_fname}')
|
||||
with open(in_fname) as f:
|
||||
lines = f.read().replace('\\\n', '')
|
||||
lines = lines.splitlines(keepends = True)
|
||||
|
||||
lines = [l.strip('#define').strip(' ') for l in lines if l.startswith('#define')]
|
||||
output = []
|
||||
signals = []
|
||||
fields = ['Name,', 'Value', 'Comment']
|
||||
excluded = ['DAC_NAMES', 'DEFAULT_DAC_VALS', 'CLK_NAMES', 'ONCHIP_DAC_NAMES']
|
||||
header = f'{fields[0]:35}{fields[1]:35}\n'
|
||||
output.append(header)
|
||||
signals.append(header)
|
||||
for line in lines:
|
||||
name, *parts = line.split()
|
||||
arg = ' '.join(parts)
|
||||
value, *comments = arg.split('//')
|
||||
value = value.strip('() ')
|
||||
# value = value.replace(', ', ' ')
|
||||
value = value.replace('\"', '')
|
||||
if name not in excluded:
|
||||
name += ','
|
||||
if name.startswith('SIGNAL_'):
|
||||
signals.append(f'{name:35}{value}\n')
|
||||
else:
|
||||
output.append(f'{name:35}\"{value}\"\n')
|
||||
|
||||
|
||||
rstpath = Path('@CMAKE_SOURCE_DIR@')/'docs/src/'
|
||||
|
||||
out_fname = Path.cwd()/f'src/{det.lower()}.csv'
|
||||
print(f'Writing: {out_fname}')
|
||||
with open(out_fname, 'w') as f:
|
||||
f.writelines(output)
|
||||
|
||||
print('END\n\n\n\n')
|
@ -48,7 +48,7 @@ int main() {
|
||||
auto tmp = os.str().erase(0, cmd.size());
|
||||
auto usage = tmp.substr(0, tmp.find_first_of('\n'));
|
||||
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";
|
||||
}
|
||||
}
|
@ -32,6 +32,7 @@ Welcome to slsDetectorPackage's documentation!
|
||||
:caption: Python API
|
||||
:maxdepth: 2
|
||||
|
||||
pygettingstarted
|
||||
pydetector
|
||||
pyenums
|
||||
pyexamples
|
||||
@ -49,6 +50,11 @@ Welcome to slsDetectorPackage's documentation!
|
||||
type_traits
|
||||
ToString
|
||||
|
||||
.. toctree::
|
||||
:caption: Servers
|
||||
|
||||
servers
|
||||
|
||||
.. Indices and tables
|
||||
.. ==================
|
||||
|
||||
|
@ -7,3 +7,4 @@ Detector
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
:inherited-members:
|
@ -4,6 +4,31 @@ Enums
|
||||
These enums are defined in slsDetectorDefs in the C++ package and
|
||||
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
|
||||
|
||||
.. autoclass:: runStatus
|
||||
|
@ -1,7 +1,73 @@
|
||||
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
|
||||
@ -74,37 +140,39 @@ But lets start looking at the at the manual way:
|
||||
::
|
||||
|
||||
import time
|
||||
from slsdet import Eiger
|
||||
d = Eiger()
|
||||
from slsdet import Detector, runStatus
|
||||
|
||||
n = 10
|
||||
t = 1
|
||||
|
||||
d.exposure_time = t
|
||||
d.n_frames = n
|
||||
d.reset_frames_caught()
|
||||
n_frames = 10
|
||||
t_exp = 1
|
||||
|
||||
#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()
|
||||
d.start_receiver()
|
||||
d.start_detector()
|
||||
d.startDetector()
|
||||
d.startReceiver()
|
||||
|
||||
#Wait for the detector to be ready or do other important stuff
|
||||
time.sleep(t*n)
|
||||
# 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 != 'idle':
|
||||
# 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.stop_receiver()
|
||||
# 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 "
|
||||
)
|
||||
|
||||
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
|
||||
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
|
||||
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 = Eiger()
|
||||
d = Detector()
|
||||
|
||||
#Process to run acquire
|
||||
p = Process(target=acquire)
|
||||
#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.busy is True:
|
||||
print(d.busy)
|
||||
while d.status != runStatus.IDLE:
|
||||
print("Working")
|
||||
time.sleep(0.1)
|
||||
|
||||
#Join the process
|
||||
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 *
|
60
docs/src/servers.rst
Normal file
60
docs/src/servers.rst
Normal file
@ -0,0 +1,60 @@
|
||||
Default values
|
||||
==============================================
|
||||
|
||||
Some general intro
|
||||
|
||||
Mythen3
|
||||
-------------
|
||||
|
||||
.. csv-table:: Default values
|
||||
:file: mythen3.csv
|
||||
:widths: 35, 35
|
||||
:header-rows: 1
|
||||
|
||||
Gotthard2
|
||||
-------------
|
||||
|
||||
.. csv-table:: Default values
|
||||
:file: gotthard2.csv
|
||||
:widths: 35, 35
|
||||
:header-rows: 1
|
||||
|
||||
Moench
|
||||
-------------
|
||||
|
||||
.. csv-table:: Default values
|
||||
:file: moench.csv
|
||||
:widths: 35, 35
|
||||
:header-rows: 1
|
||||
|
||||
Ctb
|
||||
-------------
|
||||
|
||||
.. csv-table:: Default values
|
||||
:file: ctb.csv
|
||||
:widths: 35, 35
|
||||
:header-rows: 1
|
||||
|
||||
Eiger
|
||||
-------------
|
||||
|
||||
.. csv-table:: Default values
|
||||
:file: eiger.csv
|
||||
:widths: 35, 35
|
||||
:header-rows: 1
|
||||
|
||||
Jungfrau
|
||||
-------------
|
||||
|
||||
.. csv-table:: Default values
|
||||
:file: jungfrau.csv
|
||||
:widths: 35, 35
|
||||
:header-rows: 1
|
||||
|
||||
Gotthard
|
||||
-------------
|
||||
|
||||
.. csv-table:: Default values
|
||||
:file: gotthard.csv
|
||||
:widths: 35, 35
|
||||
:header-rows: 1
|
4
docs/static/extra.css
vendored
Normal file
4
docs/static/extra.css
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
/* override table no-wrap */
|
||||
.wy-table-responsive table td, .wy-table-responsive table th {
|
||||
white-space: normal;
|
||||
}
|
@ -41,11 +41,11 @@ hostname bchip074+bchip075+
|
||||
|
||||
|
||||
r_readfreq 1
|
||||
rx_datastream 1
|
||||
rx_zmqstream 1
|
||||
|
||||
#replace my_receiver_hostname with the hostname of 1Gb IP of the machine where the receiver runs
|
||||
rx_hostname my_receiver_hostname
|
||||
rx_datastream 1
|
||||
rx_zmqstream 1
|
||||
outdir /tmp/
|
||||
|
||||
|
||||
|
@ -459,8 +459,8 @@ rx_hostname mpc2011
|
||||
|
||||
tengiga 1
|
||||
|
||||
rx_datastream 1
|
||||
rx_readfreq 1
|
||||
rx_zmqstream 1
|
||||
rx_zmqfreq 1
|
||||
|
||||
|
||||
dac 6 800
|
||||
|
@ -35,7 +35,7 @@ zmqport 50001
|
||||
|
||||
|
||||
tengiga 1
|
||||
rx_datastream 1
|
||||
rx_zmqstream 1
|
||||
|
||||
|
||||
|
||||
@ -46,7 +46,7 @@ period 0.0006
|
||||
############################################
|
||||
fpath /mnt/moench_data/scratch/
|
||||
fwrite 0
|
||||
rx_datastream 1
|
||||
rx_zmqstream 1
|
||||
|
||||
rx_jsonpara frameMode frame
|
||||
rx_jsonpara detectorMode counting
|
||||
|
@ -154,21 +154,39 @@ threaded 1
|
||||
\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):
|
||||
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}
|
||||
detsizechan 1024 512 #detector geometry, long side of the module first
|
||||
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_udpport2 50012 #udp port second quadrant, first halfmodule
|
||||
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
|
||||
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_udpport2 50014 #udp port second quadrant, second halfmodule
|
||||
1:rx_udpip 10.0.40.210 #udp IP of the receiver over 10Gb,
|
||||
can be the same or different from 0:rx_udpip
|
||||
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
|
||||
threaded 1
|
||||
\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
|
||||
\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-index 0
|
||||
sls_detector_put 0-index 0 (\textcolor{red}{0-findex})
|
||||
\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:
|
||||
\begin{verbatim}
|
||||
@ -792,7 +810,7 @@ Extremely advanced options allow to:
|
||||
\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:
|
||||
\begin{verbatim}
|
||||
./sls_detector_put flowcontrol_10g 1
|
||||
./sls_detector_put flowcontrol_10g 1 (\textcolor{red}{flowcontrol10g})
|
||||
\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:
|
||||
\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)
|
||||
\begin{verbatim}
|
||||
./sls_detector_put flowcontrol_10g 1
|
||||
./sls_detector_put flowcontrol_10g 1 (\textcolor{red}{flowcontrol10g 1})
|
||||
\end{verbatim}
|
||||
You ned to check that flow control is setup on the reeceiving interfaces. Check with:
|
||||
\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:
|
||||
\begin{verbatim}
|
||||
./sls_detector_put highvoltage 150
|
||||
./sls_detector_get highvoltage
|
||||
./sls_detector_put vhighvoltage 150 (\textcolor{red}{highvoltage})
|
||||
./sls_detector_get vhighvoltage (\textcolor{red}{highvoltage})
|
||||
\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
|
||||
|
||||
@ -1333,10 +1351,10 @@ We have also been requested if we could speed up the threshold scan. At the mome
|
||||
\begin{verbatim}
|
||||
./sls_detector_put exptime 0.01
|
||||
./sls_detector_put timing trigger
|
||||
./sls_detector_put enablefwrite 0
|
||||
./sls_detector_put resetframescaught 0
|
||||
./sls_detector_put index 0
|
||||
./sls_detector_put cycles 21 (\textcolor{red}{triggers})
|
||||
./sls_detector_put enablefwrite 0 (\textcolor{red}{fwrite} 0)
|
||||
./sls_detector_put resetframescaught 0 (\textcolor{red}{not needed anymore})
|
||||
./sls_detector_put index 0 (\textcolor{red}{findex} 0)
|
||||
./sls_detector_put cycles 21 (\textcolor{red}{triggers} 21)
|
||||
./sls_detector_put receiver start
|
||||
./sls_detector_put status start
|
||||
for i in $(seq 0 20);
|
||||
|
@ -11,7 +11,7 @@ pybind11_add_module(_slsdet
|
||||
target_link_libraries(_slsdet PUBLIC
|
||||
slsDetectorShared
|
||||
slsReceiverShared
|
||||
slsSupportLib
|
||||
slsSupportShared
|
||||
${ZeroMQ_LIBRARIES}
|
||||
)
|
||||
|
||||
@ -30,11 +30,17 @@ set( PYTHON_FILES
|
||||
detector_property.py
|
||||
detector.py
|
||||
eiger.py
|
||||
enums.py
|
||||
errors.py
|
||||
gotthard.py
|
||||
gotthard2.py
|
||||
moench.py
|
||||
proxy.py
|
||||
ctb.py
|
||||
jungfrau.py
|
||||
mythen3.py
|
||||
registers.py
|
||||
temperature.py
|
||||
lookup.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
|
||||
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.lookup import view, find
|
||||
|
||||
d = Detector()
|
||||
# e = Eiger()
|
||||
e = Eiger()
|
||||
c = Ctb()
|
||||
g = Gotthard2()
|
||||
# j = Jungfrau()
|
||||
# m = Mythen3()
|
||||
m = Moench()
|
||||
|
||||
|
@ -1,26 +0,0 @@
|
||||
import subprocess
|
||||
import locale
|
||||
out = subprocess.run(['g', 'list'], stdout = subprocess.PIPE, encoding=locale.getpreferredencoding())
|
||||
cmd = out.stdout.splitlines()
|
||||
cmd.pop(0)
|
||||
|
||||
from slsdet import Detector, Eiger, Ctb
|
||||
|
||||
pycmd = dir(Detector)+dir(Eiger)+dir(Ctb)
|
||||
|
||||
#Add commands that we should not expect as direct commands in python
|
||||
pycmd += ['vrf', 'vtr', 'vrs', 'vtgstv', 'vsvn', 'vtrim',
|
||||
'vsvp', 'vth1', 'vth2', 'vth3', 'vshaper', 'vshaperneg', 'rxb_rb',
|
||||
'rxb_lb', 'vref_prech', 'vref_rstore', 'vref_cds',
|
||||
'vpreamp', 'vref_comp', 'vref_comp_fe vref_ds', 'vref_h_adc',
|
||||
'vref_l_adc', 'iodelay', 'list', 'vref_ds', 'vis', 'vpl',
|
||||
'vref_comp_fe', 'vph', 'vout_cm', 'vcp', 'vcn', 'vcmp_ll', 'vcmp_lr'
|
||||
, 'vcmp_rl', 'vcmp_rr', 'daclist', 'dacvalues', 'vcal', 'vcas']
|
||||
|
||||
missing = []
|
||||
for c in cmd:
|
||||
if c not in pycmd:
|
||||
print(c)
|
||||
missing.append(c)
|
||||
|
||||
print(f'Missing: {len(missing)} commands')
|
132
python/scripts/compare_with_commandline.py
Normal file
132
python/scripts/compare_with_commandline.py
Normal file
@ -0,0 +1,132 @@
|
||||
import subprocess
|
||||
import locale
|
||||
out = subprocess.run(['g', 'list'], stdout = subprocess.PIPE, encoding=locale.getpreferredencoding())
|
||||
cmd = out.stdout.splitlines()
|
||||
cmd.pop(0)
|
||||
|
||||
from slsdet import Detector
|
||||
|
||||
pycmd = dir(Detector)
|
||||
|
||||
|
||||
# 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 = [
|
||||
'adcvpp',
|
||||
'iodelay',
|
||||
'list',
|
||||
'rxb_lb',
|
||||
'rxb_rb',
|
||||
'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',
|
||||
'vcal_n',
|
||||
'vcal_p',
|
||||
'vipre_out',
|
||||
'vcas',
|
||||
'vcasc_out',
|
||||
'vcasc_sfp',
|
||||
'vcascn_pb',
|
||||
'vcascp_pb',
|
||||
'vcassh',
|
||||
'vchip_comp_adc',
|
||||
'vchip_comp_fe',
|
||||
'vchip_cs',
|
||||
'vchip_opa_1st',
|
||||
'vchip_opa_fd',
|
||||
'vchip_ref_comp_fe',
|
||||
'vcmp_ll',
|
||||
'vcmp_lr',
|
||||
'vcmp_rl',
|
||||
'vcmp_rr',
|
||||
'vcn',
|
||||
'vcom_adc1',
|
||||
'vcom_adc2',
|
||||
'vcom_cds',
|
||||
'vcp',
|
||||
'vdcsh',
|
||||
'vdd_prot',
|
||||
'vicin',
|
||||
'vin_cm',
|
||||
'vin_com',
|
||||
'vipre',
|
||||
'vipre_cds',
|
||||
'vipre_out',
|
||||
'vishaper',
|
||||
'vout_cm',
|
||||
'vref_cds',
|
||||
'vref_comp',
|
||||
'vref_comp_fe',
|
||||
'vref_ds',
|
||||
'vref_h_adc',
|
||||
'vref_l_adc',
|
||||
'vref_prech',
|
||||
'vref_rstore',
|
||||
'vrpreamp',
|
||||
'vrshaper',
|
||||
'vrshaper_n',
|
||||
'vsvn',
|
||||
'vsvp',
|
||||
'vtgstv',
|
||||
'vth1',
|
||||
'vth2',
|
||||
'vth3',
|
||||
'vtrim'
|
||||
]
|
||||
|
||||
intentionally_missing = [
|
||||
'activate', #use getActive and getRxPadDeactivatedMode syntax is not a good fit for python
|
||||
'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
|
||||
'pulse', # use pulseChip pulsePixel pulsePixelNmove
|
||||
'pulsechip',
|
||||
'pulsenmove',
|
||||
]
|
||||
|
||||
pycmd += intentionally_missing
|
||||
pycmd += dacs
|
||||
missing = []
|
||||
for c in cmd:
|
||||
if c not in pycmd:
|
||||
print(c)
|
||||
missing.append(c)
|
||||
|
||||
print(f'\nMissing: {len(missing)} commands')
|
||||
print(f'Excluded: {len(dacs)} dacs')
|
||||
print(f'Excluded: {len(intentionally_missing)} other commands')
|
||||
|
||||
|
||||
|
||||
not_in_cmd = []
|
||||
for c in pycmd:
|
||||
if c.islower() and not c.startswith('_'):
|
||||
if c not in cmd:
|
||||
not_in_cmd.append(c)
|
||||
print(f'\nCommands in Python and NOT in command line: {len(not_in_cmd)}')
|
||||
for c in not_in_cmd:
|
||||
print(c)
|
||||
|
||||
|
||||
|
||||
# print(',\n'.join([f'\'{d}\'' for d in sorted(dacs)]))
|
@ -60,6 +60,23 @@ def get_arguments(node):
|
||||
args = f", {args}"
|
||||
return args
|
||||
|
||||
def get_arguments_with_default(node):
|
||||
args = []
|
||||
for arg in node.get_arguments():
|
||||
tokens = [t.spelling for t in arg.get_tokens()]
|
||||
print(tokens)
|
||||
if '=' in tokens:
|
||||
if arg.type.spelling == "sls::Positions": #TODO! automate
|
||||
args.append("py::arg() = Positions{}")
|
||||
else:
|
||||
args.append('py::arg()' + ''.join(tokens[tokens.index('='):]))
|
||||
else:
|
||||
args.append('py::arg()')
|
||||
args = ", ".join(args)
|
||||
if args:
|
||||
args = f", {args}"
|
||||
return args
|
||||
|
||||
|
||||
def get_fdec(node):
|
||||
args = [a.type.spelling for a in node.get_arguments()]
|
||||
@ -86,7 +103,8 @@ def visit(node):
|
||||
and child.access_specifier == cindex.AccessSpecifier.PUBLIC
|
||||
):
|
||||
m.append(child)
|
||||
args = get_arguments(child)
|
||||
# args = get_arguments(child)
|
||||
args = get_arguments_with_default(child)
|
||||
fs = get_fdec(child)
|
||||
lines.append(
|
||||
f'.def("{child.spelling}",{fs} &Detector::{child.spelling}{args})'
|
||||
|
@ -5,32 +5,15 @@ from .dacs import DetectorDacs, Dac
|
||||
from .detector import Detector
|
||||
from .jungfrau import Jungfrau
|
||||
from .mythen3 import Mythen3
|
||||
# from .jungfrau_ctb import JungfrauCTB
|
||||
# from _slsdet import DetectorApi
|
||||
from .gotthard2 import Gotthard2
|
||||
from .gotthard import Gotthard
|
||||
from .moench import Moench
|
||||
|
||||
import _slsdet
|
||||
|
||||
defs = _slsdet.slsDetectorDefs
|
||||
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
|
||||
from .enums import *
|
||||
|
||||
|
||||
IpAddr = _slsdet.IpAddr
|
||||
|
@ -1,23 +1,33 @@
|
||||
from functools import partial
|
||||
class Adc:
|
||||
def __init__(self, name, detector):
|
||||
def __init__(self, name, enum, detector):
|
||||
self.name = name
|
||||
self.enum = enum
|
||||
self._detector = detector
|
||||
self.get_nmod = self._detector._api.getNumberOfDetectors
|
||||
self.get_nmod = self._detector.size
|
||||
# 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):
|
||||
"""
|
||||
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())]
|
||||
return self.get()
|
||||
elif isinstance(key, Iterable):
|
||||
return [self.get(k) / 1000 for k in key]
|
||||
return self.get(list(key))
|
||||
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):
|
||||
"""String representation for a single adc in all modules"""
|
||||
|
@ -32,10 +32,9 @@ class Dac(DetectorProperty):
|
||||
def __repr__(self):
|
||||
"""String representation for a single dac in all modules"""
|
||||
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:
|
||||
_dacs = []
|
||||
_dacnames = [_d[0] for _d in _dacs]
|
||||
@ -93,6 +92,9 @@ class DetectorDacs:
|
||||
dac_array[i,:] = _d[:]
|
||||
return dac_array
|
||||
|
||||
def to_array(self):
|
||||
return self.get_asarray()
|
||||
|
||||
def set_from_array(self, dac_array):
|
||||
"""
|
||||
Set the dacs from an numpy array with dac values. [ndacs, nmodules]
|
||||
@ -101,6 +103,9 @@ class DetectorDacs:
|
||||
for i, _d in enumerate(self):
|
||||
_d[:] = dac_array[i]
|
||||
|
||||
def from_array(self, dac_array):
|
||||
self.set_from_array(dac_array)
|
||||
|
||||
def set_default(self):
|
||||
"""
|
||||
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
|
||||
"""
|
||||
|
||||
|
||||
from .detector import Detector
|
||||
|
||||
# from .adcs import Adc, DetectorAdcs
|
||||
from .temperature import Temperature, DetectorTemperature
|
||||
from .dacs import DetectorDacs
|
||||
import _slsdet
|
||||
dacIndex = _slsdet.slsDetectorDefs.dacIndex
|
||||
from .detector_property import DetectorProperty
|
||||
# from .utils import element_if_equal
|
||||
# from sls_detector.errors import DetectorValueError, DetectorError
|
||||
|
||||
class EigerVcmp:
|
||||
"""
|
||||
Convenience class to be able to loop over vcmp for Eiger
|
||||
|
||||
|
||||
.. todo::
|
||||
|
||||
Support single assignment and perhaps unify with Dac class
|
||||
@ -79,58 +74,6 @@ class EigerDacs(DetectorDacs):
|
||||
('iodelay', dacIndex.IO_DELAY,0, 4000, 660)]
|
||||
_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
|
||||
|
||||
@ -152,76 +95,18 @@ class Eiger(Detector):
|
||||
self._dacs = EigerDacs(self)
|
||||
self._vcmp = EigerVcmp(self)
|
||||
|
||||
# self._active = DetectorProperty(self.getActive,
|
||||
# self.setActive,
|
||||
# self.size,
|
||||
# 'active')
|
||||
# Eiger specific adcs
|
||||
self._temp = DetectorTemperature()
|
||||
self._temp.fpga = Temperature('temp_fpga', dacIndex.TEMPERATURE_FPGA, self)
|
||||
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
|
||||
def dacs(self):
|
||||
@ -284,68 +169,6 @@ class Eiger(Detector):
|
||||
"""
|
||||
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
|
||||
def vcmp(self):
|
||||
@ -437,40 +260,33 @@ class Eiger(Detector):
|
||||
# else:
|
||||
# self._api.setReceiverStreamingPort(port, -1)
|
||||
|
||||
# @property
|
||||
# def temp(self):
|
||||
# """
|
||||
# An instance of DetectorAdcs used to read the temperature
|
||||
# of different components
|
||||
@property
|
||||
def temp(self):
|
||||
"""
|
||||
An instance of DetectorAdcs used to read the temperature
|
||||
of different components
|
||||
|
||||
# Examples
|
||||
# -----------
|
||||
Examples
|
||||
-----------
|
||||
|
||||
# ::
|
||||
::
|
||||
|
||||
# detector.temp
|
||||
# >>
|
||||
# temp_fpga : 36.90°C, 45.60°C
|
||||
# temp_fpgaext : 31.50°C, 32.50°C
|
||||
# temp_10ge : 0.00°C, 0.00°C
|
||||
# temp_dcdc : 36.00°C, 36.00°C
|
||||
# temp_sodl : 33.00°C, 34.50°C
|
||||
# temp_sodr : 33.50°C, 34.00°C
|
||||
# temp_fpgafl : 33.81°C, 30.93°C
|
||||
# temp_fpgafr : 27.88°C, 29.15°C
|
||||
detector.temp
|
||||
>>
|
||||
temp_fpga : 36.90°C, 45.60°C
|
||||
temp_fpgaext : 31.50°C, 32.50°C
|
||||
temp_10ge : 0.00°C, 0.00°C
|
||||
temp_dcdc : 36.00°C, 36.00°C
|
||||
temp_sodl : 33.00°C, 34.50°C
|
||||
temp_sodr : 33.50°C, 34.00°C
|
||||
temp_fpgafl : 33.81°C, 30.93°C
|
||||
temp_fpgafr : 27.88°C, 29.15°C
|
||||
|
||||
# a = detector.temp.fpga[:]
|
||||
# a
|
||||
# >> [36.568, 45.542]
|
||||
a = detector.temp.fpga[:]
|
||||
a
|
||||
>> [36.568, 45.542]
|
||||
|
||||
|
||||
# """
|
||||
# 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)]
|
||||
|
||||
"""
|
||||
return self._temp
|
||||
|
||||
|
17
python/slsdet/enums.py
Normal file
17
python/slsdet/enums.py
Normal file
@ -0,0 +1,17 @@
|
||||
|
||||
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
|
||||
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
|
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
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
This file contains the specialization for the Jungfrau detector
|
||||
This file contains the specialization for the Mythen3 detector
|
||||
"""
|
||||
|
||||
|
||||
@ -19,22 +19,22 @@ class Mythen3Dacs(DetectorDacs):
|
||||
"""
|
||||
Jungfrau specific DACs
|
||||
"""
|
||||
_dacs = [('vcassh', dacIndex.VCASSH, 0, 4000, 1220),
|
||||
('vth2', dacIndex.VTH2, 0, 4000, 2800),
|
||||
('vrshaper', dacIndex.VRSHAPER, 0, 4000, 1280),
|
||||
('vrshaper_n', dacIndex.VRSHAPER_N, 0, 4000, 2800),
|
||||
('vipre_out', dacIndex.VIPRE_OUT, 0, 4000, 1220),
|
||||
('vth3', dacIndex.VTH3, 0, 4000, 2800),
|
||||
('vth1', dacIndex.VTH1, 0, 4000, 2800),
|
||||
('vicin', dacIndex.VICIN, 0, 4000, 1708),
|
||||
_dacs = [('vcassh', dacIndex.VCASSH, 0, 4000, 1220),
|
||||
('vth2', dacIndex.VTH2, 0, 4000, 2800),
|
||||
('vrshaper', dacIndex.VRSHAPER, 0, 4000, 1280),
|
||||
('vrshaper_n', dacIndex.VRSHAPER_N, 0, 4000, 2800),
|
||||
('vipre_out', dacIndex.VIPRE_OUT, 0, 4000, 1220),
|
||||
('vth3', dacIndex.VTH3, 0, 4000, 2800),
|
||||
('vth1', dacIndex.VTH1, 0, 4000, 2800),
|
||||
('vicin', dacIndex.VICIN, 0, 4000, 1708),
|
||||
('vcas', dacIndex.VCAS, 0, 4000, 1800),
|
||||
('vrpreamp', dacIndex.VRPREAMP, 0, 4000, 1100),
|
||||
('vcal_n', dacIndex.VCAL_N, 0, 4000, 1100),
|
||||
('vipre', dacIndex.VIPRE, 0, 4000, 2624),
|
||||
('vishaper', dacIndex.VISHAPER, 0, 4000, 1708),
|
||||
('vcal_p', dacIndex.VCAL_P, 0, 4000, 1712),
|
||||
('vtrim', dacIndex.VTRIM, 0, 4000, 2800),
|
||||
('vdcsh', dacIndex.VDCSH, 0, 4000, 800),
|
||||
('vrpreamp', dacIndex.VRPREAMP, 0, 4000, 1100),
|
||||
('vcal_n', dacIndex.VCAL_N, 0, 4000, 1100),
|
||||
('vipre', dacIndex.VIPRE, 0, 4000, 2624),
|
||||
('vishaper', dacIndex.VISHAPER, 0, 4000, 1708),
|
||||
('vcal_p', dacIndex.VCAL_P, 0, 4000, 1712),
|
||||
('vtrim', dacIndex.VTRIM, 0, 4000, 2800),
|
||||
('vdcsh', dacIndex.VDCSH, 0, 4000, 800),
|
||||
]
|
||||
_dacnames = [_d[0] for _d in _dacs]
|
||||
|
||||
|
85
python/slsdet/proxy.py
Normal file
85
python/slsdet/proxy.py
Normal file
@ -0,0 +1,85 @@
|
||||
from .utils import element_if_equal
|
||||
from .enums import dacIndex
|
||||
|
||||
|
||||
def set_proxy_using_dict(func, key, value):
|
||||
if isinstance(value, dict) and all(isinstance(k, int) for k in value.keys()):
|
||||
for dkey, dvalue in value.items():
|
||||
func(key, dvalue, [dkey])
|
||||
else:
|
||||
func(key, value)
|
||||
|
||||
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()])
|
||||
|
||||
|
||||
|
||||
class SlowAdcProxy:
|
||||
"""
|
||||
Proxy class to allow for more intuitive reading the slow ADCs
|
||||
"""
|
||||
def __init__(self, det):
|
||||
self.det = det
|
||||
|
||||
def __getitem__(self, key):
|
||||
dac_index = dacIndex(int(dacIndex.SLOW_ADC0)+key)
|
||||
return element_if_equal(self.det.getSlowADC(dac_index))
|
||||
|
||||
def __repr__(self):
|
||||
rstr = ''
|
||||
for i in range(7):
|
||||
r = element_if_equal(self.__getitem__(i))
|
||||
if isinstance(r, list):
|
||||
rstr += ' '.join(f'{item} mV' for item in r)
|
||||
else:
|
||||
rstr += f'{i}: {r} mV\n'
|
||||
|
||||
return rstr.strip('\n')
|
||||
|
||||
class ClkDivProxy:
|
||||
"""
|
||||
Proxy class to allow for more intuitive reading clockdivider
|
||||
"""
|
||||
def __init__(self, det):
|
||||
self.det = det
|
||||
|
||||
def __getitem__(self, key):
|
||||
return element_if_equal(self.det.getClockDivider(key))
|
||||
|
||||
def __setitem__(self, key, value):
|
||||
set_proxy_using_dict(self.det.setClockDivider, key, value)
|
||||
|
||||
def __repr__(self):
|
||||
rstr = ''
|
||||
for i in range(6):
|
||||
r = element_if_equal(self.__getitem__(i))
|
||||
if isinstance(r, list):
|
||||
rstr += ' '.join(f'{item}' for item in r)
|
||||
else:
|
||||
rstr += f'{i}: {r}\n'
|
||||
|
||||
return rstr.strip('\n')
|
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 functools
|
||||
import datetime as dt
|
||||
import pathlib
|
||||
import os
|
||||
|
||||
Geometry = namedtuple('Geometry', ['x', 'y'])
|
||||
|
||||
@ -77,6 +79,7 @@ def element(func):
|
||||
return element_if_equal(func(self, *args, **kwargs))
|
||||
return wrapper
|
||||
|
||||
|
||||
def eiger_register_to_time(register):
|
||||
"""
|
||||
Decode register value and return time in s. Values are stored in
|
||||
@ -93,3 +96,34 @@ def make_timedelta(t):
|
||||
return t
|
||||
else:
|
||||
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) and all(isinstance(k, int) for k in args.keys()):
|
||||
for key, value in args.items():
|
||||
func(value, [key])
|
||||
else:
|
||||
func(args)
|
||||
|
||||
def set_time_using_dict(func, args):
|
||||
if isinstance(args, dict) and all(isinstance(k, int) for k in args.keys()):
|
||||
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 &)) &
|
||||
Detector::loadParameters,
|
||||
py::arg())
|
||||
.def("loadParameters",
|
||||
(void (Detector::*)(const std::vector<std::string> &)) &
|
||||
Detector::loadParameters,
|
||||
py::arg())
|
||||
.def("getHostname",
|
||||
(Result<std::string>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getHostname,
|
||||
@ -180,6 +184,14 @@ void init_det(py::module &m) {
|
||||
(Result<sls::ns>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getDelayAfterTriggerLeft,
|
||||
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",
|
||||
(Result<defs::timingMode>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getTimingMode,
|
||||
@ -188,6 +200,9 @@ void init_det(py::module &m) {
|
||||
(void (Detector::*)(defs::timingMode, sls::Positions)) &
|
||||
Detector::setTimingMode,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getTimingModeList",
|
||||
(std::vector<defs::timingMode>(Detector::*)() const) &
|
||||
Detector::getTimingModeList)
|
||||
.def("getSpeed",
|
||||
(Result<defs::speedLevel>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getSpeed,
|
||||
@ -294,6 +309,9 @@ void init_det(py::module &m) {
|
||||
(void (Detector::*)(const int, sls::Positions)) &
|
||||
Detector::setImageTestMode,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getTemperatureList",
|
||||
(std::vector<defs::dacIndex>(Detector::*)() const) &
|
||||
Detector::getTemperatureList)
|
||||
.def("getTemperature",
|
||||
(Result<int>(Detector::*)(defs::dacIndex, sls::Positions) const) &
|
||||
Detector::getTemperature,
|
||||
@ -304,11 +322,11 @@ void init_det(py::module &m) {
|
||||
(Result<int>(Detector::*)(defs::dacIndex, bool, sls::Positions)
|
||||
const) &
|
||||
Detector::getDAC,
|
||||
py::arg(), py::arg(), py::arg() = Positions{})
|
||||
py::arg(), py::arg() = false, py::arg() = Positions{})
|
||||
.def("setDAC",
|
||||
(void (Detector::*)(defs::dacIndex, int, bool, sls::Positions)) &
|
||||
Detector::setDAC,
|
||||
py::arg(), py::arg(), py::arg(), py::arg() = Positions{})
|
||||
py::arg(), py::arg(), py::arg() = false, py::arg() = Positions{})
|
||||
.def("getOnChipDAC",
|
||||
(Result<int>(Detector::*)(defs::dacIndex, int, sls::Positions)
|
||||
const) &
|
||||
@ -328,6 +346,14 @@ void init_det(py::module &m) {
|
||||
sls::Positions)) &
|
||||
Detector::setExternalSignalFlags,
|
||||
py::arg(), py::arg(), py::arg() = Positions{})
|
||||
.def("getParallelMode",
|
||||
(Result<bool>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getParallelMode,
|
||||
py::arg() = Positions{})
|
||||
.def("setParallelMode",
|
||||
(void (Detector::*)(bool, sls::Positions)) &
|
||||
Detector::setParallelMode,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("acquire", (void (Detector::*)()) & Detector::acquire)
|
||||
.def("clearAcquiringFlag",
|
||||
(void (Detector::*)()) & Detector::clearAcquiringFlag)
|
||||
@ -364,6 +390,18 @@ void init_det(py::module &m) {
|
||||
(void (Detector::*)(sls::Positions)) &
|
||||
Detector::sendSoftwareTrigger,
|
||||
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",
|
||||
(Result<int>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getNumberofUDPInterfaces,
|
||||
@ -450,14 +488,22 @@ void init_det(py::module &m) {
|
||||
py::arg() = Positions{})
|
||||
.def("setDestinationUDPPort",
|
||||
(void (Detector::*)(int, int)) & Detector::setDestinationUDPPort,
|
||||
py::arg(), py::arg())
|
||||
py::arg(), py::arg() = -1)
|
||||
.def("getDestinationUDPPort2",
|
||||
(Result<int>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getDestinationUDPPort2,
|
||||
py::arg() = Positions{})
|
||||
.def("setDestinationUDPPort2",
|
||||
(void (Detector::*)(int, int)) & Detector::setDestinationUDPPort2,
|
||||
py::arg(), py::arg())
|
||||
py::arg(), py::arg() = -1)
|
||||
.def("reconfigureUDPDestination",
|
||||
(void (Detector::*)(sls::Positions)) &
|
||||
Detector::reconfigureUDPDestination,
|
||||
py::arg() = Positions{})
|
||||
.def("validateUDPConfiguration",
|
||||
(void (Detector::*)(sls::Positions)) &
|
||||
Detector::validateUDPConfiguration,
|
||||
py::arg() = Positions{})
|
||||
.def("printRxConfiguration",
|
||||
(Result<std::string>(Detector::*)(sls::Positions) const) &
|
||||
Detector::printRxConfiguration,
|
||||
@ -522,7 +568,7 @@ void init_det(py::module &m) {
|
||||
Detector::getRxPort,
|
||||
py::arg() = Positions{})
|
||||
.def("setRxPort", (void (Detector::*)(int, int)) & Detector::setRxPort,
|
||||
py::arg(), py::arg())
|
||||
py::arg(), py::arg() = -1)
|
||||
.def("getRxFifoDepth",
|
||||
(Result<int>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getRxFifoDepth,
|
||||
@ -670,13 +716,21 @@ void init_det(py::module &m) {
|
||||
(void (Detector::*)(int, sls::Positions)) &
|
||||
Detector::setRxZmqTimer,
|
||||
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",
|
||||
(Result<int>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getRxZmqPort,
|
||||
py::arg() = Positions{})
|
||||
.def("setRxZmqPort",
|
||||
(void (Detector::*)(int, int)) & Detector::setRxZmqPort, py::arg(),
|
||||
py::arg())
|
||||
py::arg() = -1)
|
||||
.def("getRxZmqIP",
|
||||
(Result<sls::IpAddr>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getRxZmqIP,
|
||||
@ -691,7 +745,7 @@ void init_det(py::module &m) {
|
||||
py::arg() = Positions{})
|
||||
.def("setClientZmqPort",
|
||||
(void (Detector::*)(int, int)) & Detector::setClientZmqPort,
|
||||
py::arg(), py::arg())
|
||||
py::arg(), py::arg() = -1)
|
||||
.def("getClientZmqIp",
|
||||
(Result<sls::IpAddr>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getClientZmqIp,
|
||||
@ -700,12 +754,6 @@ void init_det(py::module &m) {
|
||||
(void (Detector::*)(const sls::IpAddr, sls::Positions)) &
|
||||
Detector::setClientZmqIp,
|
||||
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",
|
||||
(Result<sls::ns>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getSubExptime,
|
||||
@ -730,7 +778,8 @@ void init_det(py::module &m) {
|
||||
(void (Detector::*)(int, defs::detectorSettings, bool,
|
||||
sls::Positions)) &
|
||||
Detector::setThresholdEnergy,
|
||||
py::arg(), py::arg(), py::arg(), py::arg() = Positions{})
|
||||
py::arg(), py::arg() = defs::STANDARD, py::arg() = true,
|
||||
py::arg() = Positions{})
|
||||
.def("getSettingsPath",
|
||||
(Result<std::string>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getSettingsPath,
|
||||
@ -739,14 +788,6 @@ void init_det(py::module &m) {
|
||||
(void (Detector::*)(const std::string &, sls::Positions)) &
|
||||
Detector::setSettingsPath,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getParallelMode",
|
||||
(Result<bool>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getParallelMode,
|
||||
py::arg() = Positions{})
|
||||
.def("setParallelMode",
|
||||
(void (Detector::*)(bool, sls::Positions)) &
|
||||
Detector::setParallelMode,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getOverFlowMode",
|
||||
(Result<bool>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getOverFlowMode,
|
||||
@ -939,11 +980,11 @@ void init_det(py::module &m) {
|
||||
(void (Detector::*)(const int, const int, sls::Positions)) &
|
||||
Detector::setInjectChannel,
|
||||
py::arg(), py::arg(), py::arg() = Positions{})
|
||||
.def(
|
||||
"getVetoPhoton",
|
||||
(Result<std::vector<int>>(Detector::*)(const int, sls::Positions)) &
|
||||
Detector::getVetoPhoton,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getVetoPhoton",
|
||||
(void (Detector::*)(const int, const std::string &,
|
||||
sls::Positions)) &
|
||||
Detector::getVetoPhoton,
|
||||
py::arg(), py::arg(), py::arg() = Positions{})
|
||||
.def("setVetoPhoton",
|
||||
(void (Detector::*)(const int, const int, const int,
|
||||
const std::string &, sls::Positions)) &
|
||||
@ -954,6 +995,11 @@ void init_det(py::module &m) {
|
||||
(void (Detector::*)(const int, const int, sls::Positions)) &
|
||||
Detector::setVetoReference,
|
||||
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",
|
||||
(Result<defs::burstMode>(Detector::*)(sls::Positions)) &
|
||||
Detector::getBurstMode,
|
||||
@ -962,6 +1008,20 @@ void init_det(py::module &m) {
|
||||
(void (Detector::*)(defs::burstMode, sls::Positions)) &
|
||||
Detector::setBurstMode,
|
||||
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",
|
||||
(Result<bool>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getCurrentSource,
|
||||
@ -987,6 +1047,24 @@ void init_det(py::module &m) {
|
||||
(void (Detector::*)(const bool, sls::Positions)) &
|
||||
Detector::setVeto,
|
||||
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",
|
||||
(Result<uint32_t>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getCounterMask,
|
||||
@ -1267,31 +1345,6 @@ void init_det(py::module &m) {
|
||||
sls::Positions)) &
|
||||
Detector::setAdditionalJsonParameter,
|
||||
py::arg(), py::arg(), py::arg() = Positions{})
|
||||
.def("getDetectorMinMaxEnergyThreshold",
|
||||
(Result<int>(Detector::*)(const bool, sls::Positions) const) &
|
||||
Detector::getDetectorMinMaxEnergyThreshold,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("setDetectorMinMaxEnergyThreshold",
|
||||
(void (Detector::*)(const bool, const int, sls::Positions)) &
|
||||
Detector::setDetectorMinMaxEnergyThreshold,
|
||||
py::arg(), py::arg(), py::arg() = Positions{})
|
||||
.def("getFrameMode",
|
||||
(Result<defs::frameModeType>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getFrameMode,
|
||||
py::arg() = Positions{})
|
||||
.def("setFrameMode",
|
||||
(void (Detector::*)(defs::frameModeType, sls::Positions)) &
|
||||
Detector::setFrameMode,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getDetectorMode",
|
||||
(Result<defs::detectorModeType>(Detector::*)(sls::Positions)
|
||||
const) &
|
||||
Detector::getDetectorMode,
|
||||
py::arg() = Positions{})
|
||||
.def("setDetectorMode",
|
||||
(void (Detector::*)(defs::detectorModeType, sls::Positions)) &
|
||||
Detector::setDetectorMode,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("programFPGA",
|
||||
(void (Detector::*)(const std::string &, sls::Positions)) &
|
||||
Detector::programFPGA,
|
||||
|
@ -259,24 +259,13 @@ void init_enums(py::module &m) {
|
||||
.value("IS_SLAVE", slsDetectorDefs::masterFlags::IS_SLAVE)
|
||||
.export_values();
|
||||
|
||||
py::enum_<slsDetectorDefs::frameModeType>(Defs, "frameModeType")
|
||||
.value("PEDESTAL", slsDetectorDefs::frameModeType::PEDESTAL)
|
||||
.value("NEW_PEDESTAL", slsDetectorDefs::frameModeType::NEW_PEDESTAL)
|
||||
.value("FLATFIELD", slsDetectorDefs::frameModeType::FLATFIELD)
|
||||
.value("NEW_FLATFIELD", slsDetectorDefs::frameModeType::NEW_FLATFIELD)
|
||||
.export_values();
|
||||
|
||||
py::enum_<slsDetectorDefs::detectorModeType>(Defs, "detectorModeType")
|
||||
.value("COUNTING", slsDetectorDefs::detectorModeType::COUNTING)
|
||||
.value("INTERPOLATING",
|
||||
slsDetectorDefs::detectorModeType::INTERPOLATING)
|
||||
.value("ANALOG", slsDetectorDefs::detectorModeType::ANALOG)
|
||||
.export_values();
|
||||
|
||||
py::enum_<slsDetectorDefs::burstMode>(Defs, "burstMode")
|
||||
.value("BURST_OFF", slsDetectorDefs::burstMode::BURST_OFF)
|
||||
.value("BURST_INTERNAL", slsDetectorDefs::burstMode::BURST_INTERNAL)
|
||||
.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)
|
||||
.export_values();
|
||||
|
||||
|
@ -379,15 +379,15 @@ def test_set_readout_clock_3(d, mocker):
|
||||
d.readout_clock = 'Super Slow Speed'
|
||||
m.assert_called_once_with(3)
|
||||
|
||||
#----------------------------------------------------------------rx_datastream
|
||||
def test_get_rx_datastream(d, mocker):
|
||||
#----------------------------------------------------------------rx_zmqstream
|
||||
def test_get_rx_zmqstream(d, mocker):
|
||||
m = mocker.patch('_slsdet.DetectorApi.getRxDataStreamStatus')
|
||||
m.return_value = False
|
||||
assert d.rx_datastream == False
|
||||
assert d.rx_zmqstream == False
|
||||
|
||||
def test_set_rx_datastream(d, mocker):
|
||||
def test_set_rx_zmqstream(d, mocker):
|
||||
m = mocker.patch('_slsdet.DetectorApi.setRxDataStreamStatus')
|
||||
d.rx_datastream = True
|
||||
d.rx_zmqstream = True
|
||||
m.assert_called_once_with(True)
|
||||
|
||||
def test_get_rx_zmqip(d, mocker):
|
@ -412,15 +412,15 @@ def test_set_counters_single(d, mocker):
|
||||
# d.readout_clock = 'Super Slow Speed'
|
||||
# m.assert_called_once_with(3)
|
||||
|
||||
# #----------------------------------------------------------------rx_datastream
|
||||
# def test_get_rx_datastream(d, mocker):
|
||||
# #----------------------------------------------------------------rx_zmqstream
|
||||
# def test_get_rx_zmqstream(d, mocker):
|
||||
# m = mocker.patch('_slsdet.DetectorApi.getRxDataStreamStatus')
|
||||
# m.return_value = False
|
||||
# assert d.rx_datastream == False
|
||||
# assert d.rx_zmqstream == False
|
||||
|
||||
# def test_set_rx_datastream(d, mocker):
|
||||
# def test_set_rx_zmqstream(d, mocker):
|
||||
# m = mocker.patch('_slsdet.DetectorApi.setRxDataStreamStatus')
|
||||
# d.rx_datastream = True
|
||||
# d.rx_zmqstream = True
|
||||
# m.assert_called_once_with(True)
|
||||
|
||||
# def test_get_rx_zmqip(d, mocker):
|
@ -7,6 +7,7 @@ Testing functions from utils.py
|
||||
import pytest
|
||||
from slsdet.utils import *
|
||||
import datetime as dt
|
||||
import pathlib
|
||||
|
||||
def test_iterable():
|
||||
assert is_iterable(5) == False
|
||||
@ -94,3 +95,22 @@ def test_make_timedelta_from_timedelta():
|
||||
r = make_timedelta(t)
|
||||
assert 60 == r.total_seconds()
|
||||
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)
|
||||
target_link_libraries(using_logger
|
||||
slsSupportLib
|
||||
slsSupportShared
|
||||
pthread
|
||||
rt
|
||||
)
|
||||
@ -22,7 +22,7 @@ set_target_properties(using_logger PROPERTIES
|
||||
# add_executable(udp udp.cpp)
|
||||
# target_link_libraries(udp
|
||||
# slsDetectorShared
|
||||
# slsSupportLib
|
||||
# slsSupportShared
|
||||
# pthread
|
||||
# rt
|
||||
# fmt
|
||||
|
@ -23,7 +23,7 @@ foreach(exe ${MOENCH_EXECUTABLES})
|
||||
|
||||
target_link_libraries(${exe}
|
||||
PUBLIC
|
||||
slsSupportLib
|
||||
slsSupportShared
|
||||
${ZeroMQ_LIBRARIES}
|
||||
pthread
|
||||
tiff
|
||||
|
@ -241,7 +241,7 @@ int main(int argc, char *argv[]) {
|
||||
#endif
|
||||
if (zmqsocket->Connect()) {
|
||||
cprintf(RED, "Error: Could not connect to socket %s\n",
|
||||
zmqsocket->GetZmqServerAddress());
|
||||
(zmqsocket->GetZmqServerAddress()).c_str());
|
||||
delete zmqsocket;
|
||||
return EXIT_FAILURE;
|
||||
} else
|
||||
@ -281,12 +281,12 @@ int main(int argc, char *argv[]) {
|
||||
#endif
|
||||
if (zmqsocket2->Connect()) {
|
||||
cprintf(RED, "BBB Error: Could not connect to socket %s\n",
|
||||
zmqsocket2->GetZmqServerAddress());
|
||||
zmqsocket2->GetZmqServerAddress().c_str());
|
||||
// delete zmqsocket2;
|
||||
send = false;
|
||||
// return EXIT_FAILURE;
|
||||
} 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
|
||||
|
||||
if (of) {
|
||||
mt->setFilePointer(NULL);
|
||||
fclose(of);
|
||||
of=NULL;
|
||||
}
|
||||
|
@ -602,12 +602,14 @@ int *getClusters(char *data, int *ph=NULL) {
|
||||
*/
|
||||
|
||||
static void writeClusters(FILE *f, single_photon_hit *cl, int nph, int fn=0){
|
||||
if (nph>0) {
|
||||
if (f) {
|
||||
if (nph>0) {
|
||||
#ifndef OLDFORMAT
|
||||
if (fwrite((void*)&fn, 1, sizeof(int), f))
|
||||
if (fwrite((void*)&nph, 1, sizeof(int), f))
|
||||
if (fwrite((void*)&fn, 1, sizeof(int), f))
|
||||
if (fwrite((void*)&nph, 1, sizeof(int), f))
|
||||
#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
|
||||
slsProjectOptions
|
||||
slsProjectWarnings
|
||||
slsDetectorShared
|
||||
${QT_QTCORE_LIBRARIES}
|
||||
@ -97,6 +98,7 @@ target_link_libraries(slsDetectorGui PUBLIC
|
||||
ZLIB::ZLIB
|
||||
Qt4::QtOpenGL
|
||||
Qt4::QtSvg
|
||||
expat
|
||||
)
|
||||
|
||||
set_target_properties(slsDetectorGui PROPERTIES
|
||||
@ -104,10 +106,10 @@ set_target_properties(slsDetectorGui PROPERTIES
|
||||
)
|
||||
|
||||
install(TARGETS slsDetectorGui
|
||||
# EXPORT "${TARGETS_EXPORT_NAME}"
|
||||
EXPORT "${TARGETS_EXPORT_NAME}"
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
# LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
# ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
# PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
)
|
||||
|
||||
|
@ -52,6 +52,9 @@
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="keyboardTracking">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-1.000000000000000</double>
|
||||
</property>
|
||||
|
@ -98,6 +98,9 @@
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="keyboardTracking">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
|
@ -413,249 +413,6 @@ Directory where one saves the data.
|
||||
</layout>
|
||||
</widget>
|
||||
</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">
|
||||
<widget class="QCheckBox" name="chkRate">
|
||||
<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">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>10</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QRadioButton" name="radioCustomDeadtime">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Custom Dead Time:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="5">
|
||||
<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">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>10</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QComboBox" name="comboEigerClkDivider">
|
||||
<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>
|
||||
<property name="text">
|
||||
<string>Full Speed</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Half Speed</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Quarter Speed</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="4">
|
||||
<spacer name="horizontalSpacer_6">
|
||||
<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="1" column="0">
|
||||
<widget class="QLabel" name="lblEigerFlags">
|
||||
<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>
|
||||
<property name="text">
|
||||
<string>Parallel</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Non Parallel</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
@ -672,6 +429,232 @@ Compression using Root. Available only for Gotthard in Expert Mode.
|
||||
</property>
|
||||
</spacer>
|
||||
</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="2" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="lblClkDivider">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>105</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Clock Divider:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>10</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboClkDivider">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<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>
|
||||
<property name="text">
|
||||
<string>Full Speed</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Half Speed</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Quarter Speed</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_8">
|
||||
<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>
|
||||
<item row="1" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="chkParallel">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Parallel Readout</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</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>
|
||||
</item>
|
||||
<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>
|
||||
</item>
|
||||
<item>
|
||||
<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">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>10</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</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>
|
||||
</widget>
|
||||
<tabstops>
|
||||
@ -680,12 +663,6 @@ Compression using Root. Available only for Gotthard in Expert Mode.
|
||||
<tabstop>btnOutputBrowse</tabstop>
|
||||
<tabstop>comboFileFormat</tabstop>
|
||||
<tabstop>chkOverwriteEnable</tabstop>
|
||||
<tabstop>chkTenGiga</tabstop>
|
||||
<tabstop>chkRate</tabstop>
|
||||
<tabstop>radioDefaultDeadtime</tabstop>
|
||||
<tabstop>radioCustomDeadtime</tabstop>
|
||||
<tabstop>spinCustomDeadTime</tabstop>
|
||||
<tabstop>comboEigerClkDivider</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="../include/icons.qrc"/>
|
||||
|
@ -180,6 +180,9 @@
|
||||
<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>
|
||||
</property>
|
||||
<property name="keyboardTracking">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
|
@ -432,7 +432,7 @@
|
||||
<property name="verticalSpacing">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<item row="5" column="0">
|
||||
<item row="6" column="0">
|
||||
<widget class="QStackedWidget" name="stackedLblTriggerBurst">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
@ -503,7 +503,7 @@
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="3">
|
||||
<item row="5" column="3">
|
||||
<widget class="QComboBox" name="comboPeriodUnit">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
@ -572,7 +572,7 @@ Frame period between exposures.
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2" colspan="2">
|
||||
<item row="2" column="2" colspan="2">
|
||||
<widget class="QSpinBox" name="spinNumMeasurements">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
@ -616,7 +616,7 @@ Frame period between exposures.
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
@ -674,7 +674,7 @@ Frame period between exposures.
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<item row="4" column="2">
|
||||
<widget class="QDoubleSpinBox" name="spinExpTime">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
@ -718,7 +718,7 @@ Exposure Time of a frame.
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="lblPeriod">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
@ -735,7 +735,7 @@ Frame period between exposures.
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="lblNumFrames">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
@ -745,7 +745,7 @@ Frame period between exposures.
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="lblExpTime">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
@ -762,7 +762,7 @@ Exposure Time of a frame.
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2" colspan="2">
|
||||
<item row="3" column="2" colspan="2">
|
||||
<widget class="QSpinBox" name="spinNumFrames">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
@ -809,7 +809,7 @@ Exposure Time of a frame.
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="3">
|
||||
<item row="4" column="3">
|
||||
<widget class="QComboBox" name="comboExpUnit">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
@ -871,7 +871,7 @@ Exposure Time of a frame.
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<item row="5" column="2">
|
||||
<widget class="QDoubleSpinBox" name="spinPeriod">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
@ -931,7 +931,7 @@ Frame period between exposures.
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="5" column="2">
|
||||
<item row="6" column="2">
|
||||
<widget class="QStackedWidget" name="stackedSpinTriggerBurst">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
@ -1070,7 +1070,7 @@ Frame period between exposures.
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<item row="7" column="0">
|
||||
<widget class="QStackedWidget" name="stackedLblDelayBurstPeriod">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
@ -1141,7 +1141,7 @@ Frame period between exposures.
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="2">
|
||||
<item row="7" column="2">
|
||||
<widget class="QStackedWidget" name="stackedSpinDelayBurstPeriod">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
@ -1268,7 +1268,7 @@ Frame period between exposures.
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="3">
|
||||
<item row="7" column="3">
|
||||
<widget class="QStackedWidget" name="stackedComboDelayBurstPeriod">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
@ -1431,7 +1431,7 @@ Frame period between exposures.
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<item row="8" column="0">
|
||||
<widget class="QStackedWidget" name="stackedLblSamplesGates">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
@ -1502,7 +1502,7 @@ Frame period between exposures.
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="2">
|
||||
<item row="8" column="2">
|
||||
<widget class="QStackedWidget" name="stackedSpinSamplesGates">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
@ -1639,6 +1639,53 @@ Frame period between exposures.
|
||||
</widget>
|
||||
</widget>
|
||||
</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>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -2169,7 +2169,7 @@ Displays minimum, maximum and sum of values for each plot.
|
||||
<item row="0" column="2">
|
||||
<widget class="QStackedWidget" name="stackedTimeInterval">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<number>1</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="pageTimeGap">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_14">
|
||||
@ -2181,6 +2181,9 @@ Displays minimum, maximum and sum of values for each plot.
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="keyboardTracking">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>3</number>
|
||||
</property>
|
||||
@ -2249,6 +2252,9 @@ Displays minimum, maximum and sum of values for each plot.
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="keyboardTracking">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
|
@ -19,7 +19,7 @@ class qDrawPlot : public QWidget, private Ui::PlotObject {
|
||||
~qDrawPlot();
|
||||
bool GetIsRunning();
|
||||
void SetRunning(bool enable);
|
||||
int GetProgress();
|
||||
double GetProgress();
|
||||
int64_t GetCurrentFrameIndex();
|
||||
void Select1dPlot(bool enable);
|
||||
void SetPlotTitlePrefix(QString title);
|
||||
@ -152,7 +152,7 @@ class qDrawPlot : public QWidget, private Ui::PlotObject {
|
||||
bool disableZoom{false};
|
||||
int numDiscardBits{0};
|
||||
|
||||
int progress{0};
|
||||
double progress{0};
|
||||
int64_t currentFrame{0};
|
||||
mutable std::mutex mPlots;
|
||||
int64_t currentAcqIndex{0};
|
||||
|
@ -18,17 +18,24 @@ class qTabAdvanced : public QWidget, private Ui::TabAdvancedObject {
|
||||
void SetDetector();
|
||||
void SetControlPort(int port);
|
||||
void SetStopPort(int port);
|
||||
void SetDetectorUDPIP();
|
||||
void SetDetectorUDPMAC();
|
||||
void SetDetectorUDPIP(bool force = false);
|
||||
void ForceSetDetectorUDPIP();
|
||||
void SetDetectorUDPMAC(bool force = false);
|
||||
void ForceSetDetectorUDPMAC();
|
||||
void SetCltZMQPort(int port);
|
||||
void SetCltZMQIP();
|
||||
void SetRxrHostname();
|
||||
void SetCltZMQIP(bool force = false);
|
||||
void ForceSetCltZMQIP();
|
||||
void SetRxrHostname(bool force = false);
|
||||
void ForceSetRxrHostname();
|
||||
void SetRxrTCPPort(int port);
|
||||
void SetRxrUDPPort(int port);
|
||||
void SetRxrUDPIP();
|
||||
void SetRxrUDPMAC();
|
||||
void SetRxrUDPIP(bool force = false);
|
||||
void ForceSetRxrUDPIP();
|
||||
void SetRxrUDPMAC(bool force = false);
|
||||
void ForceSetRxrUDPMAC();
|
||||
void SetRxrZMQPort(int port);
|
||||
void SetRxrZMQIP();
|
||||
void SetRxrZMQIP(bool force = false);
|
||||
void ForceSetRxrZMQIP();
|
||||
void GetROI();
|
||||
void ClearROI();
|
||||
void SetROI();
|
||||
|
@ -13,14 +13,15 @@ class qTabDataOutput : public QWidget, private Ui::TabDataOutputObject {
|
||||
private slots:
|
||||
void GetOutputDir();
|
||||
void BrowseOutputDir();
|
||||
void SetOutputDir();
|
||||
void SetOutputDir(bool force = false);
|
||||
void ForceSetOutputDir();
|
||||
void SetFileFormat(int format);
|
||||
void SetOverwriteEnable(bool enable);
|
||||
void SetTenGigaEnable(bool enable);
|
||||
void EnableRateCorrection();
|
||||
void SetRateCorrection();
|
||||
void SetSpeed(int speed);
|
||||
void SetFlags();
|
||||
void SetParallel(bool enable);
|
||||
|
||||
private:
|
||||
void SetupWidgetWindow();
|
||||
@ -34,11 +35,9 @@ class qTabDataOutput : public QWidget, private Ui::TabDataOutputObject {
|
||||
void GetTenGigaEnable();
|
||||
void GetRateCorrection();
|
||||
void GetSpeed();
|
||||
void GetFlags();
|
||||
void GetParallel();
|
||||
|
||||
sls::Detector *det;
|
||||
// Button group for radiobuttons for rate
|
||||
QButtonGroup *btnGroupRate;
|
||||
// enum for the Eiger Parallel flag
|
||||
enum { PARALLEL, NONPARALLEL };
|
||||
};
|
||||
|
@ -20,6 +20,7 @@ class qTabMeasurement : public QWidget, private Ui::TabMeasurementObject {
|
||||
|
||||
private slots:
|
||||
void SetTimingMode(int val);
|
||||
void SetBurstMode(int val);
|
||||
void SetNumMeasurements(int val);
|
||||
void SetNumFrames(int val);
|
||||
void SetNumTriggers(int val);
|
||||
@ -31,7 +32,8 @@ class qTabMeasurement : public QWidget, private Ui::TabMeasurementObject {
|
||||
void SetDelay();
|
||||
void SetBurstPeriod();
|
||||
void SetFileWrite(bool val);
|
||||
void SetFileName();
|
||||
void SetFileName(bool force = false);
|
||||
void ForceSetFileName();
|
||||
void SetRunIndex(int val);
|
||||
void SetStartingFrameNumber(int val);
|
||||
void UpdateProgress();
|
||||
@ -51,6 +53,7 @@ class qTabMeasurement : public QWidget, private Ui::TabMeasurementObject {
|
||||
void EnableWidgetsforTimingMode();
|
||||
|
||||
void GetTimingMode();
|
||||
void GetBurstMode();
|
||||
void GetNumFrames();
|
||||
void GetNumTriggers();
|
||||
void GetNumBursts();
|
||||
|
@ -24,6 +24,12 @@ class qTabPlot : public QWidget, private Ui::TabPlotObject {
|
||||
void SetBinary();
|
||||
void SetGapPixels(bool enable);
|
||||
void SetTitles();
|
||||
void isXMinModified();
|
||||
void isXMaxModified();
|
||||
void isYMinModified();
|
||||
void isYMaxModified();
|
||||
void isZMinModified();
|
||||
void isZMaxModified();
|
||||
void SetXRange();
|
||||
void SetYRange();
|
||||
void CheckAspectRatio();
|
||||
|
@ -26,7 +26,7 @@ void qDacWidget::SetupWidgetWindow(std::string name) {
|
||||
|
||||
void qDacWidget::Initialization() {
|
||||
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() {
|
||||
LOG(logDEBUG) << "Getting Dac " << index;
|
||||
|
||||
disconnect(spinDac, SIGNAL(editingFinished()), this, SLOT(SetDac()));
|
||||
disconnect(spinDac, SIGNAL(valueChanged(double)), this, SLOT(SetDac()));
|
||||
try {
|
||||
// dac units
|
||||
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),
|
||||
"qDacWidget::GetDac")
|
||||
|
||||
connect(spinDac, SIGNAL(editingFinished()), this, SLOT(SetDac()));
|
||||
connect(spinDac, SIGNAL(valueChanged(double)), this, SLOT(SetDac()));
|
||||
}
|
||||
|
||||
void qDacWidget::SetDac() {
|
||||
|
@ -222,12 +222,12 @@ void qDetectorMain::SetUpDetector(const std::string &config_file, int multiID) {
|
||||
actionLoadTrimbits->setEnabled(false);
|
||||
switch (detType) {
|
||||
case slsDetectorDefs::EIGER:
|
||||
case slsDetectorDefs::MYTHEN3:
|
||||
actionLoadTrimbits->setEnabled(true);
|
||||
break;
|
||||
case slsDetectorDefs::GOTTHARD:
|
||||
case slsDetectorDefs::JUNGFRAU:
|
||||
case slsDetectorDefs::MOENCH:
|
||||
case slsDetectorDefs::MYTHEN3:
|
||||
case slsDetectorDefs::GOTTHARD2:
|
||||
break;
|
||||
default:
|
||||
@ -334,7 +334,8 @@ void qDetectorMain::EnableModes(QAction *action) {
|
||||
|
||||
tabs->setTabEnabled(ADVANCED, enable);
|
||||
actionLoadTrimbits->setVisible(enable &&
|
||||
detType == slsDetectorDefs::EIGER);
|
||||
(detType == slsDetectorDefs::EIGER ||
|
||||
detType == slsDetectorDefs::MYTHEN3));
|
||||
LOG(logINFO) << "Expert Mode: " << qDefs::stringEnable(enable);
|
||||
}
|
||||
|
||||
@ -400,11 +401,8 @@ void qDetectorMain::ExecuteUtilities(QAction *action) {
|
||||
this, tr("Load Detector Trimbits"), fName,
|
||||
tr("Trimbit files (*.trim noise.sn*);;All Files(*)"));
|
||||
fileDialog->setFileMode(QFileDialog::AnyFile);
|
||||
if (fileDialog->exec() == QDialog::Accepted)
|
||||
if (fileDialog->exec() == QDialog::Accepted) {
|
||||
fName = fileDialog->selectedFiles()[0];
|
||||
|
||||
// Gets called when cancelled as well
|
||||
if (!fName.isEmpty()) {
|
||||
det->loadTrimbits(std::string(fName.toAscii().constData()));
|
||||
qDefs::Message(qDefs::INFORMATION,
|
||||
"The Trimbits have been loaded successfully.",
|
||||
|
@ -248,7 +248,7 @@ bool qDrawPlot::GetIsRunning() { return isRunning; }
|
||||
|
||||
void qDrawPlot::SetRunning(bool enable) { isRunning = enable; }
|
||||
|
||||
int qDrawPlot::GetProgress() { return progress; }
|
||||
double qDrawPlot::GetProgress() { return progress; }
|
||||
|
||||
int64_t qDrawPlot::GetCurrentFrameIndex() { return currentFrame; }
|
||||
|
||||
@ -717,7 +717,7 @@ void qDrawPlot::AcquisitionFinished(double currentProgress,
|
||||
LOG(logERROR) << "Acquisition finished [Status: ERROR]";
|
||||
} else {
|
||||
LOG(logINFO) << "Acquisition finished [ Status:" << status
|
||||
<< ", Progress: " << currentProgress << " ]";
|
||||
<< ", Progress: " << currentProgress << "% ]";
|
||||
}
|
||||
emit AcquireFinishedSignal();
|
||||
}
|
||||
@ -741,10 +741,10 @@ void qDrawPlot::GetData(detectorData *data, uint64_t frameIndex,
|
||||
<< " \t complete image: " << data->completeImage << std::endl
|
||||
<< " ]";
|
||||
|
||||
progress = (int)data->progressIndex;
|
||||
progress = data->progressIndex;
|
||||
currentAcqIndex = data->fileIndex;
|
||||
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)
|
||||
|
@ -29,6 +29,7 @@ void qTabAdvanced::SetupWidgetWindow() {
|
||||
tab_roi->setEnabled(true);
|
||||
break;
|
||||
case slsDetectorDefs::MYTHEN3:
|
||||
tab_trimming->setEnabled(true);
|
||||
lblDiscardBits->setEnabled(true);
|
||||
spinDiscardBits->setEnabled(true);
|
||||
lblGateIndex->setEnabled(true);
|
||||
@ -65,8 +66,7 @@ void qTabAdvanced::Initialization() {
|
||||
|
||||
// trimming
|
||||
if (tab_trimming->isEnabled()) {
|
||||
// editingFinished to not set trimbits for every character input
|
||||
connect(spinSetAllTrimbits, SIGNAL(editingFinished()), this,
|
||||
connect(spinSetAllTrimbits, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetAllTrimbits()));
|
||||
}
|
||||
|
||||
@ -79,23 +79,36 @@ void qTabAdvanced::Initialization() {
|
||||
SLOT(SetStopPort(int)));
|
||||
connect(dispDetectorUDPIP, SIGNAL(editingFinished()), this,
|
||||
SLOT(SetDetectorUDPIP()));
|
||||
connect(dispDetectorUDPIP, SIGNAL(returnPressed()), this,
|
||||
SLOT(ForceSetDetectorUDPIP()));
|
||||
connect(dispDetectorUDPMAC, SIGNAL(editingFinished()), this,
|
||||
SLOT(SetDetectorUDPMAC()));
|
||||
connect(dispDetectorUDPMAC, SIGNAL(returnPressed()), this,
|
||||
SLOT(ForceSetDetectorUDPMAC()));
|
||||
connect(spinZMQPort, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetCltZMQPort(int)));
|
||||
connect(dispZMQIP, SIGNAL(editingFinished()), this, SLOT(SetCltZMQIP()));
|
||||
connect(dispZMQIP, SIGNAL(returnPressed()), this, SLOT(ForceSetCltZMQIP()));
|
||||
connect(dispRxrHostname, SIGNAL(editingFinished()), this,
|
||||
SLOT(SetRxrHostname()));
|
||||
connect(dispRxrHostname, SIGNAL(returnPressed()), this,
|
||||
SLOT(ForceSetRxrHostname()));
|
||||
connect(spinRxrTCPPort, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetRxrTCPPort(int)));
|
||||
connect(spinRxrUDPPort, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetRxrUDPPort(int)));
|
||||
connect(dispRxrUDPIP, SIGNAL(editingFinished()), this, SLOT(SetRxrUDPIP()));
|
||||
connect(dispRxrUDPIP, SIGNAL(returnPressed()), this,
|
||||
SLOT(ForceSetRxrUDPIP()));
|
||||
connect(dispRxrUDPMAC, SIGNAL(editingFinished()), this,
|
||||
SLOT(SetRxrUDPMAC()));
|
||||
connect(dispRxrUDPMAC, SIGNAL(returnPressed()), this,
|
||||
SLOT(ForceSetRxrUDPMAC()));
|
||||
connect(spinRxrZMQPort, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetRxrZMQPort(int)));
|
||||
connect(dispRxrZMQIP, SIGNAL(editingFinished()), this, SLOT(SetRxrZMQIP()));
|
||||
connect(dispRxrZMQIP, SIGNAL(returnPressed()), this,
|
||||
SLOT(ForceSetRxrZMQIP()));
|
||||
|
||||
// roi
|
||||
if (tab_roi->isEnabled()) {
|
||||
@ -421,28 +434,42 @@ void qTabAdvanced::SetStopPort(int port) {
|
||||
&qTabAdvanced::GetStopPort)
|
||||
}
|
||||
|
||||
void qTabAdvanced::SetDetectorUDPIP() {
|
||||
std::string s = dispDetectorUDPIP->text().toAscii().constData();
|
||||
LOG(logINFO) << "Setting Detector UDP IP:" << s;
|
||||
try {
|
||||
det->setSourceUDPIP(sls::IpAddr{s}, {comboDetector->currentIndex()});
|
||||
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();
|
||||
LOG(logINFO) << "Setting Detector UDP IP:" << s;
|
||||
try {
|
||||
det->setSourceUDPIP(sls::IpAddr{s},
|
||||
{comboDetector->currentIndex()});
|
||||
}
|
||||
CATCH_HANDLE("Could not set Detector UDP IP.",
|
||||
"qTabAdvanced::SetDetectorUDPIP", this,
|
||||
&qTabAdvanced::GetDetectorUDPIP)
|
||||
}
|
||||
CATCH_HANDLE("Could not set Detector UDP IP.",
|
||||
"qTabAdvanced::SetDetectorUDPIP", this,
|
||||
&qTabAdvanced::GetDetectorUDPIP)
|
||||
}
|
||||
|
||||
void qTabAdvanced::SetDetectorUDPMAC() {
|
||||
std::string s = dispDetectorUDPMAC->text().toAscii().constData();
|
||||
LOG(logINFO) << "Setting Detector UDP MAC:" << s;
|
||||
try {
|
||||
det->setSourceUDPMAC(sls::MacAddr{s}, {comboDetector->currentIndex()});
|
||||
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();
|
||||
LOG(logINFO) << "Setting Detector UDP MAC:" << s;
|
||||
try {
|
||||
det->setSourceUDPMAC(sls::MacAddr{s},
|
||||
{comboDetector->currentIndex()});
|
||||
}
|
||||
CATCH_HANDLE("Could not set Detector UDP MAC.",
|
||||
"qTabAdvanced::SetDetectorUDPMAC", this,
|
||||
&qTabAdvanced::GetDetectorUDPMAC)
|
||||
}
|
||||
CATCH_HANDLE("Could not set Detector UDP MAC.",
|
||||
"qTabAdvanced::SetDetectorUDPMAC", this,
|
||||
&qTabAdvanced::GetDetectorUDPMAC)
|
||||
}
|
||||
|
||||
void qTabAdvanced::ForceSetDetectorUDPMAC() { SetDetectorUDPMAC(true); }
|
||||
|
||||
void qTabAdvanced::SetCltZMQPort(int port) {
|
||||
LOG(logINFO) << "Setting Client ZMQ Port:" << port;
|
||||
try {
|
||||
@ -453,29 +480,44 @@ void qTabAdvanced::SetCltZMQPort(int port) {
|
||||
&qTabAdvanced::GetCltZMQPort)
|
||||
}
|
||||
|
||||
void qTabAdvanced::SetCltZMQIP() {
|
||||
std::string s = dispZMQIP->text().toAscii().constData();
|
||||
LOG(logINFO) << "Setting Client ZMQ IP:" << s;
|
||||
try {
|
||||
det->setClientZmqIp(sls::IpAddr{s}, {comboDetector->currentIndex()});
|
||||
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();
|
||||
LOG(logINFO) << "Setting Client ZMQ IP:" << s;
|
||||
try {
|
||||
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() {
|
||||
std::string s = dispZMQIP->text().toAscii().constData();
|
||||
LOG(logINFO) << "Setting Receiver Hostname:" << s;
|
||||
try {
|
||||
det->setRxHostname(s, {comboDetector->currentIndex()});
|
||||
}
|
||||
CATCH_HANDLE("Could not set Client ZMQ IP.", "qTabAdvanced::SetRxrHostname",
|
||||
this, &qTabAdvanced::GetRxrHostname)
|
||||
void qTabAdvanced::ForceSetCltZMQIP() { SetCltZMQIP(true); }
|
||||
|
||||
// update all network widgets (receiver mainly)
|
||||
SetDetector();
|
||||
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;
|
||||
try {
|
||||
det->setRxHostname(s, {comboDetector->currentIndex()});
|
||||
}
|
||||
CATCH_HANDLE("Could not set Client ZMQ IP.",
|
||||
"qTabAdvanced::SetRxrHostname", this,
|
||||
&qTabAdvanced::GetRxrHostname)
|
||||
|
||||
// update all network widgets (receiver mainly)
|
||||
SetDetector();
|
||||
}
|
||||
}
|
||||
|
||||
void qTabAdvanced::ForceSetRxrHostname() { SetRxrHostname(true); }
|
||||
|
||||
void qTabAdvanced::SetRxrTCPPort(int port) {
|
||||
LOG(logINFO) << "Setting Receiver TCP Port:" << port;
|
||||
try {
|
||||
@ -496,29 +538,42 @@ void qTabAdvanced::SetRxrUDPPort(int port) {
|
||||
&qTabAdvanced::GetRxrUDPPort)
|
||||
}
|
||||
|
||||
void qTabAdvanced::SetRxrUDPIP() {
|
||||
std::string s = dispRxrUDPIP->text().toAscii().constData();
|
||||
LOG(logINFO) << "Setting Receiver UDP IP:" << s;
|
||||
try {
|
||||
det->setDestinationUDPIP(sls::IpAddr{s},
|
||||
{comboDetector->currentIndex()});
|
||||
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();
|
||||
LOG(logINFO) << "Setting Receiver UDP IP:" << s;
|
||||
try {
|
||||
det->setDestinationUDPIP(sls::IpAddr{s},
|
||||
{comboDetector->currentIndex()});
|
||||
}
|
||||
CATCH_HANDLE("Could not set Receiver UDP IP.",
|
||||
"qTabAdvanced::SetRxrUDPIP", this,
|
||||
&qTabAdvanced::GetRxrUDPIP)
|
||||
}
|
||||
CATCH_HANDLE("Could not set Receiver UDP IP.", "qTabAdvanced::SetRxrUDPIP",
|
||||
this, &qTabAdvanced::GetRxrUDPIP)
|
||||
}
|
||||
|
||||
void qTabAdvanced::SetRxrUDPMAC() {
|
||||
std::string s = dispRxrUDPMAC->text().toAscii().constData();
|
||||
LOG(logINFO) << "Setting Receiver UDP MAC:" << s;
|
||||
try {
|
||||
det->setDestinationUDPMAC(sls::MacAddr{s},
|
||||
{comboDetector->currentIndex()});
|
||||
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();
|
||||
LOG(logINFO) << "Setting Receiver UDP MAC:" << s;
|
||||
try {
|
||||
det->setDestinationUDPMAC(sls::MacAddr{s},
|
||||
{comboDetector->currentIndex()});
|
||||
}
|
||||
CATCH_HANDLE("Could not set Receiver UDP MAC.",
|
||||
"qTabAdvanced::SetRxrUDPMAC", this,
|
||||
&qTabAdvanced::GetRxrUDPMAC)
|
||||
}
|
||||
CATCH_HANDLE("Could not set Receiver UDP MAC.",
|
||||
"qTabAdvanced::SetRxrUDPMAC", this,
|
||||
&qTabAdvanced::GetRxrUDPMAC)
|
||||
}
|
||||
|
||||
void qTabAdvanced::ForceSetRxrUDPMAC() { SetRxrUDPMAC(true); }
|
||||
|
||||
void qTabAdvanced::SetRxrZMQPort(int port) {
|
||||
LOG(logINFO) << "Setting Receiver ZMQ Port:" << port;
|
||||
try {
|
||||
@ -529,16 +584,23 @@ void qTabAdvanced::SetRxrZMQPort(int port) {
|
||||
&qTabAdvanced::GetRxrZMQPort)
|
||||
}
|
||||
|
||||
void qTabAdvanced::SetRxrZMQIP() {
|
||||
std::string s = dispRxrZMQIP->text().toAscii().constData();
|
||||
LOG(logINFO) << "Setting Receiver ZMQ IP:" << s;
|
||||
try {
|
||||
det->setRxZmqIP(sls::IpAddr{s}, {comboDetector->currentIndex()});
|
||||
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();
|
||||
LOG(logINFO) << "Setting Receiver ZMQ IP:" << s;
|
||||
try {
|
||||
det->setRxZmqIP(sls::IpAddr{s}, {comboDetector->currentIndex()});
|
||||
}
|
||||
CATCH_HANDLE("Could not set Receiver ZMQ IP.",
|
||||
"qTabAdvanced::SetRxrZMQIP", this,
|
||||
&qTabAdvanced::GetRxrZMQIP)
|
||||
}
|
||||
CATCH_HANDLE("Could not set Receiver ZMQ IP.", "qTabAdvanced::SetRxrZMQIP",
|
||||
this, &qTabAdvanced::GetRxrZMQIP)
|
||||
}
|
||||
|
||||
void qTabAdvanced::ForceSetRxrZMQIP() { SetRxrZMQIP(true); }
|
||||
|
||||
void qTabAdvanced::GetROI() {
|
||||
LOG(logDEBUG) << "Getting ROI";
|
||||
try {
|
||||
@ -575,7 +637,7 @@ void qTabAdvanced::SetROI() {
|
||||
|
||||
void qTabAdvanced::GetAllTrimbits() {
|
||||
LOG(logDEBUG) << "Getting all trimbits value";
|
||||
disconnect(spinSetAllTrimbits, SIGNAL(editingFinished()), this,
|
||||
disconnect(spinSetAllTrimbits, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetAllTrimbits()));
|
||||
|
||||
try {
|
||||
@ -584,7 +646,7 @@ void qTabAdvanced::GetAllTrimbits() {
|
||||
}
|
||||
CATCH_DISPLAY("Could not get all trimbits.", "qTabAdvanced::GetAllTrimbits")
|
||||
|
||||
connect(spinSetAllTrimbits, SIGNAL(editingFinished()), this,
|
||||
connect(spinSetAllTrimbits, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetAllTrimbits()));
|
||||
}
|
||||
|
||||
|
@ -32,12 +32,20 @@ void qTabDataOutput::SetupWidgetWindow() {
|
||||
radioDefaultDeadtime->setEnabled(true);
|
||||
radioCustomDeadtime->setEnabled(true);
|
||||
// flags and speed
|
||||
widgetEiger->setVisible(true);
|
||||
widgetEiger->setEnabled(true);
|
||||
lblClkDivider->setEnabled(true);
|
||||
comboClkDivider->setEnabled(true);
|
||||
chkParallel->setEnabled(true);
|
||||
break;
|
||||
case slsDetectorDefs::MOENCH:
|
||||
chkTenGiga->setEnabled(true);
|
||||
break;
|
||||
case slsDetectorDefs::MYTHEN3:
|
||||
chkParallel->setEnabled(true);
|
||||
break;
|
||||
case slsDetectorDefs::JUNGFRAU:
|
||||
lblClkDivider->setEnabled(true);
|
||||
comboClkDivider->setEnabled(true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -54,6 +62,8 @@ void qTabDataOutput::Initialization() {
|
||||
SLOT(GetOutputDir()));
|
||||
connect(dispOutputDir, SIGNAL(editingFinished()), this,
|
||||
SLOT(SetOutputDir()));
|
||||
connect(dispOutputDir, SIGNAL(returnPressed()), this,
|
||||
SLOT(ForceSetOutputDir()));
|
||||
connect(btnOutputBrowse, SIGNAL(clicked()), this, SLOT(BrowseOutputDir()));
|
||||
connect(comboFileFormat, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetFileFormat(int)));
|
||||
@ -69,15 +79,18 @@ void qTabDataOutput::Initialization() {
|
||||
SLOT(EnableRateCorrection()));
|
||||
connect(btnGroupRate, SIGNAL(buttonClicked(int)), this,
|
||||
SLOT(SetRateCorrection()));
|
||||
connect(spinCustomDeadTime, SIGNAL(editingFinished()), this,
|
||||
connect(spinCustomDeadTime, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetRateCorrection()));
|
||||
}
|
||||
// flags, speed
|
||||
if (widgetEiger->isEnabled()) {
|
||||
connect(comboEigerClkDivider, SIGNAL(currentIndexChanged(int)), this,
|
||||
// parallel
|
||||
if (chkParallel->isEnabled()) {
|
||||
connect(chkParallel, SIGNAL(toggled(bool)), this,
|
||||
SLOT(SetParallel(bool)));
|
||||
}
|
||||
// speed
|
||||
if (comboClkDivider->isEnabled()) {
|
||||
connect(comboClkDivider, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetSpeed(int)));
|
||||
connect(comboEigerParallelFlag, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetFlags()));
|
||||
}
|
||||
}
|
||||
|
||||
@ -169,35 +182,41 @@ void qTabDataOutput::BrowseOutputDir() {
|
||||
dispOutputDir->setText(directory);
|
||||
}
|
||||
|
||||
void qTabDataOutput::SetOutputDir() {
|
||||
QString path = dispOutputDir->text();
|
||||
LOG(logDEBUG) << "Setting output directory to "
|
||||
<< path.toAscii().constData();
|
||||
void qTabDataOutput::SetOutputDir(bool force) {
|
||||
// return forces modification (inconsistency from command line)
|
||||
if (dispOutputDir->isModified() || force) {
|
||||
dispOutputDir->setModified(false);
|
||||
QString path = dispOutputDir->text();
|
||||
LOG(logDEBUG) << "Setting output directory to "
|
||||
<< path.toAscii().constData();
|
||||
|
||||
// empty
|
||||
if (path.isEmpty()) {
|
||||
qDefs::Message(qDefs::WARNING,
|
||||
"Invalid Output Path. Must not be empty.",
|
||||
"qTabDataOutput::SetOutputDir");
|
||||
LOG(logWARNING) << "Invalid Output Path. Must not be empty.";
|
||||
GetOutputDir();
|
||||
} else {
|
||||
// chop off trailing '/'
|
||||
if (path.endsWith('/')) {
|
||||
while (path.endsWith('/')) {
|
||||
path.chop(1);
|
||||
// empty
|
||||
if (path.isEmpty()) {
|
||||
qDefs::Message(qDefs::WARNING,
|
||||
"Invalid Output Path. Must not be empty.",
|
||||
"qTabDataOutput::SetOutputDir");
|
||||
LOG(logWARNING) << "Invalid Output Path. Must not be empty.";
|
||||
GetOutputDir();
|
||||
} else {
|
||||
// chop off trailing '/'
|
||||
if (path.endsWith('/')) {
|
||||
while (path.endsWith('/')) {
|
||||
path.chop(1);
|
||||
}
|
||||
}
|
||||
std::string spath = std::string(path.toAscii().constData());
|
||||
try {
|
||||
det->setFilePath(spath, {comboDetector->currentIndex() - 1});
|
||||
}
|
||||
CATCH_HANDLE("Could not set output file path.",
|
||||
"qTabDataOutput::SetOutputDir", this,
|
||||
&qTabDataOutput::GetOutputDir)
|
||||
}
|
||||
std::string spath = std::string(path.toAscii().constData());
|
||||
try {
|
||||
det->setFilePath(spath, {comboDetector->currentIndex() - 1});
|
||||
}
|
||||
CATCH_HANDLE("Could not set output file path.",
|
||||
"qTabDataOutput::SetOutputDir", this,
|
||||
&qTabDataOutput::GetOutputDir)
|
||||
}
|
||||
}
|
||||
|
||||
void qTabDataOutput::ForceSetOutputDir() { SetOutputDir(true); };
|
||||
|
||||
void qTabDataOutput::GetFileFormat() {
|
||||
LOG(logDEBUG) << "Getting File Format";
|
||||
disconnect(comboFileFormat, SIGNAL(currentIndexChanged(int)), this,
|
||||
@ -288,7 +307,7 @@ void qTabDataOutput::GetRateCorrection() {
|
||||
SLOT(EnableRateCorrection()));
|
||||
disconnect(btnGroupRate, SIGNAL(buttonClicked(int)), this,
|
||||
SLOT(SetRateCorrection()));
|
||||
disconnect(spinCustomDeadTime, SIGNAL(editingFinished()), this,
|
||||
disconnect(spinCustomDeadTime, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetRateCorrection()));
|
||||
try {
|
||||
spinCustomDeadTime->setValue(-1);
|
||||
@ -305,7 +324,7 @@ void qTabDataOutput::GetRateCorrection() {
|
||||
connect(chkRate, SIGNAL(toggled(bool)), this, SLOT(EnableRateCorrection()));
|
||||
connect(btnGroupRate, SIGNAL(buttonClicked(int)), this,
|
||||
SLOT(SetRateCorrection()));
|
||||
connect(spinCustomDeadTime, SIGNAL(editingFinished()), this,
|
||||
connect(spinCustomDeadTime, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetRateCorrection()));
|
||||
}
|
||||
|
||||
@ -351,22 +370,21 @@ void qTabDataOutput::SetRateCorrection() {
|
||||
|
||||
void qTabDataOutput::GetSpeed() {
|
||||
LOG(logDEBUG) << "Getting Speed";
|
||||
disconnect(comboEigerClkDivider, SIGNAL(currentIndexChanged(int)), this,
|
||||
disconnect(comboClkDivider, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetSpeed(int)));
|
||||
try {
|
||||
auto retval =
|
||||
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")
|
||||
connect(comboEigerClkDivider, SIGNAL(currentIndexChanged(int)), this,
|
||||
connect(comboClkDivider, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetSpeed(int)));
|
||||
}
|
||||
|
||||
void qTabDataOutput::SetSpeed(int speed) {
|
||||
LOG(logINFO) << "Setting Speed to "
|
||||
<< comboEigerClkDivider->currentText().toAscii().data();
|
||||
;
|
||||
<< comboClkDivider->currentText().toAscii().data();
|
||||
try {
|
||||
det->setSpeed(static_cast<slsDetectorDefs::speedLevel>(speed));
|
||||
}
|
||||
@ -374,34 +392,28 @@ void qTabDataOutput::SetSpeed(int speed) {
|
||||
&qTabDataOutput::GetSpeed)
|
||||
}
|
||||
|
||||
void qTabDataOutput::GetFlags() {
|
||||
LOG(logDEBUG) << "Getting readout flags";
|
||||
disconnect(comboEigerParallelFlag, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetFlags()));
|
||||
void qTabDataOutput::GetParallel() {
|
||||
LOG(logDEBUG) << "Getting parallel readout";
|
||||
disconnect(chkParallel, SIGNAL(toggled(bool)), this,
|
||||
SLOT(SetParallel(bool)));
|
||||
try {
|
||||
auto retval = det->getParallelMode().tsquash(
|
||||
"Parallel Flag is inconsistent for all detectors.");
|
||||
// parallel or non parallel
|
||||
if (retval)
|
||||
comboEigerParallelFlag->setCurrentIndex(PARALLEL);
|
||||
else
|
||||
comboEigerParallelFlag->setCurrentIndex(NONPARALLEL);
|
||||
chkParallel->setChecked(retval);
|
||||
}
|
||||
CATCH_DISPLAY("Could not get flags.", "qTabDataOutput::GetFlags")
|
||||
connect(comboEigerParallelFlag, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetFlags()));
|
||||
CATCH_DISPLAY("Could not get parallel readout.",
|
||||
"qTabDataOutput::GetParallel")
|
||||
connect(chkParallel, SIGNAL(toggled(bool)), this, SLOT(SetParallel(bool)));
|
||||
}
|
||||
|
||||
void qTabDataOutput::SetFlags() {
|
||||
auto mode =
|
||||
comboEigerParallelFlag->currentIndex() == PARALLEL ? true : false;
|
||||
void qTabDataOutput::SetParallel(bool enable) {
|
||||
LOG(logINFO) << "Setting PArallel readout to " << enable;
|
||||
try {
|
||||
LOG(logINFO) << "Setting Readout Flags to "
|
||||
<< comboEigerParallelFlag->currentText().toAscii().data();
|
||||
det->setParallelMode(mode);
|
||||
det->setParallelMode(enable);
|
||||
}
|
||||
CATCH_HANDLE("Could not set readout flags.", "qTabDataOutput::SetFlags",
|
||||
this, &qTabDataOutput::GetFlags)
|
||||
CATCH_HANDLE("Could not set parallel readout.",
|
||||
"qTabDataOutput::SetParallel", this,
|
||||
&qTabDataOutput::GetParallel)
|
||||
}
|
||||
|
||||
void qTabDataOutput::Refresh() {
|
||||
@ -419,9 +431,11 @@ void qTabDataOutput::Refresh() {
|
||||
if (chkTenGiga->isEnabled()) {
|
||||
GetTenGigaEnable();
|
||||
}
|
||||
if (widgetEiger->isEnabled()) {
|
||||
if (chkParallel->isEnabled()) {
|
||||
GetParallel();
|
||||
}
|
||||
if (comboClkDivider->isEnabled()) {
|
||||
GetSpeed();
|
||||
GetFlags();
|
||||
}
|
||||
|
||||
LOG(logDEBUG) << "**Updated DataOutput Tab";
|
||||
|
@ -290,7 +290,7 @@ void qTabDeveloper::Initialization() {
|
||||
SLOT(Refresh()));
|
||||
connect(comboHV, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetHighVoltage()));
|
||||
connect(spinHV, SIGNAL(editingFinished()), this, SLOT(SetHighVoltage()));
|
||||
connect(spinHV, SIGNAL(valueChanged(int)), this, SLOT(SetHighVoltage()));
|
||||
}
|
||||
|
||||
void qTabDeveloper::PopulateDetectors() {
|
||||
@ -312,7 +312,7 @@ void qTabDeveloper::GetHighVoltage() {
|
||||
if (!comboHV->isVisible() && !spinHV->isVisible())
|
||||
return;
|
||||
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,
|
||||
SLOT(SetHighVoltage()));
|
||||
try {
|
||||
@ -359,7 +359,7 @@ void qTabDeveloper::GetHighVoltage() {
|
||||
}
|
||||
CATCH_DISPLAY("Could not get high voltage.",
|
||||
"qTabDeveloper::GetHighVoltage")
|
||||
connect(spinHV, SIGNAL(editingFinished()), this, SLOT(SetHighVoltage()));
|
||||
connect(spinHV, SIGNAL(valueChanged(int)), this, SLOT(SetHighVoltage()));
|
||||
connect(comboHV, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetHighVoltage()));
|
||||
}
|
||||
|
@ -46,6 +46,8 @@ void qTabMeasurement::SetupWidgetWindow() {
|
||||
ShowGates();
|
||||
|
||||
// enabling according to det type
|
||||
lblBurstMode->hide();
|
||||
comboBurstMode->hide();
|
||||
switch (det->getDetectorType().squash()) {
|
||||
case slsDetectorDefs::MOENCH:
|
||||
lblNumSamples->setEnabled(true);
|
||||
@ -64,6 +66,8 @@ void qTabMeasurement::SetupWidgetWindow() {
|
||||
startingFnumImplemented = true;
|
||||
break;
|
||||
case slsDetectorDefs::GOTTHARD2:
|
||||
lblBurstMode->show();
|
||||
comboBurstMode->show();
|
||||
lblNumBursts->setEnabled(true);
|
||||
spinNumBursts->setEnabled(true);
|
||||
lblBurstPeriod->setEnabled(true);
|
||||
@ -89,6 +93,10 @@ void qTabMeasurement::SetupWidgetWindow() {
|
||||
void qTabMeasurement::Initialization() {
|
||||
connect(comboTimingMode, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetTimingMode(int)));
|
||||
if (comboBurstMode->isVisible()) {
|
||||
connect(comboBurstMode, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetBurstMode(int)));
|
||||
}
|
||||
connect(spinNumMeasurements, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetNumMeasurements(int)));
|
||||
connect(spinNumFrames, SIGNAL(valueChanged(int)), this,
|
||||
@ -129,6 +137,8 @@ void qTabMeasurement::Initialization() {
|
||||
}
|
||||
connect(chkFile, SIGNAL(toggled(bool)), this, SLOT(SetFileWrite(bool)));
|
||||
connect(dispFileName, SIGNAL(editingFinished()), this, SLOT(SetFileName()));
|
||||
connect(dispFileName, SIGNAL(returnPressed()), this,
|
||||
SLOT(ForceSetFileName()));
|
||||
connect(spinIndex, SIGNAL(valueChanged(int)), this, SLOT(SetRunIndex(int)));
|
||||
if (startingFnumImplemented) {
|
||||
connect(spinStartingFrameNumber, SIGNAL(valueChanged(int)), this,
|
||||
@ -142,18 +152,15 @@ void qTabMeasurement::Initialization() {
|
||||
void qTabMeasurement::ShowTriggerDelay() {
|
||||
bool showTrigger = true;
|
||||
if (det->getDetectorType().squash() == slsDetectorDefs::GOTTHARD2) {
|
||||
try {
|
||||
LOG(logDEBUG) << "Getting burst mode";
|
||||
auto retval = det->getBurstMode().tsquash(
|
||||
"Inconsistent burst mode for all detectors.");
|
||||
// burst mode and auto timing mode
|
||||
if (retval != slsDetectorDefs::BURST_OFF &&
|
||||
comboTimingMode->currentIndex() == AUTO) {
|
||||
showTrigger = false;
|
||||
}
|
||||
// burst and auto
|
||||
if ((comboBurstMode->currentIndex() ==
|
||||
slsDetectorDefs::BURST_INTERNAL ||
|
||||
comboBurstMode->currentIndex() ==
|
||||
slsDetectorDefs::BURST_EXTERNAL) &&
|
||||
(comboTimingMode->currentIndex() == AUTO)) {
|
||||
// show burst, burstperiod, not trigger or delay
|
||||
showTrigger = false;
|
||||
}
|
||||
CATCH_DISPLAY("Could not get burst mode.",
|
||||
"qTabMeasurement::ShowTriggerDelay")
|
||||
}
|
||||
|
||||
if (showTrigger) {
|
||||
@ -246,7 +253,7 @@ void qTabMeasurement::EnableWidgetsforTimingMode() {
|
||||
spinPeriod->setEnabled(true);
|
||||
comboPeriodUnit->setEnabled(true);
|
||||
if (det->getDetectorType().squash() == slsDetectorDefs::GOTTHARD2) {
|
||||
ShowTriggerDelay();
|
||||
GetBurstMode(); // also decides to show trigger or burst mode
|
||||
}
|
||||
break;
|
||||
case TRIGGER:
|
||||
@ -270,7 +277,7 @@ void qTabMeasurement::EnableWidgetsforTimingMode() {
|
||||
spinDelay->setEnabled(true);
|
||||
comboDelayUnit->setEnabled(true);
|
||||
if (det->getDetectorType().squash() == slsDetectorDefs::GOTTHARD2) {
|
||||
ShowTriggerDelay();
|
||||
GetBurstMode(); // also decides to show trigger or burst mode
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -357,6 +364,42 @@ void qTabMeasurement::SetTimingMode(int val) {
|
||||
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) {
|
||||
LOG(logINFO) << "Setting Number of Measurements to " << val;
|
||||
numMeasurements = val;
|
||||
@ -723,19 +766,26 @@ void qTabMeasurement::GetFileName() {
|
||||
connect(dispFileName, SIGNAL(editingFinished()), this, SLOT(SetFileName()));
|
||||
}
|
||||
|
||||
void qTabMeasurement::SetFileName() {
|
||||
std::string val = std::string(dispFileName->text().toAscii().constData());
|
||||
LOG(logINFO) << "Setting File Name Prefix:" << val;
|
||||
try {
|
||||
det->setFileNamePrefix(val);
|
||||
}
|
||||
CATCH_HANDLE("Could not set file name prefix.",
|
||||
"qTabMeasurement::SetFileName", this,
|
||||
&qTabMeasurement::GetFileName)
|
||||
void qTabMeasurement::SetFileName(bool force) {
|
||||
// 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;
|
||||
try {
|
||||
det->setFileNamePrefix(val);
|
||||
}
|
||||
CATCH_HANDLE("Could not set file name prefix.",
|
||||
"qTabMeasurement::SetFileName", this,
|
||||
&qTabMeasurement::GetFileName)
|
||||
|
||||
emit FileNameChangedSignal(dispFileName->text());
|
||||
emit FileNameChangedSignal(dispFileName->text());
|
||||
}
|
||||
}
|
||||
|
||||
void qTabMeasurement::ForceSetFileName() { SetFileName(true); }
|
||||
|
||||
void qTabMeasurement::GetRunIndex() {
|
||||
LOG(logDEBUG) << "Getting Acquisition File index";
|
||||
disconnect(spinIndex, SIGNAL(valueChanged(int)), this,
|
||||
@ -904,6 +954,9 @@ void qTabMeasurement::Refresh() {
|
||||
|
||||
if (!plot->GetIsRunning()) {
|
||||
GetTimingMode();
|
||||
if (comboBurstMode->isVisible()) {
|
||||
GetBurstMode();
|
||||
}
|
||||
GetNumFrames();
|
||||
GetExposureTime();
|
||||
GetAcquisitionPeriod();
|
||||
|
@ -87,9 +87,9 @@ void qTabPlot::Initialization() {
|
||||
SLOT(SetStreamingFrequency()));
|
||||
connect(comboTimeGapUnit, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetStreamingFrequency()));
|
||||
connect(spinTimeGap, SIGNAL(editingFinished()), this,
|
||||
connect(spinTimeGap, SIGNAL(valueChanged(double)), this,
|
||||
SLOT(SetStreamingFrequency()));
|
||||
connect(spinNthFrame, SIGNAL(editingFinished()), this,
|
||||
connect(spinNthFrame, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetStreamingFrequency()));
|
||||
|
||||
// navigation buttons for options
|
||||
@ -174,17 +174,17 @@ void qTabPlot::Initialization() {
|
||||
connect(chkXMax, SIGNAL(toggled(bool)), this, SLOT(SetXRange()));
|
||||
connect(chkYMin, SIGNAL(toggled(bool)), this, SLOT(SetYRange()));
|
||||
connect(chkYMax, SIGNAL(toggled(bool)), this, SLOT(SetYRange()));
|
||||
connect(dispXMin, SIGNAL(editingFinished()), this, SLOT(SetXRange()));
|
||||
connect(dispXMax, SIGNAL(editingFinished()), this, SLOT(SetXRange()));
|
||||
connect(dispYMin, SIGNAL(editingFinished()), this, SLOT(SetYRange()));
|
||||
connect(dispYMax, SIGNAL(editingFinished()), this, SLOT(SetYRange()));
|
||||
connect(dispXMin, SIGNAL(editingFinished()), this, SLOT(isXMinModified()));
|
||||
connect(dispXMax, SIGNAL(editingFinished()), this, SLOT(isXMaxModified()));
|
||||
connect(dispYMin, SIGNAL(editingFinished()), this, SLOT(isYMinModified()));
|
||||
connect(dispYMax, SIGNAL(editingFinished()), this, SLOT(isYMaxModified()));
|
||||
connect(chkAspectRatio, SIGNAL(toggled(bool)), this,
|
||||
SLOT(CheckAspectRatio()));
|
||||
|
||||
connect(chkZMin, SIGNAL(toggled(bool)), this, SLOT(SetZRange()));
|
||||
connect(chkZMax, SIGNAL(toggled(bool)), this, SLOT(SetZRange()));
|
||||
connect(dispZMin, SIGNAL(editingFinished()), this, SLOT(SetZRange()));
|
||||
connect(dispZMax, SIGNAL(editingFinished()), this, SLOT(SetZRange()));
|
||||
connect(dispZMin, SIGNAL(editingFinished()), this, SLOT(isZMinModified()));
|
||||
connect(dispZMax, SIGNAL(editingFinished()), this, SLOT(isZMaxModified()));
|
||||
}
|
||||
|
||||
void qTabPlot::Select1DPlot(bool enable) {
|
||||
@ -389,6 +389,48 @@ void qTabPlot::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() {
|
||||
LOG(logDEBUG) << "Enable X axis range";
|
||||
|
||||
@ -452,10 +494,14 @@ void qTabPlot::MaintainAspectRatio(int dimension) {
|
||||
disconnect(chkXMax, SIGNAL(toggled(bool)), this, SLOT(SetXRange()));
|
||||
disconnect(chkYMin, SIGNAL(toggled(bool)), this, SLOT(SetYRange()));
|
||||
disconnect(chkYMax, SIGNAL(toggled(bool)), this, SLOT(SetYRange()));
|
||||
disconnect(dispXMin, SIGNAL(editingFinished()), this, SLOT(SetXRange()));
|
||||
disconnect(dispXMax, SIGNAL(editingFinished()), this, SLOT(SetXRange()));
|
||||
disconnect(dispYMin, SIGNAL(editingFinished()), this, SLOT(SetYRange()));
|
||||
disconnect(dispYMax, SIGNAL(editingFinished()), this, SLOT(SetYRange()));
|
||||
disconnect(dispXMin, SIGNAL(editingFinished()), this,
|
||||
SLOT(isXMinModified()));
|
||||
disconnect(dispXMax, SIGNAL(editingFinished()), this,
|
||||
SLOT(isXMaxModified()));
|
||||
disconnect(dispYMin, SIGNAL(editingFinished()), this,
|
||||
SLOT(isYMinModified()));
|
||||
disconnect(dispYMax, SIGNAL(editingFinished()), this,
|
||||
SLOT(isYMaxModified()));
|
||||
|
||||
// check all, fill all
|
||||
chkXMin->setChecked(true);
|
||||
@ -550,10 +596,10 @@ void qTabPlot::MaintainAspectRatio(int dimension) {
|
||||
connect(chkXMax, SIGNAL(toggled(bool)), this, SLOT(SetXRange()));
|
||||
connect(chkYMin, SIGNAL(toggled(bool)), this, SLOT(SetYRange()));
|
||||
connect(chkYMax, SIGNAL(toggled(bool)), this, SLOT(SetYRange()));
|
||||
connect(dispXMin, SIGNAL(editingFinished()), this, SLOT(SetXRange()));
|
||||
connect(dispXMax, SIGNAL(editingFinished()), this, SLOT(SetXRange()));
|
||||
connect(dispYMin, SIGNAL(editingFinished()), this, SLOT(SetYRange()));
|
||||
connect(dispYMax, SIGNAL(editingFinished()), this, SLOT(SetYRange()));
|
||||
connect(dispXMin, SIGNAL(editingFinished()), this, SLOT(isXMinModified()));
|
||||
connect(dispXMax, SIGNAL(editingFinished()), this, SLOT(isXMaxModified()));
|
||||
connect(dispYMin, SIGNAL(editingFinished()), this, SLOT(isYMinModified()));
|
||||
connect(dispYMax, SIGNAL(editingFinished()), this, SLOT(isYMaxModified()));
|
||||
|
||||
bool isRange[4]{true, true, true, true};
|
||||
plot->SetXYRangeChanged(true, ranges, isRange);
|
||||
@ -583,9 +629,9 @@ void qTabPlot::GetStreamingFrequency() {
|
||||
SLOT(SetStreamingFrequency()));
|
||||
disconnect(comboTimeGapUnit, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetStreamingFrequency()));
|
||||
disconnect(spinTimeGap, SIGNAL(editingFinished()), this,
|
||||
disconnect(spinTimeGap, SIGNAL(valueChanged(double)), this,
|
||||
SLOT(SetStreamingFrequency()));
|
||||
disconnect(spinNthFrame, SIGNAL(editingFinished()), this,
|
||||
disconnect(spinNthFrame, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetStreamingFrequency()));
|
||||
try {
|
||||
int freq = det->getRxZmqFrequency().tsquash(
|
||||
@ -621,9 +667,9 @@ void qTabPlot::GetStreamingFrequency() {
|
||||
SLOT(SetStreamingFrequency()));
|
||||
connect(comboTimeGapUnit, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetStreamingFrequency()));
|
||||
connect(spinTimeGap, SIGNAL(editingFinished()), this,
|
||||
connect(spinTimeGap, SIGNAL(valueChanged(double)), this,
|
||||
SLOT(SetStreamingFrequency()));
|
||||
connect(spinNthFrame, SIGNAL(editingFinished()), this,
|
||||
connect(spinNthFrame, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetStreamingFrequency()));
|
||||
}
|
||||
|
||||
|
Binary file not shown.
@ -23,6 +23,7 @@
|
||||
|
||||
// Global variable from slsDetectorServer_funcs
|
||||
extern int debugflag;
|
||||
extern int updateFlag;
|
||||
extern udpStruct udpDetails;
|
||||
extern const enum detectorType myDetectorType;
|
||||
|
||||
@ -105,8 +106,9 @@ void basictests() {
|
||||
}
|
||||
|
||||
// does check only if flag is 0 (by default), set by command line
|
||||
if ((!debugflag) && ((checkType() == FAIL) || (testFpga() == FAIL) ||
|
||||
(testBus() == FAIL))) {
|
||||
if ((!debugflag) && (!updateFlag) &&
|
||||
((checkType() == FAIL) || (testFpga() == FAIL) ||
|
||||
(testBus() == FAIL))) {
|
||||
strcpy(initErrorMessage, "Could not pass basic tests of FPGA and bus. "
|
||||
"Dangerous to continue.\n");
|
||||
LOG(logERROR, ("%s\n\n", initErrorMessage));
|
||||
@ -145,7 +147,7 @@ void basictests() {
|
||||
(long long int)client_sw_apiversion));
|
||||
|
||||
// return if flag is not zero, debug mode
|
||||
if (debugflag) {
|
||||
if (debugflag || updateFlag) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -417,7 +419,7 @@ uint32_t getDetectorIP() {
|
||||
/* initialization */
|
||||
|
||||
void initControlServer() {
|
||||
if (initError == OK) {
|
||||
if (!updateFlag && initError == OK) {
|
||||
setupDetector();
|
||||
}
|
||||
initCheckDone = 1;
|
||||
@ -2347,7 +2349,7 @@ int stopStateMachine() {
|
||||
sharedMemory_setStop(1);
|
||||
// read till status is idle
|
||||
while (sharedMemory_getStatus() == RUNNING)
|
||||
;
|
||||
usleep(500);
|
||||
sharedMemory_setStop(0);
|
||||
LOG(logINFO, ("Stopped State Machine\n"));
|
||||
return OK;
|
||||
|
@ -95,7 +95,7 @@ enum CLKINDEX { RUN_CLK, ADC_CLK, SYNC_CLK, DBIT_CLK, NUM_CLOCKS };
|
||||
#define NDAC_ONLY (NDAC - NPWR)
|
||||
#define DYNAMIC_RANGE (16)
|
||||
#define NUM_BYTES_PER_PIXEL (DYNAMIC_RANGE / 8)
|
||||
#define CLK_FREQ (156.25) /* MHz */
|
||||
#define CLK_FREQ (156.25) // MHz
|
||||
#define I2C_POWER_VIO_DEVICE_ID (0x40)
|
||||
#define I2C_POWER_VA_DEVICE_ID (0x41)
|
||||
#define I2C_POWER_VB_DEVICE_ID (0x42)
|
||||
|
@ -39,6 +39,10 @@ uint64_t Beb_deactivatedStartFrameNumber = 0;
|
||||
int Beb_quadEnable = 0;
|
||||
int Beb_positions[2] = {0, 0};
|
||||
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) {
|
||||
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) {
|
||||
if (!Beb_activated) {
|
||||
// not transmitting
|
||||
*retval = 0;
|
||||
return OK;
|
||||
}
|
||||
// mapping new memory
|
||||
u_int32_t *csp0base = 0;
|
||||
int addr_l_txndelaycounter = 0, addr_l_framedelaycounter = 0;
|
||||
@ -482,6 +491,9 @@ int Beb_Set32bitOverflow(int val) {
|
||||
}
|
||||
|
||||
int Beb_GetTenGigaFlowControl() {
|
||||
if (!Beb_activated)
|
||||
return Beb_deactivated_transmission_flowcontrol_10g;
|
||||
|
||||
u_int32_t offset = FLOW_REG_OFFSET;
|
||||
u_int32_t *csp0base = 0;
|
||||
int fd = Beb_open(&csp0base, XPAR_PLB_GPIO_SYS_BASEADDR);
|
||||
@ -501,6 +513,11 @@ int Beb_GetTenGigaFlowControl() {
|
||||
|
||||
int Beb_SetTenGigaFlowControl(int 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;
|
||||
u_int32_t offset = FLOW_REG_OFFSET;
|
||||
u_int32_t *csp0base = 0;
|
||||
@ -521,12 +538,17 @@ int Beb_SetTenGigaFlowControl(int value) {
|
||||
retval | ((value << FLOW_REG_TXM_FLOW_CNTRL_10G_OFST) &
|
||||
FLOW_REG_TXM_FLOW_CNTRL_10G_MSK));
|
||||
|
||||
Beb_deactivated_transmission_flowcontrol_10g = value;
|
||||
Beb_close(fd, csp0base);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
int Beb_GetTransmissionDelayFrame() {
|
||||
if (!Beb_activated) {
|
||||
return Beb_deactivated_transmission_delay_frame;
|
||||
}
|
||||
|
||||
u_int32_t offset = TXM_DELAY_FRAME_OFFSET;
|
||||
u_int32_t *csp0base = 0;
|
||||
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));
|
||||
return 0;
|
||||
}
|
||||
if (!Beb_activated) {
|
||||
Beb_deactivated_transmission_delay_frame = value;
|
||||
return 1;
|
||||
}
|
||||
u_int32_t offset = TXM_DELAY_FRAME_OFFSET;
|
||||
u_int32_t *csp0base = 0;
|
||||
int fd = Beb_open(&csp0base, XPAR_PLB_GPIO_SYS_BASEADDR);
|
||||
@ -556,12 +582,16 @@ int Beb_SetTransmissionDelayFrame(int value) {
|
||||
return 0;
|
||||
} else {
|
||||
Beb_Write32(csp0base, offset, value);
|
||||
Beb_deactivated_transmission_delay_frame = value;
|
||||
Beb_close(fd, csp0base);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
int Beb_GetTransmissionDelayLeft() {
|
||||
if (!Beb_activated) {
|
||||
return Beb_deactivated_transmission_delay_left;
|
||||
}
|
||||
u_int32_t offset = TXM_DELAY_LEFT_OFFSET;
|
||||
u_int32_t *csp0base = 0;
|
||||
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));
|
||||
return 0;
|
||||
}
|
||||
if (!Beb_activated) {
|
||||
Beb_deactivated_transmission_delay_left = value;
|
||||
return 1;
|
||||
}
|
||||
u_int32_t offset = TXM_DELAY_LEFT_OFFSET;
|
||||
u_int32_t *csp0base = 0;
|
||||
int fd = Beb_open(&csp0base, XPAR_PLB_GPIO_SYS_BASEADDR);
|
||||
@ -591,12 +625,17 @@ int Beb_SetTransmissionDelayLeft(int value) {
|
||||
return 0;
|
||||
} else {
|
||||
Beb_Write32(csp0base, offset, value);
|
||||
Beb_deactivated_transmission_delay_left = value;
|
||||
Beb_close(fd, csp0base);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
int Beb_GetTransmissionDelayRight() {
|
||||
if (!Beb_activated) {
|
||||
return Beb_deactivated_transmission_delay_right;
|
||||
}
|
||||
|
||||
u_int32_t offset = TXM_DELAY_RIGHT_OFFSET;
|
||||
u_int32_t *csp0base = 0;
|
||||
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));
|
||||
return 0;
|
||||
}
|
||||
if (!Beb_activated) {
|
||||
Beb_deactivated_transmission_delay_right = value;
|
||||
return 1;
|
||||
}
|
||||
u_int32_t offset = TXM_DELAY_RIGHT_OFFSET;
|
||||
u_int32_t *csp0base = 0;
|
||||
int fd = Beb_open(&csp0base, XPAR_PLB_GPIO_SYS_BASEADDR);
|
||||
@ -626,57 +669,12 @@ int Beb_SetTransmissionDelayRight(int value) {
|
||||
return 0;
|
||||
} else {
|
||||
Beb_Write32(csp0base, offset, value);
|
||||
Beb_deactivated_transmission_delay_right = value;
|
||||
Beb_close(fd, csp0base);
|
||||
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() {
|
||||
// mapping new memory
|
||||
u_int32_t *csp0base = 0;
|
||||
|
@ -986,11 +986,16 @@ int Feb_Control_StartAcquisition() {
|
||||
int Feb_Control_StopAcquisition() { return Feb_Control_Reset(); }
|
||||
|
||||
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) {
|
||||
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
|
||||
LOG(logDEBUG1, ("Setting Trigger, Register:0x%x\n", cmd));
|
||||
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
|
||||
// A1) and then A1/65536/0.00198421639-273.15
|
||||
int Feb_Control_GetLeftFPGATemp() {
|
||||
if (!Feb_Control_activated) {
|
||||
return 0;
|
||||
}
|
||||
unsigned int temperature = 0;
|
||||
Feb_Interface_ReadRegister(Feb_Control_leftAddress, FEB_REG_STATUS,
|
||||
&temperature);
|
||||
if (!Feb_Interface_ReadRegister(Feb_Control_leftAddress, FEB_REG_STATUS,
|
||||
&temperature)) {
|
||||
LOG(logERROR, ("Trouble reading FEB_REG_STATUS reg to get left feb "
|
||||
"temperature\n"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
temperature = temperature >> 16;
|
||||
temperature =
|
||||
@ -1875,9 +1887,16 @@ int Feb_Control_GetLeftFPGATemp() {
|
||||
}
|
||||
|
||||
int Feb_Control_GetRightFPGATemp() {
|
||||
if (!Feb_Control_activated) {
|
||||
return 0;
|
||||
}
|
||||
unsigned int temperature = 0;
|
||||
Feb_Interface_ReadRegister(Feb_Control_rightAddress, FEB_REG_STATUS,
|
||||
&temperature);
|
||||
if (!Feb_Interface_ReadRegister(Feb_Control_rightAddress, FEB_REG_STATUS,
|
||||
&temperature)) {
|
||||
LOG(logERROR, ("Trouble reading FEB_REG_STATUS reg to get right feb "
|
||||
"temperature\n"));
|
||||
return 0;
|
||||
}
|
||||
temperature = temperature >> 16;
|
||||
temperature =
|
||||
((((float)(temperature) / 65536.0f) / 0.00198421639f) - 273.15f) *
|
||||
@ -1887,15 +1906,29 @@ int Feb_Control_GetRightFPGATemp() {
|
||||
}
|
||||
|
||||
int64_t Feb_Control_GetMeasuredPeriod() {
|
||||
if (!Feb_Control_activated) {
|
||||
return 0;
|
||||
}
|
||||
unsigned int value = 0;
|
||||
Feb_Interface_ReadRegister(Feb_Control_leftAddress, MEAS_PERIOD_REG,
|
||||
&value);
|
||||
if (!Feb_Interface_ReadRegister(Feb_Control_leftAddress, MEAS_PERIOD_REG,
|
||||
&value)) {
|
||||
LOG(logERROR,
|
||||
("Trouble reading MEAS_PERIOD_REG reg to get measured period\n"));
|
||||
return 0;
|
||||
}
|
||||
return (int64_t)value * 10;
|
||||
}
|
||||
|
||||
int64_t Feb_Control_GetSubMeasuredPeriod() {
|
||||
if (!Feb_Control_activated) {
|
||||
return 0;
|
||||
}
|
||||
unsigned int value = 0;
|
||||
Feb_Interface_ReadRegister(Feb_Control_leftAddress, MEAS_SUBPERIOD_REG,
|
||||
&value);
|
||||
if (!Feb_Interface_ReadRegister(Feb_Control_leftAddress, MEAS_SUBPERIOD_REG,
|
||||
&value)) {
|
||||
LOG(logERROR, ("Trouble reading MEAS_SUBPERIOD_REG reg to get measured "
|
||||
"sub period\n"));
|
||||
return 0;
|
||||
}
|
||||
return (int64_t)value * 10;
|
||||
}
|
||||
|
Binary file not shown.
@ -20,6 +20,7 @@
|
||||
|
||||
// Global variable from slsDetectorServer_funcs
|
||||
extern int debugflag;
|
||||
extern int updateFlag;
|
||||
extern udpStruct udpDetails;
|
||||
extern const enum detectorType myDetectorType;
|
||||
|
||||
@ -140,7 +141,7 @@ void basictests() {
|
||||
return;
|
||||
#endif
|
||||
// return if debugflag is not zero, debug mode
|
||||
if (debugflag) {
|
||||
if (debugflag || updateFlag) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -319,7 +320,7 @@ u_int32_t getDetectorIP() {
|
||||
|
||||
void initControlServer() {
|
||||
LOG(logINFOBLUE, ("Configuring Control server\n"));
|
||||
if (initError == OK) {
|
||||
if (!updateFlag && initError == OK) {
|
||||
readDetectorNumber();
|
||||
getModuleConfiguration();
|
||||
#ifndef VIRTUAL
|
||||
@ -2048,11 +2049,12 @@ void *start_timer(void *arg) {
|
||||
int colRight = top ? eiger_virtual_detPos[1] + 1 : eiger_virtual_detPos[1];
|
||||
int ntotpixels = 256 * 256 * 4;
|
||||
|
||||
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 "
|
||||
"ntotpixels:%d\n",
|
||||
dr, bytesPerPixel, tgEnable, datasize, packetsize,
|
||||
numPacketsPerFrame, npixelsx, databytes, ntotpixels));
|
||||
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 "
|
||||
"ntotpixels:%d\n",
|
||||
dr, bytesPerPixel, tgEnable, datasize, packetsize, numPacketsPerFrame,
|
||||
npixelsx, databytes, ntotpixels));
|
||||
|
||||
// Generate data
|
||||
char imageData[databytes * 2];
|
||||
@ -2181,7 +2183,8 @@ void *start_timer(void *arg) {
|
||||
usleep(eiger_virtual_transmission_delay_right);
|
||||
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);
|
||||
int64_t timeNs = ((end.tv_sec - begin.tv_sec) * 1E9 +
|
||||
(end.tv_nsec - begin.tv_nsec));
|
||||
@ -2215,7 +2218,7 @@ int stopStateMachine() {
|
||||
sharedMemory_setStop(1);
|
||||
// read till status is idle
|
||||
while (sharedMemory_getStatus() == RUNNING)
|
||||
;
|
||||
usleep(500);
|
||||
sharedMemory_setStop(0);
|
||||
LOG(logINFO, ("Stopped State Machine\n"));
|
||||
return OK;
|
||||
|
@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
#include "sls_detector_defs.h"
|
||||
|
||||
#define REQUIRED_FIRMWARE_VERSION (26)
|
||||
#define REQUIRED_FIRMWARE_VERSION (27)
|
||||
#define IDFILECOMMAND "more /home/root/executables/detid.txt"
|
||||
#define CONFIG_FILE ("config_eiger.txt")
|
||||
#define WAIT_STOP_SERVER_START (1 * 1000 * 1000)
|
||||
@ -130,7 +130,7 @@ enum MASTERINDEX { MASTER_HARDWARE, OW_MASTER, OW_SLAVE };
|
||||
#define DAC_MAX_STEPS (4096)
|
||||
|
||||
#define MAX_SUBFRAME_EXPOSURE_VAL_IN_10NS \
|
||||
(0x1FFFFFFF) /** 29 bit register for max subframe exposure value */
|
||||
(0x1FFFFFFF) // 29 bit register for max subframe exposure value
|
||||
|
||||
#define SLAVE_HIGH_VOLTAGE_READ_VAL (-999)
|
||||
#define HIGH_VOLTAGE_TOLERANCE (5)
|
||||
|
@ -121,9 +121,10 @@
|
||||
|
||||
#define ASIC_CONFIG_RUN_MODE_OFST (0)
|
||||
#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_CONT_VAL ((0x2 << 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_BURST_VAL ((0x0 << 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_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_MSK (0x00000003 << ASIC_CONFIG_GAIN_OFST)
|
||||
#define ASIC_CONFIG_DYNAMIC_GAIN_VAL ((0x0 << ASIC_CONFIG_GAIN_OFST) & ASIC_CONFIG_GAIN_MSK)
|
||||
|
Binary file not shown.
@ -22,6 +22,7 @@
|
||||
|
||||
// Global variable from slsDetectorServer_funcs
|
||||
extern int debugflag;
|
||||
extern int updateFlag;
|
||||
extern int checkModuleFlag;
|
||||
extern udpStruct udpDetails;
|
||||
extern const enum detectorType myDetectorType;
|
||||
@ -92,8 +93,9 @@ void basictests() {
|
||||
return;
|
||||
}
|
||||
// does check only if flag is 0 (by default), set by command line
|
||||
if ((!debugflag) && ((checkType() == FAIL) || (testFpga() == FAIL) ||
|
||||
(testBus() == FAIL))) {
|
||||
if ((!debugflag) && (!updateFlag) &&
|
||||
((checkKernelVersion() == FAIL) || (checkType() == FAIL) ||
|
||||
(testFpga() == FAIL) || (testBus() == FAIL))) {
|
||||
sprintf(initErrorMessage,
|
||||
"Could not pass basic tests of FPGA and bus. Dangerous to "
|
||||
"continue. (Firmware version:0x%llx) \n",
|
||||
@ -131,7 +133,7 @@ void basictests() {
|
||||
(long long int)client_sw_apiversion));
|
||||
|
||||
// return if flag is not zero, debug mode
|
||||
if (debugflag) {
|
||||
if (debugflag || updateFlag) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -175,6 +177,13 @@ void basictests() {
|
||||
#endif
|
||||
}
|
||||
|
||||
int checkKernelVersion() {
|
||||
#ifdef VIRTUAL
|
||||
return OK;
|
||||
#endif
|
||||
return Nios_checkKernelVersion(KERNEL_DATE_VRSN);
|
||||
}
|
||||
|
||||
int checkType() {
|
||||
#ifdef VIRTUAL
|
||||
return OK;
|
||||
@ -326,7 +335,7 @@ u_int32_t getDetectorIP() {
|
||||
/* initialization */
|
||||
|
||||
void initControlServer() {
|
||||
if (initError == OK) {
|
||||
if (!updateFlag && initError == OK) {
|
||||
setupDetector();
|
||||
}
|
||||
initCheckDone = 1;
|
||||
@ -809,11 +818,15 @@ int setDynamicRange(int dr) { return DYNAMIC_RANGE; }
|
||||
/* parameters - timer */
|
||||
void setNumFrames(int64_t val) {
|
||||
if (val > 0) {
|
||||
if (burstMode == BURST_OFF) {
|
||||
// continuous
|
||||
if (burstMode == CONTINUOUS_INTERNAL ||
|
||||
burstMode == CONTINUOUS_EXTERNAL) {
|
||||
LOG(logINFO,
|
||||
("Setting number of frames %lld [Continuous mode]\n", val));
|
||||
set64BitReg(val, SET_FRAMES_LSB_REG, SET_FRAMES_MSB_REG);
|
||||
} else {
|
||||
}
|
||||
// burst
|
||||
else {
|
||||
LOG(logINFO,
|
||||
("Setting number of frames %d [Burst mode]\n", (int)val));
|
||||
bus_w(ASIC_INT_FRAMES_REG,
|
||||
@ -826,9 +839,12 @@ void setNumFrames(int64_t val) {
|
||||
}
|
||||
|
||||
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);
|
||||
} else {
|
||||
}
|
||||
// burst
|
||||
else {
|
||||
return ((bus_r(ASIC_INT_FRAMES_REG) & ASIC_INT_FRAMES_MSK) >>
|
||||
ASIC_INT_FRAMES_OFST);
|
||||
}
|
||||
@ -856,9 +872,13 @@ int64_t getNumTriggers() {
|
||||
void setNumBursts(int64_t val) {
|
||||
if (val > 0) {
|
||||
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);
|
||||
} else {
|
||||
}
|
||||
// burst-trigger or continuous
|
||||
else {
|
||||
LOG(logINFO,
|
||||
("\tNot (Burst and Auto mode): not writing to register\n"));
|
||||
numBurstsReg = val;
|
||||
@ -867,9 +887,12 @@ void setNumBursts(int64_t val) {
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
// burst-trigger or continuous
|
||||
return numBurstsReg;
|
||||
}
|
||||
|
||||
@ -901,12 +924,16 @@ int setPeriod(int64_t val) {
|
||||
LOG(logERROR, ("Invalid period: %lld ns\n", val));
|
||||
return FAIL;
|
||||
}
|
||||
val *= (1E-9 * systemFrequency);
|
||||
if (burstMode == BURST_OFF) {
|
||||
// continuous
|
||||
if (burstMode == CONTINUOUS_INTERNAL || burstMode == CONTINUOUS_EXTERNAL) {
|
||||
LOG(logINFO, ("Setting period %lld ns [Continuous mode]\n", val));
|
||||
val *= (1E-9 * systemFrequency);
|
||||
set64BitReg(val, SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG);
|
||||
} else {
|
||||
}
|
||||
// burst
|
||||
else {
|
||||
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);
|
||||
}
|
||||
// validate for tolerance
|
||||
@ -919,10 +946,13 @@ int setPeriod(int64_t val) {
|
||||
}
|
||||
|
||||
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) /
|
||||
(1E-9 * systemFrequency);
|
||||
} else {
|
||||
}
|
||||
// burst
|
||||
else {
|
||||
return get64BitReg(ASIC_INT_PERIOD_LSB_REG, ASIC_INT_PERIOD_MSB_REG) /
|
||||
(1E-9 * systemFrequency);
|
||||
}
|
||||
@ -965,9 +995,13 @@ int setBurstPeriod(int64_t val) {
|
||||
}
|
||||
LOG(logINFO, ("Setting burst period %lld ns\n", val));
|
||||
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);
|
||||
} else {
|
||||
}
|
||||
// burst-trigger, continuous
|
||||
else {
|
||||
LOG(logINFO,
|
||||
("\tNot (Burst and Auto mode): not writing to register\n"));
|
||||
burstPeriodReg = val;
|
||||
@ -983,10 +1017,13 @@ int setBurstPeriod(int64_t val) {
|
||||
}
|
||||
|
||||
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) /
|
||||
(1E-9 * systemFrequency);
|
||||
}
|
||||
// burst-trigger, continuous
|
||||
return burstPeriodReg / (1E-9 * systemFrequency);
|
||||
}
|
||||
|
||||
@ -1210,7 +1247,7 @@ void setTiming(enum timingMode arg) {
|
||||
get64BitReg(SET_TRIGGER_DELAY_LSB_REG, SET_TRIGGER_DELAY_MSB_REG);
|
||||
}
|
||||
// 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);
|
||||
burstPeriodReg = get64BitReg(SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG);
|
||||
}
|
||||
@ -1237,7 +1274,7 @@ void setTiming(enum timingMode arg) {
|
||||
LOG(logINFO, ("\tTriggers reg: %lld, Delay reg: %lldns\n",
|
||||
getNumTriggers(), getDelayAfterTrigger()));
|
||||
// burst
|
||||
if (burstMode != BURST_OFF) {
|
||||
if (burstMode == BURST_INTERNAL || burstMode == BURST_EXTERNAL) {
|
||||
LOG(logINFO, ("\tFrame reg: 1, Period reg: 0\n"))
|
||||
set64BitReg(1, SET_FRAMES_LSB_REG, SET_FRAMES_MSB_REG);
|
||||
set64BitReg(0, SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG);
|
||||
@ -1249,7 +1286,7 @@ void setTiming(enum timingMode arg) {
|
||||
set64BitReg(1, SET_CYCLES_LSB_REG, SET_CYCLES_MSB_REG);
|
||||
set64BitReg(0, SET_TRIGGER_DELAY_LSB_REG, SET_TRIGGER_DELAY_MSB_REG);
|
||||
// burst
|
||||
if (burstMode != BURST_OFF) {
|
||||
if (burstMode == BURST_INTERNAL || burstMode == BURST_EXTERNAL) {
|
||||
set64BitReg(numBurstsReg, SET_FRAMES_LSB_REG, SET_FRAMES_MSB_REG);
|
||||
set64BitReg(burstPeriodReg, SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG);
|
||||
LOG(logINFO, ("\tFrames reg (bursts): %lld, Period reg(burst "
|
||||
@ -1818,7 +1855,8 @@ int configureASICVetoReference(int chipIndex, int *gainIndices, int *values) {
|
||||
("Unknown gain index %d for channel %d\n", gainIndices[i], i));
|
||||
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]));
|
||||
}
|
||||
|
||||
@ -2051,15 +2089,18 @@ int setBurstModeinFPGA(enum burstMode value) {
|
||||
uint32_t addr = ASIC_CONFIG_REG;
|
||||
uint32_t runmode = 0;
|
||||
switch (value) {
|
||||
case BURST_OFF:
|
||||
runmode = ASIC_CONFIG_RUN_MODE_CONT_VAL;
|
||||
break;
|
||||
case BURST_INTERNAL:
|
||||
runmode = ASIC_CONFIG_RUN_MODE_INT_BURST_VAL;
|
||||
break;
|
||||
case BURST_EXTERNAL:
|
||||
runmode = ASIC_CONFIG_RUN_MODE_EXT_BURST_VAL;
|
||||
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:
|
||||
LOG(logERROR, ("Unknown burst mode %d\n", value));
|
||||
return FAIL;
|
||||
@ -2073,16 +2114,20 @@ int setBurstModeinFPGA(enum burstMode value) {
|
||||
}
|
||||
|
||||
int setBurstMode(enum burstMode burst) {
|
||||
LOG(logINFO, ("Setting burst mode to %s\n",
|
||||
burst == BURST_OFF
|
||||
? "off"
|
||||
: (burst == BURST_INTERNAL ? "internal" : "external")));
|
||||
LOG(logINFO,
|
||||
("Setting burst mode to %s\n",
|
||||
(burst == BURST_INTERNAL
|
||||
? "burst_internal"
|
||||
: (burst == BURST_EXTERNAL ? "burst external"
|
||||
: (burst == CONTINUOUS_INTERNAL
|
||||
? "continuous internal"
|
||||
: "continuous external")))));
|
||||
|
||||
// update
|
||||
int64_t framesReg = 0;
|
||||
int64_t periodReg = 0;
|
||||
// burst
|
||||
if (burstMode != BURST_OFF) {
|
||||
if (burstMode == BURST_INTERNAL || burstMode == BURST_EXTERNAL) {
|
||||
framesReg = ((bus_r(ASIC_INT_FRAMES_REG) & ASIC_INT_FRAMES_MSK) >>
|
||||
ASIC_INT_FRAMES_OFST);
|
||||
periodReg =
|
||||
@ -2106,7 +2151,7 @@ int setBurstMode(enum burstMode burst) {
|
||||
|
||||
LOG(logINFO, ("\tUpdating registers\n"));
|
||||
// continuous
|
||||
if (burstMode == BURST_OFF) {
|
||||
if (burstMode == CONTINUOUS_INTERNAL || burstMode == CONTINUOUS_EXTERNAL) {
|
||||
set64BitReg(framesReg, SET_FRAMES_LSB_REG, SET_FRAMES_MSB_REG);
|
||||
set64BitReg(periodReg, SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG);
|
||||
LOG(logINFO, ("\tFrames reg: %lld, Period reg: %lldns\n",
|
||||
@ -2156,14 +2201,17 @@ int configureASICGlobalSettings() {
|
||||
int value = ((filter << ASIC_FILTER_OFST) & ASIC_FILTER_MSK) |
|
||||
((cdsGain << ASIC_CDS_GAIN_OFST) & ASIC_CDS_GAIN_MSK);
|
||||
switch (burstMode) {
|
||||
case BURST_OFF:
|
||||
value |= (ASIC_CONT_MODE_MSK | ASIC_EXT_TIMING_MSK);
|
||||
break;
|
||||
case BURST_INTERNAL:
|
||||
break;
|
||||
case BURST_EXTERNAL:
|
||||
value |= ASIC_EXT_TIMING_MSK;
|
||||
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, "
|
||||
"cdsgain:%d)\n",
|
||||
@ -2212,15 +2260,18 @@ enum burstMode getBurstMode() {
|
||||
uint32_t addr = ASIC_CONFIG_REG;
|
||||
int runmode = bus_r(addr) & ASIC_CONFIG_RUN_MODE_MSK;
|
||||
switch (runmode) {
|
||||
case ASIC_CONFIG_RUN_MODE_CONT_VAL:
|
||||
burstMode = BURST_OFF;
|
||||
break;
|
||||
case ASIC_CONFIG_RUN_MODE_INT_BURST_VAL:
|
||||
burstMode = BURST_INTERNAL;
|
||||
break;
|
||||
case ASIC_CONFIG_RUN_MODE_EXT_BURST_VAL:
|
||||
burstMode = BURST_EXTERNAL;
|
||||
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:
|
||||
LOG(logERROR, ("Unknown run mode read from FPGA %d\n", runmode));
|
||||
return -1;
|
||||
@ -2429,9 +2480,13 @@ void *start_timer(void *arg) {
|
||||
|
||||
int numRepeats = getNumTriggers();
|
||||
if (getTiming() == AUTO_TIMING) {
|
||||
if (burstMode == BURST_OFF) {
|
||||
// continuous
|
||||
if (burstMode == CONTINUOUS_INTERNAL ||
|
||||
burstMode == CONTINUOUS_EXTERNAL) {
|
||||
numRepeats = 1;
|
||||
} else {
|
||||
}
|
||||
// burst
|
||||
else {
|
||||
numRepeats = getNumBursts();
|
||||
}
|
||||
}
|
||||
@ -2509,8 +2564,8 @@ void *start_timer(void *arg) {
|
||||
sendUDPPacket(1, packetData2, vetopacketsize);
|
||||
}
|
||||
LOG(logINFO,
|
||||
("Sent frame: %d (bursts: %d) [%lld]\n", frameNr, repeatNr,
|
||||
(long long unsigned int)virtual_currentFrameNumber));
|
||||
("Sent frame: %d (bursts/ triggers: %d) [%lld]\n", frameNr,
|
||||
repeatNr, (long long unsigned int)virtual_currentFrameNumber));
|
||||
clock_gettime(CLOCK_REALTIME, &end);
|
||||
int64_t timeNs = ((end.tv_sec - begin.tv_sec) * 1E9 +
|
||||
(end.tv_nsec - begin.tv_nsec));
|
||||
@ -2555,7 +2610,7 @@ int stopStateMachine() {
|
||||
#ifdef VIRTUAL
|
||||
sharedMemory_setStop(1);
|
||||
while (sharedMemory_getStatus() == RUNNING)
|
||||
;
|
||||
usleep(500);
|
||||
sharedMemory_setStop(0);
|
||||
LOG(logINFO, ("Stopped State Machine\n"));
|
||||
return OK;
|
||||
|
@ -2,6 +2,7 @@
|
||||
#include "sls_detector_defs.h"
|
||||
|
||||
#define REQRD_FRMWRE_VRSN (0x200707)
|
||||
#define KERNEL_DATE_VRSN "Wed May 20 13:58:38 CEST 2020"
|
||||
|
||||
#define CTRL_SRVR_INIT_TIME_US (300 * 1000)
|
||||
|
||||
@ -46,8 +47,8 @@
|
||||
#define DEFAULT_CURRENT_SOURCE (0)
|
||||
#define DEFAULT_TIMING_SOURCE (TIMING_INTERNAL)
|
||||
|
||||
#define DEFAULT_READOUT_C0 (8) //(108333336) // rdo_clk, 108 MHz
|
||||
#define DEFAULT_READOUT_C1 (8) //(108333336) // rdo_x2_clk, 108 MHz
|
||||
#define DEFAULT_READOUT_C0 (6) //(144444448) // rdo_clk, 144 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_C1 (10) //(72222224) // chip_clk, 72 MHz
|
||||
#define DEFAULT_SYSTEM_C2 (5) //(144444448) // sync_clk, 144 MHz
|
||||
@ -137,17 +138,17 @@ enum PLLINDEX { READOUT_PLL, SYSTEM_PLL };
|
||||
#define ASIC_ADC_MAX_VAL (0x7F)
|
||||
#define ASIC_GLOBAL_SETT_MAX_BITS (6)
|
||||
|
||||
#define ASIC_EXT_MEMCTRL_OFST (0)
|
||||
#define ASIC_EXT_MEMCTRL_MSK (0x1 << ASIC_EXT_MEMCTRL_OFST)
|
||||
#define ASIC_EXT_TIMING_OFST (1)
|
||||
#define ASIC_EXT_TIMING_MSK (0x1 << ASIC_EXT_TIMING_OFST)
|
||||
#define ASIC_CONT_MODE_OFST (2)
|
||||
#define ASIC_CONT_MODE_MSK (0x1 << ASIC_CONT_MODE_OFST)
|
||||
#define ASIC_FILTER_OFST (3)
|
||||
#define ASIC_FILTER_MSK (0x3 << ASIC_FILTER_OFST)
|
||||
#define ASIC_FILTER_MAX_VALUE (3)
|
||||
#define ASIC_CDS_GAIN_OFST (5)
|
||||
#define ASIC_CDS_GAIN_MSK (0x1 << ASIC_CDS_GAIN_OFST)
|
||||
#define ASIC_EXT_MEMCTRL_OFST (0)
|
||||
#define ASIC_EXT_MEMCTRL_MSK (0x1 << ASIC_EXT_MEMCTRL_OFST)
|
||||
#define ASIC_EXT_TIMING_OFST (1)
|
||||
#define ASIC_EXT_TIMING_MSK (0x1 << ASIC_EXT_TIMING_OFST)
|
||||
#define ASIC_CONT_MODE_OFST (2)
|
||||
#define ASIC_CONT_MODE_MSK (0x1 << ASIC_CONT_MODE_OFST)
|
||||
#define ASIC_FILTER_OFST (3)
|
||||
#define ASIC_FILTER_MSK (0x3 << ASIC_FILTER_OFST)
|
||||
#define ASIC_FILTER_MAX_VALUE (3)
|
||||
#define ASIC_CDS_GAIN_OFST (5)
|
||||
#define ASIC_CDS_GAIN_MSK (0x1 << ASIC_CDS_GAIN_OFST)
|
||||
|
||||
/* Struct Definitions */
|
||||
typedef struct udp_header_struct {
|
||||
|
Binary file not shown.
@ -18,6 +18,9 @@
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
// Global variable from slsDetectorServer_funcs
|
||||
extern int debugflag;
|
||||
extern int updateFlag;
|
||||
extern udpStruct udpDetails;
|
||||
extern const enum detectorType myDetectorType;
|
||||
|
||||
@ -91,7 +94,8 @@ void basictests() {
|
||||
}
|
||||
|
||||
// does check only if flag is 0 (by default), set by command line
|
||||
if (((checkType() == FAIL) || (testFpga() == FAIL) ||
|
||||
if ((!debugflag) && (!updateFlag) &&
|
||||
((checkType() == FAIL) || (testFpga() == FAIL) ||
|
||||
(testBus() == FAIL))) {
|
||||
strcpy(initErrorMessage, "Could not pass basic tests of FPGA and bus. "
|
||||
"Dangerous to continue.\n");
|
||||
@ -125,7 +129,9 @@ void basictests() {
|
||||
(long long int)fwversion, (long long int)swversion,
|
||||
(long long int)client_sw_apiversion));
|
||||
|
||||
LOG(logINFO, ("Basic Tests - success\n"));
|
||||
if (!debugflag || updateFlag) {
|
||||
LOG(logINFO, ("Basic Tests - success\n"));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -343,7 +349,7 @@ u_int32_t getBoardRevision() {
|
||||
/* initialization */
|
||||
|
||||
void initControlServer() {
|
||||
if (initError == OK) {
|
||||
if (!updateFlag && initError == OK) {
|
||||
setupDetector();
|
||||
}
|
||||
initCheckDone = 1;
|
||||
@ -1630,7 +1636,7 @@ int stopStateMachine() {
|
||||
sharedMemory_setStop(1);
|
||||
// read till status is idle
|
||||
while (sharedMemory_getStatus() == RUNNING)
|
||||
;
|
||||
usleep(500);
|
||||
sharedMemory_setStop(0);
|
||||
LOG(logINFO, ("Stopped State Machine\n"));
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ enum CLKINDEX { ADC_CLK, NUM_CLOCKS };
|
||||
#define DYNAMIC_RANGE (16)
|
||||
#define NUM_BITS_PER_PIXEL (DYNAMIC_RANGE / 8)
|
||||
#define DATA_BYTES (NCHIP * NCHAN * NUM_BITS_PER_PIXEL)
|
||||
#define CLK_FREQ (32007729) /* Hz */
|
||||
#define CLK_FREQ (32007729) // Hz
|
||||
#define MAX_EXT_SIGNALS (1)
|
||||
|
||||
/** Firmware Definitions */
|
||||
|
Binary file not shown.
@ -22,6 +22,7 @@
|
||||
|
||||
// Global variable from slsDetectorServer_funcs
|
||||
extern int debugflag;
|
||||
extern int updateFlag;
|
||||
extern udpStruct udpDetails;
|
||||
extern const enum detectorType myDetectorType;
|
||||
|
||||
@ -77,8 +78,9 @@ void basictests() {
|
||||
}
|
||||
|
||||
// does check only if flag is 0 (by default), set by command line
|
||||
if ((!debugflag) && ((checkType() == FAIL) || (testFpga() == FAIL) ||
|
||||
(testBus() == FAIL))) {
|
||||
if ((!debugflag) && (!updateFlag) &&
|
||||
((checkType() == FAIL) || (testFpga() == FAIL) ||
|
||||
(testBus() == FAIL))) {
|
||||
strcpy(initErrorMessage, "Could not pass basic tests of FPGA and bus. "
|
||||
"Dangerous to continue.\n");
|
||||
LOG(logERROR, ("%s\n\n", initErrorMessage));
|
||||
@ -119,7 +121,7 @@ void basictests() {
|
||||
(long long int)client_sw_apiversion));
|
||||
|
||||
// return if flag is not zero, debug mode
|
||||
if (debugflag) {
|
||||
if (debugflag || updateFlag) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -347,7 +349,7 @@ u_int32_t getDetectorIP() {
|
||||
/* initialization */
|
||||
|
||||
void initControlServer() {
|
||||
if (initError == OK) {
|
||||
if (!updateFlag && initError == OK) {
|
||||
setupDetector();
|
||||
}
|
||||
initCheckDone = 1;
|
||||
@ -1818,7 +1820,7 @@ int stopStateMachine() {
|
||||
sharedMemory_setStop(1);
|
||||
// read till status is idle
|
||||
while (sharedMemory_getStatus() == RUNNING)
|
||||
;
|
||||
usleep(500);
|
||||
sharedMemory_setStop(0);
|
||||
LOG(logINFO, ("Stopped State Machine\n"));
|
||||
return OK;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user