mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-18 15:57:13 +02:00
Compare commits
290 Commits
2020.03.11
...
2020.06.08
Author | SHA1 | Date | |
---|---|---|---|
6c95bf171b | |||
fd948f1a00 | |||
ff9811895f | |||
7f6d57d6ba | |||
099805ba8b | |||
1e2a3f2767 | |||
9a8300ca08 | |||
40257fc82d | |||
3bdc8e95ce | |||
223e24f924 | |||
4053594c4d | |||
f07e722d26 | |||
2ef8f2f046 | |||
0e514a470d | |||
294612b03c | |||
f223415f94 | |||
c6ff50d753 | |||
f0a318777c | |||
8aa7144252 | |||
15eea51f12 | |||
e884836f5c | |||
104d91e8c6 | |||
9ddebc4c09 | |||
0525e374b2 | |||
e727b97d75 | |||
5ca987ecbb | |||
2a64a9f6e0 | |||
a708da5455 | |||
e2eb1598d3 | |||
d175ba0936 | |||
6189fd157a | |||
6c753f3b50 | |||
098d3e6d98 | |||
4300e95a8e | |||
46daa7e2de | |||
754536898a | |||
20bfe92573 | |||
9493ae3da9 | |||
0fca9fba79 | |||
b543708d9d | |||
e0ea08332f | |||
e229fee6ba | |||
44a88893ba | |||
f4ba46c19b | |||
37cb0bb1c0 | |||
f293ba8c56 | |||
e9ca17f860 | |||
30391a2faf | |||
7ba877446c | |||
6bdc506a34 | |||
9592d1760f | |||
8ffb27c300 | |||
0a66605111 | |||
02d8b1fb5f | |||
457f31ed61 | |||
be3f095b56 | |||
174bb32744 | |||
07d90d127f | |||
0debd6a457 | |||
8f0ef68029 | |||
d71e40729a | |||
9475e01062 | |||
dc8f67cd7b | |||
3ebb1fca02 | |||
8973ef1aaa | |||
5690914048 | |||
fa768e584e | |||
62e69b900b | |||
30fc346e22 | |||
761f93d753 | |||
6d71d6cf9f | |||
e208d3ebe8 | |||
cd90f09a30 | |||
4570ffc8ad | |||
a7ce30391c | |||
c33c479ada | |||
c8eda1a458 | |||
ecc692ad9a | |||
00c1211c56 | |||
599625e6ed | |||
3514b14bc9 | |||
395b9f1b72 | |||
26dfccf77e | |||
50d2d21018 | |||
2c83abcac7 | |||
ea7cc9db8c | |||
0dd5a099c8 | |||
e6deccc2c6 | |||
ad42a61bae | |||
cbc2856c1c | |||
e34fbb4350 | |||
eea67014b7 | |||
3962714b48 | |||
f0f97f265a | |||
e730c124e3 | |||
f51c4e1d7c | |||
a62b650e24 | |||
af4b5bbf50 | |||
d8ca9bb6b5 | |||
9a1fdc4104 | |||
b3ebce378d | |||
46afcfe694 | |||
d7563fdd1a | |||
ccf1889113 | |||
88f801061f | |||
e3d3c88d74 | |||
80f4f115f9 | |||
9a7d15bbf6 | |||
e148a584df | |||
5aaefc8e00 | |||
ed8d606eb2 | |||
eff664e790 | |||
1ed1b5da86 | |||
353b8d0057 | |||
bbe9108fb9 | |||
1998f9541e | |||
6620027439 | |||
30078d6c1f | |||
13c1f7c2d6 | |||
28bafb012a | |||
9c7ff84b73 | |||
ab5cad4fde | |||
dac9998161 | |||
1dfac6ae6a | |||
2e75f36fa0 | |||
c1902c713d | |||
61f5564bb7 | |||
ec2f7db729 | |||
676055837f | |||
cce028b825 | |||
d468641138 | |||
01d1c86403 | |||
2ac7451a99 | |||
15b57b29fb | |||
902616a09d | |||
eb3971fedc | |||
64f0aa98ab | |||
61b86962bd | |||
0e5a96e1ed | |||
2f11dbc2c9 | |||
9b21f44d94 | |||
e56b431dc3 | |||
1741c84406 | |||
1623448086 | |||
1a39f92f8f | |||
4ea1f2c7e3 | |||
66d30cb2f1 | |||
8f021fe4ac | |||
7f42f5cadb | |||
999c548aa1 | |||
6872f24037 | |||
1a75170eed | |||
a12d47da36 | |||
c16411ba00 | |||
379b9b53b4 | |||
d76f43f5fd | |||
7d94ad51ab | |||
671cf45fd7 | |||
31ec3c8cf7 | |||
8ff9b0cdac | |||
ea4044e4b1 | |||
e599bb7c24 | |||
3618f6e5d3 | |||
959fd562d3 | |||
32662baef8 | |||
4e4f06560c | |||
efcb6cf480 | |||
9ae933b177 | |||
f87e8d3c19 | |||
903ebb2679 | |||
f41083842f | |||
9a87ba610a | |||
7224ad989a | |||
64f5c0f34b | |||
3238ecfc8d | |||
395d7ba98a | |||
96ec3b2123 | |||
b7805ae0d4 | |||
1f6b0b5887 | |||
b1cdc79bd4 | |||
f626db454e | |||
86b39853a3 | |||
e3044689dd | |||
337e56d9bf | |||
eb257154c6 | |||
c1ae67ac46 | |||
68f76e5356 | |||
8afa11ed33 | |||
bc389f4825 | |||
095ced153c | |||
a1a5a20845 | |||
c725a05ef8 | |||
815b6a37aa | |||
655a410d43 | |||
97ba81d923 | |||
3d00eed0f0 | |||
a7f5300455 | |||
2f33a1a479 | |||
39fa5e0185 | |||
ba4985ed4d | |||
f811c065d1 | |||
3a1d87728c | |||
0652ff6b5a | |||
373e177274 | |||
6dd6685e7d | |||
38c31fdada | |||
b3fe0e79bc | |||
215e4a56fd | |||
71a68c2022 | |||
55f8497eac | |||
738f341265 | |||
c4ae876ca7 | |||
07cd71f0c7 | |||
9f3ad4e2f4 | |||
ab9fed45fb | |||
a86ae0cb47 | |||
bdf0f9e2b9 | |||
fad10273ed | |||
83283b672a | |||
456b96446f | |||
80e55cd4da | |||
47b0e46f15 | |||
fdb6e3f3d4 | |||
eeed102bf3 | |||
7c7f7e8c70 | |||
262b4b0b16 | |||
83010de9f4 | |||
f2dd146e56 | |||
03af145ee8 | |||
043e62f9fd | |||
6289163ac8 | |||
3ba9e5ec22 | |||
719157f5c3 | |||
d58eb1dc6e | |||
6a6af528ef | |||
112d120a89 | |||
8dfb55d476 | |||
d488f4bea8 | |||
58ab3c4123 | |||
02d7381788 | |||
fb051355b8 | |||
4d8a63eee1 | |||
d0c3e006fb | |||
f22f23849d | |||
94bddb9908 | |||
ed20e17c3a | |||
8fc1578a5e | |||
9753d075f0 | |||
865b4e50ad | |||
597c359ef8 | |||
a108a4df4c | |||
0a6b04ee76 | |||
78dd96357d | |||
9230182e35 | |||
8f7adb130f | |||
16d5321885 | |||
9a6f521f6a | |||
dee0aea378 | |||
0e3cd00579 | |||
6091271f37 | |||
272a8bfaf1 | |||
75692c3539 | |||
46e9b450c0 | |||
40c5ccfe37 | |||
bf1b1a2d9e | |||
b608ec6fbd | |||
4813b5567a | |||
8ab742c2b7 | |||
cb8403f1b0 | |||
b751238fc1 | |||
5479d3a198 | |||
e1768905dd | |||
775d0842e9 | |||
e7e201bd2a | |||
ec9f8305e9 | |||
3307bfab1b | |||
ce2c62000d | |||
cf817c4ec1 | |||
bd01a5f2d2 | |||
b059ba7c90 | |||
89d70097f6 | |||
41d115a394 | |||
45c1d3a553 | |||
17227be4df | |||
7f4f8e8f09 | |||
6809bd6567 | |||
711d40a56e | |||
81911fae3c | |||
f940397e3a | |||
dc53887a48 |
@ -4,3 +4,4 @@ IndentWidth: 4
|
|||||||
UseTab: Never
|
UseTab: Never
|
||||||
ColumnLimit: 80
|
ColumnLimit: 80
|
||||||
AlignConsecutiveAssignments: false
|
AlignConsecutiveAssignments: false
|
||||||
|
AlignConsecutiveMacros: true
|
@ -45,8 +45,34 @@ option(SLS_USE_CTBGUI "ctb GUI" OFF)
|
|||||||
option(SLS_BUILD_DOCS "docs" OFF)
|
option(SLS_BUILD_DOCS "docs" OFF)
|
||||||
option(SLS_BUILD_EXAMPLES "examples" OFF)
|
option(SLS_BUILD_EXAMPLES "examples" OFF)
|
||||||
option(SLS_TUNE_LOCAL "tune to local machine" OFF)
|
option(SLS_TUNE_LOCAL "tune to local machine" OFF)
|
||||||
|
option(SLS_DEVEL_HEADERS "install headers for devel" OFF)
|
||||||
|
|
||||||
|
# set(ClangFormat_BIN_NAME clang-format)
|
||||||
|
set(ClangFormat_EXCLUDE_PATTERNS "build/"
|
||||||
|
"libs/"
|
||||||
|
"slsDetectorCalibration/"
|
||||||
|
"ctbGui/"
|
||||||
|
"manual/"
|
||||||
|
"python/"
|
||||||
|
"sample/"
|
||||||
|
${CMAKE_BINARY_DIR})
|
||||||
|
find_package(ClangFormat)
|
||||||
|
|
||||||
|
#Enable LTO if available
|
||||||
|
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 ()
|
||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
|
||||||
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||||
@ -203,11 +229,9 @@ if(SLS_BUILD_DOCS)
|
|||||||
add_subdirectory(docs)
|
add_subdirectory(docs)
|
||||||
endif(SLS_BUILD_DOCS)
|
endif(SLS_BUILD_DOCS)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(SLS_MASTER_PROJECT)
|
if(SLS_MASTER_PROJECT)
|
||||||
# Set install dir CMake packages
|
# Set install dir CMake packages
|
||||||
set(CMAKE_INSTALL_DIR ${CMAKE_INSTALL_DATADIR}/cmake/sls)
|
set(CMAKE_INSTALL_DIR "share/cmake/${PROJECT_NAME}")
|
||||||
# Set the list of exported targets
|
# Set the list of exported targets
|
||||||
set(PROJECT_LIBRARIES slsSupportLib slsDetectorShared slsReceiverShared)
|
set(PROJECT_LIBRARIES slsSupportLib slsDetectorShared slsReceiverShared)
|
||||||
# Generate and install package config file and version
|
# Generate and install package config file and version
|
||||||
|
39
cmake/FindClangFormat.cmake
Normal file
39
cmake/FindClangFormat.cmake
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
# Find Clang format
|
||||||
|
if(NOT ClangFormat_BIN_NAME)
|
||||||
|
set(ClangFormat_BIN_NAME clang-format)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# if custom path check there first
|
||||||
|
if(ClangFormat_ROOT_DIR)
|
||||||
|
find_program(ClangFormat_BIN
|
||||||
|
NAMES
|
||||||
|
${ClangFormat_BIN_NAME}
|
||||||
|
PATHS
|
||||||
|
"${ClangFormat_ROOT_DIR}"
|
||||||
|
NO_DEFAULT_PATH)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_program(ClangFormat_BIN NAMES ${ClangFormat_BIN_NAME})
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
|
||||||
|
ClangFormat
|
||||||
|
DEFAULT_MSG
|
||||||
|
ClangFormat_BIN)
|
||||||
|
|
||||||
|
mark_as_advanced(
|
||||||
|
ClangFormat_BIN)
|
||||||
|
|
||||||
|
if(ClangFormat_FOUND)
|
||||||
|
exec_program(${ClangFormat_BIN} ${CMAKE_CURRENT_SOURCE_DIR} ARGS --version OUTPUT_VARIABLE CLANG_VERSION_TEXT)
|
||||||
|
string(REGEX MATCH "([0-9]+)\\.[0-9]+\\.[0-9]+" CLANG_VERSION ${CLANG_VERSION_TEXT})
|
||||||
|
if((${CLANG_VERSION} GREATER "9") OR (${CLANG_VERSION} EQUAL "9"))
|
||||||
|
# A CMake script to find all source files and setup clang-format targets for them
|
||||||
|
message(STATUS "found clang-format \"${CLANG_VERSION}\" adding formatting targets")
|
||||||
|
include(clang-format)
|
||||||
|
else()
|
||||||
|
message(STATUS "clang-format version \"${CLANG_VERSION}\" found but need at least 9. Not setting up format targets")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
message(STATUS "clang-format not found. Not setting up format targets")
|
||||||
|
endif()
|
47
cmake/clang-format.cmake
Normal file
47
cmake/clang-format.cmake
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
# A CMake script to find all source files and setup clang-format targets for them
|
||||||
|
|
||||||
|
# Find all source files
|
||||||
|
set(ClangFormat_CXX_FILE_EXTENSIONS ${ClangFormat_CXX_FILE_EXTENSIONS} *.cpp *.h *.cxx *.hxx *.hpp *.cc *.ipp *.c)
|
||||||
|
file(GLOB_RECURSE ALL_SOURCE_FILES ${ClangFormat_CXX_FILE_EXTENSIONS})
|
||||||
|
|
||||||
|
# Don't include some common build folders
|
||||||
|
set(ClangFormat_EXCLUDE_PATTERNS ${ClangFormat_EXCLUDE_PATTERNS} "/CMakeFiles/" "cmake")
|
||||||
|
|
||||||
|
# get all project files file
|
||||||
|
foreach (SOURCE_FILE ${ALL_SOURCE_FILES})
|
||||||
|
foreach (EXCLUDE_PATTERN ${ClangFormat_EXCLUDE_PATTERNS})
|
||||||
|
string(FIND ${SOURCE_FILE} ${EXCLUDE_PATTERN} EXCLUDE_FOUND)
|
||||||
|
if (NOT ${EXCLUDE_FOUND} EQUAL -1)
|
||||||
|
list(REMOVE_ITEM ALL_SOURCE_FILES ${SOURCE_FILE})
|
||||||
|
endif ()
|
||||||
|
endforeach ()
|
||||||
|
endforeach ()
|
||||||
|
|
||||||
|
#target for formatting soruce files
|
||||||
|
add_custom_target(format
|
||||||
|
COMMENT "Running clang-format to change files"
|
||||||
|
COMMAND ${ClangFormat_BIN}
|
||||||
|
-style=file
|
||||||
|
-i
|
||||||
|
${ALL_SOURCE_FILES}
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
#target to check format on source files
|
||||||
|
add_custom_target(format-check
|
||||||
|
COMMENT "Checking clang-format changes"
|
||||||
|
# Use ! to negate the result for correct output
|
||||||
|
COMMAND !
|
||||||
|
${ClangFormat_BIN}
|
||||||
|
-style=file
|
||||||
|
-output-replacements-xml
|
||||||
|
${ALL_SOURCE_FILES}
|
||||||
|
| grep -q "replacement offset"
|
||||||
|
)
|
||||||
|
|
||||||
|
# debug to check which file will be formatted
|
||||||
|
add_custom_target(
|
||||||
|
listformatfiles
|
||||||
|
COMMAND
|
||||||
|
echo ${ALL_SOURCE_FILES}
|
||||||
|
)
|
@ -15,17 +15,20 @@ configure_package_config_file(
|
|||||||
write_basic_package_version_file(
|
write_basic_package_version_file(
|
||||||
"${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}-config-version.cmake"
|
"${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}-config-version.cmake"
|
||||||
VERSION ${PROJECT_VERSION}
|
VERSION ${PROJECT_VERSION}
|
||||||
COMPATIBILITY SameMajorVersion)
|
COMPATIBILITY SameMajorVersion
|
||||||
|
)
|
||||||
|
|
||||||
install(FILES
|
install(FILES
|
||||||
"${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}-config.cmake"
|
"${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}-config.cmake"
|
||||||
"${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}-config-version.cmake"
|
"${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}-config-version.cmake"
|
||||||
COMPONENT devel
|
COMPONENT devel
|
||||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME_LOWER})
|
DESTINATION ${CMAKE_INSTALL_DIR}
|
||||||
|
)
|
||||||
|
|
||||||
if (PROJECT_LIBRARIES OR PROJECT_STATIC_LIBRARIES)
|
if (PROJECT_LIBRARIES OR PROJECT_STATIC_LIBRARIES)
|
||||||
install(
|
install(
|
||||||
EXPORT "${TARGETS_EXPORT_NAME}"
|
EXPORT "${TARGETS_EXPORT_NAME}"
|
||||||
FILE ${PROJECT_NAME_LOWER}-targets.cmake
|
FILE ${PROJECT_NAME_LOWER}-targets.cmake
|
||||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME_LOWER})
|
DESTINATION ${CMAKE_INSTALL_DIR}
|
||||||
|
)
|
||||||
endif ()
|
endif ()
|
||||||
|
19
cmk.sh
19
cmk.sh
@ -11,6 +11,7 @@ PYTHON=0
|
|||||||
TESTS=0
|
TESTS=0
|
||||||
SIMULATOR=0
|
SIMULATOR=0
|
||||||
CTBGUI=0
|
CTBGUI=0
|
||||||
|
MANUALS=0
|
||||||
|
|
||||||
|
|
||||||
CLEAN=0
|
CLEAN=0
|
||||||
@ -19,7 +20,7 @@ CMAKE_PRE=""
|
|||||||
CMAKE_POST=""
|
CMAKE_POST=""
|
||||||
|
|
||||||
usage() { echo -e "
|
usage() { echo -e "
|
||||||
Usage: $0 [-c] [-b] [-p] [e] [t] [r] [g] [s] [u] [i] [-h] [-d <HDF5 directory>] [-j] <Number of threads>
|
Usage: $0 [-c] [-b] [-p] [e] [t] [r] [g] [s] [u] [i] [m] [-h] [-d <HDF5 directory>] [-j] <Number of threads>
|
||||||
-[no option]: only make
|
-[no option]: only make
|
||||||
-c: Clean
|
-c: Clean
|
||||||
-b: Builds/Rebuilds CMake files normal mode
|
-b: Builds/Rebuilds CMake files normal mode
|
||||||
@ -34,6 +35,7 @@ Usage: $0 [-c] [-b] [-p] [e] [t] [r] [g] [s] [u] [i] [-h] [-d <HDF5 directory>]
|
|||||||
-j: Number of threads to compile through
|
-j: Number of threads to compile through
|
||||||
-e: Debug mode
|
-e: Debug mode
|
||||||
-i: Builds tests
|
-i: Builds tests
|
||||||
|
-m: Manuals
|
||||||
|
|
||||||
Rebuild when you switch to a new build and compile in parallel:
|
Rebuild when you switch to a new build and compile in parallel:
|
||||||
./cmk.sh -bj5
|
./cmk.sh -bj5
|
||||||
@ -69,7 +71,7 @@ For rebuilding only certain sections
|
|||||||
|
|
||||||
" ; exit 1; }
|
" ; exit 1; }
|
||||||
|
|
||||||
while getopts ":bpchd:j:trgeisu" opt ; do
|
while getopts ":bpchd:j:trgeisum" opt ; do
|
||||||
case $opt in
|
case $opt in
|
||||||
b)
|
b)
|
||||||
echo "Building of CMake files Required"
|
echo "Building of CMake files Required"
|
||||||
@ -124,6 +126,10 @@ while getopts ":bpchd:j:trgeisu" opt ; do
|
|||||||
echo "Compiling Options: Simulator"
|
echo "Compiling Options: Simulator"
|
||||||
SIMULATOR=1
|
SIMULATOR=1
|
||||||
;;
|
;;
|
||||||
|
m)
|
||||||
|
echo "Compiling Manuals"
|
||||||
|
MANUALS=1
|
||||||
|
;;
|
||||||
u)
|
u)
|
||||||
echo "Compiling Options: Chip Test Gui"
|
echo "Compiling Options: Chip Test Gui"
|
||||||
CTBGUI=1
|
CTBGUI=1
|
||||||
@ -198,6 +204,12 @@ if [ $SIMULATOR -eq 1 ]; then
|
|||||||
echo "Simulator Option enabled"
|
echo "Simulator Option enabled"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#Manuals
|
||||||
|
if [ $MANUALS -eq 1 ]; then
|
||||||
|
CMAKE_POST+=" -DSLS_BUILD_DOCS=ON "
|
||||||
|
echo "Manuals Option enabled"
|
||||||
|
fi
|
||||||
|
|
||||||
#Chip Test Gui
|
#Chip Test Gui
|
||||||
if [ $CTBGUI -eq 1 ]; then
|
if [ $CTBGUI -eq 1 ]; then
|
||||||
CMAKE_POST+=" -DSLS_USE_CTBGUI=ON "
|
CMAKE_POST+=" -DSLS_USE_CTBGUI=ON "
|
||||||
@ -251,6 +263,9 @@ else
|
|||||||
make
|
make
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ $MANUALS -eq 1 ]; then
|
||||||
|
make docs
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,18 +5,20 @@ mkdir $PREFIX/include
|
|||||||
mkdir $PREFIX/include/slsDetectorPackage
|
mkdir $PREFIX/include/slsDetectorPackage
|
||||||
|
|
||||||
#Shared and static libraries
|
#Shared and static libraries
|
||||||
cp build/bin/libSlsDetector.so $PREFIX/lib/.
|
# cp build/bin/libSlsDetector.so $PREFIX/lib/.
|
||||||
cp build/bin/libSlsReceiver.so $PREFIX/lib/.
|
# cp build/bin/libSlsReceiver.so $PREFIX/lib/.
|
||||||
cp build/bin/libSlsSupport.so $PREFIX/lib/.
|
# cp build/bin/libSlsSupport.so $PREFIX/lib/.
|
||||||
|
|
||||||
|
cp build/install/lib/* $PREFIX/lib/
|
||||||
|
|
||||||
#Binaries
|
#Binaries
|
||||||
cp build/bin/sls_detector_acquire $PREFIX/bin/.
|
cp build/install/bin/sls_detector_acquire $PREFIX/bin/.
|
||||||
cp build/bin/sls_detector_get $PREFIX/bin/.
|
cp build/install/bin/sls_detector_get $PREFIX/bin/.
|
||||||
cp build/bin/sls_detector_put $PREFIX/bin/.
|
cp build/install/bin/sls_detector_put $PREFIX/bin/.
|
||||||
cp build/bin/sls_detector_help $PREFIX/bin/.
|
cp build/install/bin/sls_detector_help $PREFIX/bin/.
|
||||||
cp build/bin/slsReceiver $PREFIX/bin/.
|
cp build/install/bin/slsReceiver $PREFIX/bin/.
|
||||||
cp build/bin/slsMultiReceiver $PREFIX/bin/.
|
cp build/install/bin/slsMultiReceiver $PREFIX/bin/.
|
||||||
|
|
||||||
#Which headers do we need for development??
|
|
||||||
cp build/install/include/* $PREFIX/include/slsDetectorPackage/
|
cp build/install/include/* $PREFIX/include/
|
||||||
# cp include/some_lib.h $PREFIX/include/.
|
cp -r build/install/share/ $PREFIX/share
|
||||||
|
@ -7,7 +7,7 @@ source:
|
|||||||
- path: ..
|
- path: ..
|
||||||
|
|
||||||
build:
|
build:
|
||||||
number: 2
|
number: 0
|
||||||
binary_relocation: True
|
binary_relocation: True
|
||||||
rpaths:
|
rpaths:
|
||||||
- lib/
|
- lib/
|
||||||
@ -37,6 +37,7 @@ requirements:
|
|||||||
host:
|
host:
|
||||||
- libstdcxx-ng
|
- libstdcxx-ng
|
||||||
- libgcc-ng
|
- libgcc-ng
|
||||||
|
- zeromq
|
||||||
- xorg-libx11
|
- xorg-libx11
|
||||||
- xorg-libice
|
- xorg-libice
|
||||||
- xorg-libxext
|
- xorg-libxext
|
||||||
@ -46,6 +47,7 @@ requirements:
|
|||||||
- xorg-libxfixes
|
- xorg-libxfixes
|
||||||
|
|
||||||
run:
|
run:
|
||||||
|
- zeromq
|
||||||
- libstdcxx-ng
|
- libstdcxx-ng
|
||||||
- libgcc-ng
|
- libgcc-ng
|
||||||
|
|
||||||
|
@ -1646,10 +1646,13 @@ void ctbAcquisition::update() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (myDet->getDetectorType().squash() == slsDetectorDefs::MOENCH) {
|
||||||
|
dBitOffset = 0;
|
||||||
|
} else {
|
||||||
try {
|
try {
|
||||||
dBitOffset = myDet->getRxDbitOffset().tsquash("Different values");
|
dBitOffset = myDet->getRxDbitOffset().tsquash("Different values");
|
||||||
} CATCH_DISPLAY ("Could not get receiver dbit offset", "ctbAcquisition::update")
|
} CATCH_DISPLAY ("Could not get receiver dbit offset", "ctbAcquisition::update")
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
tenG = myDet->getTenGiga().tsquash("Different values");
|
tenG = myDet->getTenGiga().tsquash("Different values");
|
||||||
} CATCH_DISPLAY ("Could not get ten giga enable", "ctbAcquisition::update")
|
} CATCH_DISPLAY ("Could not get ten giga enable", "ctbAcquisition::update")
|
||||||
@ -1735,9 +1738,13 @@ void ctbAcquisition::toggleAcquisition() {
|
|||||||
setDigitalSamples(retval);
|
setDigitalSamples(retval);
|
||||||
} CATCH_DISPLAY ("Could not get number of digital samples", "ctbAcquisition::toggleAcquisition")
|
} CATCH_DISPLAY ("Could not get number of digital samples", "ctbAcquisition::toggleAcquisition")
|
||||||
|
|
||||||
|
if (myDet->getDetectorType().squash() == slsDetectorDefs::MOENCH) {
|
||||||
|
dBitOffset = 0;
|
||||||
|
} else {
|
||||||
try {
|
try {
|
||||||
dBitOffset = myDet->getRxDbitOffset().tsquash("Different values");
|
dBitOffset = myDet->getRxDbitOffset().tsquash("Different values");
|
||||||
} CATCH_DISPLAY ("Could not get receiver dbit offset", "ctbAcquisition::toggleAcquisition")
|
} CATCH_DISPLAY ("Could not get receiver dbit offset", "ctbAcquisition::toggleAcquisition")
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
roMode = static_cast<int>(myDet->getReadoutMode().tsquash("Different values"));
|
roMode = static_cast<int>(myDet->getReadoutMode().tsquash("Different values"));
|
||||||
@ -1974,6 +1981,9 @@ void ctbAcquisition::setDbitEnable(Int_t reg){
|
|||||||
void ctbAcquisition::updateChans() {
|
void ctbAcquisition::updateChans() {
|
||||||
|
|
||||||
// dbit list
|
// dbit list
|
||||||
|
if (myDet->getDetectorType().squash() == slsDetectorDefs::MOENCH) {
|
||||||
|
dbitlist.clear();
|
||||||
|
} else {
|
||||||
try {
|
try {
|
||||||
auto retval = myDet->getRxDbitList().tsquash("Different values");
|
auto retval = myDet->getRxDbitList().tsquash("Different values");
|
||||||
dbitlist.clear();
|
dbitlist.clear();
|
||||||
@ -1982,6 +1992,7 @@ void ctbAcquisition::updateChans() {
|
|||||||
dbitlist.push_back(value);
|
dbitlist.push_back(value);
|
||||||
}
|
}
|
||||||
} CATCH_DISPLAY ("Could not get receiver dbit list.", "ctbAcquisition::updateChans")
|
} CATCH_DISPLAY ("Could not get receiver dbit list.", "ctbAcquisition::updateChans")
|
||||||
|
}
|
||||||
|
|
||||||
// adc mask
|
// adc mask
|
||||||
try {
|
try {
|
||||||
|
@ -374,6 +374,16 @@ void ctbSignals::update() {
|
|||||||
|
|
||||||
} CATCH_DISPLAY ("Could not get patternIOcontrol.", "ctbSignals::update")
|
} CATCH_DISPLAY ("Could not get patternIOcontrol.", "ctbSignals::update")
|
||||||
|
|
||||||
|
if (myDet->getDetectorType().squash() == slsDetectorDefs::MOENCH) {
|
||||||
|
// enable all
|
||||||
|
for (int is=0; is<64; is++) {
|
||||||
|
signals[is]->setDbitList(1);
|
||||||
|
}
|
||||||
|
eDbitOffset->SetNumber(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ctb
|
||||||
|
else {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
auto dbitlist = myDet->getRxDbitList().tsquash("Different values");
|
auto dbitlist = myDet->getRxDbitList().tsquash("Different values");
|
||||||
@ -400,7 +410,7 @@ void ctbSignals::update() {
|
|||||||
auto val = myDet->getRxDbitOffset().tsquash("Different values");
|
auto val = myDet->getRxDbitOffset().tsquash("Different values");
|
||||||
eDbitOffset->SetNumber(val);
|
eDbitOffset->SetNumber(val);
|
||||||
} CATCH_DISPLAY ("Could not get receiver dbit offset.", "ctbSignals::update")
|
} CATCH_DISPLAY ("Could not get receiver dbit offset.", "ctbSignals::update")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ if [ -f "$infile" ]
|
|||||||
then
|
then
|
||||||
gcc -DINFILE="\"$infile\"" -DOUTFILE="\"$outfile\"" -DOUTFILEBIN="\"$outfilebin\"" -o $exe generator.c ;
|
gcc -DINFILE="\"$infile\"" -DOUTFILE="\"$outfile\"" -DOUTFILEBIN="\"$outfilebin\"" -o $exe generator.c ;
|
||||||
echo compiling
|
echo compiling
|
||||||
|
echo gcc -DINFILE="\"$infile\"" -DOUTFILE="\"$outfile\"" -DOUTFILEBIN="\"$outfilebin\"" -o $exe generator.c ;
|
||||||
$exe ;
|
$exe ;
|
||||||
echo cleaning
|
echo cleaning
|
||||||
rm $exe
|
rm $exe
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
find_package(Doxygen)
|
find_package(Doxygen REQUIRED)
|
||||||
find_package(Sphinx)
|
find_package(Sphinx REQUIRED)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (DOXYGEN_FOUND AND SPHINX_FOUND)
|
|
||||||
message(${CMAKE_PROJECT_SORURCE_DIR}/slsDetectorSoftware/src)
|
|
||||||
# Utility to generate command line documentation
|
# Utility to generate command line documentation
|
||||||
add_executable(gendoc src/gendoc.cpp)
|
add_executable(gendoc src/gendoc.cpp)
|
||||||
# This is a bit hacky, but better than exposing stuff?
|
# This is a bit hacky, but better than exposing stuff?
|
||||||
@ -30,6 +30,7 @@ if (DOXYGEN_FOUND AND SPHINX_FOUND)
|
|||||||
set(SPHINX_SOURCE_FILES
|
set(SPHINX_SOURCE_FILES
|
||||||
src/commandline.rst
|
src/commandline.rst
|
||||||
src/container_utils.rst
|
src/container_utils.rst
|
||||||
|
src/consuming.rst
|
||||||
src/dependencies.rst
|
src/dependencies.rst
|
||||||
src/detector.rst
|
src/detector.rst
|
||||||
src/index.rst
|
src/index.rst
|
||||||
@ -41,6 +42,7 @@ if (DOXYGEN_FOUND AND SPHINX_FOUND)
|
|||||||
src/result.rst
|
src/result.rst
|
||||||
src/type_traits.rst
|
src/type_traits.rst
|
||||||
src/ToString.rst
|
src/ToString.rst
|
||||||
|
src/examples.rst
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -64,6 +66,4 @@ if (DOXYGEN_FOUND AND SPHINX_FOUND)
|
|||||||
${SPHINX_BUILD}/html
|
${SPHINX_BUILD}/html
|
||||||
COMMENT "Generating documentation with Sphinx")
|
COMMENT "Generating documentation with Sphinx")
|
||||||
|
|
||||||
else (DOXYGEN_FOUND AND SPHINX_FOUND)
|
|
||||||
message("Doxygen and Sphinx are needed to build documentation")
|
|
||||||
endif (DOXYGEN_FOUND AND SPHINX_FOUND)
|
|
||||||
|
116
docs/src/consuming.rst
Normal file
116
docs/src/consuming.rst
Normal file
@ -0,0 +1,116 @@
|
|||||||
|
Consuming slsDetectorPackage
|
||||||
|
===============================
|
||||||
|
|
||||||
|
Depending on how you want to build your integration with
|
||||||
|
slsDetectorPackage there are a few different ways to
|
||||||
|
consume our package. The recommended way is to use one of the
|
||||||
|
CMake approaches.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
CMake: slsDetectorPackage as submodule in your project
|
||||||
|
---------------------------------------
|
||||||
|
|
||||||
|
If you are using CMake to build your integration and want to build everything
|
||||||
|
in one go, we support adding slsDetectorPackage as a subfolder in your cmake project.
|
||||||
|
|
||||||
|
A minimal CMakeLists.txt could look like this:
|
||||||
|
|
||||||
|
.. code-block:: cmake
|
||||||
|
|
||||||
|
project(myDetectorIntegration)
|
||||||
|
cmake_minimum_required(VERSION 3.12)
|
||||||
|
add_subdirectory(slsDetectorPackage)
|
||||||
|
|
||||||
|
#Add your executable
|
||||||
|
add_executable(example main.cpp)
|
||||||
|
target_compile_features(example PRIVATE cxx_std_11)
|
||||||
|
|
||||||
|
#Link towards slsDetectorShared
|
||||||
|
target_link_libraries(example slsDetectorShared)
|
||||||
|
|
||||||
|
A fully working example can be found at:
|
||||||
|
|
||||||
|
https://github.com/slsdetectorgroup/cmake-subfolder-example
|
||||||
|
|
||||||
|
|
||||||
|
CMake: find_package(slsDetectorPackage)
|
||||||
|
------------------------------------------
|
||||||
|
|
||||||
|
If you have compiled and installed slsDetectorPackage we also support
|
||||||
|
find_package in CMake. If installed in a system wide location no path
|
||||||
|
should be needed, otherwise specify cmake prefix path.
|
||||||
|
|
||||||
|
.. code-block:: cmake
|
||||||
|
|
||||||
|
cmake_minimum_required(VERSION 3.12)
|
||||||
|
project(myintegration)
|
||||||
|
|
||||||
|
find_package(slsDetectorPackage 5.0 REQUIRED)
|
||||||
|
add_executable(example main.cpp)
|
||||||
|
target_link_libraries(example slsDetectorShared)
|
||||||
|
|
||||||
|
|
||||||
|
Then assuming the slsDetectorPackage is installed in /path/to/sls/install
|
||||||
|
you should be able to configure and build your project in this way.
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
cmake ../path/to/your/source -DCMAKE_PREFIX_PATH=/path/to/sls/install
|
||||||
|
make
|
||||||
|
|
||||||
|
|
||||||
|
A minimal example is available at: https://github.com/slsdetectorgroup/minimal-cmake
|
||||||
|
|
||||||
|
|
||||||
|
CMake: find_package and conda
|
||||||
|
----------------------------------
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
conda can also be used for installing dependencies such as zmq, Qt4 etc.
|
||||||
|
|
||||||
|
find_package(slsDetectorPackage) also works if you have installed slsDetectorPackage using conda.
|
||||||
|
The only difference is that you point CMake to $CONDA_PREFIX
|
||||||
|
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
#assuming myenv contains slsdetlib
|
||||||
|
conda activate myenv
|
||||||
|
cmake ../path/to/your/source -DCMAKE_PREFIX_PATH=$CONDA_PREFIX
|
||||||
|
make
|
||||||
|
|
||||||
|
Depending on your system compiler you might also have to install gxx_linux-64 to compiled.
|
||||||
|
|
||||||
|
No tools minimal approach
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
|
While not recommended it is still possible to specify the include and library paths
|
||||||
|
manually when invoking g++. This can sometimes be handy for a quick try.
|
||||||
|
|
||||||
|
.. code-block:: cpp
|
||||||
|
|
||||||
|
#include "Detector.h"
|
||||||
|
#include <iostream>
|
||||||
|
int main(){
|
||||||
|
|
||||||
|
sls::Detector det;
|
||||||
|
|
||||||
|
//Get all values and print them
|
||||||
|
std::cout << "Hostname: " << det.getHostname() << "\n";
|
||||||
|
std::cout << "Type: " << det.getDetectorType() << "\n";
|
||||||
|
std::cout << "Udp ip: " << det.getSourceUDPIP() << "\n";
|
||||||
|
|
||||||
|
|
||||||
|
//Get mac addr
|
||||||
|
const int module = 0;
|
||||||
|
auto mac = det.getSourceUDPMAC()[module];
|
||||||
|
std::cout << "Mac addr of module "<< module << " is " << mac.str() << '\n';
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
g++ -I/install/path/include/ -L/install/path/lib64/ myapp.cpp -lSlsDetector -lSlsSupport -Wl,-rpath=../install/path/lib64
|
@ -13,7 +13,7 @@ To use the basic building blocks, meaning sls_detector_get/put and
|
|||||||
the shared libraries these are needed:
|
the shared libraries these are needed:
|
||||||
|
|
||||||
* Linux, preferably recent kernel (currently no cross platform support)
|
* Linux, preferably recent kernel (currently no cross platform support)
|
||||||
* CMake > 3.9
|
* CMake > 3.12
|
||||||
* C++11 compatible compiler. (We test with gcc and clang)
|
* C++11 compatible compiler. (We test with gcc and clang)
|
||||||
* ZeroMQ version 4
|
* ZeroMQ version 4
|
||||||
|
|
||||||
@ -24,7 +24,7 @@ GUI
|
|||||||
The GUI is currently using Qt4 but watch out for an upgrade to 5.
|
The GUI is currently using Qt4 but watch out for an upgrade to 5.
|
||||||
|
|
||||||
* Qt 4.8
|
* Qt 4.8
|
||||||
* Qwt 6
|
* Qwt 6.1
|
||||||
|
|
||||||
-----------------------
|
-----------------------
|
||||||
Python bindings
|
Python bindings
|
||||||
|
115
docs/src/examples.rst
Normal file
115
docs/src/examples.rst
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Examples
|
||||||
|
===========
|
||||||
|
|
||||||
|
Setup
|
||||||
|
------------
|
||||||
|
|
||||||
|
The examples here assume that you have compiled and installed slsDetectorPackage
|
||||||
|
to ~/sls/install and that the option for SLS_USE_SIMULATOR was enabled. This also builds
|
||||||
|
the virtual detector servers that we will be using for testing.
|
||||||
|
|
||||||
|
We also add ~/sls/detector/install/bin to the path for convenience.
|
||||||
|
|
||||||
|
Compile examples
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
The source code of the examples is available at:
|
||||||
|
https://github.com/slsdetectorgroup/api-examples
|
||||||
|
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
git clone https://github.com/slsdetectorgroup/api-examples.git
|
||||||
|
mkdir build && cd build
|
||||||
|
cmake ../api-examples -DCMAKE_PREFIX_PATH=~/sls/detector/install
|
||||||
|
make
|
||||||
|
|
||||||
|
Below follows a short description of what is included in the examples.
|
||||||
|
|
||||||
|
|
||||||
|
Running a config file [e1]
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
|
|
||||||
|
.. code-block:: cpp
|
||||||
|
|
||||||
|
#include "Detector.h"
|
||||||
|
...
|
||||||
|
sls::Detector det;
|
||||||
|
det.loadConfig("path/to/config/file.config");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
To configure the connection between PC and detector the easiest
|
||||||
|
is to run a config file. For this example we first launch a virtual Jungfrau server and
|
||||||
|
then set up the detector.
|
||||||
|
|
||||||
|
**Launch a virtual detector server**
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
jungfrauDetectorServer_virtual
|
||||||
|
|
||||||
|
This launches a virtual Jungfrau detector server. As default is uses port 1952 and 1953
|
||||||
|
for communication over TCP. Most commands go on 1952 and only stop and status on 1953.
|
||||||
|
|
||||||
|
**Run example to configure**
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
./e1-config one_det_no_receiver.config
|
||||||
|
- 12:01:06.371 INFO: Shared memory deleted /slsDetectorPackage_multi_0_sls_0
|
||||||
|
- 12:01:06.371 INFO: Shared memory deleted /slsDetectorPackage_multi_0
|
||||||
|
- 12:01:06.372 INFO: Shared memory created /slsDetectorPackage_multi_0
|
||||||
|
- 12:01:06.376 INFO: Loading configuration file: one_det_no_receiver.config
|
||||||
|
- 12:01:06.376 INFO: Adding detector localhost
|
||||||
|
- 12:01:06.377 INFO: Shared memory created /slsDetectorPackage_multi_0_sls_0
|
||||||
|
- 12:01:06.377 INFO: Checking Detector Version Compatibility
|
||||||
|
- 12:01:06.378 INFO: Detector connecting - updating!
|
||||||
|
hostname [localhost]
|
||||||
|
|
||||||
|
|
||||||
|
Jungfrau detector with 1 modules configured
|
||||||
|
|
||||||
|
|
||||||
|
Using the return type sls::Result [e2]
|
||||||
|
-----------------------------------------
|
||||||
|
|
||||||
|
Since many our detectors have multiple modules we cannot return
|
||||||
|
a single value when reading from the Detector. Hostname, Ip and also
|
||||||
|
for example exposure time can differ between modules.
|
||||||
|
|
||||||
|
Therefore we return Result<T> which is a thin wrapper around
|
||||||
|
std::vector.
|
||||||
|
|
||||||
|
.. code-block:: cpp
|
||||||
|
|
||||||
|
sls::Result<int> res1{1, 1, 1};
|
||||||
|
std::cout << "res1: " << res1 << '\n';
|
||||||
|
res1.squash();
|
||||||
|
res1.squash(-1);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Setting exposure time [e3]
|
||||||
|
-----------------------------------------
|
||||||
|
|
||||||
|
For setting times, like exposure time, period, delay etc.
|
||||||
|
we use std::chrono::duration.
|
||||||
|
|
||||||
|
Example 3 shows how to set and read exposure time as well
|
||||||
|
as converting to floating point.
|
||||||
|
|
||||||
|
.. code-block:: cpp
|
||||||
|
|
||||||
|
#include "Detector.h"
|
||||||
|
#include <chrono>
|
||||||
|
...
|
||||||
|
std::chrono::microseconds t0{500};
|
||||||
|
det.setExptime(t0);
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -9,7 +9,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
|
||||||
#include "CmdProxy.h"
|
#include "CmdProxy.h"
|
||||||
#include "Detector.h"
|
#include "Detector.h"
|
||||||
#include "sls_detector_defs.h"
|
#include "sls_detector_defs.h"
|
||||||
@ -52,5 +51,4 @@ int main() {
|
|||||||
auto help = replace_all(tmp, "\n\t", "\n\t\t");
|
auto help = replace_all(tmp, "\n\t", "\n\t\t");
|
||||||
fs << '\t' << cmd << usage << help << "\n";
|
fs << '\t' << cmd << usage << help << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -6,12 +6,18 @@
|
|||||||
Welcome to slsDetectorPackage's documentation!
|
Welcome to slsDetectorPackage's documentation!
|
||||||
==============================================
|
==============================================
|
||||||
|
|
||||||
|
.. note ::
|
||||||
|
|
||||||
|
This is the documentation for the latest development version of slsDetectorPackage
|
||||||
|
For documentation on current and previous releases visit the official page: https://www.psi.ch/en/detectors/documentation
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
:maxdepth: 1
|
:maxdepth: 1
|
||||||
:caption: Installation:
|
:caption: Installation:
|
||||||
|
|
||||||
installation
|
installation
|
||||||
dependencies
|
dependencies
|
||||||
|
consuming
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
:caption: C++ API
|
:caption: C++ API
|
||||||
@ -20,6 +26,7 @@ Welcome to slsDetectorPackage's documentation!
|
|||||||
detector
|
detector
|
||||||
result
|
result
|
||||||
receiver
|
receiver
|
||||||
|
examples
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
:caption: Python API
|
:caption: Python API
|
||||||
|
@ -2,4 +2,68 @@
|
|||||||
Installation
|
Installation
|
||||||
==============================================
|
==============================================
|
||||||
|
|
||||||
get the source etc.
|
Build from source using CMake
|
||||||
|
---------------------------------
|
||||||
|
|
||||||
|
.. note ::
|
||||||
|
|
||||||
|
The default branch of our git repository is developer. It contains the
|
||||||
|
latest development version. It is expected to compile and work but
|
||||||
|
features might be added or tweaked. In some cases the API might also change
|
||||||
|
without being communicated. If absolute stability of the API is needed please
|
||||||
|
use one of the release versions.
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
git clone https://github.com/slsdetectorgroup/slsDetectorPackage.git
|
||||||
|
mkdir build && cd build
|
||||||
|
cmake ../slsDetectorPackage -DCMAKE_INSTALL_PREFIX=/your/install/path
|
||||||
|
make -j12
|
||||||
|
make install
|
||||||
|
|
||||||
|
Install binaries using conda
|
||||||
|
--------------------------------
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
#Add channels for dependencies and our library
|
||||||
|
conda config --add channels conda-forge
|
||||||
|
conda config --add channels slsdetectorgroup
|
||||||
|
conda config --set channel_priority strict
|
||||||
|
|
||||||
|
#cerate an environment with our library, then activate
|
||||||
|
conda create -n myenv slsdetlib=2020.03.18.dev2
|
||||||
|
codna activate myenv
|
||||||
|
|
||||||
|
#ready to use
|
||||||
|
sls_detector_get exptime
|
||||||
|
etc ...
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Build from source on old distributions
|
||||||
|
-----------------------------------------
|
||||||
|
|
||||||
|
If your linux distribution doesn't come with a C++11 compiler (gcc>4.8) then
|
||||||
|
it's possible to install a newer gcc using conda and build the slsDetectorPackage
|
||||||
|
using this compiler
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
#Create an environment with the dependencies
|
||||||
|
conda create -n myenv gxx_linux-64 cmake zmq
|
||||||
|
conda activate myenv
|
||||||
|
cmake ../slsDetectorPackage -DCMAKE_PREFIX_PATH=$CONDA_PREFIX
|
||||||
|
make -j12
|
||||||
|
|
||||||
|
|
||||||
|
Build this documentation
|
||||||
|
-------------------------------
|
||||||
|
|
||||||
|
The documentation for the slsDetectorPackage is build using a combination
|
||||||
|
of Doxygen, Sphinx and Breathe. The easiest way to install the dependencies
|
||||||
|
is to use conda
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
conda create -n myenv python sphinx sphinx_rtd_theme
|
@ -1,9 +1,9 @@
|
|||||||
Detector
|
Detector
|
||||||
=====================================================
|
=====================================================
|
||||||
|
|
||||||
.. py:currentmodule:: sls_detector
|
.. py:currentmodule:: slsdet
|
||||||
|
|
||||||
.. autoclass:: ExperimentalDetector
|
.. autoclass:: Detector
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
29
examples/gotthard_II.config
Normal file
29
examples/gotthard_II.config
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
hostname strip3
|
||||||
|
|
||||||
|
udp_srcip 10.1.1.184
|
||||||
|
udp_dstip 10.1.1.107
|
||||||
|
|
||||||
|
udp_dstport2 50084
|
||||||
|
udp_srcip2 10.1.1.185
|
||||||
|
udp_dstip2 10.1.1.107
|
||||||
|
|
||||||
|
rx_hostname pc12365:1954
|
||||||
|
#udp_dstmac 3c:fd:fe:d2:a4:25
|
||||||
|
fpath /tmp
|
||||||
|
fname run
|
||||||
|
fwrite 0
|
||||||
|
|
||||||
|
bursts 10
|
||||||
|
frames 2700
|
||||||
|
burstperiod 100ms
|
||||||
|
|
||||||
|
numinterfaces 2
|
||||||
|
veto 1
|
||||||
|
|
||||||
|
#fixing data looks
|
||||||
|
# Sampling pipeline 1 clk
|
||||||
|
reg 0x120 0x00000010
|
||||||
|
clkphase 1 135 deg
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -430,13 +430,13 @@ patwaittime2 0
|
|||||||
#############################################
|
#############################################
|
||||||
### edit with 10 Gbs IP of your server
|
### edit with 10 Gbs IP of your server
|
||||||
############################################
|
############################################
|
||||||
#0:udp_dstip 10.1.1.102
|
0:udp_dstip 10.1.1.102
|
||||||
0:udp_dstip 129.129.202.136
|
#0:udp_dstip 129.129.202.136
|
||||||
#############################################
|
#############################################
|
||||||
### edit with any number in the subnet of your server (first 3 numbers as above)
|
### edit with any number in the subnet of your server (first 3 numbers as above)
|
||||||
############################################
|
############################################
|
||||||
#0:udp_srcip 10.1.1.19
|
0:udp_srcip 10.1.1.19
|
||||||
0:udp_srcip 129.129.202.13
|
#0:udp_srcip 129.129.202.13
|
||||||
|
|
||||||
0:udp_dstport 33410
|
0:udp_dstport 33410
|
||||||
#############################################
|
#############################################
|
||||||
@ -457,7 +457,7 @@ patwaittime2 0
|
|||||||
############################################
|
############################################
|
||||||
rx_hostname mpc2011
|
rx_hostname mpc2011
|
||||||
|
|
||||||
tengiga 0
|
tengiga 1
|
||||||
|
|
||||||
rx_datastream 1
|
rx_datastream 1
|
||||||
rx_readfreq 1
|
rx_readfreq 1
|
||||||
|
@ -1,11 +1,15 @@
|
|||||||
#initialchecks 0
|
initialchecks 0
|
||||||
#############################################
|
#############################################
|
||||||
### edit with hostname or IP address of your detector
|
### edit with hostname or IP address of your detector
|
||||||
############################################
|
############################################
|
||||||
hostname bchip181+
|
hostname bchip181+
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
### edit with hostname or 1Gbs IP address of your server
|
||||||
|
############################################
|
||||||
|
rx_hostname mpc2011
|
||||||
|
|
||||||
|
rx_tcpport 1954
|
||||||
#############################################
|
#############################################
|
||||||
### edit with 10 Gbs IP of your server
|
### edit with 10 Gbs IP of your server
|
||||||
############################################
|
############################################
|
||||||
@ -14,24 +18,20 @@ udp_dstip 10.1.1.102
|
|||||||
### edit with any number in the subnet of your server (first 3 numbers as above)
|
### edit with any number in the subnet of your server (first 3 numbers as above)
|
||||||
############################################
|
############################################
|
||||||
udp_srcip 10.1.1.19
|
udp_srcip 10.1.1.19
|
||||||
udp_dstport 33410
|
udp_dstport 32411
|
||||||
|
|
||||||
#############################################
|
#############################################
|
||||||
### edit with 10 Gbs IP of your server
|
### edit with 10 Gbs IP of your server
|
||||||
############################################
|
############################################
|
||||||
#rx_zmqip 10.1.1.102
|
rx_zmqip 10.1.1.102
|
||||||
#rx_zmqport 30001
|
rx_zmqport 50003
|
||||||
#############################################
|
#############################################
|
||||||
### edit with 1 Gbs IP of PC where you will run the GUI
|
### edit with 1 Gbs IP of PC where you will run the GUI
|
||||||
############################################
|
############################################
|
||||||
#zmqip 129.129.202.136
|
zmqip 129.129.202.136
|
||||||
#zmqport 40001
|
zmqport 50001
|
||||||
|
|
||||||
|
|
||||||
#############################################
|
|
||||||
### edit with hostname or 1Gbs IP address of your server
|
|
||||||
############################################
|
|
||||||
rx_hostname mpc2011
|
|
||||||
|
|
||||||
|
|
||||||
tengiga 1
|
tengiga 1
|
||||||
@ -39,8 +39,8 @@ rx_datastream 1
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
frames 1
|
frames 100000
|
||||||
period 0.001
|
period 0.0006
|
||||||
#############################################
|
#############################################
|
||||||
### edit with directory you want to write to
|
### edit with directory you want to write to
|
||||||
############################################
|
############################################
|
||||||
@ -48,8 +48,8 @@ fpath /mnt/moench_data/scratch/
|
|||||||
fwrite 0
|
fwrite 0
|
||||||
rx_datastream 1
|
rx_datastream 1
|
||||||
|
|
||||||
rx_jsonpara frameMode newpedestal
|
rx_jsonpara frameMode frame
|
||||||
rx_jsonpara detectorMode analog
|
rx_jsonpara detectorMode counting
|
||||||
rx_discardpolicy discardpartial
|
rx_discardpolicy discardpartial
|
||||||
|
|
||||||
|
|
||||||
@ -58,4 +58,6 @@ adcpipeline 15
|
|||||||
powerchip 1
|
powerchip 1
|
||||||
vhighvoltage 90
|
vhighvoltage 90
|
||||||
|
|
||||||
adcreg 14 40
|
#adcreg 0x14 0x40
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "catch.hpp"
|
|
||||||
#include "DetectorImpl.h"
|
#include "DetectorImpl.h"
|
||||||
|
#include "catch.hpp"
|
||||||
#include "string_utils.h"
|
#include "string_utils.h"
|
||||||
#include "tests/globals.h"
|
#include "tests/globals.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
26
integrationTests/test-integrationDectector.cpp
Executable file → Normal file
26
integrationTests/test-integrationDectector.cpp
Executable file → Normal file
@ -2,9 +2,9 @@
|
|||||||
#include "catch.hpp"
|
#include "catch.hpp"
|
||||||
|
|
||||||
#include "ClientSocket.h"
|
#include "ClientSocket.h"
|
||||||
#include "logger.h"
|
|
||||||
#include "DetectorImpl.h"
|
#include "DetectorImpl.h"
|
||||||
#include "Module.h"
|
#include "Module.h"
|
||||||
|
#include "logger.h"
|
||||||
#include "sls_detector_defs.h"
|
#include "sls_detector_defs.h"
|
||||||
|
|
||||||
#include "Timer.h"
|
#include "Timer.h"
|
||||||
@ -79,7 +79,6 @@ TEST_CASE("Set control port then create a new object with this control port",
|
|||||||
d.freeSharedMemory();
|
d.freeSharedMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TEST_CASE("single EIGER detector no receiver basic set and get",
|
TEST_CASE("single EIGER detector no receiver basic set and get",
|
||||||
"[.integration][eiger]") {
|
"[.integration][eiger]") {
|
||||||
// TODO! this test should take command line arguments for config
|
// TODO! this test should take command line arguments for config
|
||||||
@ -130,8 +129,6 @@ TEST_CASE("single EIGER detector no receiver basic set and get",
|
|||||||
d.freeSharedMemory();
|
d.freeSharedMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TEST_CASE("Locking mechanism and last ip", "[.integration][.single]") {
|
TEST_CASE("Locking mechanism and last ip", "[.integration][.single]") {
|
||||||
Module d(test::type);
|
Module d(test::type);
|
||||||
d.setHostname(test::hostname);
|
d.setHostname(test::hostname);
|
||||||
@ -160,7 +157,6 @@ TEST_CASE("Set settings", "[.integration][.single]"){
|
|||||||
CHECK(d.setSettings(defs::STANDARD) == defs::STANDARD);
|
CHECK(d.setSettings(defs::STANDARD) == defs::STANDARD);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TEST_CASE("Timer functions", "[.integration][cli]") {
|
TEST_CASE("Timer functions", "[.integration][cli]") {
|
||||||
// FRAME_NUMBER, /**< number of real time frames: total number of
|
// FRAME_NUMBER, /**< number of real time frames: total number of
|
||||||
// acquisitions is number or frames*number of triggers */ ACQUISITION_TIME,
|
// acquisitions is number or frames*number of triggers */ ACQUISITION_TIME,
|
||||||
@ -204,8 +200,7 @@ TEST_CASE("Timer functions", "[.integration][cli]") {
|
|||||||
if (test::type != dt::EIGER) {
|
if (test::type != dt::EIGER) {
|
||||||
auto delay = 10000;
|
auto delay = 10000;
|
||||||
d.setDelayAfterTrigger(delay);
|
d.setDelayAfterTrigger(delay);
|
||||||
CHECK(d.getDelayAfterTrigger() ==
|
CHECK(d.getDelayAfterTrigger() == delay);
|
||||||
delay);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto triggers = 2;
|
auto triggers = 2;
|
||||||
@ -221,7 +216,6 @@ TEST_CASE("Timer functions", "[.integration][cli]") {
|
|||||||
d.startAndReadAll();
|
d.startAndReadAll();
|
||||||
|
|
||||||
d.freeSharedMemory();
|
d.freeSharedMemory();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TEST_CASE("Aquire", "[.integration][eiger]"){
|
// TEST_CASE("Aquire", "[.integration][eiger]"){
|
||||||
@ -382,8 +376,8 @@ TEST_CASE("Chiptestboard Loading Patterns", "[.ctbintegration]") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_CASE("Chiptestboard Dbit offset, list, sampling, advinvert",
|
||||||
TEST_CASE("Chiptestboard Dbit offset, list, sampling, advinvert", "[.ctbintegration][dbit]") {
|
"[.ctbintegration][dbit]") {
|
||||||
SingleDetectorConfig c;
|
SingleDetectorConfig c;
|
||||||
|
|
||||||
// pick up multi detector from shm id 0
|
// pick up multi detector from shm id 0
|
||||||
@ -450,17 +444,20 @@ TEST_CASE("Chiptestboard Dbit offset, list, sampling, advinvert", "[.ctbintegrat
|
|||||||
m.setExternalSampling(1);
|
m.setExternalSampling(1);
|
||||||
CHECK(m.getExternalSampling() == 1);
|
CHECK(m.getExternalSampling() == 1);
|
||||||
CHECK(m.readRegister(0x7b) == 0x1003E);
|
CHECK(m.readRegister(0x7b) == 0x1003E);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("Eiger or Jungfrau startingfnum", "[.eigerintegration][.jungfrauintegration][startingfnum]") {
|
TEST_CASE("Eiger or Jungfrau startingfnum",
|
||||||
|
"[.eigerintegration][.jungfrauintegration][startingfnum]") {
|
||||||
SingleDetectorConfig c;
|
SingleDetectorConfig c;
|
||||||
|
|
||||||
// pick up multi detector from shm id 0
|
// pick up multi detector from shm id 0
|
||||||
DetectorImpl m(0);
|
DetectorImpl m(0);
|
||||||
|
|
||||||
// ensure ctb detector type, hostname and online
|
// ensure ctb detector type, hostname and online
|
||||||
REQUIRE(((m.getDetectorTypeAsEnum() == slsDetectorDefs::detectorType::EIGER) || (m.getDetectorTypeAsEnum() == slsDetectorDefs::detectorType::JUNGFRAU)));
|
REQUIRE(
|
||||||
|
((m.getDetectorTypeAsEnum() == slsDetectorDefs::detectorType::EIGER) ||
|
||||||
|
(m.getDetectorTypeAsEnum() ==
|
||||||
|
slsDetectorDefs::detectorType::JUNGFRAU)));
|
||||||
REQUIRE(m.getHostname() == c.hostname);
|
REQUIRE(m.getHostname() == c.hostname);
|
||||||
|
|
||||||
CHECK(m.setNumberOfFrames(1) == 1);
|
CHECK(m.setNumberOfFrames(1) == 1);
|
||||||
@ -498,7 +495,8 @@ TEST_CASE("Eiger readnlines", "[.eigerintegration][readnlines]") {
|
|||||||
DetectorImpl m(0);
|
DetectorImpl m(0);
|
||||||
|
|
||||||
// ensure detector type, hostname
|
// ensure detector type, hostname
|
||||||
REQUIRE((m.getDetectorTypeAsEnum() == slsDetectorDefs::detectorType::EIGER));
|
REQUIRE(
|
||||||
|
(m.getDetectorTypeAsEnum() == slsDetectorDefs::detectorType::EIGER));
|
||||||
REQUIRE(m.getHostname() == c.hostname);
|
REQUIRE(m.getHostname() == c.hostname);
|
||||||
|
|
||||||
m.setDynamicRange(16);
|
m.setDynamicRange(16);
|
||||||
|
6
integrationTests/test-integrationMulti.cpp
Executable file → Normal file
6
integrationTests/test-integrationMulti.cpp
Executable file → Normal file
@ -1,5 +1,5 @@
|
|||||||
#include "catch.hpp"
|
|
||||||
#include "DetectorImpl.h"
|
#include "DetectorImpl.h"
|
||||||
|
#include "catch.hpp"
|
||||||
#include "string_utils.h"
|
#include "string_utils.h"
|
||||||
#include "tests/globals.h"
|
#include "tests/globals.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@ -24,8 +24,6 @@ TEST_CASE("Initialize a multi detector", "[.integration][.multi]") {
|
|||||||
d.freeSharedMemory();
|
d.freeSharedMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TEST_CASE("Set and read timers", "[.integration][.multi]") {
|
TEST_CASE("Set and read timers", "[.integration][.multi]") {
|
||||||
|
|
||||||
DetectorImpl d(0, true, true);
|
DetectorImpl d(0, true, true);
|
||||||
@ -57,7 +55,6 @@ TEST_CASE("Set and read timers", "[.integration][.multi]") {
|
|||||||
// PROGRESS, /**< fraction of measurement elapsed - only get! */
|
// PROGRESS, /**< fraction of measurement elapsed - only get! */
|
||||||
// MEASUREMENTS_NUMBER,
|
// MEASUREMENTS_NUMBER,
|
||||||
|
|
||||||
|
|
||||||
// FRAMES_FROM_START,
|
// FRAMES_FROM_START,
|
||||||
// FRAMES_FROM_START_PG,
|
// FRAMES_FROM_START_PG,
|
||||||
// SAMPLES,
|
// SAMPLES,
|
||||||
@ -78,7 +75,6 @@ TEST_CASE("Set and read timers", "[.integration][.multi]") {
|
|||||||
CHECK(d.setSubFrameExposureDeadTime(-1) == Approx(subframe_deadtime));
|
CHECK(d.setSubFrameExposureDeadTime(-1) == Approx(subframe_deadtime));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (test::type == dt::EIGER) {
|
if (test::type == dt::EIGER) {
|
||||||
// 32bit is needed for subframe exposure
|
// 32bit is needed for subframe exposure
|
||||||
d.setDynamicRange(32);
|
d.setDynamicRange(32);
|
||||||
|
82
python/api-tests/test_detector.py
Normal file
82
python/api-tests/test_detector.py
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
import pytest
|
||||||
|
import datetime as dt
|
||||||
|
from slsdet import Detector, timingMode, detectorType
|
||||||
|
|
||||||
|
not_eiger = pytest.mark.skipif(
|
||||||
|
Detector().type == detectorType.EIGER, reason="Does not work for eiger"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture
|
||||||
|
def det():
|
||||||
|
from slsdet import Detector
|
||||||
|
|
||||||
|
return Detector()
|
||||||
|
|
||||||
|
|
||||||
|
def test_frames(det):
|
||||||
|
for n in [1, 100, 3245, 10000]:
|
||||||
|
det.frames = n
|
||||||
|
assert det.frames == n
|
||||||
|
det.frames = 1
|
||||||
|
|
||||||
|
|
||||||
|
def test_triggers(det):
|
||||||
|
for n in [1, 100, 3245, 10000]:
|
||||||
|
det.triggers = n
|
||||||
|
assert det.triggers == n
|
||||||
|
det.triggers = 1
|
||||||
|
|
||||||
|
|
||||||
|
def test_exptime(det):
|
||||||
|
det.exptime = 1
|
||||||
|
assert det.exptime == 1
|
||||||
|
det.exptime = dt.timedelta(milliseconds=10)
|
||||||
|
assert det.exptime == 0.01
|
||||||
|
det.exptime = 1
|
||||||
|
|
||||||
|
|
||||||
|
def test_period(det):
|
||||||
|
det.period = 3.2
|
||||||
|
assert det.period == 3.2
|
||||||
|
|
||||||
|
p = dt.timedelta(microseconds=1020)
|
||||||
|
det.period = p
|
||||||
|
assert det.period == 0.001020
|
||||||
|
r = det.getPeriod()
|
||||||
|
assert r[0] == p
|
||||||
|
det.period = 0
|
||||||
|
assert det.period == 0
|
||||||
|
|
||||||
|
|
||||||
|
def test_lock(det):
|
||||||
|
for l in [True, False]:
|
||||||
|
det.lock = l
|
||||||
|
assert det.lock == l
|
||||||
|
|
||||||
|
|
||||||
|
def test_timing(det):
|
||||||
|
# auto and trigger is available for all det
|
||||||
|
for m in [timingMode.TRIGGER_EXPOSURE, timingMode.AUTO_TIMING]:
|
||||||
|
det.timing = m
|
||||||
|
assert det.timing == m
|
||||||
|
|
||||||
|
@not_eiger
|
||||||
|
def test_delay(det):
|
||||||
|
det.delay = 1
|
||||||
|
assert det.delay == 1
|
||||||
|
|
||||||
|
t = dt.timedelta(microseconds=1)
|
||||||
|
det.delay = t
|
||||||
|
assert det.delay == t.total_seconds()
|
||||||
|
|
||||||
|
r = det.getDelayAfterTrigger()[0]
|
||||||
|
assert r == t
|
||||||
|
|
||||||
|
det.delay = 0
|
||||||
|
assert det.delay == 0
|
||||||
|
|
||||||
|
|
||||||
|
@not_eiger
|
||||||
|
def test_delayl(det):
|
||||||
|
assert det.delayl == 0
|
89
python/api-tests/test_jungfrau.py
Normal file
89
python/api-tests/test_jungfrau.py
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
import pytest
|
||||||
|
import datetime as dt
|
||||||
|
from slsdet import Detector, detectorType
|
||||||
|
|
||||||
|
"""
|
||||||
|
These tests are designed to work the API and catch
|
||||||
|
any changes in behavior or naming. Tests are expected
|
||||||
|
to pass with a virtual detector or a real one
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture
|
||||||
|
def jf():
|
||||||
|
from slsdet import Jungfrau
|
||||||
|
return Jungfrau()
|
||||||
|
|
||||||
|
|
||||||
|
jungfrautest = pytest.mark.skipif(
|
||||||
|
Detector().type != detectorType.JUNGFRAU, reason="Only valid for Jungfrau"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@jungfrautest
|
||||||
|
def test_storagecells(jf):
|
||||||
|
for i in range(16):
|
||||||
|
jf.storagecells = i
|
||||||
|
assert jf.storagecells == i
|
||||||
|
jf.storagecells = 0 # default
|
||||||
|
|
||||||
|
@jungfrautest
|
||||||
|
def test_storagecell_start(jf):
|
||||||
|
for i in range(16):
|
||||||
|
jf.storagecell_start = i
|
||||||
|
assert jf.storagecell_start == i
|
||||||
|
jf.storagecells = 15 # default
|
||||||
|
|
||||||
|
@jungfrautest
|
||||||
|
def test_storagecell_delay(jf):
|
||||||
|
for t in [0.001, 0.0002, 0.0013]:
|
||||||
|
jf.storagecell_delay = t
|
||||||
|
assert jf.storagecell_delay == t
|
||||||
|
jf.storagecell_delay = 0 # default
|
||||||
|
|
||||||
|
@jungfrautest
|
||||||
|
def test_temp_event(jf):
|
||||||
|
# hard to test with virtual server
|
||||||
|
assert jf.temp_event == 0
|
||||||
|
|
||||||
|
@jungfrautest
|
||||||
|
def test_temp_threshold(jf):
|
||||||
|
for th in [0, 10, 43, 72]:
|
||||||
|
jf.temp_threshold = th
|
||||||
|
assert jf.temp_threshold == th
|
||||||
|
jf.temp_threshold = 0
|
||||||
|
|
||||||
|
@jungfrautest
|
||||||
|
def test_auto_comp_disable(jf):
|
||||||
|
for v in [True, False]:
|
||||||
|
jf.auto_comp_disable = v
|
||||||
|
assert jf.auto_comp_disable == v
|
||||||
|
|
||||||
|
@jungfrautest
|
||||||
|
def test_numinterfaces(jf):
|
||||||
|
for n in [2, 1]:
|
||||||
|
jf.numinterfaces = n
|
||||||
|
assert jf.numinterfaces == n
|
||||||
|
|
||||||
|
@jungfrautest
|
||||||
|
def test_dr(jf):
|
||||||
|
assert jf.dr == 16
|
||||||
|
|
||||||
|
@jungfrautest
|
||||||
|
def test_temp_control(jf):
|
||||||
|
for v in [True, False]:
|
||||||
|
jf.temp_control = v
|
||||||
|
assert jf.temp_control == v
|
||||||
|
|
||||||
|
@jungfrautest
|
||||||
|
def test_startingfnum(jf):
|
||||||
|
for n in [10, 127, 43321, 1]:
|
||||||
|
jf.startingfnum = n
|
||||||
|
assert jf.startingfnum == n
|
||||||
|
|
||||||
|
@jungfrautest
|
||||||
|
def test_selinterface(jf):
|
||||||
|
for i in [1, 0]:
|
||||||
|
jf.selinterface = i
|
||||||
|
assert jf.selinterface == i
|
@ -15,7 +15,7 @@ pycmd += ['vrf', 'vtr', 'vrs', 'vtgstv', 'vsvn', 'vtrim',
|
|||||||
'vpreamp', 'vref_comp', 'vref_comp_fe vref_ds', 'vref_h_adc',
|
'vpreamp', 'vref_comp', 'vref_comp_fe vref_ds', 'vref_h_adc',
|
||||||
'vref_l_adc', 'iodelay', 'list', 'vref_ds', 'vis', 'vpl',
|
'vref_l_adc', 'iodelay', 'list', 'vref_ds', 'vis', 'vpl',
|
||||||
'vref_comp_fe', 'vph', 'vout_cm', 'vcp', 'vcn', 'vcmp_ll', 'vcmp_lr'
|
'vref_comp_fe', 'vph', 'vout_cm', 'vcp', 'vcn', 'vcmp_ll', 'vcmp_lr'
|
||||||
, 'vcmp_rl', 'vcmp_rr']
|
, 'vcmp_rl', 'vcmp_rr', 'daclist', 'dacvalues', 'vcal', 'vcas']
|
||||||
|
|
||||||
missing = []
|
missing = []
|
||||||
for c in cmd:
|
for c in cmd:
|
||||||
|
@ -11,6 +11,10 @@ import subprocess
|
|||||||
|
|
||||||
from parse import remove_comments
|
from parse import remove_comments
|
||||||
|
|
||||||
|
def single_line_enum(line):
|
||||||
|
sub = line[line.find('{')+1:line.find('}')]
|
||||||
|
return sub.strip().split(',')
|
||||||
|
|
||||||
def extract_enums(lines):
|
def extract_enums(lines):
|
||||||
line_iter = iter(lines)
|
line_iter = iter(lines)
|
||||||
enums = {}
|
enums = {}
|
||||||
@ -18,8 +22,15 @@ def extract_enums(lines):
|
|||||||
m = re.search("(?<=enum )\w+(?= {)", line)
|
m = re.search("(?<=enum )\w+(?= {)", line)
|
||||||
if m:
|
if m:
|
||||||
enum_name = m.group()
|
enum_name = m.group()
|
||||||
# print(enum_name)
|
print(enum_name)
|
||||||
|
# print(line)
|
||||||
fields = []
|
fields = []
|
||||||
|
|
||||||
|
#deal with single line enums
|
||||||
|
if '};' in line:
|
||||||
|
fields = single_line_enum(line)
|
||||||
|
else:
|
||||||
|
#deal with multi line enums
|
||||||
while True:
|
while True:
|
||||||
l = next(line_iter)
|
l = next(line_iter)
|
||||||
if '};' in l:
|
if '};' in l:
|
||||||
|
@ -18,7 +18,13 @@ fpath = "../../slsDetectorSoftware/src/Detector.cpp"
|
|||||||
|
|
||||||
|
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument("-p", "--build_path", help="Path to the build database", type = str, default=default_build_path)
|
parser.add_argument(
|
||||||
|
"-p",
|
||||||
|
"--build_path",
|
||||||
|
help="Path to the build database",
|
||||||
|
type=str,
|
||||||
|
default=default_build_path,
|
||||||
|
)
|
||||||
cargs = parser.parse_args()
|
cargs = parser.parse_args()
|
||||||
|
|
||||||
db = cindex.CompilationDatabase.fromDirectory(cargs.build_path)
|
db = cindex.CompilationDatabase.fromDirectory(cargs.build_path)
|
||||||
@ -26,7 +32,7 @@ index = cindex.Index.create()
|
|||||||
args = db.getCompileCommands(fpath)
|
args = db.getCompileCommands(fpath)
|
||||||
args = list(iter(args).__next__().arguments)[0:-1]
|
args = list(iter(args).__next__().arguments)[0:-1]
|
||||||
args = args + "-x c++ --std=c++11".split()
|
args = args + "-x c++ --std=c++11".split()
|
||||||
syspath = system_include_paths('clang++')
|
syspath = system_include_paths("clang++")
|
||||||
incargs = ["-I" + inc for inc in syspath]
|
incargs = ["-I" + inc for inc in syspath]
|
||||||
args = args + incargs
|
args = args + incargs
|
||||||
|
|
||||||
@ -39,6 +45,9 @@ ag = []
|
|||||||
|
|
||||||
lines = []
|
lines = []
|
||||||
|
|
||||||
|
ag2 = []
|
||||||
|
|
||||||
|
cn = []
|
||||||
|
|
||||||
def get_arguments(node):
|
def get_arguments(node):
|
||||||
args = [a.type.spelling for a in node.get_arguments()]
|
args = [a.type.spelling for a in node.get_arguments()]
|
||||||
@ -46,9 +55,25 @@ def get_arguments(node):
|
|||||||
"py::arg() = Positions{}" if item == "sls::Positions" else "py::arg()"
|
"py::arg() = Positions{}" if item == "sls::Positions" else "py::arg()"
|
||||||
for item in args
|
for item in args
|
||||||
]
|
]
|
||||||
args = ', '.join(args)
|
args = ", ".join(args)
|
||||||
if args:
|
if args:
|
||||||
args = f', {args}'
|
args = f", {args}"
|
||||||
|
return args
|
||||||
|
|
||||||
|
|
||||||
|
def get_fdec(node):
|
||||||
|
args = [a.type.spelling for a in node.get_arguments()]
|
||||||
|
if node.result_type.spelling:
|
||||||
|
return_type = node.result_type.spelling
|
||||||
|
else:
|
||||||
|
return_type = 'void'
|
||||||
|
|
||||||
|
if node.is_const_method():
|
||||||
|
const = 'const'
|
||||||
|
else:
|
||||||
|
const = ''
|
||||||
|
args = ", ".join(args)
|
||||||
|
args = f'({return_type}(Detector::*)({args}){const})'
|
||||||
return args
|
return args
|
||||||
|
|
||||||
|
|
||||||
@ -62,23 +87,37 @@ def visit(node):
|
|||||||
):
|
):
|
||||||
m.append(child)
|
m.append(child)
|
||||||
args = get_arguments(child)
|
args = get_arguments(child)
|
||||||
lines.append(f'.def(\"{child.spelling}\", &Detector::{child.spelling}{args})')
|
fs = get_fdec(child)
|
||||||
|
lines.append(
|
||||||
|
f'.def("{child.spelling}",{fs} &Detector::{child.spelling}{args})'
|
||||||
|
)
|
||||||
|
cn.append(child)
|
||||||
for child in node.get_children():
|
for child in node.get_children():
|
||||||
visit(child)
|
visit(child)
|
||||||
|
|
||||||
|
# .def("setRxHostname",
|
||||||
|
# (void (Detector::*)(const std::string &, Positions)) &
|
||||||
|
# Detector::setRxHostname,
|
||||||
|
# py::arg(), py::arg() = Positions{})
|
||||||
|
# .def("setRxHostname",
|
||||||
|
# (void (Detector::*)(const std::vector<std::string> &)) &
|
||||||
|
# Detector::setRxHostname,
|
||||||
|
# py::arg())
|
||||||
|
|
||||||
|
|
||||||
visit(tu.cursor)
|
visit(tu.cursor)
|
||||||
|
|
||||||
|
|
||||||
with open('../src/detector_in.cpp') as f:
|
with open("../src/detector_in.cpp") as f:
|
||||||
data = f.read()
|
data = f.read()
|
||||||
s = ''.join(lines)
|
s = "".join(lines)
|
||||||
s += ';'
|
s += ";"
|
||||||
text = data.replace('[[FUNCTIONS]]', s)
|
text = data.replace("[[FUNCTIONS]]", s)
|
||||||
warning = '/* WARINING This file is auto generated any edits might be overwritten without warning */\n\n'
|
warning = "/* WARINING This file is auto generated any edits might be overwritten without warning */\n\n"
|
||||||
with open('../src/detector.cpp', 'w') as f:
|
with open("../src/detector.cpp", "w") as f:
|
||||||
f.write(warning)
|
f.write(warning)
|
||||||
f.write(text)
|
f.write(text)
|
||||||
|
|
||||||
# run clang format on the output
|
# run clang format on the output
|
||||||
subprocess.run(['clang-format', '../src/detector.cpp', '-i'])
|
subprocess.run(["clang-format", "../src/detector.cpp", "-i"])
|
||||||
|
|
||||||
|
0
python/scripts/list_tested_cmd.py
Normal file → Executable file
0
python/scripts/list_tested_cmd.py
Normal file → Executable file
@ -45,7 +45,7 @@ ext_modules = [
|
|||||||
# get_pybind_include(),
|
# get_pybind_include(),
|
||||||
# get_pybind_include(user=True),
|
# get_pybind_include(user=True),
|
||||||
os.path.join('../libs/pybind11/include'),
|
os.path.join('../libs/pybind11/include'),
|
||||||
os.path.join(get_conda_path(), 'include/slsDetectorPackage'),
|
os.path.join(get_conda_path(), 'include'),
|
||||||
|
|
||||||
],
|
],
|
||||||
libraries=['SlsDetector', 'SlsReceiver', 'zmq'],
|
libraries=['SlsDetector', 'SlsReceiver', 'zmq'],
|
||||||
|
@ -1,23 +1,29 @@
|
|||||||
from _slsdet import CppDetectorApi
|
from _slsdet import CppDetectorApi
|
||||||
from _slsdet import slsDetectorDefs
|
from _slsdet import slsDetectorDefs
|
||||||
|
from _slsdet import IpAddr, MacAddr
|
||||||
|
|
||||||
runStatus = slsDetectorDefs.runStatus
|
runStatus = slsDetectorDefs.runStatus
|
||||||
|
timingMode = slsDetectorDefs.timingMode
|
||||||
speedLevel = slsDetectorDefs.speedLevel
|
speedLevel = slsDetectorDefs.speedLevel
|
||||||
dacIndex = slsDetectorDefs.dacIndex
|
dacIndex = slsDetectorDefs.dacIndex
|
||||||
|
detectorType = slsDetectorDefs.detectorType
|
||||||
|
|
||||||
from .utils import element_if_equal, all_equal, get_set_bits, list_to_bitmask
|
from .utils import element_if_equal, all_equal, get_set_bits, list_to_bitmask
|
||||||
from .utils import Geometry, to_geo, element
|
from .utils import Geometry, to_geo, element, reduce_time, is_iterable
|
||||||
|
from . import utils as ut
|
||||||
from .registers import Register, Adc_register
|
from .registers import Register, Adc_register
|
||||||
import datetime as dt
|
import datetime as dt
|
||||||
|
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
import socket
|
||||||
|
|
||||||
|
|
||||||
def freeze(cls):
|
def freeze(cls):
|
||||||
cls._frozen = False
|
cls._frozen = False
|
||||||
|
|
||||||
def frozensetattr(self, key, value):
|
def frozensetattr(self, key, value):
|
||||||
if self._frozen and not hasattr(self, key):
|
if self._frozen and not key in dir(self):
|
||||||
raise AttributeError(
|
raise AttributeError(
|
||||||
"Class {} is frozen. Cannot set {} = {}".format(
|
"Class {} is frozen. Cannot set {} = {}".format(
|
||||||
cls.__name__, key, value
|
cls.__name__, key, value
|
||||||
@ -57,23 +63,16 @@ class Detector(CppDetectorApi):
|
|||||||
self._register = Register(self)
|
self._register = Register(self)
|
||||||
self._adc_register = Adc_register(self)
|
self._adc_register = Adc_register(self)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# CONFIGURATION
|
# CONFIGURATION
|
||||||
def __len__(self):
|
def __len__(self):
|
||||||
return self.size()
|
return self.size()
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return '{}(id = {})'.format(self.__class__.__name__,
|
return "{}(id = {})".format(self.__class__.__name__, self.getShmId())
|
||||||
self.getShmId())
|
|
||||||
|
|
||||||
|
|
||||||
def free(self):
|
def free(self):
|
||||||
self.freeSharedMemory()
|
self.freeSharedMemory()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def config(self):
|
def config(self):
|
||||||
return NotImplementedError("config is set only")
|
return NotImplementedError("config is set only")
|
||||||
@ -161,58 +160,48 @@ class Detector(CppDetectorApi):
|
|||||||
def frames(self, n_frames):
|
def frames(self, n_frames):
|
||||||
self.setNumberOfFrames(n_frames)
|
self.setNumberOfFrames(n_frames)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def triggers(self):
|
||||||
|
return element_if_equal(self.getNumberOfTriggers())
|
||||||
|
|
||||||
|
@triggers.setter
|
||||||
|
def triggers(self, n_triggers):
|
||||||
|
self.setNumberOfTriggers(n_triggers)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def exptime(self):
|
def exptime(self):
|
||||||
|
if self.type == detectorType.MYTHEN3:
|
||||||
|
res = self.getExptimeForAllGates()
|
||||||
|
else:
|
||||||
res = self.getExptime()
|
res = self.getExptime()
|
||||||
return element_if_equal([it.total_seconds() for it in res])
|
return reduce_time(res)
|
||||||
|
|
||||||
@exptime.setter
|
@exptime.setter
|
||||||
def exptime(self, t):
|
def exptime(self, t):
|
||||||
if isinstance(t, dt.timedelta):
|
self.setExptime(ut.make_timedelta(t))
|
||||||
self.setExptime(t)
|
|
||||||
else:
|
|
||||||
self.setExptime(dt.timedelta(seconds=t))
|
|
||||||
|
|
||||||
@property
|
|
||||||
def subexptime(self):
|
|
||||||
res = self.getSubExptime()
|
|
||||||
return element_if_equal([it.total_seconds() for it in res])
|
|
||||||
|
|
||||||
@subexptime.setter
|
|
||||||
def subexptime(self, t):
|
|
||||||
if isinstance(t, dt.timedelta):
|
|
||||||
self.setSubExptime(t)
|
|
||||||
else:
|
|
||||||
self.setSubExptime(dt.timedelta(seconds=t))
|
|
||||||
|
|
||||||
@property
|
|
||||||
def subdeadtime(self):
|
|
||||||
res = self.getSubDeadTime()
|
|
||||||
return element_if_equal([it.total_seconds() for it in res])
|
|
||||||
|
|
||||||
@subdeadtime.setter
|
|
||||||
def subdeadtime(self, t):
|
|
||||||
if isinstance(t, dt.timedelta):
|
|
||||||
self.setSubDeadTime(t)
|
|
||||||
else:
|
|
||||||
self.setSubDeadTime(dt.timedelta(seconds=t))
|
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def period(self):
|
def period(self):
|
||||||
res = self.getPeriod()
|
res = self.getPeriod()
|
||||||
return element_if_equal([it.total_seconds() for it in res])
|
return reduce_time(res)
|
||||||
|
|
||||||
@period.setter
|
@period.setter
|
||||||
def period(self, t):
|
def period(self, t):
|
||||||
if isinstance(t, dt.timedelta):
|
self.setPeriod(ut.make_timedelta(t))
|
||||||
self.setPeriod(t)
|
|
||||||
else:
|
|
||||||
self.setPeriod(dt.timedelta(seconds=t))
|
|
||||||
|
|
||||||
|
@property
|
||||||
|
@element
|
||||||
|
def delay(self):
|
||||||
|
return ut.reduce_time(self.getDelayAfterTrigger())
|
||||||
|
|
||||||
|
@delay.setter
|
||||||
|
def delay(self, t):
|
||||||
|
self.setDelayAfterTrigger(ut.make_timedelta(t))
|
||||||
|
|
||||||
|
@property
|
||||||
|
@element
|
||||||
|
def delayl(self):
|
||||||
|
return ut.reduce_time(self.getDelayAfterTriggerLeft())
|
||||||
|
|
||||||
|
|
||||||
# Time
|
# Time
|
||||||
@ -220,7 +209,6 @@ class Detector(CppDetectorApi):
|
|||||||
def rx_framescaught(self):
|
def rx_framescaught(self):
|
||||||
return element_if_equal(self.getFramesCaught())
|
return element_if_equal(self.getFramesCaught())
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def startingfnum(self):
|
def startingfnum(self):
|
||||||
return element_if_equal(self.getStartingFrameNumber())
|
return element_if_equal(self.getStartingFrameNumber())
|
||||||
@ -228,9 +216,6 @@ class Detector(CppDetectorApi):
|
|||||||
@startingfnum.setter
|
@startingfnum.setter
|
||||||
def startingfnum(self, value):
|
def startingfnum(self, value):
|
||||||
self.setStartingFrameNumber(value)
|
self.setStartingFrameNumber(value)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# TODO! add txdelay
|
# TODO! add txdelay
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -297,10 +282,17 @@ class Detector(CppDetectorApi):
|
|||||||
@property
|
@property
|
||||||
def rx_lastclient(self):
|
def rx_lastclient(self):
|
||||||
return element_if_equal(self.getRxLastClientIP())
|
return element_if_equal(self.getRxLastClientIP())
|
||||||
|
|
||||||
|
|
||||||
# FILE
|
# FILE
|
||||||
|
|
||||||
|
@property
|
||||||
|
@element
|
||||||
|
def numinterfaces(self):
|
||||||
|
return self.getNumberofUDPInterfaces()
|
||||||
|
|
||||||
|
@numinterfaces.setter
|
||||||
|
def numinterfaces(self, value):
|
||||||
|
self.setNumberofUDPInterfaces(value)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def fformat(self):
|
def fformat(self):
|
||||||
return element_if_equal(self.getFileFormat())
|
return element_if_equal(self.getFileFormat())
|
||||||
@ -415,14 +407,15 @@ class Detector(CppDetectorApi):
|
|||||||
def zmqip(self, ip):
|
def zmqip(self, ip):
|
||||||
self.setClientZmqIp(ip)
|
self.setClientZmqIp(ip)
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def udp_dstip(self):
|
def udp_dstip(self):
|
||||||
return element_if_equal(self.getDestinationUDPIP())
|
return element_if_equal(self.getDestinationUDPIP())
|
||||||
|
|
||||||
@udp_dstip.setter
|
@udp_dstip.setter
|
||||||
def udp_dstip(self, ip):
|
def udp_dstip(self, ip):
|
||||||
self.getDestinationUDPIP(ip)
|
if ip == "auto":
|
||||||
|
ip = socket.gethostbyname(self.rx_hostname)
|
||||||
|
self.setDestinationUDPIP(IpAddr(ip))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def udp_dstip2(self):
|
def udp_dstip2(self):
|
||||||
@ -430,7 +423,9 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@udp_dstip2.setter
|
@udp_dstip2.setter
|
||||||
def udp_dstip2(self, ip):
|
def udp_dstip2(self, ip):
|
||||||
self.getDestinationUDPIP2(ip)
|
if ip == "auto":
|
||||||
|
ip = socket.gethostbyname(self.rx_hostname)
|
||||||
|
self.setDestinationUDPIP2(IpAddr(ip))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def udp_dstmac(self):
|
def udp_dstmac(self):
|
||||||
@ -438,7 +433,7 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@udp_dstmac.setter
|
@udp_dstmac.setter
|
||||||
def udp_dstmac(self, mac):
|
def udp_dstmac(self, mac):
|
||||||
self.getDestinationUDPMAC2(mac)
|
self.setDestinationUDPMAC(MacAddr(mac))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def udp_dstmac2(self):
|
def udp_dstmac2(self):
|
||||||
@ -446,8 +441,7 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@udp_dstmac2.setter
|
@udp_dstmac2.setter
|
||||||
def udp_dstmac2(self, mac):
|
def udp_dstmac2(self, mac):
|
||||||
self.getDestinationUDPMAC2(mac)
|
self.setDestinationUDPMAC2(MacAddr(mac))
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def udp_srcip(self):
|
def udp_srcip(self):
|
||||||
@ -455,7 +449,7 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@udp_srcip.setter
|
@udp_srcip.setter
|
||||||
def udp_srcip(self, ip):
|
def udp_srcip(self, ip):
|
||||||
self.setSourceUDPIP(ip)
|
self.setSourceUDPIP(IpAddr(ip))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def udp_srcip2(self):
|
def udp_srcip2(self):
|
||||||
@ -487,7 +481,7 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@src_udpmac.setter
|
@src_udpmac.setter
|
||||||
def src_udpmac(self, mac):
|
def src_udpmac(self, mac):
|
||||||
self.setSourceUDPMAC(mac)
|
self.setSourceUDPMAC(MacAddr(mac))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def src_udpip2(self):
|
def src_udpip2(self):
|
||||||
@ -495,7 +489,7 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@src_udpip2.setter
|
@src_udpip2.setter
|
||||||
def src_udpip2(self, ip):
|
def src_udpip2(self, ip):
|
||||||
self.setSourceUDPIP(ip)
|
self.setSourceUDPIP(IpAddr(ip))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def src_udpip(self):
|
def src_udpip(self):
|
||||||
@ -503,8 +497,7 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@src_udpip.setter
|
@src_udpip.setter
|
||||||
def src_udpip(self, ip):
|
def src_udpip(self, ip):
|
||||||
self.setSourceUDPIP(ip)
|
self.setSourceUDPIP(IpAddr(ip))
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def src_udpmac2(self):
|
def src_udpmac2(self):
|
||||||
@ -512,7 +505,7 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@src_udpmac2.setter
|
@src_udpmac2.setter
|
||||||
def src_udpmac2(self, mac):
|
def src_udpmac2(self, mac):
|
||||||
self.setSourceUDPMAC2(mac)
|
self.setSourceUDPMAC2(MacAddr(mac))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def vhighvoltage(self):
|
def vhighvoltage(self):
|
||||||
@ -542,8 +535,6 @@ class Detector(CppDetectorApi):
|
|||||||
def rx_status(self):
|
def rx_status(self):
|
||||||
return element_if_equal(self.getReceiverStatus())
|
return element_if_equal(self.getReceiverStatus())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def rx_udpsocksize(self):
|
def rx_udpsocksize(self):
|
||||||
return element_if_equal(self.getRxUDPSocketBufferSize())
|
return element_if_equal(self.getRxUDPSocketBufferSize())
|
||||||
@ -558,7 +549,7 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def trimbits(self):
|
def trimbits(self):
|
||||||
return NotImplementedError('trimbits are set only')
|
return NotImplementedError("trimbits are set only")
|
||||||
|
|
||||||
@trimbits.setter
|
@trimbits.setter
|
||||||
def trimbits(self, fname):
|
def trimbits(self, fname):
|
||||||
@ -592,7 +583,6 @@ class Detector(CppDetectorApi):
|
|||||||
def adcreg(self):
|
def adcreg(self):
|
||||||
return self._adc_register
|
return self._adc_register
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def led(self):
|
def led(self):
|
||||||
return element_if_equal(self.getLEDEnable())
|
return element_if_equal(self.getLEDEnable())
|
||||||
@ -651,8 +641,6 @@ class Detector(CppDetectorApi):
|
|||||||
def vthreshold(self):
|
def vthreshold(self):
|
||||||
return element_if_equal(self.getDAC(dacIndex.THRESHOLD))
|
return element_if_equal(self.getDAC(dacIndex.THRESHOLD))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def type(self):
|
def type(self):
|
||||||
return element_if_equal(self.getDetectorType())
|
return element_if_equal(self.getDetectorType())
|
||||||
@ -665,10 +653,27 @@ class Detector(CppDetectorApi):
|
|||||||
def rx_missingpackets(self):
|
def rx_missingpackets(self):
|
||||||
return element_if_equal(self.getNumMissingPackets())
|
return element_if_equal(self.getNumMissingPackets())
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Some Eiger stuff, does this have to be here or can we move it to subclass?
|
Some Eiger stuff, does this have to be here or can we move it to subclass?
|
||||||
"""
|
"""
|
||||||
|
@property
|
||||||
|
def subexptime(self):
|
||||||
|
res = self.getSubExptime()
|
||||||
|
return reduce_time(res)
|
||||||
|
|
||||||
|
@subexptime.setter
|
||||||
|
def subexptime(self, t):
|
||||||
|
self.setSubExptime(ut.make_timedelta(t))
|
||||||
|
|
||||||
|
@property
|
||||||
|
def subdeadtime(self):
|
||||||
|
res = self.getSubDeadTime()
|
||||||
|
reduce_time(res)
|
||||||
|
|
||||||
|
@subdeadtime.setter
|
||||||
|
def subdeadtime(self, t):
|
||||||
|
self.setSubDeadTime(ut.make_timedelta(t))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def partialreset(self):
|
def partialreset(self):
|
||||||
return element_if_equal(self.getPartialReset())
|
return element_if_equal(self.getPartialReset())
|
||||||
@ -727,7 +732,6 @@ class Detector(CppDetectorApi):
|
|||||||
res = self.getMeasuredSubFramePeriod()
|
res = self.getMeasuredSubFramePeriod()
|
||||||
return element_if_equal([it.total_seconds() for it in res])
|
return element_if_equal([it.total_seconds() for it in res])
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def storeinram(self):
|
def storeinram(self):
|
||||||
return element_if_equal(self.getStoreInRamMode())
|
return element_if_equal(self.getStoreInRamMode())
|
||||||
@ -736,11 +740,116 @@ class Detector(CppDetectorApi):
|
|||||||
def storeinram(self, value):
|
def storeinram(self, value):
|
||||||
self.setStoreInRamMode(value)
|
self.setStoreInRamMode(value)
|
||||||
|
|
||||||
|
"""
|
||||||
|
Jungfrau specific
|
||||||
|
"""
|
||||||
|
|
||||||
|
@property
|
||||||
|
@element
|
||||||
|
def auto_comp_disable(self):
|
||||||
|
return self.getAutoCompDisable()
|
||||||
|
|
||||||
|
@auto_comp_disable.setter
|
||||||
|
def auto_comp_disable(self, value):
|
||||||
|
self.setAutoCompDisable(value)
|
||||||
|
|
||||||
|
@property
|
||||||
|
@element
|
||||||
|
def storagecells(self):
|
||||||
|
return self.getNumberOfAdditionalStorageCells()
|
||||||
|
|
||||||
|
@storagecells.setter
|
||||||
|
def storagecells(self, n_cells):
|
||||||
|
self.setNumberOfAdditionalStorageCells(n_cells)
|
||||||
|
|
||||||
|
@property
|
||||||
|
@element
|
||||||
|
def storagecell_start(self):
|
||||||
|
return self.getStorageCellStart()
|
||||||
|
|
||||||
|
@storagecell_start.setter
|
||||||
|
def storagecell_start(self, value):
|
||||||
|
self.setStorageCellStart(value)
|
||||||
|
|
||||||
|
@property
|
||||||
|
@element
|
||||||
|
def storagecell_delay(self):
|
||||||
|
return ut.reduce_time(self.getStorageCellDelay())
|
||||||
|
|
||||||
|
@storagecell_delay.setter
|
||||||
|
def storagecell_delay(self, t):
|
||||||
|
self.setStorageCellDelay(ut.make_timedelta(t))
|
||||||
|
|
||||||
|
@property
|
||||||
|
@element
|
||||||
|
def temp_threshold(self):
|
||||||
|
return self.getThresholdTemperature()
|
||||||
|
|
||||||
|
@temp_threshold.setter
|
||||||
|
def temp_threshold(self, value):
|
||||||
|
self.setThresholdTemperature(value)
|
||||||
|
|
||||||
|
@property
|
||||||
|
@element
|
||||||
|
def temp_event(self):
|
||||||
|
return self.getTemperatureEvent()
|
||||||
|
|
||||||
|
@temp_event.setter
|
||||||
|
def temp_event(self, value):
|
||||||
|
if value != 0:
|
||||||
|
raise ValueError("Value needs to be 0 for reset. Setting not allowed")
|
||||||
|
self.resetTemperatureEvent()
|
||||||
|
|
||||||
|
@property
|
||||||
|
@element
|
||||||
|
def temp_control(self):
|
||||||
|
return self.getTemperatureControl()
|
||||||
|
|
||||||
|
@temp_control.setter
|
||||||
|
def temp_control(self, value):
|
||||||
|
self.setTemperatureControl(value)
|
||||||
|
|
||||||
|
|
||||||
|
@property
|
||||||
|
@element
|
||||||
|
def selinterface(self):
|
||||||
|
return self.getSelectedUDPInterface()
|
||||||
|
|
||||||
|
@selinterface.setter
|
||||||
|
def selinterface(self, i):
|
||||||
|
self.selectUDPInterface(i)
|
||||||
|
|
||||||
|
"""
|
||||||
|
Gotthard2
|
||||||
|
"""
|
||||||
|
|
||||||
|
@property
|
||||||
|
@element
|
||||||
|
def veto(self):
|
||||||
|
return self.getVeto()
|
||||||
|
|
||||||
|
@veto.setter
|
||||||
|
def veto(self, value):
|
||||||
|
self.setVeto(value)
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Mythen3 specific
|
Mythen3 specific
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@property
|
||||||
|
def gatedelay(self):
|
||||||
|
return reduce_time(self.getGateDelayForAllGates())
|
||||||
|
|
||||||
|
@gatedelay.setter
|
||||||
|
def gatedelay(self, value):
|
||||||
|
if is_iterable(value):
|
||||||
|
if len(value) == 3:
|
||||||
|
for i, v in enumerate(value):
|
||||||
|
self.setGateDelay(i, ut.make_timedelta(v))
|
||||||
|
else:
|
||||||
|
self.setGateDelay(-1, ut.make_timedelta(value))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def counters(self):
|
def counters(self):
|
||||||
mask = self.getCounterMask()
|
mask = self.getCounterMask()
|
||||||
@ -750,7 +859,6 @@ class Detector(CppDetectorApi):
|
|||||||
else:
|
else:
|
||||||
return [get_set_bits(m) for m in mask]
|
return [get_set_bits(m) for m in mask]
|
||||||
|
|
||||||
|
|
||||||
@counters.setter
|
@counters.setter
|
||||||
def counters(self, values):
|
def counters(self, values):
|
||||||
self.setCounterMask(list_to_bitmask(values))
|
self.setCounterMask(list_to_bitmask(values))
|
||||||
@ -958,7 +1066,6 @@ class Detector(CppDetectorApi):
|
|||||||
def patwaittime2(self, nclk):
|
def patwaittime2(self, nclk):
|
||||||
self.setPatternWaitTime(2, nclk)
|
self.setPatternWaitTime(2, nclk)
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def patloop0(self):
|
def patloop0(self):
|
||||||
return element_if_equal(self.getPatternLoopAddresses(0))
|
return element_if_equal(self.getPatternLoopAddresses(0))
|
||||||
@ -1007,7 +1114,6 @@ class Detector(CppDetectorApi):
|
|||||||
def patnloop2(self, n):
|
def patnloop2(self, n):
|
||||||
self.setPatternLoopCycles(2, n)
|
self.setPatternLoopCycles(2, n)
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@element
|
@element
|
||||||
def v_a(self):
|
def v_a(self):
|
||||||
|
@ -7,10 +7,17 @@ but not directly used in controlling the detector
|
|||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
import _slsdet #C++ lib
|
import _slsdet #C++ lib
|
||||||
import functools
|
import functools
|
||||||
|
import datetime as dt
|
||||||
|
|
||||||
Geometry = namedtuple('Geometry', ['x', 'y'])
|
Geometry = namedtuple('Geometry', ['x', 'y'])
|
||||||
|
|
||||||
|
def is_iterable(item):
|
||||||
|
try:
|
||||||
|
iter(item)
|
||||||
|
except TypeError:
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
def get_set_bits(mask):
|
def get_set_bits(mask):
|
||||||
"""
|
"""
|
||||||
Return a list of the set bits in a python integer
|
Return a list of the set bits in a python integer
|
||||||
@ -41,6 +48,9 @@ def all_equal(mylist):
|
|||||||
|
|
||||||
def element_if_equal(mylist):
|
def element_if_equal(mylist):
|
||||||
"""If all elements are equal return only one element"""
|
"""If all elements are equal return only one element"""
|
||||||
|
if not is_iterable(mylist):
|
||||||
|
return mylist
|
||||||
|
|
||||||
if all_equal(mylist):
|
if all_equal(mylist):
|
||||||
if len(mylist) == 0:
|
if len(mylist) == 0:
|
||||||
return None
|
return None
|
||||||
@ -49,6 +59,15 @@ def element_if_equal(mylist):
|
|||||||
else:
|
else:
|
||||||
return mylist
|
return mylist
|
||||||
|
|
||||||
|
def reduce_time(mylist):
|
||||||
|
res = element_if_equal(element_if_equal(mylist))
|
||||||
|
if isinstance(res, dt.timedelta):
|
||||||
|
return res.total_seconds()
|
||||||
|
elif isinstance(res[0], list):
|
||||||
|
return [[item.total_seconds() for item in subl] for subl in res]
|
||||||
|
else:
|
||||||
|
return [r.total_seconds() for r in res]
|
||||||
|
|
||||||
def element(func):
|
def element(func):
|
||||||
"""
|
"""
|
||||||
Wrapper to return either list or element
|
Wrapper to return either list or element
|
||||||
@ -69,3 +88,8 @@ def eiger_register_to_time(register):
|
|||||||
exponent = register & 0b111
|
exponent = register & 0b111
|
||||||
return clocks*10**exponent / 100e6
|
return clocks*10**exponent / 100e6
|
||||||
|
|
||||||
|
def make_timedelta(t):
|
||||||
|
if isinstance(t, dt.timedelta):
|
||||||
|
return t
|
||||||
|
else:
|
||||||
|
return dt.timedelta(seconds=t)
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -8,10 +8,17 @@
|
|||||||
#include "network_utils.h"
|
#include "network_utils.h"
|
||||||
#include "sls_detector_defs.h"
|
#include "sls_detector_defs.h"
|
||||||
#include "typecaster.h"
|
#include "typecaster.h"
|
||||||
|
|
||||||
|
#include "TimeHelper.h"
|
||||||
|
#include <array>
|
||||||
|
#include <chrono>
|
||||||
namespace py = pybind11;
|
namespace py = pybind11;
|
||||||
void init_det(py::module &m) {
|
void init_det(py::module &m) {
|
||||||
using sls::Detector;
|
using sls::Detector;
|
||||||
using sls::Positions;
|
using sls::Positions;
|
||||||
|
using sls::Result;
|
||||||
|
using sls::defs;
|
||||||
|
using sls::ns;
|
||||||
|
|
||||||
py::class_<Detector> CppDetectorApi(m, "CppDetectorApi");
|
py::class_<Detector> CppDetectorApi(m, "CppDetectorApi");
|
||||||
CppDetectorApi
|
CppDetectorApi
|
||||||
|
@ -65,38 +65,14 @@ void init_enums(py::module &m) {
|
|||||||
.export_values();
|
.export_values();
|
||||||
|
|
||||||
py::enum_<slsDetectorDefs::externalSignalFlag>(Defs, "externalSignalFlag")
|
py::enum_<slsDetectorDefs::externalSignalFlag>(Defs, "externalSignalFlag")
|
||||||
.value("GET_EXTERNAL_SIGNAL_FLAG",
|
|
||||||
slsDetectorDefs::externalSignalFlag::GET_EXTERNAL_SIGNAL_FLAG)
|
|
||||||
.value("SIGNAL_OFF", slsDetectorDefs::externalSignalFlag::SIGNAL_OFF)
|
|
||||||
.value("GATE_IN_ACTIVE_HIGH",
|
|
||||||
slsDetectorDefs::externalSignalFlag::GATE_IN_ACTIVE_HIGH)
|
|
||||||
.value("GATE_IN_ACTIVE_LOW",
|
|
||||||
slsDetectorDefs::externalSignalFlag::GATE_IN_ACTIVE_LOW)
|
|
||||||
.value("TRIGGER_IN_RISING_EDGE",
|
.value("TRIGGER_IN_RISING_EDGE",
|
||||||
slsDetectorDefs::externalSignalFlag::TRIGGER_IN_RISING_EDGE)
|
slsDetectorDefs::externalSignalFlag::TRIGGER_IN_RISING_EDGE)
|
||||||
.value("TRIGGER_IN_FALLING_EDGE",
|
.value("TRIGGER_IN_FALLING_EDGE",
|
||||||
slsDetectorDefs::externalSignalFlag::TRIGGER_IN_FALLING_EDGE)
|
slsDetectorDefs::externalSignalFlag::TRIGGER_IN_FALLING_EDGE)
|
||||||
.value("RO_TRIGGER_IN_RISING_EDGE",
|
.value("INVERSION_ON",
|
||||||
slsDetectorDefs::externalSignalFlag::RO_TRIGGER_IN_RISING_EDGE)
|
slsDetectorDefs::externalSignalFlag::INVERSION_ON)
|
||||||
.value("RO_TRIGGER_IN_FALLING_EDGE",
|
.value("INVERSION_OFF",
|
||||||
slsDetectorDefs::externalSignalFlag::RO_TRIGGER_IN_FALLING_EDGE)
|
slsDetectorDefs::externalSignalFlag::INVERSION_OFF)
|
||||||
.value("GATE_OUT_ACTIVE_HIGH",
|
|
||||||
slsDetectorDefs::externalSignalFlag::GATE_OUT_ACTIVE_HIGH)
|
|
||||||
.value("GATE_OUT_ACTIVE_LOW",
|
|
||||||
slsDetectorDefs::externalSignalFlag::GATE_OUT_ACTIVE_LOW)
|
|
||||||
.value("TRIGGER_OUT_RISING_EDGE",
|
|
||||||
slsDetectorDefs::externalSignalFlag::TRIGGER_OUT_RISING_EDGE)
|
|
||||||
.value("TRIGGER_OUT_FALLING_EDGE",
|
|
||||||
slsDetectorDefs::externalSignalFlag::TRIGGER_OUT_FALLING_EDGE)
|
|
||||||
.value("RO_TRIGGER_OUT_RISING_EDGE",
|
|
||||||
slsDetectorDefs::externalSignalFlag::RO_TRIGGER_OUT_RISING_EDGE)
|
|
||||||
.value("RO_TRIGGER_OUT_FALLING_EDGE",
|
|
||||||
slsDetectorDefs::externalSignalFlag::RO_TRIGGER_OUT_FALLING_EDGE)
|
|
||||||
.value("OUTPUT_LOW", slsDetectorDefs::externalSignalFlag::OUTPUT_LOW)
|
|
||||||
.value("OUTPUT_HIGH", slsDetectorDefs::externalSignalFlag::OUTPUT_HIGH)
|
|
||||||
.value(
|
|
||||||
"MASTER_SLAVE_SYNCHRONIZATION",
|
|
||||||
slsDetectorDefs::externalSignalFlag::MASTER_SLAVE_SYNCHRONIZATION)
|
|
||||||
.export_values();
|
.export_values();
|
||||||
|
|
||||||
py::enum_<slsDetectorDefs::timingMode>(Defs, "timingMode")
|
py::enum_<slsDetectorDefs::timingMode>(Defs, "timingMode")
|
||||||
@ -106,6 +82,9 @@ void init_enums(py::module &m) {
|
|||||||
slsDetectorDefs::timingMode::TRIGGER_EXPOSURE)
|
slsDetectorDefs::timingMode::TRIGGER_EXPOSURE)
|
||||||
.value("GATED", slsDetectorDefs::timingMode::GATED)
|
.value("GATED", slsDetectorDefs::timingMode::GATED)
|
||||||
.value("BURST_TRIGGER", slsDetectorDefs::timingMode::BURST_TRIGGER)
|
.value("BURST_TRIGGER", slsDetectorDefs::timingMode::BURST_TRIGGER)
|
||||||
|
.value("TRIGGER_GATED", slsDetectorDefs::timingMode::TRIGGER_GATED)
|
||||||
|
.value("NUM_TIMING_MODES",
|
||||||
|
slsDetectorDefs::timingMode::NUM_TIMING_MODES)
|
||||||
.export_values();
|
.export_values();
|
||||||
|
|
||||||
py::enum_<slsDetectorDefs::dacIndex>(Defs, "dacIndex")
|
py::enum_<slsDetectorDefs::dacIndex>(Defs, "dacIndex")
|
||||||
@ -184,6 +163,11 @@ void init_enums(py::module &m) {
|
|||||||
.value("VB_PIXBUF", slsDetectorDefs::dacIndex::VB_PIXBUF)
|
.value("VB_PIXBUF", slsDetectorDefs::dacIndex::VB_PIXBUF)
|
||||||
.value("VIN_COM", slsDetectorDefs::dacIndex::VIN_COM)
|
.value("VIN_COM", slsDetectorDefs::dacIndex::VIN_COM)
|
||||||
.value("VDD_PROT", slsDetectorDefs::dacIndex::VDD_PROT)
|
.value("VDD_PROT", slsDetectorDefs::dacIndex::VDD_PROT)
|
||||||
|
.value("VBP_COLBUF", slsDetectorDefs::dacIndex::VBP_COLBUF)
|
||||||
|
.value("VB_SDA", slsDetectorDefs::dacIndex::VB_SDA)
|
||||||
|
.value("VCASC_SFP", slsDetectorDefs::dacIndex::VCASC_SFP)
|
||||||
|
.value("VIPRE_CDS", slsDetectorDefs::dacIndex::VIPRE_CDS)
|
||||||
|
.value("IBIAS_SFP", slsDetectorDefs::dacIndex::IBIAS_SFP)
|
||||||
.value("V_POWER_A", slsDetectorDefs::dacIndex::V_POWER_A)
|
.value("V_POWER_A", slsDetectorDefs::dacIndex::V_POWER_A)
|
||||||
.value("V_POWER_B", slsDetectorDefs::dacIndex::V_POWER_B)
|
.value("V_POWER_B", slsDetectorDefs::dacIndex::V_POWER_B)
|
||||||
.value("V_POWER_C", slsDetectorDefs::dacIndex::V_POWER_C)
|
.value("V_POWER_C", slsDetectorDefs::dacIndex::V_POWER_C)
|
||||||
@ -224,6 +208,18 @@ void init_enums(py::module &m) {
|
|||||||
.value("FORCESWITCHG2",
|
.value("FORCESWITCHG2",
|
||||||
slsDetectorDefs::detectorSettings::FORCESWITCHG2)
|
slsDetectorDefs::detectorSettings::FORCESWITCHG2)
|
||||||
.value("VERYLOWGAIN", slsDetectorDefs::detectorSettings::VERYLOWGAIN)
|
.value("VERYLOWGAIN", slsDetectorDefs::detectorSettings::VERYLOWGAIN)
|
||||||
|
.value("G1_HIGHGAIN", slsDetectorDefs::detectorSettings::G1_HIGHGAIN)
|
||||||
|
.value("G1_LOWGAIN", slsDetectorDefs::detectorSettings::G1_LOWGAIN)
|
||||||
|
.value("G2_HIGHCAP_HIGHGAIN",
|
||||||
|
slsDetectorDefs::detectorSettings::G2_HIGHCAP_HIGHGAIN)
|
||||||
|
.value("G2_HIGHCAP_LOWGAIN",
|
||||||
|
slsDetectorDefs::detectorSettings::G2_HIGHCAP_LOWGAIN)
|
||||||
|
.value("G2_LOWCAP_HIGHGAIN",
|
||||||
|
slsDetectorDefs::detectorSettings::G2_LOWCAP_HIGHGAIN)
|
||||||
|
.value("G2_LOWCAP_LOWGAIN",
|
||||||
|
slsDetectorDefs::detectorSettings::G2_LOWCAP_LOWGAIN)
|
||||||
|
.value("G4_HIGHGAIN", slsDetectorDefs::detectorSettings::G4_HIGHGAIN)
|
||||||
|
.value("G4_LOWGAIN", slsDetectorDefs::detectorSettings::G4_LOWGAIN)
|
||||||
.value("UNDEFINED", slsDetectorDefs::detectorSettings::UNDEFINED)
|
.value("UNDEFINED", slsDetectorDefs::detectorSettings::UNDEFINED)
|
||||||
.value("UNINITIALIZED",
|
.value("UNINITIALIZED",
|
||||||
slsDetectorDefs::detectorSettings::UNINITIALIZED)
|
slsDetectorDefs::detectorSettings::UNINITIALIZED)
|
||||||
@ -283,6 +279,7 @@ void init_enums(py::module &m) {
|
|||||||
.value("BURST_OFF", slsDetectorDefs::burstMode::BURST_OFF)
|
.value("BURST_OFF", slsDetectorDefs::burstMode::BURST_OFF)
|
||||||
.value("BURST_INTERNAL", slsDetectorDefs::burstMode::BURST_INTERNAL)
|
.value("BURST_INTERNAL", slsDetectorDefs::burstMode::BURST_INTERNAL)
|
||||||
.value("BURST_EXTERNAL", slsDetectorDefs::burstMode::BURST_EXTERNAL)
|
.value("BURST_EXTERNAL", slsDetectorDefs::burstMode::BURST_EXTERNAL)
|
||||||
|
.value("NUM_BURST_MODES", slsDetectorDefs::burstMode::NUM_BURST_MODES)
|
||||||
.export_values();
|
.export_values();
|
||||||
|
|
||||||
py::enum_<slsDetectorDefs::timingSourceType>(Defs, "timingSourceType")
|
py::enum_<slsDetectorDefs::timingSourceType>(Defs, "timingSourceType")
|
||||||
|
@ -15,10 +15,11 @@ using sls::IpAddr;
|
|||||||
using sls::MacAddr;
|
using sls::MacAddr;
|
||||||
void init_network(py::module &m) {
|
void init_network(py::module &m) {
|
||||||
|
|
||||||
py::class_ <IpAddr> IpAddr(m, "IpAddr");
|
py::class_ <IpAddr>(m, "IpAddr")
|
||||||
IpAddr.def(py::init())
|
.def(py::init())
|
||||||
.def(py::init<const std::string&>())
|
.def(py::init<const std::string&>())
|
||||||
.def(py::init<uint32_t>())
|
.def(py::init<uint32_t>())
|
||||||
|
.def(py::init<const IpAddr&>())
|
||||||
.def("hex", &IpAddr::hex)
|
.def("hex", &IpAddr::hex)
|
||||||
.def("uint32", &IpAddr::uint32)
|
.def("uint32", &IpAddr::uint32)
|
||||||
.def(py::self == py::self)
|
.def(py::self == py::self)
|
||||||
@ -26,10 +27,11 @@ void init_network(py::module &m) {
|
|||||||
.def("str", &IpAddr::str);
|
.def("str", &IpAddr::str);
|
||||||
|
|
||||||
|
|
||||||
py::class_ <MacAddr> MacAddr(m, "MacAddr");
|
py::class_ <MacAddr>(m, "MacAddr")
|
||||||
MacAddr.def(py::init())
|
.def(py::init())
|
||||||
.def(py::init<const std::string&>())
|
.def(py::init<const std::string&>())
|
||||||
.def(py::init<uint64_t>())
|
.def(py::init<uint64_t>())
|
||||||
|
.def(py::init<const MacAddr&>())
|
||||||
.def("hex", &MacAddr::hex)
|
.def("hex", &MacAddr::hex)
|
||||||
.def(py::self == py::self)
|
.def(py::self == py::self)
|
||||||
.def("uint64", &MacAddr::uint64)
|
.def("uint64", &MacAddr::uint64)
|
||||||
|
@ -5,7 +5,28 @@ Testing functions from utils.py
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from sls_detector.utils import *
|
from slsdet.utils import *
|
||||||
|
import datetime as dt
|
||||||
|
|
||||||
|
def test_iterable():
|
||||||
|
assert is_iterable(5) == False
|
||||||
|
assert is_iterable('abc') == True
|
||||||
|
assert is_iterable([]) == True
|
||||||
|
assert is_iterable(5.9) == False
|
||||||
|
|
||||||
|
def test_reduce_time_to_single_value_from_list():
|
||||||
|
t = 3*[dt.timedelta(seconds = 1)]
|
||||||
|
assert reduce_time(t) == 1
|
||||||
|
|
||||||
|
def test_reduce_time_to_single_value_from_list_of_lists():
|
||||||
|
t = 3*[dt.timedelta(seconds = 3.3)]
|
||||||
|
tt = 5*t
|
||||||
|
assert reduce_time(tt) == 3.3
|
||||||
|
|
||||||
|
def test_reduce_time_when_sublist_is_different():
|
||||||
|
t = [dt.timedelta(seconds = 1), dt.timedelta(seconds = 2), dt.timedelta(seconds = 1)]
|
||||||
|
tt = [t for i in range(4)]
|
||||||
|
assert reduce_time(tt) == [1,2,1]
|
||||||
|
|
||||||
|
|
||||||
def test_convert_zero():
|
def test_convert_zero():
|
||||||
@ -60,3 +81,16 @@ def test_list_to_mask():
|
|||||||
assert(list_to_bitmask([1]) == 2)
|
assert(list_to_bitmask([1]) == 2)
|
||||||
assert(list_to_bitmask([3]) == 8)
|
assert(list_to_bitmask([3]) == 8)
|
||||||
assert(list_to_bitmask([1,1,1]) == 2)
|
assert(list_to_bitmask([1,1,1]) == 2)
|
||||||
|
|
||||||
|
|
||||||
|
def test_make_timedelta_from_double():
|
||||||
|
t = 1.7
|
||||||
|
r = make_timedelta(t)
|
||||||
|
assert t == r.total_seconds()
|
||||||
|
assert r == dt.timedelta(seconds=t)
|
||||||
|
|
||||||
|
def test_make_timedelta_from_timedelta():
|
||||||
|
t = dt.timedelta(minutes=1)
|
||||||
|
r = make_timedelta(t)
|
||||||
|
assert 60 == r.total_seconds()
|
||||||
|
assert r == dt.timedelta(minutes=1)
|
BIN
settingsdir/eiger/standard/4500eV/noise.sn000
Executable file
BIN
settingsdir/eiger/standard/4500eV/noise.sn000
Executable file
Binary file not shown.
@ -14,8 +14,8 @@ class MovingStat
|
|||||||
/** constructor
|
/** constructor
|
||||||
\param nn number of samples parameter to be used
|
\param nn number of samples parameter to be used
|
||||||
*/
|
*/
|
||||||
MovingStat(int nn=1000) : n(nn), m_n(0) {}
|
MovingStat(int nn) : n(nn), m_n(0), m_newM(0),m_newM2(0) {}
|
||||||
|
// void setPointers(double *me, double *va) {mean=me; var=va;}
|
||||||
/**
|
/**
|
||||||
clears the moving average number of samples parameter, mean and standard deviation
|
clears the moving average number of samples parameter, mean and standard deviation
|
||||||
*/
|
*/
|
||||||
@ -31,10 +31,10 @@ class MovingStat
|
|||||||
*/
|
*/
|
||||||
void Set(double val, double rms=0, int m=-1)
|
void Set(double val, double rms=0, int m=-1)
|
||||||
{
|
{
|
||||||
if (m>0) m_n = m; else m_n = n;
|
if (m>=0) m_n = m; else m_n = n;
|
||||||
m_newM=val*m_n;
|
m_newM=val*m_n;
|
||||||
// cout << "set " << val << " " << m << " " << m_n << " " << m_newM << endl;
|
|
||||||
SetRMS(rms);
|
SetRMS(rms);
|
||||||
|
// cout << "set " << val << " " << m << " " << m_n << " " << m_newM << endl;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
clears the moving average number of samples parameter, mean and standard deviation
|
clears the moving average number of samples parameter, mean and standard deviation
|
||||||
@ -42,12 +42,15 @@ class MovingStat
|
|||||||
void SetRMS(double rms)
|
void SetRMS(double rms)
|
||||||
{
|
{
|
||||||
if (rms<=0) {
|
if (rms<=0) {
|
||||||
m_newM2=m_newM*m_newM/n;
|
if (m_n>0)
|
||||||
|
m_newM2=m_newM*m_newM/m_n;
|
||||||
|
else
|
||||||
|
m_newM2=0;
|
||||||
//m_n=0;
|
//m_n=0;
|
||||||
} else {
|
} else {
|
||||||
if (m_n>0)
|
if (m_n>0) {
|
||||||
m_newM2=(m_n*rms*rms+m_newM*m_newM/m_n);
|
m_newM2=(m_n*rms*rms+m_newM*m_newM/m_n);
|
||||||
else {
|
} else {
|
||||||
m_newM2=(m_n*rms*rms+m_newM*m_newM/n);
|
m_newM2=(m_n*rms*rms+m_newM*m_newM/n);
|
||||||
m_n=0;
|
m_n=0;
|
||||||
}
|
}
|
||||||
@ -102,7 +105,8 @@ class MovingStat
|
|||||||
m_newM = x;
|
m_newM = x;
|
||||||
m_newM2 = x*x;
|
m_newM2 = x*x;
|
||||||
m_n++;
|
m_n++;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
m_newM = m_newM + x - m_newM/m_n;
|
m_newM = m_newM + x - m_newM/m_n;
|
||||||
m_newM2 = m_newM2 + x*x - m_newM2/m_n;
|
m_newM2 = m_newM2 + x*x - m_newM2/m_n;
|
||||||
}
|
}
|
||||||
@ -122,6 +126,8 @@ class MovingStat
|
|||||||
inline double Mean() const
|
inline double Mean() const
|
||||||
{
|
{
|
||||||
// cout << "get " << m_n << " " << m_newM << " " << m_newM/m_n << endl;
|
// cout << "get " << m_n << " " << m_newM << " " << m_newM/m_n << endl;
|
||||||
|
|
||||||
|
|
||||||
return (m_n > 0) ? m_newM/m_n : 0.0;
|
return (m_n > 0) ? m_newM/m_n : 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,7 +144,7 @@ class MovingStat
|
|||||||
*/
|
*/
|
||||||
inline double Variance() const
|
inline double Variance() const
|
||||||
{
|
{
|
||||||
return ( (m_n > 1) ? (M2()-Mean()*Mean()) : 0.0 );
|
return (m_n > 0) ? m_newM2/m_n-m_newM/m_n*m_newM/m_n : 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** returns the standard deviation, 0 if no elements are inside
|
/** returns the standard deviation, 0 if no elements are inside
|
||||||
@ -146,7 +152,8 @@ class MovingStat
|
|||||||
*/
|
*/
|
||||||
inline double StandardDeviation() const
|
inline double StandardDeviation() const
|
||||||
{
|
{
|
||||||
return ( (Variance() > 0) ? sqrt( Variance() ) : -1 );
|
|
||||||
|
return sqrt(Variance());//
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -68,10 +68,15 @@ template <class dataType> class analogDetector {
|
|||||||
det->getDetectorSize(nx,ny);
|
det->getDetectorSize(nx,ny);
|
||||||
|
|
||||||
stat=new pedestalSubtraction*[ny];
|
stat=new pedestalSubtraction*[ny];
|
||||||
|
/* pedMean=new double*[ny]; */
|
||||||
|
/* pedVariance=new double*[ny]; */
|
||||||
for (int i=0; i<ny; i++) {
|
for (int i=0; i<ny; i++) {
|
||||||
stat[i]=new pedestalSubtraction[nx];
|
stat[i]=new pedestalSubtraction[nx];
|
||||||
for (int ix=0; ix<nx; ix++) {
|
/* pedMean[i]=new double[nx]; */
|
||||||
|
/* pedVariance[i]=new double[nx]; */
|
||||||
|
for (ix=0; ix<nx; ++ix) {
|
||||||
stat[i][ix].SetNPedestals(nped);
|
stat[i][ix].SetNPedestals(nped);
|
||||||
|
/* stat[i][ix].setPointers(&(pedMean[iy][ix]),&(pedVariance[iy][ix])); */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
image=new int[nx*ny];
|
image=new int[nx*ny];
|
||||||
@ -95,7 +100,16 @@ template <class dataType> class analogDetector {
|
|||||||
/**
|
/**
|
||||||
destructor. Deletes the pdestalSubtraction array and the image
|
destructor. Deletes the pdestalSubtraction array and the image
|
||||||
*/
|
*/
|
||||||
virtual ~analogDetector() {for (int i=0; i<ny; i++) delete [] stat[i]; delete [] stat; delete [] image;
|
virtual ~analogDetector() {
|
||||||
|
for (int i=0; i<ny; i++) {
|
||||||
|
delete [] stat[i];
|
||||||
|
/* delete [] pedMean[i]; */
|
||||||
|
/* delete [] pedVariance[i]; */
|
||||||
|
};
|
||||||
|
/* delete [] pedMean; */
|
||||||
|
/* delete [] pedVariance; */
|
||||||
|
delete [] stat;
|
||||||
|
delete [] image;
|
||||||
#ifdef ROOTSPECTRUM
|
#ifdef ROOTSPECTRUM
|
||||||
delete hs;
|
delete hs;
|
||||||
#ifdef ROOTCLUST
|
#ifdef ROOTCLUST
|
||||||
@ -132,16 +146,23 @@ template <class dataType> class analogDetector {
|
|||||||
|
|
||||||
|
|
||||||
stat=new pedestalSubtraction*[ny];
|
stat=new pedestalSubtraction*[ny];
|
||||||
|
/* pedMean=new double*[ny]; */
|
||||||
|
/* pedVariance=new double*[ny]; */
|
||||||
for (int i=0; i<ny; i++) {
|
for (int i=0; i<ny; i++) {
|
||||||
stat[i]=new pedestalSubtraction[nx];
|
stat[i]=new pedestalSubtraction[nx];
|
||||||
|
/* pedMean[i]=new double[nx]; */
|
||||||
|
/* pedVariance[i]=new double[nx]; */
|
||||||
}
|
}
|
||||||
|
|
||||||
int nped=orig->SetNPedestals();
|
int nped=orig->SetNPedestals();
|
||||||
//cout << nped << " " << orig->getPedestal(ix,iy) << orig->getPedestalRMS(ix,iy) << endl;
|
//cout << nped << " " << orig->getPedestal(ix,iy) << orig->getPedestalRMS(ix,iy) << endl;
|
||||||
for (int iy=0; iy<ny; iy++) {
|
for (iy=0; iy<ny; ++iy) {
|
||||||
for (int ix=0; ix<nx; ix++) {
|
for (ix=0; ix<nx; ++ix) {
|
||||||
|
//stat[iy][ix].setPointers(&(pedMean[iy][ix]),&(pedVariance[iy][ix]));
|
||||||
stat[iy][ix].SetNPedestals(nped);
|
stat[iy][ix].SetNPedestals(nped);
|
||||||
setPedestal(ix,iy,orig->getPedestal(ix,iy),orig->getPedestalRMS(ix,iy),orig->GetNPedestals(ix,iy));
|
setPedestal(ix,iy,orig->getPedestal(ix,iy),orig->getPedestalRMS(ix,iy),orig->GetNPedestals(ix,iy));
|
||||||
|
/* if (ix==50 && iy==50) */
|
||||||
|
/* cout << "clone ped " << " " << ix << " " << iy << " " << getPedestal(ix,iy) << " " << getPedestalRMS(ix,iy)<< " " << GetNPedestals(ix,iy) << endl; */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
image=new int[nx*ny];
|
image=new int[nx*ny];
|
||||||
@ -199,7 +220,7 @@ template <class dataType> class analogDetector {
|
|||||||
\param nns reference to number of subpixels for interpolating detector, will always be 1 in this case
|
\param nns reference to number of subpixels for interpolating detector, will always be 1 in this case
|
||||||
\returns number of pixels of the detector image
|
\returns number of pixels of the detector image
|
||||||
*/
|
*/
|
||||||
virtual int getImageSize(int &nnx, int &nny, int &nns){nnx=nx; nny=ny; nns=1; return nx*ny;};
|
virtual int getImageSize(int &nnx, int &nny, int &nnsx, int &nnsy){nnx=nx; nny=ny; nnsx=1; nnsy=1; return nx*ny;};
|
||||||
/**
|
/**
|
||||||
Returns data size of the detector image matrix
|
Returns data size of the detector image matrix
|
||||||
\param nnx reference to pixel size in x
|
\param nnx reference to pixel size in x
|
||||||
@ -231,8 +252,8 @@ template <class dataType> class analogDetector {
|
|||||||
if (gm) {
|
if (gm) {
|
||||||
if (gmap) delete [] gmap;
|
if (gmap) delete [] gmap;
|
||||||
gmap=new double[nnx*nny];
|
gmap=new double[nnx*nny];
|
||||||
for (int iy=0; iy<nny; iy++) {
|
for (iy=0; iy<nny; ++iy) {
|
||||||
for (int ix=0; ix<nnx; ix++) {
|
for (ix=0; ix<nnx; ++ix) {
|
||||||
gmap[iy*nnx+ix]=gm[iy*nnx+ix];
|
gmap[iy*nnx+ix]=gm[iy*nnx+ix];
|
||||||
// cout << gmap[iy*nnx+ix] << " " ;
|
// cout << gmap[iy*nnx+ix] << " " ;
|
||||||
}
|
}
|
||||||
@ -251,8 +272,8 @@ template <class dataType> class analogDetector {
|
|||||||
void *ret;
|
void *ret;
|
||||||
if (gmap) {
|
if (gmap) {
|
||||||
gm=new float[nx*ny];
|
gm=new float[nx*ny];
|
||||||
for (int iy=0; iy<ny; iy++) {
|
for (iy=0; iy<ny; ++iy) {
|
||||||
for (int ix=0; ix<nx; ix++) {
|
for (ix=0; ix<nx; ++ix) {
|
||||||
gm[iy*nx+ix]=gmap[iy*nx+ix];
|
gm[iy*nx+ix]=gmap[iy*nx+ix];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -267,8 +288,8 @@ template <class dataType> class analogDetector {
|
|||||||
|
|
||||||
virtual void newDataSet(){
|
virtual void newDataSet(){
|
||||||
iframe=-1;
|
iframe=-1;
|
||||||
for (int iy=0; iy<ny; iy++)
|
for (iy=0; iy<ny; ++iy)
|
||||||
for (int ix=0; ix<nx; ix++) {
|
for (ix=0; ix<nx; ++ix) {
|
||||||
stat[iy][ix].Clear();
|
stat[iy][ix].Clear();
|
||||||
image[iy*nx+ix]=0;
|
image[iy*nx+ix]=0;
|
||||||
}
|
}
|
||||||
@ -285,12 +306,14 @@ template <class dataType> class analogDetector {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** resets the commonModeSubtraction and increases the frame index */
|
/** resets the commonModeSubtraction and increases the frame index */
|
||||||
virtual void newFrame(){iframe++; if (cmSub) cmSub->newFrame();};
|
virtual void newFrame(){iframe++; if (cmSub) cmSub->newFrame(); det->newFrame();};
|
||||||
|
|
||||||
/** resets the commonModeSubtraction and increases the frame index */
|
/** resets the commonModeSubtraction and increases the frame index */
|
||||||
virtual void newFrame(char *data){
|
virtual void newFrame(char *data){
|
||||||
iframe++;
|
iframe++;
|
||||||
if (cmSub) cmSub->newFrame();
|
if (cmSub) cmSub->newFrame();
|
||||||
|
det->newFrame();
|
||||||
|
// det->getData(data);
|
||||||
calcGhost(data);
|
calcGhost(data);
|
||||||
// cout << getId() << " Calc ghost " << getGhost(15,15) << endl;
|
// cout << getId() << " Calc ghost " << getGhost(15,15) << endl;
|
||||||
};
|
};
|
||||||
@ -359,8 +382,8 @@ template <class dataType> class analogDetector {
|
|||||||
// cout << "+"<< getId() << endl;
|
// cout << "+"<< getId() << endl;
|
||||||
if (cmSub) {
|
if (cmSub) {
|
||||||
//cout << "*" << endl;
|
//cout << "*" << endl;
|
||||||
for (int iy=ymin; iy<ymax; iy++) {
|
for (iy=ymin; iy<ymax; ++iy) {
|
||||||
for (int ix=xmin; ix<xmax; ix++) {
|
for (ix=xmin; ix<xmax; ++ix) {
|
||||||
// if (getNumpedestals(ix,iy)>0)
|
// if (getNumpedestals(ix,iy)>0)
|
||||||
// if (det->isGood(ix,iy)) {
|
// if (det->isGood(ix,iy)) {
|
||||||
addToCommonMode(data, ix, iy);
|
addToCommonMode(data, ix, iy);
|
||||||
@ -403,8 +426,10 @@ template <class dataType> class analogDetector {
|
|||||||
if (ix>=0 && ix<nx && iy>=0 && iy<ny) {
|
if (ix>=0 && ix<nx && iy>=0 && iy<ny) {
|
||||||
if (cmSub && cm>0) {
|
if (cmSub && cm>0) {
|
||||||
return stat[iy][ix].getPedestal()+getCommonMode(ix,iy);
|
return stat[iy][ix].getPedestal()+getCommonMode(ix,iy);
|
||||||
|
//return pedMean[iy][ix]+getCommonMode(ix,iy);
|
||||||
} else return stat[iy][ix].getPedestal();
|
}
|
||||||
|
//return pedMean[iy][ix];
|
||||||
|
return stat[iy][ix].getPedestal();
|
||||||
} else return -1;
|
} else return -1;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -422,8 +447,8 @@ template <class dataType> class analogDetector {
|
|||||||
g=gmap[iy*nx+ix];
|
g=gmap[iy*nx+ix];
|
||||||
if (g==0) g=-1.;
|
if (g==0) g=-1.;
|
||||||
}
|
}
|
||||||
|
// return sqrt(pedVariance[iy][ix])/g;
|
||||||
return stat[iy][ix].getPedestalRMS();//divide by gain?
|
return stat[iy][ix].getPedestalRMS()/g;//divide by gain?
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
};
|
};
|
||||||
@ -441,10 +466,11 @@ template <class dataType> class analogDetector {
|
|||||||
\returns pedestal value
|
\returns pedestal value
|
||||||
*/
|
*/
|
||||||
virtual double* getPedestal(double *ped){
|
virtual double* getPedestal(double *ped){
|
||||||
if (ped==NULL)
|
if (ped==NULL) {
|
||||||
ped=new double[nx*ny];
|
ped=new double[nx*ny];
|
||||||
for (int iy=0; iy<ny; iy++) {
|
}
|
||||||
for (int ix=0; ix<nx; ix++) {
|
for (iy=0; iy<ny; ++iy) {
|
||||||
|
for (ix=0; ix<nx; ++ix) {
|
||||||
ped[iy*nx+ix]=stat[iy][ix].getPedestal();
|
ped[iy*nx+ix]=stat[iy][ix].getPedestal();
|
||||||
//cout << ped[iy*nx+ix] << " " ;
|
//cout << ped[iy*nx+ix] << " " ;
|
||||||
}
|
}
|
||||||
@ -459,10 +485,11 @@ template <class dataType> class analogDetector {
|
|||||||
\returns pedestal rms
|
\returns pedestal rms
|
||||||
*/
|
*/
|
||||||
virtual double* getPedestalRMS(double *ped=NULL){
|
virtual double* getPedestalRMS(double *ped=NULL){
|
||||||
if (ped==NULL)
|
if (ped==NULL) {
|
||||||
ped=new double[nx*ny];
|
ped=new double[nx*ny];
|
||||||
for (int iy=0; iy<ny; iy++) {
|
}
|
||||||
for (int ix=0; ix<nx; ix++) {
|
for (iy=0; iy<ny; ++iy) {
|
||||||
|
for (ix=0; ix<nx; ++ix) {
|
||||||
ped[iy*nx+ix]=stat[iy][ix].getPedestalRMS();
|
ped[iy*nx+ix]=stat[iy][ix].getPedestalRMS();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -501,8 +528,8 @@ template <class dataType> class analogDetector {
|
|||||||
*/
|
*/
|
||||||
virtual void setPedestal(double *ped, double *rms=NULL, int m=-1){
|
virtual void setPedestal(double *ped, double *rms=NULL, int m=-1){
|
||||||
double rr=0;
|
double rr=0;
|
||||||
for (int iy=ymin; iy<ymax; iy++) {
|
for (iy=ymin; iy<ymax; ++iy) {
|
||||||
for (int ix=xmin; ix<xmax; ix++) {
|
for (ix=xmin; ix<xmax; ++ix) {
|
||||||
if (rms) rr=rms[iy*nx+ix];
|
if (rms) rr=rms[iy*nx+ix];
|
||||||
stat[iy][ix].setPedestal(ped[iy*nx+ix],rr, m);
|
stat[iy][ix].setPedestal(ped[iy*nx+ix],rr, m);
|
||||||
// cout << ix << " " << iy << " " << ped[iy*nx+ix] << " " << stat[iy][ix].getPedestal() << endl;
|
// cout << ix << " " << iy << " " << ped[iy*nx+ix] << " " << stat[iy][ix].getPedestal() << endl;
|
||||||
@ -531,8 +558,8 @@ template <class dataType> class analogDetector {
|
|||||||
\param rms pointer to array of pedestal rms
|
\param rms pointer to array of pedestal rms
|
||||||
*/
|
*/
|
||||||
virtual void setPedestalRMS(double *rms){
|
virtual void setPedestalRMS(double *rms){
|
||||||
for (int iy=ymin; iy<ymax; iy++) {
|
for (iy=ymin; iy<ymax; ++iy) {
|
||||||
for (int ix=xmin; ix<xmax; ix++) {
|
for (ix=xmin; ix<xmax; ++ix) {
|
||||||
stat[iy][ix].setPedestalRMS(rms[iy*nx+ix]);
|
stat[iy][ix].setPedestalRMS(rms[iy*nx+ix]);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -572,8 +599,8 @@ template <class dataType> class analogDetector {
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
gm=new float[nx*ny];
|
gm=new float[nx*ny];
|
||||||
for (int iy=0; iy<ny; iy++) {
|
for (iy=0; iy<ny; ++iy) {
|
||||||
for (int ix=0; ix<nx; ix++) {
|
for (ix=0; ix<nx; ++ix) {
|
||||||
gm[iy*nx+ix]=image[iy*nx+ix];
|
gm[iy*nx+ix]=image[iy*nx+ix];
|
||||||
#ifdef ROOTSPECTRUM
|
#ifdef ROOTSPECTRUM
|
||||||
hmap->SetBinContent(ix+1, iy+1,image[iy*nx+ix]);
|
hmap->SetBinContent(ix+1, iy+1,image[iy*nx+ix]);
|
||||||
@ -620,8 +647,8 @@ template <class dataType> class analogDetector {
|
|||||||
TH2F *hmap=new TH2F("hmap","hmap",nx, -0.5,nx-0.5, ny, -0.5, ny-0.5);
|
TH2F *hmap=new TH2F("hmap","hmap",nx, -0.5,nx-0.5, ny, -0.5, ny-0.5);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
for (int iy=0; iy<ny; iy++) {
|
for (iy=0; iy<ny; ++iy) {
|
||||||
for (int ix=0; ix<nx; ix++) {
|
for (ix=0; ix<nx; ++ix) {
|
||||||
/* if (cmSub) */
|
/* if (cmSub) */
|
||||||
/* gm[iy*nx+ix]=stat[iy][ix].getPedestal()-cmSub->getCommonMode(); */
|
/* gm[iy*nx+ix]=stat[iy][ix].getPedestal()-cmSub->getCommonMode(); */
|
||||||
/* else */
|
/* else */
|
||||||
@ -667,15 +694,15 @@ template <class dataType> class analogDetector {
|
|||||||
|
|
||||||
|
|
||||||
if (gm) {
|
if (gm) {
|
||||||
for (int iy=0; iy<nny; iy++) {
|
for (iy=0; iy<nny; ++iy) {
|
||||||
for (int ix=0; ix<nnx; ix++) {
|
for (ix=0; ix<nnx; ++ix) {
|
||||||
stat[iy][ix].setPedestal(gm[iy*nx+ix],-1,-1);
|
stat[iy][ix].setPedestal(gm[iy*nx+ix],-1,-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
delete [] gm;
|
delete [] gm;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return NULL;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -692,15 +719,15 @@ template <class dataType> class analogDetector {
|
|||||||
|
|
||||||
|
|
||||||
if (gm) {
|
if (gm) {
|
||||||
for (int iy=0; iy<nny; iy++) {
|
for (iy=0; iy<nny; ++iy) {
|
||||||
for (int ix=0; ix<nnx; ix++) {
|
for (ix=0; ix<nnx; ++ix) {
|
||||||
image[iy*nx+ix]=gm[iy*nx+ix];
|
image[iy*nx+ix]=gm[iy*nx+ix];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
delete [] gm;
|
delete [] gm;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return NULL;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -718,8 +745,8 @@ template <class dataType> class analogDetector {
|
|||||||
float *gm=NULL;
|
float *gm=NULL;
|
||||||
void *ret;
|
void *ret;
|
||||||
gm=new float[nx*ny];
|
gm=new float[nx*ny];
|
||||||
for (int iy=0; iy<ny; iy++) {
|
for (iy=0; iy<ny; ++iy) {
|
||||||
for (int ix=0; ix<nx; ix++) {
|
for (ix=0; ix<nx; ++ix) {
|
||||||
gm[iy*nx+ix]=stat[iy][ix].getPedestalRMS();
|
gm[iy*nx+ix]=stat[iy][ix].getPedestalRMS();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -740,8 +767,8 @@ template <class dataType> class analogDetector {
|
|||||||
if (nnx>nx) nnx=nx;
|
if (nnx>nx) nnx=nx;
|
||||||
if (nny>ny) nny=ny;
|
if (nny>ny) nny=ny;
|
||||||
if (gm) {
|
if (gm) {
|
||||||
for (int iy=0; iy<nny; iy++) {
|
for (iy=0; iy<nny; ++iy) {
|
||||||
for (int ix=0; ix<nnx; ix++) {
|
for (ix=0; ix<nnx; ++ix) {
|
||||||
stat[iy][ix].setPedestalRMS(gm[iy*nx+ix]);
|
stat[iy][ix].setPedestalRMS(gm[iy*nx+ix]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -777,11 +804,13 @@ template <class dataType> class analogDetector {
|
|||||||
|
|
||||||
//cout << xmin << " " << xmax << endl;
|
//cout << xmin << " " << xmax << endl;
|
||||||
// cout << ymin << " " << ymax << endl;
|
// cout << ymin << " " << ymax << endl;
|
||||||
for (int iy=ymin; iy<ymax; iy++) {
|
for (iy=ymin; iy<ymax; ++iy) {
|
||||||
for (int ix=xmin; ix<xmax; ix++) {
|
for (ix=xmin; ix<xmax; ++ix) {
|
||||||
if (det->isGood(ix,iy)) {
|
if (det->isGood(ix,iy)) {
|
||||||
// addToPedestal(data,ix,iy,1);
|
// addToPedestal(data,ix,iy,1);
|
||||||
addToPedestal(data,ix,iy,cm);
|
addToPedestal(data,ix,iy,cm);
|
||||||
|
/* if (ix==50 && iy==50) */
|
||||||
|
/* cout<< "*ped* " << id << " " << ix << " " << iy << " " << det->getChannel(data,ix,iy) << " " << stat[iy][ix].getPedestal() << " " << stat[iy][ix].getPedestalRMS() <<" " << stat[iy][ix]. GetNPedestals() << endl; */
|
||||||
//if (ix==10 && iy==10)
|
//if (ix==10 && iy==10)
|
||||||
// cout <<ix << " " << iy << " " << getPedestal(ix,iy)<< endl;
|
// cout <<ix << " " << iy << " " << getPedestal(ix,iy)<< endl;
|
||||||
#ifdef ROOTSPECTRUM
|
#ifdef ROOTSPECTRUM
|
||||||
@ -905,8 +934,8 @@ template <class dataType> class analogDetector {
|
|||||||
|
|
||||||
//calcGhost(data);
|
//calcGhost(data);
|
||||||
|
|
||||||
for (int iy=ymin; iy<ymax; iy++) {
|
for (iy=ymin; iy<ymax; ++iy) {
|
||||||
for (int ix=xmin; ix<xmax; ix++) {
|
for (ix=xmin; ix<xmax; ++ix) {
|
||||||
if (det->isGood(ix,iy))
|
if (det->isGood(ix,iy))
|
||||||
val[iy*nx+ix]+=subtractPedestal(data, ix, iy,cm);
|
val[iy*nx+ix]+=subtractPedestal(data, ix, iy,cm);
|
||||||
}
|
}
|
||||||
@ -952,8 +981,8 @@ template <class dataType> class analogDetector {
|
|||||||
hs->Fill(val,(iy-ymin)*(xmax-xmin)+(ix-xmin));
|
hs->Fill(val,(iy-ymin)*(xmax-xmin)+(ix-xmin));
|
||||||
#ifdef ROOTCLUST
|
#ifdef ROOTCLUST
|
||||||
double v3=0,v5=0,v7=0,v9=0;
|
double v3=0,v5=0,v7=0,v9=0;
|
||||||
for (int iix=-4; iix<5; iix++)
|
for (int iix=-4; iix<5; i++ix)
|
||||||
for (int iiy=-4; iiy<5; iiy++) {
|
for (int iiy=-4; iiy<5; i++iy) {
|
||||||
if (det)
|
if (det)
|
||||||
val= (dataSign*det->getValue(data, ix+iix, iy+iiy)-getPedestal(ix+iix,iy+iiy,cm))/g;
|
val= (dataSign*det->getValue(data, ix+iix, iy+iiy)-getPedestal(ix+iix,iy+iiy,cm))/g;
|
||||||
else
|
else
|
||||||
@ -1047,8 +1076,8 @@ template <class dataType> class analogDetector {
|
|||||||
|
|
||||||
//calcGhost(data);
|
//calcGhost(data);
|
||||||
addToCommonMode(data);
|
addToCommonMode(data);
|
||||||
for (int iy=ymin; iy<ymax; iy++) {
|
for (iy=ymin; iy<ymax; ++iy) {
|
||||||
for (int ix=xmin; ix<xmax; ix++) {
|
for (ix=xmin; ix<xmax; ++ix) {
|
||||||
if (det->isGood(ix,iy))
|
if (det->isGood(ix,iy))
|
||||||
nph[iy*nx+ix]+=getNPhotons(data, ix, iy);
|
nph[iy*nx+ix]+=getNPhotons(data, ix, iy);
|
||||||
}
|
}
|
||||||
@ -1062,8 +1091,8 @@ template <class dataType> class analogDetector {
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
virtual void clearImage(){
|
virtual void clearImage(){
|
||||||
for (int iy=0; iy<ny; iy++) {
|
for (iy=0; iy<ny; ++iy) {
|
||||||
for (int ix=0; ix<nx; ix++) {
|
for (ix=0; ix<nx; ++ix) {
|
||||||
image[iy*nx+ix]=0;
|
image[iy*nx+ix]=0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1093,8 +1122,8 @@ template <class dataType> class analogDetector {
|
|||||||
int SetNPedestals(int i=-1) {
|
int SetNPedestals(int i=-1) {
|
||||||
int ix=0, iy=0;
|
int ix=0, iy=0;
|
||||||
if (i>0)
|
if (i>0)
|
||||||
for (iy=0; iy<ny; iy++)
|
for (iy=0; iy<ny; ++iy)
|
||||||
for (ix=0; ix<nx; ix++)
|
for (ix=0; ix<nx; ++ix)
|
||||||
stat[iy][ix].SetNPedestals(i);
|
stat[iy][ix].SetNPedestals(i);
|
||||||
return stat[0][0].SetNPedestals();
|
return stat[0][0].SetNPedestals();
|
||||||
};
|
};
|
||||||
@ -1129,8 +1158,8 @@ template <class dataType> class analogDetector {
|
|||||||
newFrame(data);
|
newFrame(data);
|
||||||
//calcGhost(data);
|
//calcGhost(data);
|
||||||
addToCommonMode(data);
|
addToCommonMode(data);
|
||||||
for (int iy=ymi; iy<yma; iy++)
|
for (iy=ymi; iy<yma; ++iy)
|
||||||
for (int ix=xmi; ix<xma; ix++)
|
for (ix=xmi; ix<xma; ++ix)
|
||||||
if (det->isGood(ix,iy)) {
|
if (det->isGood(ix,iy)) {
|
||||||
if (ix>=0 && ix<nx && iy>=0 && iy<ny)
|
if (ix>=0 && ix<nx && iy>=0 && iy<ny)
|
||||||
val+=getNPhotons(data, ix, iy);
|
val+=getNPhotons(data, ix, iy);
|
||||||
@ -1233,6 +1262,8 @@ FILE *getFilePointer(){return myFile;};
|
|||||||
int nx; /**< Size of the detector in x direction */
|
int nx; /**< Size of the detector in x direction */
|
||||||
int ny; /**< Size of the detector in y direction */
|
int ny; /**< Size of the detector in y direction */
|
||||||
pedestalSubtraction **stat; /**< pedestalSubtraction class */
|
pedestalSubtraction **stat; /**< pedestalSubtraction class */
|
||||||
|
/* double **pedMean; /\**< pedestalSubtraction class *\/ */
|
||||||
|
/* double **pedVariance; /\**< pedestalSubtraction class *\/ */
|
||||||
commonModeSubtraction *cmSub;/**< commonModeSubtraction class */
|
commonModeSubtraction *cmSub;/**< commonModeSubtraction class */
|
||||||
int dataSign; /**< sign of the data i.e. 1 if photon is positive, -1 if negative */
|
int dataSign; /**< sign of the data i.e. 1 if photon is positive, -1 if negative */
|
||||||
int iframe; /**< frame number (not from file but incremented within the dataset every time newFrame is called */
|
int iframe; /**< frame number (not from file but incremented within the dataset every time newFrame is called */
|
||||||
@ -1250,6 +1281,7 @@ FILE *getFilePointer(){return myFile;};
|
|||||||
frameMode fMode; /**< current detector frame mode */
|
frameMode fMode; /**< current detector frame mode */
|
||||||
detectorMode dMode; /**< current detector frame mode */
|
detectorMode dMode; /**< current detector frame mode */
|
||||||
FILE *myFile; /**< file pointer to write to */
|
FILE *myFile; /**< file pointer to write to */
|
||||||
|
int ix, iy;
|
||||||
#ifdef ROOTSPECTRUM
|
#ifdef ROOTSPECTRUM
|
||||||
TH2F *hs;
|
TH2F *hs;
|
||||||
#ifdef ROOTCLUST
|
#ifdef ROOTCLUST
|
||||||
|
@ -44,6 +44,28 @@ class moench04CtbZmq10GbData : public slsDetectorData<uint16_t> {
|
|||||||
|
|
||||||
int adc_nr[32]={9, 8,11,10,13,12,15,14,1,0,3,2,5,4,7,6,23,22,21,20,19,18,17,16,31,30,29,28,27,26,25,24 };
|
int adc_nr[32]={9, 8,11,10,13,12,15,14,1,0,3,2,5,4,7,6,23,22,21,20,19,18,17,16,31,30,29,28,27,26,25,24 };
|
||||||
|
|
||||||
|
/*
|
||||||
|
iadc=ptr%32
|
||||||
|
isample=ptr/32
|
||||||
|
|
||||||
|
col=(adc_nr[iadc]%16)*25+isample%25
|
||||||
|
if (adc_nr[iadc]<16)
|
||||||
|
row=199-isample/25;
|
||||||
|
else
|
||||||
|
row=200+isample/25
|
||||||
|
|
||||||
|
|
||||||
|
adc0 col(9*25..10*25-1) row(199..0)
|
||||||
|
adc1 col(8*25..9*25-1) row(199..0)
|
||||||
|
adc2 col(11*25..12*25-1) row(199..0)
|
||||||
|
adc3 col(10*25..11*25-1) row(199..0)
|
||||||
|
adc4 col(13*25..14*25-1) row(199..0)
|
||||||
|
adc5 col(12*25..13*25-1) row(199..0)
|
||||||
|
adc6 col(15*25..16*25-1) row(199..0)
|
||||||
|
adc7 col(14*25..15*25-1) row(199..0)
|
||||||
|
adc8 col(1*25..2*25-1) row(199..0)
|
||||||
|
*/
|
||||||
|
|
||||||
int row, col;
|
int row, col;
|
||||||
|
|
||||||
//int isample;
|
//int isample;
|
||||||
@ -134,7 +156,7 @@ class moench04CtbZmq10GbData : public slsDetectorData<uint16_t> {
|
|||||||
if (dSamples>isample) {
|
if (dSamples>isample) {
|
||||||
ptr=data+32*(isample+1)+8*isample;
|
ptr=data+32*(isample+1)+8*isample;
|
||||||
sample=*((uint64_t*)ptr);
|
sample=*((uint64_t*)ptr);
|
||||||
cout << isc << " " << ibit[isc] << " " << isample << hex << sample << dec << endl;
|
// cout << isc << " " << ibit[isc] << " " << isample << hex << sample << dec << endl;
|
||||||
if (sample & (1<<ibit[isc]))
|
if (sample & (1<<ibit[isc]))
|
||||||
return 1;
|
return 1;
|
||||||
else
|
else
|
||||||
|
@ -120,7 +120,7 @@ class moench04CtbZmqData : public slsDetectorData<uint16_t> {
|
|||||||
if (dSamples>isample) {
|
if (dSamples>isample) {
|
||||||
ptr=data+aoff+8*isample;
|
ptr=data+aoff+8*isample;
|
||||||
sample=*((uint64_t*)ptr);
|
sample=*((uint64_t*)ptr);
|
||||||
cout << isc << " " << ibit[isc] << " " << isample << hex << sample << dec << endl;
|
// cout << isc << " " << ibit[isc] << " " << isample << hex << sample << dec << endl;
|
||||||
if (sample & (1<<ibit[isc]))
|
if (sample & (1<<ibit[isc]))
|
||||||
return 1;
|
return 1;
|
||||||
else
|
else
|
||||||
|
@ -20,6 +20,8 @@ class slsDetectorData {
|
|||||||
int **dataROIMask; /**< Array of size nx*ny 1 if channel is good (or in the ROI), 0 if bad channel (or out of ROI) */
|
int **dataROIMask; /**< Array of size nx*ny 1 if channel is good (or in the ROI), 0 if bad channel (or out of ROI) */
|
||||||
int *xmap;
|
int *xmap;
|
||||||
int *ymap;
|
int *ymap;
|
||||||
|
dataType **orderedData;
|
||||||
|
int isOrdered;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -37,35 +39,29 @@ class slsDetectorData {
|
|||||||
\param dROI Array of size nx*ny. The elements are 1s if the channel is good or in the ROI, 0 is bad or out of the ROI. NULL (default) means all 1s.
|
\param dROI Array of size nx*ny. The elements are 1s if the channel is good or in the ROI, 0 is bad or out of the ROI. NULL (default) means all 1s.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
slsDetectorData(int npx, int npy, int dsize, int **dMap=NULL, dataType **dMask=NULL, int **dROI=NULL): nx(npx), ny(npy), dataSize(dsize) {
|
slsDetectorData(int npx, int npy, int dsize, int **dMap=NULL, dataType **dMask=NULL, int **dROI=NULL): nx(npx), ny(npy), dataSize(dsize), orderedData(NULL), isOrdered(0) {
|
||||||
|
|
||||||
|
int el=dsize/sizeof(dataType);
|
||||||
|
xmap=new int[el];
|
||||||
|
ymap=new int[el];
|
||||||
|
|
||||||
|
|
||||||
xmap=new int[dsize/sizeof(dataType)];
|
|
||||||
ymap=new int[dsize/sizeof(dataType)];
|
|
||||||
|
|
||||||
|
orderedData=new dataType*[ny];
|
||||||
// if (dataMask==NULL) {
|
|
||||||
dataMask=new dataType*[ny];
|
|
||||||
for(int i = 0; i < ny; i++) {
|
|
||||||
dataMask[i] = new dataType[nx];
|
|
||||||
}
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (dataMap==NULL) {
|
|
||||||
dataMap=new int*[ny];
|
dataMap=new int*[ny];
|
||||||
for(int i = 0; i < ny; i++) {
|
dataMask=new dataType*[ny];
|
||||||
dataMap[i] = new int[nx];
|
|
||||||
}
|
|
||||||
// }
|
|
||||||
// if (dataROIMask==NULL) {
|
|
||||||
dataROIMask=new int*[ny];
|
dataROIMask=new int*[ny];
|
||||||
for(int i = 0; i < ny; i++) {
|
for(int i = 0; i < ny; i++) {
|
||||||
|
dataMap[i] = new int[nx];
|
||||||
|
orderedData[i]=new dataType[nx];
|
||||||
|
dataMask[i] = new dataType[nx];
|
||||||
dataROIMask[i] = new int[nx];
|
dataROIMask[i] = new int[nx];
|
||||||
for (int j=0; j<nx; j++)
|
for (int j=0; j<nx; j++)
|
||||||
dataROIMask[i][j]=1;
|
dataROIMask[i][j]=1;
|
||||||
|
|
||||||
}
|
}
|
||||||
// }
|
|
||||||
for (int ip=0; ip<dsize/sizeof(dataType); ip++){
|
for (int ip=0; ip<el; ip++){
|
||||||
xmap[ip]=-1;
|
xmap[ip]=-1;
|
||||||
ymap[ip]=-1;
|
ymap[ip]=-1;
|
||||||
}
|
}
|
||||||
@ -74,22 +70,24 @@ class slsDetectorData {
|
|||||||
setDataMask(dMask);
|
setDataMask(dMask);
|
||||||
setDataROIMask(dROI);
|
setDataROIMask(dROI);
|
||||||
|
|
||||||
};
|
}
|
||||||
|
|
||||||
virtual ~slsDetectorData() {
|
virtual ~slsDetectorData() {
|
||||||
for(int i = 0; i < ny; i++) {
|
for(int i = 0; i < ny; i++) {
|
||||||
delete [] dataMap[i];
|
delete [] dataMap[i];
|
||||||
delete [] dataMask[i];
|
delete [] dataMask[i];
|
||||||
delete [] dataROIMask[i];
|
delete [] dataROIMask[i];
|
||||||
|
delete [] orderedData[i];
|
||||||
}
|
}
|
||||||
delete [] dataMap;
|
delete [] dataMap;
|
||||||
delete [] dataMask;
|
delete [] dataMask;
|
||||||
delete [] dataROIMask;
|
delete [] dataROIMask;
|
||||||
|
delete [] orderedData;
|
||||||
delete [] xmap;
|
delete [] xmap;
|
||||||
delete [] ymap;
|
delete [] ymap;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
virtual int getPointer(int ix,int iy) {return dataMap[iy][ix];};
|
||||||
/**
|
/**
|
||||||
defines the data map (as offset) - no error checking if datasize and offsets are compatible!
|
defines the data map (as offset) - no error checking if datasize and offsets are compatible!
|
||||||
\param dMap array of size nx*ny storing the pointers to the data in the dataset (as offset). If NULL (default),the data are arranged as if read out row by row (dataMap[iy][ix]=(iy*nx+ix)*sizeof(dataType);)
|
\param dMap array of size nx*ny storing the pointers to the data in the dataset (as offset). If NULL (default),the data are arranged as if read out row by row (dataMap[iy][ix]=(iy*nx+ix)*sizeof(dataType);)
|
||||||
@ -205,23 +203,28 @@ class slsDetectorData {
|
|||||||
virtual void getPixel(int ip, int &x, int &y) {x=xmap[ip]; y=ymap[ip];};
|
virtual void getPixel(int ip, int &x, int &y) {x=xmap[ip]; y=ymap[ip];};
|
||||||
|
|
||||||
virtual dataType **getData(char *ptr, int dsize=-1) {
|
virtual dataType **getData(char *ptr, int dsize=-1) {
|
||||||
|
int el=dsize/sizeof(dataType);
|
||||||
dataType **data;
|
//dataType **data;
|
||||||
int ix,iy;
|
int ix,iy;
|
||||||
data=new dataType*[ny];
|
//data=new dataType*[ny];
|
||||||
for(int i = 0; i < ny; i++) {
|
//for(int i = 0; i < ny; i++) {
|
||||||
data[i]=new dataType[nx];
|
// data[i]=new dataType[nx];
|
||||||
}
|
//}
|
||||||
|
isOrdered=0;
|
||||||
if (dsize<=0 || dsize>dataSize) dsize=dataSize;
|
if (dsize<=0 || dsize>dataSize) dsize=dataSize;
|
||||||
for (int ip=0; ip<(dsize/sizeof(dataType)); ip++) {
|
|
||||||
|
for (int ip=0; ip<(el); ip++) {
|
||||||
getPixel(ip,ix,iy);
|
getPixel(ip,ix,iy);
|
||||||
if (ix>=0 && ix<nx && iy>=0 && iy<ny) {
|
if (ix>=0 && ix<nx && iy>=0 && iy<ny) {
|
||||||
data[iy][ix]=getChannel(ptr,ix,iy);
|
//data[iy][ix]=getChannel(ptr,ix,iy);
|
||||||
|
orderedData[iy][ix]=*(ptr+ip);//getChannel(ptr,ix,iy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return data;
|
isOrdered=1;
|
||||||
|
return orderedData;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
void newFrame(){isOrdered=0;};
|
||||||
|
|
||||||
virtual double **getImage(char *ptr, int dsize=-1) {
|
virtual double **getImage(char *ptr, int dsize=-1) {
|
||||||
|
|
||||||
@ -231,15 +234,15 @@ class slsDetectorData {
|
|||||||
for(int i = 0; i < ny; i++) {
|
for(int i = 0; i < ny; i++) {
|
||||||
data[i]=new double[nx];
|
data[i]=new double[nx];
|
||||||
}
|
}
|
||||||
|
int el=dsize/sizeof(dataType);
|
||||||
if (dsize<=0 || dsize>dataSize) dsize=dataSize;
|
if (dsize<=0 || dsize>dataSize) dsize=dataSize;
|
||||||
for (int ip=0; ip<(dsize/sizeof(dataType)); ip++) {
|
for (int ip=0; ip<el; ip++) {
|
||||||
getPixel(ip,ix,iy);
|
getPixel(ip,ix,iy);
|
||||||
if (ix>=0 && ix<nx && iy>=0 && iy<ny) {
|
if (ix>=0 && ix<nx && iy>=0 && iy<ny) {
|
||||||
data[iy][ix]=getValue(ptr,ix,iy);
|
data[iy][ix]=getValue(ptr,ix,iy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -256,7 +259,10 @@ class slsDetectorData {
|
|||||||
// cout << ix << " " << iy << " " ;
|
// cout << ix << " " << iy << " " ;
|
||||||
//cout << dataMap[ix][iy] << " " << (void*)data << " " << dataSize<< endl;
|
//cout << dataMap[ix][iy] << " " << (void*)data << " " << dataSize<< endl;
|
||||||
m=dataMask[iy][ix];
|
m=dataMask[iy][ix];
|
||||||
d=*((dataType*)(data+dataMap[iy][ix]));
|
if (isOrdered==0)
|
||||||
|
d=*((dataType*)(data+getPointer(ix,iy)));
|
||||||
|
else
|
||||||
|
d=orderedData[iy][ix];
|
||||||
}
|
}
|
||||||
return d^m;
|
return d^m;
|
||||||
};
|
};
|
||||||
|
@ -13,7 +13,7 @@ template <class dataType> class ghostSummation {
|
|||||||
/** constructor
|
/** constructor
|
||||||
\param xt crosstalk
|
\param xt crosstalk
|
||||||
*/
|
*/
|
||||||
ghostSummation(slsDetectorData<dataType> *d, double xt) : xtalk(xt),det(d) {
|
ghostSummation(slsDetectorData<dataType> *d, double xt) : xtalk(xt),det(d), nx(1), ny(1) {
|
||||||
if (det)
|
if (det)
|
||||||
det->getDetectorSize(nx,ny);
|
det->getDetectorSize(nx,ny);
|
||||||
ghost=new double[nx*ny];
|
ghost=new double[nx*ny];
|
||||||
@ -22,6 +22,9 @@ template <class dataType> class ghostSummation {
|
|||||||
ghostSummation(ghostSummation *orig) {
|
ghostSummation(ghostSummation *orig) {
|
||||||
xtalk=orig->xtalk;
|
xtalk=orig->xtalk;
|
||||||
det=orig->det;
|
det=orig->det;
|
||||||
|
nx=1;
|
||||||
|
ny=1;
|
||||||
|
det->getDetectorSize(nx,ny);
|
||||||
ghost=new double[nx*ny];
|
ghost=new double[nx*ny];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -107,11 +107,11 @@ class interpolatingDetector : public singlePhotonDetector {
|
|||||||
singlePhotonDetector::clearImage();
|
singlePhotonDetector::clearImage();
|
||||||
};
|
};
|
||||||
|
|
||||||
int getImageSize(int &nnx, int &nny, int &ns) {
|
int getImageSize(int &nnx, int &nny, int &nsx, int &nsy) {
|
||||||
if (interp)
|
if (interp)
|
||||||
return interp->getImageSize(nnx, nny, ns);
|
return interp->getImageSize(nnx, nny, nsx, nsy);
|
||||||
else
|
else
|
||||||
return analogDetector<uint16_t>::getImageSize(nnx, nny, ns);
|
return analogDetector<uint16_t>::getImageSize(nnx, nny, nsx, nsy);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -251,6 +251,7 @@ int addFrame(char *data, int *ph=NULL, int ff=0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual int getNSubPixels(){ if (interp) return interp->getNSubPixels(); else return 1;}
|
virtual int getNSubPixels(){ if (interp) return interp->getNSubPixels(); else return 1;}
|
||||||
|
|
||||||
virtual int setNSubPixels(int ns) {
|
virtual int setNSubPixels(int ns) {
|
||||||
if (interp) {
|
if (interp) {
|
||||||
pthread_mutex_lock(fi);
|
pthread_mutex_lock(fi);
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
class eta2InterpolationBase : public virtual etaInterpolationBase {
|
class eta2InterpolationBase : public virtual etaInterpolationBase {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
eta2InterpolationBase(int nx=400, int ny=400, int ns=25, int nb=-1, double emin=1, double emax=0) : etaInterpolationBase(nx,ny, ns, nb, emin, emax) {
|
eta2InterpolationBase(int nx=400, int ny=400, int ns=25, int nsy=25, int nb=-1, int nby=-1, double emin=1, double emax=0) : etaInterpolationBase(nx,ny, ns, nsy, nb, nby, emin, emax) {
|
||||||
|
|
||||||
/* if (etamin>=etamax) { */
|
/* if (etamin>=etamax) { */
|
||||||
/* etamin=-1; */
|
/* etamin=-1; */
|
||||||
@ -37,7 +37,7 @@ class eta2InterpolationBase : public virtual etaInterpolationBase {
|
|||||||
|
|
||||||
int corner;
|
int corner;
|
||||||
corner=calcQuad(data, tot, totquad, sDum);
|
corner=calcQuad(data, tot, totquad, sDum);
|
||||||
if (nSubPixels>2)
|
if (nSubPixelsX>2 || nSubPixelsY>2)
|
||||||
calcEta(totquad, sDum, etax, etay);
|
calcEta(totquad, sDum, etax, etay);
|
||||||
getInterpolatedPosition(x,y,etax,etay,corner,int_x,int_y);
|
getInterpolatedPosition(x,y,etax,etay,corner,int_x,int_y);
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ class eta2InterpolationBase : public virtual etaInterpolationBase {
|
|||||||
|
|
||||||
int corner;
|
int corner;
|
||||||
corner=calcQuad(data, tot, totquad, sDum);
|
corner=calcQuad(data, tot, totquad, sDum);
|
||||||
if (nSubPixels>2)
|
if (nSubPixelsX>2 || nSubPixelsY>2 )
|
||||||
calcEta(totquad, sDum, etax, etay);
|
calcEta(totquad, sDum, etax, etay);
|
||||||
getInterpolatedPosition(x,y,etax,etay,corner,int_x,int_y);
|
getInterpolatedPosition(x,y,etax,etay,corner,int_x,int_y);
|
||||||
|
|
||||||
@ -93,7 +93,7 @@ class eta2InterpolationBase : public virtual etaInterpolationBase {
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
double etax=0, etay=0;
|
double etax=0, etay=0;
|
||||||
if (nSubPixels>2) {
|
if (nSubPixelsX>2 || nSubPixelsY>2) {
|
||||||
cc[0][0]=cl[xoff+3*yoff];
|
cc[0][0]=cl[xoff+3*yoff];
|
||||||
cc[1][0]=cl[xoff+3*(yoff+1)];
|
cc[1][0]=cl[xoff+3*(yoff+1)];
|
||||||
cc[0][1]=cl[xoff+1+3*yoff];
|
cc[0][1]=cl[xoff+1+3*yoff];
|
||||||
@ -133,7 +133,7 @@ class eta2InterpolationBase : public virtual etaInterpolationBase {
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
double etax=0, etay=0;
|
double etax=0, etay=0;
|
||||||
if (nSubPixels>2) {
|
if (nSubPixelsX>2 || nSubPixelsY>2) {
|
||||||
cc[0][0]=cl[xoff+3*yoff];
|
cc[0][0]=cl[xoff+3*yoff];
|
||||||
cc[1][0]=cl[xoff+3*(yoff+1)];
|
cc[1][0]=cl[xoff+3*(yoff+1)];
|
||||||
cc[0][1]=cl[xoff+1+3*yoff];
|
cc[0][1]=cl[xoff+1+3*yoff];
|
||||||
@ -182,31 +182,31 @@ class eta2InterpolationBase : public virtual etaInterpolationBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (nSubPixels>2) {
|
if (nSubPixelsX>2 || nSubPixelsY>2 ) {
|
||||||
|
|
||||||
ex=(etax-etamin)/etastep;
|
ex=(etax-etamin)/etastepX;
|
||||||
ey=(etay-etamin)/etastep;
|
ey=(etay-etamin)/etastepY;
|
||||||
if (ex<0) {
|
if (ex<0) {
|
||||||
cout << "x*"<< ex << endl;
|
cout << "x*"<< ex << endl;
|
||||||
ex=0;
|
ex=0;
|
||||||
}
|
}
|
||||||
if (ex>=nbeta) {
|
if (ex>=nbetaX) {
|
||||||
cout << "x?"<< ex << endl;
|
cout << "x?"<< ex << endl;
|
||||||
ex=nbeta-1;
|
ex=nbetaX-1;
|
||||||
}
|
}
|
||||||
if (ey<0) {
|
if (ey<0) {
|
||||||
cout << "y*"<< ey << endl;
|
cout << "y*"<< ey << " " << nbetaY << endl;
|
||||||
ey=0;
|
ey=0;
|
||||||
}
|
}
|
||||||
if (ey>=nbeta) {
|
if (ey>=nbetaY) {
|
||||||
cout << "y?"<< ey << endl;
|
cout << "y?"<< ey << " " << nbetaY << endl;
|
||||||
ey=nbeta-1;
|
ey=nbetaY-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
xpos_eta=(((double)hhx[(ey*nbeta+ex)]))+dX ;///((double)nSubPixels);
|
xpos_eta=(((double)hhx[(ey*nbetaX+ex)]))+dX ;///((double)nSubPixels);
|
||||||
ypos_eta=(((double)hhy[(ey*nbeta+ex)]))+dY ;///((double)nSubPixels);
|
ypos_eta=(((double)hhy[(ey*nbetaX+ex)]))+dY ;///((double)nSubPixels);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
xpos_eta=0.5*dX+0.25;
|
xpos_eta=0.5*dX+0.25;
|
||||||
@ -347,10 +347,10 @@ class eta2InterpolationBase : public virtual etaInterpolationBase {
|
|||||||
#endif
|
#endif
|
||||||
#ifndef MYROOT1
|
#ifndef MYROOT1
|
||||||
int ex,ey;
|
int ex,ey;
|
||||||
ex=(etax-etamin)/etastep;
|
ex=(etax-etamin)/etastepX;
|
||||||
ey=(etay-etamin)/etastep;
|
ey=(etay-etamin)/etastepY;
|
||||||
if (ey<nbeta && ex<nbeta && ex>=0 && ey>=0)
|
if (ey<nbetaY && ex<nbetaX && ex>=0 && ey>=0)
|
||||||
heta[ey*nbeta+ex]++;
|
heta[ey*nbetaX+ex]++;
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
@ -360,22 +360,22 @@ class eta2InterpolationBase : public virtual etaInterpolationBase {
|
|||||||
// cout << "ff" << endl;
|
// cout << "ff" << endl;
|
||||||
calcDiff(1, hhx, hhy); //get flat
|
calcDiff(1, hhx, hhy); //get flat
|
||||||
double avg=0;
|
double avg=0;
|
||||||
for (ipx=0; ipx<nSubPixels; ipx++)
|
for (ipx=0; ipx<nSubPixelsX; ipx++)
|
||||||
for (ipy=0; ipy<nSubPixels; ipy++)
|
for (ipy=0; ipy<nSubPixelsY; ipy++)
|
||||||
avg+=flat[ipx+ipy*nSubPixels];
|
avg+=flat[ipx+ipy*nSubPixelsX];
|
||||||
avg/=nSubPixels*nSubPixels;
|
avg/=nSubPixelsY*nSubPixelsX;
|
||||||
|
|
||||||
for (int ibx=0 ; ibx<nSubPixels*nPixelsX; ibx++) {
|
for (int ibx=0 ; ibx<nSubPixelsX*nPixelsX; ibx++) {
|
||||||
ipx=ibx%nSubPixels-nSubPixels/2;
|
ipx=ibx%nSubPixelsX-nSubPixelsX/2;
|
||||||
if (ipx<0) ipx=nSubPixels+ipx;
|
if (ipx<0) ipx=nSubPixelsX+ipx;
|
||||||
for (int iby=0 ; iby<nSubPixels*nPixelsY; iby++) {
|
for (int iby=0 ; iby<nSubPixelsY*nPixelsY; iby++) {
|
||||||
ipy=iby%nSubPixels-nSubPixels/2;
|
ipy=iby%nSubPixelsY-nSubPixelsY/2;
|
||||||
if (ipy<0) ipy=nSubPixels+ipy;
|
if (ipy<0) ipy=nSubPixelsY+ipy;
|
||||||
// cout << ipx << " " << ipy << " " << ibx << " " << iby << endl;
|
// cout << ipx << " " << ipy << " " << ibx << " " << iby << endl;
|
||||||
if (flat[ipx+ipy*nSubPixels]>0)
|
if (flat[ipx+ipy*nSubPixelsX]>0)
|
||||||
hintcorr[ibx+iby*nSubPixels*nPixelsX]=hint[ibx+iby*nSubPixels*nPixelsX]*(avg/flat[ipx+ipy*nSubPixels]);
|
hintcorr[ibx+iby*nSubPixelsX*nPixelsX]=hint[ibx+iby*nSubPixelsX*nPixelsX]*(avg/flat[ipx+ipy*nSubPixelsX]);
|
||||||
else
|
else
|
||||||
hintcorr[ibx+iby*nSubPixels*nPixelsX]=hint[ibx+iby*nSubPixels*nPixelsX];
|
hintcorr[ibx+iby*nSubPixelsX*nPixelsX]=hint[ibx+iby*nSubPixelsX*nPixelsX];
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -13,35 +13,12 @@
|
|||||||
class eta3InterpolationBase : public virtual etaInterpolationBase {
|
class eta3InterpolationBase : public virtual etaInterpolationBase {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
eta3InterpolationBase(int nx=400, int ny=400, int ns=25, int nb=-1, double emin=1, double emax=0) : etaInterpolationBase(nx, ny, ns, nb, emin, emax) {
|
eta3InterpolationBase(int nx=400, int ny=400, int ns=25, int nsy=25, int nb=-1, int nby=-1, double emin=1, double emax=0) : etaInterpolationBase(nx, ny, ns, nsy, nb, nby, emin, emax) {
|
||||||
// cout << "e3ib " << nb << " " << emin << " " << emax << endl;
|
// cout << "e3ib " << nb << " " << emin << " " << emax << endl;
|
||||||
/* if (nbeta<=0) { */
|
/* if (nbeta<=0) { */
|
||||||
/* nbeta=nSubPixels*10; */
|
/* nbeta=nSubPixels*10; */
|
||||||
/* } */
|
/* } */
|
||||||
if (etamin>=etamax) {
|
|
||||||
etamin=-1;
|
|
||||||
etamax=1;
|
|
||||||
}
|
|
||||||
|
|
||||||
etastep=(etamax-etamin)/nbeta;
|
|
||||||
#ifdef MYROOT1
|
|
||||||
delete heta;
|
|
||||||
delete hhx;
|
|
||||||
delete hhy;
|
|
||||||
heta=new TH2D("heta","heta",nbeta,etamin,etamax,nbeta,etamin,etamax);
|
|
||||||
hhx=new TH2D("hhx","hhx",nbeta,etamin,etamax,nbeta,etamin,etamax);
|
|
||||||
hhy=new TH2D("hhy","hhy",nbeta,etamin,etamax,nbeta,etamin,etamax);
|
|
||||||
#endif
|
|
||||||
#ifndef MYROOT1
|
|
||||||
/* delete [] heta; */
|
|
||||||
/* delete [] hhx; */
|
|
||||||
/* delete [] hhy; */
|
|
||||||
|
|
||||||
/* heta=new int[nbeta*nbeta]; */
|
|
||||||
/* hhx=new float[nbeta*nbeta]; */
|
|
||||||
/* hhy=new float[nbeta*nbeta]; */
|
|
||||||
|
|
||||||
#endif
|
|
||||||
// cout << nbeta << " " << etamin << " " << etamax << endl;
|
// cout << nbeta << " " << etamin << " " << etamax << endl;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -88,7 +65,7 @@ class eta3InterpolationBase : public virtual etaInterpolationBase {
|
|||||||
|
|
||||||
|
|
||||||
double etax, etay;
|
double etax, etay;
|
||||||
if (nSubPixels>2) {
|
if (nSubPixelsX>2 || nSubPixelsY>2 ) {
|
||||||
calcEta3(cl,etax,etay, totquad);
|
calcEta3(cl,etax,etay, totquad);
|
||||||
}
|
}
|
||||||
return getInterpolatedPosition(x,y,etax, etay,quad,int_x,int_y);
|
return getInterpolatedPosition(x,y,etax, etay,quad,int_x,int_y);
|
||||||
@ -101,7 +78,7 @@ class eta3InterpolationBase : public virtual etaInterpolationBase {
|
|||||||
|
|
||||||
|
|
||||||
double etax, etay;
|
double etax, etay;
|
||||||
if (nSubPixels>2) {
|
if (nSubPixelsX>2 || nSubPixelsY>2 ) {
|
||||||
calcEta3(cl,etax,etay, totquad);
|
calcEta3(cl,etax,etay, totquad);
|
||||||
}
|
}
|
||||||
return getInterpolatedPosition(x,y,etax, etay,quad,int_x,int_y);
|
return getInterpolatedPosition(x,y,etax, etay,quad,int_x,int_y);
|
||||||
@ -117,38 +94,38 @@ class eta3InterpolationBase : public virtual etaInterpolationBase {
|
|||||||
double xpos_eta=0,ypos_eta=0;
|
double xpos_eta=0,ypos_eta=0;
|
||||||
int ex,ey;
|
int ex,ey;
|
||||||
|
|
||||||
if (nSubPixels>2) {
|
if (nSubPixelsX>2 || nSubPixelsY>2 ) {
|
||||||
|
|
||||||
#ifdef MYROOT1
|
#ifdef MYROOT1
|
||||||
xpos_eta=(hhx->GetBinContent(hhx->GetXaxis()->FindBin(etax),hhy->GetYaxis()->FindBin(etay)))/((double)nSubPixels);
|
xpos_eta=(hhx->GetBinContent(hhx->GetXaxis()->FindBin(etax),hhy->GetYaxis()->FindBin(etay)))/((double)nSubPixelsX);
|
||||||
ypos_eta=(hhy->GetBinContent(hhx->GetXaxis()->FindBin(etax),hhy->GetYaxis()->FindBin(etay)))/((double)nSubPixels);
|
ypos_eta=(hhy->GetBinContent(hhx->GetXaxis()->FindBin(etax),hhy->GetYaxis()->FindBin(etay)))/((double)nSubPixelsY);
|
||||||
#endif
|
#endif
|
||||||
#ifndef MYROOT1
|
#ifndef MYROOT1
|
||||||
ex=(etax-etamin)/etastep;
|
ex=(etax-etamin)/etastepX;
|
||||||
ey=(etay-etamin)/etastep;
|
ey=(etay-etamin)/etastepY;
|
||||||
if (ex<0) {
|
if (ex<0) {
|
||||||
/* cout << etax << " " << etamin << " "; */
|
/* cout << etax << " " << etamin << " "; */
|
||||||
/* cout << "3x*"<< ex << endl; */
|
/* cout << "3x*"<< ex << endl; */
|
||||||
ex=0;
|
ex=0;
|
||||||
}
|
}
|
||||||
if (ex>=nbeta) {
|
if (ex>=nbetaX) {
|
||||||
/* cout << etax << " " << etamin << " "; */
|
/* cout << etax << " " << etamin << " "; */
|
||||||
/* cout << "3x?"<< ex << endl; */
|
/* cout << "3x?"<< ex << endl; */
|
||||||
ex=nbeta-1;
|
ex=nbetaX-1;
|
||||||
}
|
}
|
||||||
if (ey<0) {
|
if (ey<0) {
|
||||||
/* cout << etay << " " << etamin << " "; */
|
/* cout << etay << " " << etamin << " "; */
|
||||||
/* cout << "3y*"<< ey << endl; */
|
/* cout << "3y*"<< ey << endl; */
|
||||||
ey=0;
|
ey=0;
|
||||||
}
|
}
|
||||||
if (ey>=nbeta) {
|
if (ey>=nbetaY) {
|
||||||
/* cout << etay << " " << etamin << " "; */
|
/* cout << etay << " " << etamin << " "; */
|
||||||
/* cout << "3y?"<< ey << endl; */
|
/* cout << "3y?"<< ey << endl; */
|
||||||
ey=nbeta-1;
|
ey=nbetaY-1;
|
||||||
|
|
||||||
}
|
}
|
||||||
xpos_eta=(((double)hhx[(ey*nbeta+ex)]));///((double)nSubPixels);
|
xpos_eta=(((double)hhx[(ey*nbetaX+ex)]));///((double)nSubPixels);
|
||||||
ypos_eta=(((double)hhy[(ey*nbeta+ex)]));///((double)nSubPixels);
|
ypos_eta=(((double)hhy[(ey*nbetaX+ex)]));///((double)nSubPixels);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -265,10 +242,10 @@ class eta3InterpolationBase : public virtual etaInterpolationBase {
|
|||||||
#endif
|
#endif
|
||||||
#ifndef MYROOT1
|
#ifndef MYROOT1
|
||||||
int ex,ey;
|
int ex,ey;
|
||||||
ex=(etax-etamin)/etastep;
|
ex=(etax-etamin)/etastepX;
|
||||||
ey=(etay-etamin)/etastep;
|
ey=(etay-etamin)/etastepY;
|
||||||
if (ey<nbeta && ex<nbeta && ex>=0 && ey>=0)
|
if (ey<nbetaY && ex<nbetaX && ex>=0 && ey>=0)
|
||||||
heta[ey*nbeta+ex]++;
|
heta[ey*nbetaX+ex]++;
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include <TH2D.h>
|
#include <TH2D.h>
|
||||||
#include <TH2F.h>
|
#include <TH2F.h>
|
||||||
#endif
|
#endif
|
||||||
|
#include <cmath>
|
||||||
#include "slsInterpolation.h"
|
#include "slsInterpolation.h"
|
||||||
#include "tiffIO.h"
|
#include "tiffIO.h"
|
||||||
|
|
||||||
@ -15,44 +15,51 @@ class etaInterpolationBase : public slsInterpolation {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
etaInterpolationBase(int nx=400, int ny=400, int ns=25, int nb=-1, double emin=1, double emax=0) : slsInterpolation(nx,ny,ns), hhx(NULL), hhy(NULL), heta(NULL), nbeta(nb), etamin(emin), etamax(emax) {
|
etaInterpolationBase(int nx=400, int ny=400, int ns=25, int nsy=25, int nb=-1, int nby=-1, double emin=1, double emax=0) : slsInterpolation(nx,ny,ns,nsy), hhx(NULL), hhy(NULL), heta(NULL), nbetaX(nb), nbetaY(nby), etamin(emin), etamax(emax) {
|
||||||
// cout << "eb " << nb << " " << emin << " " << emax << endl;
|
// cout << "eb " << nb << " " << emin << " " << emax << endl;
|
||||||
// cout << nb << " " << etamin << " " << etamax << endl;
|
// cout << nb << " " << etamin << " " << etamax << endl;
|
||||||
if (nbeta<=0) {
|
if (nbetaX<=0) {
|
||||||
//cout << "aaa:" <<endl;
|
//cout << "aaa:" <<endl;
|
||||||
nbeta=nSubPixels*10;
|
nbetaX=nSubPixelsX*10;
|
||||||
|
}
|
||||||
|
if (nbetaY<=0) {
|
||||||
|
//cout << "aaa:" <<endl;
|
||||||
|
nbetaY=nSubPixelsY*10;
|
||||||
}
|
}
|
||||||
if (etamin>=etamax) {
|
if (etamin>=etamax) {
|
||||||
etamin=-1;
|
etamin=-1;
|
||||||
etamax=2;
|
etamax=2;
|
||||||
}
|
}
|
||||||
etastep=(etamax-etamin)/nbeta;
|
etastepX=(etamax-etamin)/nbetaX;
|
||||||
heta=new int[nbeta*nbeta];
|
etastepY=(etamax-etamin)/nbetaY;
|
||||||
hhx=new float[nbeta*nbeta];
|
heta=new int[nbetaX*nbetaY];
|
||||||
hhy=new float[nbeta*nbeta];
|
hhx=new float[nbetaX*nbetaY];
|
||||||
|
hhy=new float[nbetaX*nbetaY];
|
||||||
rangeMin=etamin;
|
rangeMin=etamin;
|
||||||
rangeMax=etamax;
|
rangeMax=etamax;
|
||||||
flat= new double[nSubPixels*nSubPixels];
|
flat= new double[nSubPixelsX*nSubPixelsY];
|
||||||
hintcorr=new int [nSubPixels*nSubPixels*nPixelsX*nPixelsY];
|
hintcorr=new int [nSubPixelsX*nSubPixelsY*nPixelsX*nPixelsY];
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
etaInterpolationBase(etaInterpolationBase *orig): slsInterpolation(orig){
|
etaInterpolationBase(etaInterpolationBase *orig): slsInterpolation(orig){
|
||||||
nbeta=orig->nbeta;
|
nbetaX=orig->nbetaX;
|
||||||
|
nbetaY=orig->nbetaY;
|
||||||
etamin=orig->etamin;
|
etamin=orig->etamin;
|
||||||
etamax=orig->etamax;
|
etamax=orig->etamax;
|
||||||
rangeMin=orig->rangeMin;
|
rangeMin=orig->rangeMin;
|
||||||
rangeMax=orig->rangeMax;
|
rangeMax=orig->rangeMax;
|
||||||
|
|
||||||
|
|
||||||
etastep=(etamax-etamin)/nbeta;
|
etastepX=(etamax-etamin)/nbetaX;
|
||||||
heta=new int[nbeta*nbeta];
|
etastepY=(etamax-etamin)/nbetaY;
|
||||||
memcpy(heta,orig->heta,nbeta*nbeta*sizeof(int));
|
heta=new int[nbetaX*nbetaY];
|
||||||
hhx=new float[nbeta*nbeta];
|
memcpy(heta,orig->heta,nbetaX*nbetaY*sizeof(int));
|
||||||
memcpy(hhx,orig->hhx,nbeta*nbeta*sizeof(float));
|
hhx=new float[nbetaX*nbetaY];
|
||||||
hhy=new float[nbeta*nbeta];
|
memcpy(hhx,orig->hhx,nbetaX*nbetaY*sizeof(float));
|
||||||
memcpy(hhy,orig->hhy,nbeta*nbeta*sizeof(float));
|
hhy=new float[nbetaX*nbetaY];
|
||||||
hintcorr=new int [nSubPixels*nSubPixels*nPixelsX*nPixelsY];
|
memcpy(hhy,orig->hhy,nbetaX*nbetaY*sizeof(float));
|
||||||
|
hintcorr=new int [nSubPixelsX*nSubPixelsY*nPixelsX*nPixelsY];
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -61,7 +68,7 @@ class etaInterpolationBase : public slsInterpolation {
|
|||||||
|
|
||||||
|
|
||||||
virtual void resetFlatField() {
|
virtual void resetFlatField() {
|
||||||
for (int ibx=0; ibx<nbeta*nbeta; ibx++) {
|
for (int ibx=0; ibx<nbetaX*nbetaY; ibx++) {
|
||||||
heta[ibx]=0;
|
heta[ibx]=0;
|
||||||
hhx[ibx]=0;
|
hhx[ibx]=0;
|
||||||
hhy[ibx]=0;
|
hhy[ibx]=0;
|
||||||
@ -70,13 +77,16 @@ class etaInterpolationBase : public slsInterpolation {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
int *setEta(int *h, int nb=-1, double emin=1, double emax=0)
|
int *setEta(int *h, int nb=-1, int nby=-1, double emin=1, double emax=0)
|
||||||
{
|
{
|
||||||
if (h) {
|
if (h) {
|
||||||
if (heta) delete [] heta;
|
if (heta) delete [] heta;
|
||||||
heta=h;
|
heta=h;
|
||||||
nbeta=nb;
|
nbetaX=nb;
|
||||||
if (nb<=0) nbeta=nSubPixels*10;
|
nbetaY=nby;
|
||||||
|
if (nbetaX<=0) nbetaX=nSubPixelsX*10;
|
||||||
|
if (nbetaY<=0) nbetaY=nSubPixelsY*10;
|
||||||
|
|
||||||
etamin=emin;
|
etamin=emin;
|
||||||
etamax=emax;
|
etamax=emax;
|
||||||
if (etamin>=etamax) {
|
if (etamin>=etamax) {
|
||||||
@ -85,22 +95,24 @@ class etaInterpolationBase : public slsInterpolation {
|
|||||||
}
|
}
|
||||||
rangeMin=etamin;
|
rangeMin=etamin;
|
||||||
rangeMax=etamax;
|
rangeMax=etamax;
|
||||||
etastep=(etamax-etamin)/nbeta;
|
etastepX=(etamax-etamin)/nbetaX;
|
||||||
|
etastepY=(etamax-etamin)/nbetaY;
|
||||||
}
|
}
|
||||||
return heta;
|
return heta;
|
||||||
};
|
};
|
||||||
|
|
||||||
int *setFlatField(int *h, int nb=-1, double emin=1, double emax=0)
|
int *setFlatField(int *h, int nb=-1, int nby=-1, double emin=1, double emax=0)
|
||||||
{
|
{
|
||||||
return setEta(h, nb, emin, emax);
|
return setEta(h, nb, nby, emin, emax);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int *getFlatField(){return setEta(NULL);};
|
int *getFlatField(){return setEta(NULL);};
|
||||||
|
|
||||||
int *getFlatField(int &nb, double &emin, double &emax){
|
int *getFlatField(int &nb, int &nby, double &emin, double &emax){
|
||||||
nb=nbeta;
|
nb=nbetaX;
|
||||||
|
nby=nbetaY;
|
||||||
emin=etamin;
|
emin=etamin;
|
||||||
emax=etamax;
|
emax=etamax;
|
||||||
return getFlatField();
|
return getFlatField();
|
||||||
@ -109,13 +121,13 @@ class etaInterpolationBase : public slsInterpolation {
|
|||||||
|
|
||||||
void *writeFlatField(const char * imgname) {
|
void *writeFlatField(const char * imgname) {
|
||||||
float *gm=NULL;
|
float *gm=NULL;
|
||||||
gm=new float[nbeta*nbeta];
|
gm=new float[nbetaX*nbetaY];
|
||||||
for (int ix=0; ix<nbeta; ix++) {
|
for (int ix=0; ix<nbetaX; ix++) {
|
||||||
for (int iy=0; iy<nbeta; iy++) {
|
for (int iy=0; iy<nbetaY; iy++) {
|
||||||
gm[iy*nbeta+ix]=heta[iy*nbeta+ix];
|
gm[iy*nbetaX+ix]=heta[iy*nbetaX+ix];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
WriteToTiff(gm, imgname, nbeta, nbeta);
|
WriteToTiff(gm, imgname, nbetaX, nbetaY);
|
||||||
delete [] gm;
|
delete [] gm;
|
||||||
return NULL;
|
return NULL;
|
||||||
};
|
};
|
||||||
@ -129,16 +141,18 @@ class etaInterpolationBase : public slsInterpolation {
|
|||||||
etamax=2;
|
etamax=2;
|
||||||
}
|
}
|
||||||
|
|
||||||
etastep=(etamax-etamin)/nbeta;
|
etastepX=(etamax-etamin)/nbetaX;
|
||||||
|
etastepY=(etamax-etamin)/nbetaY;
|
||||||
uint32 nnx;
|
uint32 nnx;
|
||||||
uint32 nny;
|
uint32 nny;
|
||||||
float *gm=ReadFromTiff(imgname, nnx, nny);
|
float *gm=ReadFromTiff(imgname, nnx, nny);
|
||||||
if (nnx!=nny) {
|
/* if (nnx!=nny) { */
|
||||||
cout << "different number of bins in x " << nnx << " and y " << nny<< " !"<< endl;
|
/* cout << "different number of bins in x " << nnx << " and y " << nny<< " !"<< endl; */
|
||||||
cout << "Aborting read"<< endl;
|
/* cout << "Aborting read"<< endl; */
|
||||||
return 0;
|
/* return 0; */
|
||||||
}
|
/* } */
|
||||||
nbeta=nnx;
|
nbetaX=nnx;
|
||||||
|
nbetaY=nny;
|
||||||
if (gm) {
|
if (gm) {
|
||||||
if (heta) {
|
if (heta) {
|
||||||
delete [] heta;
|
delete [] heta;
|
||||||
@ -146,13 +160,13 @@ class etaInterpolationBase : public slsInterpolation {
|
|||||||
delete [] hhy;
|
delete [] hhy;
|
||||||
}
|
}
|
||||||
|
|
||||||
heta=new int[nbeta*nbeta];
|
heta=new int[nbetaX*nbetaY];
|
||||||
hhx=new float[nbeta*nbeta];
|
hhx=new float[nbetaX*nbetaY];
|
||||||
hhy=new float[nbeta*nbeta];
|
hhy=new float[nbetaX*nbetaY];
|
||||||
|
|
||||||
for (int ix=0; ix<nbeta; ix++) {
|
for (int ix=0; ix<nbetaX; ix++) {
|
||||||
for (int iy=0; iy<nbeta; iy++) {
|
for (int iy=0; iy<nbetaY; iy++) {
|
||||||
heta[iy*nbeta+ix]=gm[iy*nbeta+ix];
|
heta[iy*nbetaX+ix]=gm[iy*nbetaX+ix];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
delete [] gm;
|
delete [] gm;
|
||||||
@ -178,10 +192,10 @@ float *gethhx()
|
|||||||
};
|
};
|
||||||
virtual int addToFlatField(double etax, double etay){
|
virtual int addToFlatField(double etax, double etay){
|
||||||
int ex,ey;
|
int ex,ey;
|
||||||
ex=(etax-etamin)/etastep;
|
ex=(etax-etamin)/etastepX;
|
||||||
ey=(etay-etamin)/etastep;
|
ey=(etay-etamin)/etastepY;
|
||||||
if (ey<nbeta && ex<nbeta && ex>=0 && ey>=0)
|
if (ey<nbetaY && ex<nbetaX && ex>=0 && ey>=0)
|
||||||
heta[ey*nbeta+ex]++;
|
heta[ey*nbetaX+ex]++;
|
||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -195,80 +209,80 @@ float *gethhx()
|
|||||||
|
|
||||||
float tot_eta=0;
|
float tot_eta=0;
|
||||||
|
|
||||||
float *etah=new float[nbeta*nbeta];
|
float *etah=new float[nbetaX*nbetaY];
|
||||||
int etabins=nbeta;
|
// int etabins=nbeta;
|
||||||
int ibb=0;
|
int ibb=0;
|
||||||
|
|
||||||
for (int ii=0; ii<etabins*etabins; ii++) {
|
for (int ii=0; ii<nbetaX*nbetaY; ii++) {
|
||||||
|
|
||||||
etah[ii]=heta[ii];
|
etah[ii]=heta[ii];
|
||||||
tot_eta+=heta[ii];
|
tot_eta+=heta[ii];
|
||||||
}
|
}
|
||||||
sprintf(tit,"/scratch/eta_%d.tiff",ind);
|
sprintf(tit,"/scratch/eta_%d.tiff",ind);
|
||||||
WriteToTiff(etah, tit, etabins, etabins);
|
WriteToTiff(etah, tit, nbetaX, nbetaY);
|
||||||
|
|
||||||
|
|
||||||
for (int ii=0; ii<etabins*etabins; ii++) {
|
for (int ii=0; ii<nbetaX*nbetaY; ii++) {
|
||||||
ibb=(hhx[ii]*nSubPixels);
|
ibb=(hhx[ii]*nSubPixelsX);
|
||||||
etah[ii]=ibb;
|
etah[ii]=ibb;
|
||||||
}
|
}
|
||||||
sprintf(tit,"/scratch/eta_hhx_%d.tiff",ind);
|
sprintf(tit,"/scratch/eta_hhx_%d.tiff",ind);
|
||||||
WriteToTiff(etah, tit, etabins, etabins);
|
WriteToTiff(etah, tit, nbetaX, nbetaY);
|
||||||
|
|
||||||
for (int ii=0; ii<etabins*etabins; ii++) {
|
for (int ii=0; ii<nbetaX*nbetaY; ii++) {
|
||||||
ibb=hhy[ii]*nSubPixels;
|
ibb=hhy[ii]*nSubPixelsY;
|
||||||
etah[ii]=ibb;
|
etah[ii]=ibb;
|
||||||
}
|
}
|
||||||
sprintf(tit,"/scratch/eta_hhy_%d.tiff",ind);
|
sprintf(tit,"/scratch/eta_hhy_%d.tiff",ind);
|
||||||
WriteToTiff(etah, tit, etabins, etabins);
|
WriteToTiff(etah, tit, nbetaX, nbetaY);
|
||||||
|
|
||||||
|
|
||||||
float *ftest=new float[nSubPixels*nSubPixels];
|
float *ftest=new float[nSubPixelsX*nSubPixelsY];
|
||||||
|
|
||||||
for (int ib=0; ib<nSubPixels*nSubPixels; ib++) ftest[ib]=0;
|
for (int ib=0; ib<nSubPixelsX*nSubPixelsY; ib++) ftest[ib]=0;
|
||||||
|
|
||||||
|
|
||||||
//int ibx=0, iby=0;
|
//int ibx=0, iby=0;
|
||||||
|
|
||||||
for (int ii=0; ii<nbeta*nbeta; ii++) {
|
for (int ii=0; ii<nbetaX*nbetaY; ii++) {
|
||||||
|
|
||||||
ibx=nSubPixels*hhx[ii];
|
ibx=nSubPixelsX*hhx[ii];
|
||||||
iby=nSubPixels*hhy[ii];
|
iby=nSubPixelsY*hhy[ii];
|
||||||
if (ibx<0) ibx=0;
|
if (ibx<0) ibx=0;
|
||||||
if (iby<0) iby=0;
|
if (iby<0) iby=0;
|
||||||
if (ibx>=nSubPixels) ibx=nSubPixels-1;
|
if (ibx>=nSubPixelsX) ibx=nSubPixelsX-1;
|
||||||
if (iby>=nSubPixels) iby=nSubPixels-1;
|
if (iby>=nSubPixelsY) iby=nSubPixelsY-1;
|
||||||
|
|
||||||
|
|
||||||
if (ibx>=0 && ibx<nSubPixels && iby>=0 && iby<nSubPixels) {
|
if (ibx>=0 && ibx<nSubPixelsX && iby>=0 && iby<nSubPixelsY) {
|
||||||
//
|
//
|
||||||
// if (ibx>0 && iby>0) cout << ibx << " " << iby << " " << ii << endl;
|
// if (ibx>0 && iby>0) cout << ibx << " " << iby << " " << ii << endl;
|
||||||
ftest[ibx+iby*nSubPixels]+=heta[ii];
|
ftest[ibx+iby*nSubPixelsX]+=heta[ii];
|
||||||
} else
|
} else
|
||||||
cout << "Bad interpolation "<< ii << " " << ibx << " " << iby<< endl;
|
cout << "Bad interpolation "<< ii << " " << ibx << " " << iby<< endl;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(tit,"/scratch/ftest_%d.tiff",ind);
|
sprintf(tit,"/scratch/ftest_%d.tiff",ind);
|
||||||
WriteToTiff(ftest, tit, nSubPixels, nSubPixels);
|
WriteToTiff(ftest, tit, nSubPixelsX, nSubPixelsY);
|
||||||
|
|
||||||
//int ibx=0, iby=0;
|
//int ibx=0, iby=0;
|
||||||
tot_eta/=nSubPixels*nSubPixels;
|
tot_eta/=nSubPixelsX*nSubPixelsY;
|
||||||
int nbad=0;
|
int nbad=0;
|
||||||
for (int ii=0; ii<etabins*etabins; ii++) {
|
for (int ii=0; ii<nbetaX*nbetaY; ii++) {
|
||||||
ibx=nSubPixels*hhx[ii];
|
ibx=nSubPixelsX*hhx[ii];
|
||||||
iby=nSubPixels*hhy[ii];
|
iby=nSubPixelsY*hhy[ii];
|
||||||
if (ftest[ibx+iby*nSubPixels]<tot_eta*0.5) {
|
if (ftest[ibx+iby*nSubPixelsX]<tot_eta*0.5) {
|
||||||
etah[ii]=1;
|
etah[ii]=1;
|
||||||
nbad++;
|
nbad++;
|
||||||
} else if(ftest[ibx+iby*nSubPixels]>tot_eta*2.){
|
} else if(ftest[ibx+iby*nSubPixelsX]>tot_eta*2.){
|
||||||
etah[ii]=2;
|
etah[ii]=2;
|
||||||
nbad++;
|
nbad++;
|
||||||
} else
|
} else
|
||||||
etah[ii]=0;
|
etah[ii]=0;
|
||||||
}
|
}
|
||||||
sprintf(tit,"/scratch/eta_bad_%d.tiff",ind);
|
sprintf(tit,"/scratch/eta_bad_%d.tiff",ind);
|
||||||
WriteToTiff(etah, tit, etabins, etabins);
|
WriteToTiff(etah, tit, nbetaX, nbetaY);
|
||||||
// cout << "Index: " << ind << "\t Bad bins: "<< nbad << endl;
|
// cout << "Index: " << ind << "\t Bad bins: "<< nbad << endl;
|
||||||
//int ibx=0, iby=0;
|
//int ibx=0, iby=0;
|
||||||
|
|
||||||
@ -286,46 +300,44 @@ float *gethhx()
|
|||||||
double diff=0, d;
|
double diff=0, d;
|
||||||
//double bsize=1./nSubPixels;
|
//double bsize=1./nSubPixels;
|
||||||
int nbad=0;
|
int nbad=0;
|
||||||
double p_tot_x[nSubPixels], p_tot_y[nSubPixels], p_tot[nSubPixels*nSubPixels];
|
double p_tot_x[nSubPixelsX], p_tot_y[nSubPixelsY], p_tot[nSubPixelsX*nSubPixelsY];
|
||||||
double maxdiff=0, mindiff=avg*nSubPixels*nSubPixels;
|
double maxdiff=0, mindiff=avg*nSubPixelsX*nSubPixelsY;
|
||||||
|
|
||||||
int ipx, ipy;
|
int ipx, ipy;
|
||||||
for (ipy=0; ipy<nSubPixels; ipy++) {
|
for (ipy=0; ipy<nSubPixelsY; ipy++) {
|
||||||
for (ipx=0; ipx<nSubPixels; ipx++) {
|
for (ipx=0; ipx<nSubPixelsX; ipx++) {
|
||||||
p_tot[ipx+ipy*nSubPixels]=0;
|
p_tot[ipx+ipy*nSubPixelsX]=0;
|
||||||
}
|
}
|
||||||
p_tot_y[ipy]=0;
|
p_tot_y[ipy]=0;
|
||||||
p_tot_x[ipy]=0;
|
p_tot_x[ipy]=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int ibx=0; ibx<nbeta; ibx++) {
|
for (int ibx=0; ibx<nbetaX; ibx++) {
|
||||||
for (int iby=0; iby<nbeta; iby++) {
|
for (int iby=0; iby<nbetaY; iby++) {
|
||||||
ipx=hx[ibx+iby*nbeta]*nSubPixels;
|
ipx=hx[ibx+iby*nbetaX]*nSubPixelsX;
|
||||||
if (ipx<0) ipx=0;
|
if (ipx<0) ipx=0;
|
||||||
if (ipx>=nSubPixels) ipx=nSubPixels-1;
|
if (ipx>=nSubPixelsX) ipx=nSubPixelsX-1;
|
||||||
|
|
||||||
ipy=hy[ibx+iby*nbeta]*nSubPixels;
|
ipy=hy[ibx+iby*nbetaX]*nSubPixelsY;
|
||||||
if (ipy<0) ipy=0;
|
if (ipy<0) ipy=0;
|
||||||
if (ipy>=nSubPixels) ipy=nSubPixels-1;
|
if (ipy>=nSubPixelsY) ipy=nSubPixelsY-1;
|
||||||
|
|
||||||
p_tot[ipx+ipy*nSubPixels]+=heta[ibx+iby*nbeta];
|
|
||||||
p_tot_y[ipy]+=heta[ibx+iby*nbeta];
|
|
||||||
p_tot_x[ipx]+=heta[ibx+iby*nbeta];
|
|
||||||
|
|
||||||
|
|
||||||
|
p_tot[ipx+ipy*nSubPixelsX]+=heta[ibx+iby*nbetaX];
|
||||||
|
p_tot_y[ipy]+=heta[ibx+iby*nbetaX];
|
||||||
|
p_tot_x[ipx]+=heta[ibx+iby*nbetaX];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// cout << endl << endl;
|
// cout << endl << endl;
|
||||||
for (ipy=0; ipy<nSubPixels; ipy++) {
|
for (ipy=0; ipy<nSubPixelsY; ipy++) {
|
||||||
cout.width(5);
|
cout.width(5);
|
||||||
//flat_y[ipy]=p_tot_y[ipy];//avg/nSubPixels;
|
//flat_y[ipy]=p_tot_y[ipy];//avg/nSubPixels;
|
||||||
for (ipx=0; ipx<nSubPixels; ipx++) {
|
for (ipx=0; ipx<nSubPixelsX; ipx++) {
|
||||||
|
|
||||||
// flat_x[ipx]=p_tot_x[ipx];///avg/nSubPixels;
|
// flat_x[ipx]=p_tot_x[ipx];///avg/nSubPixels;
|
||||||
flat[ipx+nSubPixels*ipy]=p_tot[ipx+nSubPixels*ipy];///avg;
|
flat[ipx+nSubPixelsX*ipy]=p_tot[ipx+nSubPixelsX*ipy];///avg;
|
||||||
d=p_tot[ipx+nSubPixels*ipy]-avg;
|
d=p_tot[ipx+nSubPixelsX*ipy]-avg;
|
||||||
if (d<0) d*=-1.;
|
if (d<0) d*=-1.;
|
||||||
if (d>5*sqrt(avg) )
|
if (d>5*sqrt(avg) )
|
||||||
nbad++;
|
nbad++;
|
||||||
@ -354,8 +366,8 @@ float *gethhx()
|
|||||||
float *hhx;
|
float *hhx;
|
||||||
float *hhy;
|
float *hhy;
|
||||||
int *heta;
|
int *heta;
|
||||||
int nbeta;
|
int nbetaX, nbetaY;
|
||||||
double etamin, etamax, etastep;
|
double etamin, etamax, etastepX, etastepY;
|
||||||
double rangeMin, rangeMax;
|
double rangeMin, rangeMax;
|
||||||
|
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
class etaInterpolationPosXY : public virtual etaInterpolationBase{
|
class etaInterpolationPosXY : public virtual etaInterpolationBase{
|
||||||
public:
|
public:
|
||||||
etaInterpolationPosXY(int nx=400, int ny=400, int ns=25, int nb=-1, double emin=1, double emax=0) : etaInterpolationBase(nx,ny,ns, nb, emin,emax){
|
etaInterpolationPosXY(int nx=400, int ny=400, int ns=25, int nsy=25, int nb=-1, int nby=-1, double emin=1, double emax=0) : etaInterpolationBase(nx,ny, ns, nsy, nb, nby, emin, emax){
|
||||||
// cout << "epxy " << nb << " " << emin << " " << emax << endl; cout << nbeta << " " << etamin << " " << etamax << endl;
|
// cout << "epxy " << nb << " " << emin << " " << emax << endl; cout << nbeta << " " << etamin << " " << etamax << endl;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -24,14 +24,6 @@ class etaInterpolationPosXY : public virtual etaInterpolationBase{
|
|||||||
virtual void prepareInterpolation(int &ok)
|
virtual void prepareInterpolation(int &ok)
|
||||||
{
|
{
|
||||||
ok=1;
|
ok=1;
|
||||||
#ifdef MYROOT1
|
|
||||||
if (hhx) delete hhx;
|
|
||||||
if (hhy) delete hhy;
|
|
||||||
|
|
||||||
hhx=new TH2D("hhx","hhx",heta->GetNbinsX(),heta->GetXaxis()->GetXmin(),heta->GetXaxis()->GetXmax(), heta->GetNbinsY(),heta->GetYaxis()->GetXmin(),heta->GetYaxis()->GetXmax());
|
|
||||||
hhy=new TH2D("hhy","hhy",heta->GetNbinsX(),heta->GetXaxis()->GetXmin(),heta->GetXaxis()->GetXmax(), heta->GetNbinsY(),heta->GetYaxis()->GetXmin(),heta->GetYaxis()->GetXmax());
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
///*Eta Distribution Rebinning*///
|
///*Eta Distribution Rebinning*///
|
||||||
@ -40,106 +32,128 @@ class etaInterpolationPosXY : public virtual etaInterpolationBase{
|
|||||||
double tot_eta=0;
|
double tot_eta=0;
|
||||||
double tot_eta_x=0;
|
double tot_eta_x=0;
|
||||||
double tot_eta_y=0;
|
double tot_eta_y=0;
|
||||||
for (int ip=0; ip<nbeta*nbeta; ip++)
|
for (int ip=0; ip<nbetaX*nbetaY; ip++)
|
||||||
tot_eta+=heta[ip];
|
tot_eta+=heta[ip];
|
||||||
cout << "total eta entries is :"<< tot_eta << endl;
|
cout << "total eta entries is :"<< tot_eta << endl;
|
||||||
if (tot_eta<=0) {ok=0; return;};
|
if (tot_eta<=0) {ok=0; return;};
|
||||||
|
|
||||||
|
|
||||||
double hx[nbeta]; //profile x
|
double hx[nbetaX]; //profile x
|
||||||
double hy[nbeta]; //profile y
|
double hy[nbetaY]; //profile y
|
||||||
double hix[nbeta]; //integral of projection x
|
double hix[nbetaX]; //integral of projection x
|
||||||
double hiy[nbeta]; //integral of projection y
|
double hiy[nbetaY]; //integral of projection y
|
||||||
// int ii=0;
|
// int ii=0;
|
||||||
double etax;//, etay;
|
double etax, etay;
|
||||||
for (int ib=0; ib<nbeta; ib++) {
|
for (int ib=0; ib<nbetaX; ib++) {
|
||||||
|
|
||||||
tot_eta_x=0;
|
|
||||||
tot_eta_y=0;
|
|
||||||
|
|
||||||
for (int iby=0; iby<nbeta; iby++) {
|
//tot_eta_y=0;
|
||||||
etax=etamin+iby*etastep;
|
|
||||||
|
for (int iby=0; iby<nbetaY; iby++) {
|
||||||
|
etay=etamin+iby*etastepY;
|
||||||
//cout << etax << endl;
|
//cout << etax << endl;
|
||||||
if (etax>=0 && etax<=1)
|
|
||||||
hx[iby]=heta[iby+ib*nbeta];
|
|
||||||
else {
|
|
||||||
hx[iby]=0;
|
|
||||||
}
|
|
||||||
// tot_eta_x+=hx[iby];
|
// tot_eta_x+=hx[iby];
|
||||||
if (etax>=0 && etax<=1)
|
if (etay>=0 && etay<=1)
|
||||||
hy[iby]=heta[ib+iby*nbeta];
|
hy[iby]=heta[ib+iby*nbetaX];
|
||||||
else
|
else
|
||||||
hy[iby]=0;
|
hy[iby]=0;
|
||||||
// tot_eta_y+=hy[iby];
|
// tot_eta_y+=hy[iby];
|
||||||
}
|
}
|
||||||
|
|
||||||
hix[0]=hx[0];
|
|
||||||
hiy[0]=hy[0];
|
hiy[0]=hy[0];
|
||||||
|
|
||||||
for (int iby=1; iby<nbeta; iby++) {
|
for (int iby=1; iby<nbetaY; iby++) {
|
||||||
hix[iby]=hix[iby-1]+hx[iby];
|
|
||||||
hiy[iby]=hiy[iby-1]+hy[iby];
|
hiy[iby]=hiy[iby-1]+hy[iby];
|
||||||
}
|
}
|
||||||
|
|
||||||
// ii=0;
|
tot_eta_y=hiy[nbetaY-1]+1;
|
||||||
tot_eta_x=hix[nbeta-1]+1;
|
|
||||||
tot_eta_y=hiy[nbeta-1]+1;
|
|
||||||
|
|
||||||
for (int ibx=0; ibx<nbeta; ibx++) {
|
for (int iby=0; iby<nbetaY; iby++) {
|
||||||
if (tot_eta_x<=0) {
|
|
||||||
hhx[ibx+ib*nbeta]=-1;
|
|
||||||
//ii=(ibx)/nbeta;
|
|
||||||
} else //if (hix[ibx]>(ii+1)*tot_eta_x*bsize)
|
|
||||||
{
|
|
||||||
//if (hix[ibx]>tot_eta_x*(ii+1)/nSubPixels) ii++;
|
|
||||||
hhx[ibx+ib*nbeta]=hix[ibx]/tot_eta_x;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* if (ii!=(nSubPixels-1)) */
|
|
||||||
/* cout << ib << " x " << tot_eta_x << " " << (ii+1)*tot_eta_x*bsize << " " << ii << " " << hix[nbeta-1]<< endl; */
|
|
||||||
|
|
||||||
//ii=0;
|
|
||||||
|
|
||||||
for (int ibx=0; ibx<nbeta; ibx++) {
|
|
||||||
if (tot_eta_y<=0) {
|
if (tot_eta_y<=0) {
|
||||||
hhy[ib+ibx*nbeta]=-1;
|
hhy[ib+iby*nbetaX]=-1;
|
||||||
//ii=(ibx*nSubPixels)/nbeta;
|
//ii=(ibx*nSubPixels)/nbeta;
|
||||||
} else {
|
} else {
|
||||||
//if (hiy[ibx]>tot_eta_y*(ii+1)/nSubPixels) ii++;
|
//if (hiy[ibx]>tot_eta_y*(ii+1)/nSubPixels) ii++;
|
||||||
hhy[ib+ibx*nbeta]=hiy[ibx]/tot_eta_y;
|
hhy[ib+iby*nbetaX]=hiy[iby]/tot_eta_y;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
for (int ib=0; ib<nbetaY; ib++) {
|
||||||
|
|
||||||
|
for (int ibx=0; ibx<nbetaX; ibx++) {
|
||||||
|
etax=etamin+ibx*etastepX;
|
||||||
|
//cout << etax << endl;
|
||||||
|
if (etax>=0 && etax<=1)
|
||||||
|
hx[ibx]=heta[ibx+ib*nbetaX];
|
||||||
|
else {
|
||||||
|
hx[ibx]=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
hix[0]=hx[0];
|
||||||
|
|
||||||
|
for (int ibx=1; ibx<nbetaX; ibx++) {
|
||||||
|
hix[ibx]=hix[ibx-1]+hx[ibx];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
tot_eta_x=hix[nbetaX-1]+1;
|
||||||
|
|
||||||
|
for (int ibx=0; ibx<nbetaX; ibx++) {
|
||||||
|
if (tot_eta_x<=0) {
|
||||||
|
hhx[ibx+ib*nbetaX]=-1;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
hhx[ibx+ib*nbetaX]=hix[ibx]/tot_eta_x;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
for (int ibx=0; ibx<nbetaX; ibx++) {
|
||||||
|
if (tot_eta_x<=0) {
|
||||||
|
hhx[ibx+ib*nbetaX]=-1;
|
||||||
|
} else {
|
||||||
|
//if (hix[ibx]>tot_eta_x*(ii+1)/nSubPixels) ii++;
|
||||||
|
hhx[ibx+ib*nbetaX]=hix[ibx]/tot_eta_x;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int ibx, iby, ib;
|
int ibx, iby, ib;
|
||||||
|
|
||||||
iby=0;
|
iby=0;
|
||||||
while (hhx[iby*nbeta+nbeta/2]<0) iby++;
|
while (hhx[iby*nbetaY+nbetaY/2]<0) iby++;
|
||||||
for (ib=0; ib<iby;ib++) {
|
for (ib=0; ib<iby;ib++) {
|
||||||
for (ibx=0; ibx<nbeta;ibx++)
|
for (ibx=0; ibx<nbetaX;ibx++)
|
||||||
hhx[ibx+nbeta*ib]=hhx[ibx+nbeta*iby];
|
hhx[ibx+nbetaX*ib]=hhx[ibx+nbetaX*iby];
|
||||||
}
|
}
|
||||||
iby=nbeta-1;
|
iby=nbetaY-1;
|
||||||
|
|
||||||
while (hhx[iby*nbeta+nbeta/2]<0) iby--;
|
while (hhx[iby*nbetaY+nbetaY/2]<0) iby--;
|
||||||
for (ib=iby+1; ib<nbeta;ib++) {
|
for (ib=iby+1; ib<nbetaY;ib++) {
|
||||||
for (ibx=0; ibx<nbeta;ibx++)
|
for (ibx=0; ibx<nbetaX;ibx++)
|
||||||
hhx[ibx+nbeta*ib]=hhx[ibx+nbeta*iby];
|
hhx[ibx+nbetaX*ib]=hhx[ibx+nbetaX*iby];
|
||||||
}
|
}
|
||||||
|
|
||||||
iby=0;
|
iby=0;
|
||||||
while (hhy[nbeta/2*nbeta+iby]<0) iby++;
|
while (hhy[nbetaX/2*nbetaX+iby]<0) iby++;
|
||||||
for (ib=0; ib<iby;ib++) {
|
for (ib=0; ib<iby;ib++) {
|
||||||
for (ibx=0; ibx<nbeta;ibx++)
|
for (ibx=0; ibx<nbetaY;ibx++)
|
||||||
hhy[ib+nbeta*ibx]=hhy[iby+nbeta*ibx];
|
hhy[ib+nbetaX*ibx]=hhy[iby+nbetaX*ibx];
|
||||||
}
|
}
|
||||||
iby=nbeta-1;
|
iby=nbetaX-1;
|
||||||
|
|
||||||
while (hhy[nbeta/2*nbeta+iby]<0) iby--;
|
while (hhy[nbetaX/2*nbetaX+iby]<0) iby--;
|
||||||
for (ib=iby+1; ib<nbeta;ib++) {
|
for (ib=iby+1; ib<nbetaX;ib++) {
|
||||||
for (ibx=0; ibx<nbeta;ibx++)
|
for (ibx=0; ibx<nbetaY;ibx++)
|
||||||
hhy[ib+nbeta*ibx]=hhy[iby+nbeta*ibx];
|
hhy[ib+nbetaX*ibx]=hhy[iby+nbetaX*ibx];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -156,9 +170,16 @@ class etaInterpolationPosXY : public virtual etaInterpolationBase{
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class eta2InterpolationPosXY : public virtual eta2InterpolationBase, public virtual etaInterpolationPosXY {
|
class eta2InterpolationPosXY : public virtual eta2InterpolationBase, public virtual etaInterpolationPosXY {
|
||||||
public:
|
public:
|
||||||
eta2InterpolationPosXY(int nx=400, int ny=400, int ns=25, int nb=-1, double emin=1, double emax=0) : etaInterpolationBase(nx,ny,ns, nb, emin,emax),eta2InterpolationBase(nx,ny,ns, nb, emin,emax),etaInterpolationPosXY(nx,ny,ns, nb, emin,emax){
|
eta2InterpolationPosXY(int nx=400, int ny=400, int ns=25, int nsy=25, int nb=-1, int nby=-1, double emin=1, double emax=0) : etaInterpolationBase(nx,ny, ns, nsy, nb, nby, emin, emax),eta2InterpolationBase(nx,ny, ns, nsy, nb, nby, emin, emax),etaInterpolationPosXY(nx,ny, ns, nsy, nb, nby, emin, emax){
|
||||||
// cout << "e2pxy " << nb << " " << emin << " " << emax << endl;
|
// cout << "e2pxy " << nb << " " << emin << " " << emax << endl;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -172,8 +193,8 @@ class eta2InterpolationPosXY : public virtual eta2InterpolationBase, public virt
|
|||||||
|
|
||||||
class eta3InterpolationPosXY : public virtual eta3InterpolationBase, public virtual etaInterpolationPosXY {
|
class eta3InterpolationPosXY : public virtual eta3InterpolationBase, public virtual etaInterpolationPosXY {
|
||||||
public:
|
public:
|
||||||
eta3InterpolationPosXY(int nx=400, int ny=400, int ns=25, int nb=-1, double emin=1, double emax=0) : etaInterpolationBase(nx,ny,ns, nb, emin,emax),eta3InterpolationBase(nx,ny,ns, nb, emin,emax), etaInterpolationPosXY(nx,ny,ns, nb, emin,emax){
|
eta3InterpolationPosXY(int nx=400, int ny=400, int ns=25, int nsy=25, int nb=-1, int nby=-1, double emin=1, double emax=0) : etaInterpolationBase(nx,ny, ns, nsy, nb, nby, emin, emax),eta3InterpolationBase(nx,ny, ns, nsy, nb, nby, emin, emax), etaInterpolationPosXY(nx,ny, ns, nsy, nb, nby, emin, emax){
|
||||||
cout << "e3pxy " << nbeta << " " << etamin << " " << etamax << " " << nSubPixels<< endl;
|
// cout << "e3pxy " << nbeta << " " << etamin << " " << etamax << " " << nSubPixels<< endl;
|
||||||
};
|
};
|
||||||
|
|
||||||
eta3InterpolationPosXY(eta3InterpolationPosXY *orig): etaInterpolationBase(orig), etaInterpolationPosXY(orig) {};
|
eta3InterpolationPosXY(eta3InterpolationPosXY *orig): etaInterpolationBase(orig), etaInterpolationPosXY(orig) {};
|
||||||
|
@ -29,19 +29,21 @@ class slsInterpolation
|
|||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
slsInterpolation(int nx=400, int ny=400, int ns=25) :nPixelsX(nx), nPixelsY(ny), nSubPixels(ns), id(0) {
|
slsInterpolation(int nx=400, int ny=400, int ns=25, int nsy=-1) :nPixelsX(nx), nPixelsY(ny), nSubPixelsX(ns), nSubPixelsY(nsy),id(0) {
|
||||||
|
|
||||||
hint=new int[ns*nx*ns*ny];
|
if (nSubPixelsY<=0) nSubPixelsY=nSubPixelsX;
|
||||||
|
hint=new int[nSubPixelsX*nx*nSubPixelsY*ny];
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
slsInterpolation(slsInterpolation *orig){
|
slsInterpolation(slsInterpolation *orig){
|
||||||
nPixelsX=orig->nPixelsX;
|
nPixelsX=orig->nPixelsX;
|
||||||
nPixelsY=orig->nPixelsY;
|
nPixelsY=orig->nPixelsY;
|
||||||
nSubPixels=orig->nSubPixels;
|
nSubPixelsX=orig->nSubPixelsX;
|
||||||
|
nSubPixelsY=orig->nSubPixelsY;
|
||||||
|
|
||||||
hint=new int[nSubPixels*nPixelsX*nSubPixels*nPixelsY];
|
hint=new int[nSubPixelsX*nPixelsX*nSubPixelsY*nPixelsY];
|
||||||
memcpy(hint, orig->hint,nSubPixels*nPixelsX*nSubPixels*nPixelsY*sizeof(int));
|
memcpy(hint, orig->hint,nSubPixelsX*nPixelsX*nSubPixelsY*nPixelsY*sizeof(int));
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -51,23 +53,37 @@ class slsInterpolation
|
|||||||
return new slsInterpolation(this);
|
return new slsInterpolation(this);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
int getNSubPixels() {return nSubPixels;};
|
int getNSubPixelsX() {return nSubPixelsX;};
|
||||||
|
int getNSubPixelsY() {return nSubPixelsY;};
|
||||||
|
int getNSubPixels() {if (nSubPixelsX==nSubPixelsY) return nSubPixelsX; else return 0;};
|
||||||
|
void getNSubPixels(int &nsx, int &nsy) {nsx=nSubPixelsX; nsy=nsx=nSubPixelsY;}
|
||||||
|
|
||||||
|
void setNSubPixels(int ns, int nsy=-1) {
|
||||||
|
|
||||||
int setNSubPixels(int ns) {
|
|
||||||
if (ns>0 && ns!=nSubPixels) {
|
|
||||||
delete [] hint;
|
delete [] hint;
|
||||||
nSubPixels=ns;
|
nSubPixelsX=ns;
|
||||||
hint=new int[nSubPixels*nPixelsX*nSubPixels*nPixelsY];
|
if (nsy>0) nSubPixelsY=nsy;
|
||||||
}
|
else nSubPixelsY=ns;
|
||||||
return nSubPixels;
|
|
||||||
|
hint=new int[nSubPixelsX*nPixelsX*nSubPixelsY*nPixelsY];
|
||||||
|
|
||||||
|
//return nSubPixels;
|
||||||
}
|
}
|
||||||
|
|
||||||
int getImageSize(int &nnx, int &nny, int &ns) {
|
|
||||||
nnx=nSubPixels*nPixelsX;
|
|
||||||
nny=nSubPixels*nPixelsY;
|
|
||||||
ns=nSubPixels;
|
int getImageSize(int &nnx, int &nny, int &nsx, int &nsy) {
|
||||||
return nSubPixels*nSubPixels*nPixelsX*nPixelsY;
|
nnx=nSubPixelsX*nPixelsX;
|
||||||
|
nny=nSubPixelsY*nPixelsY;
|
||||||
|
nsx=nSubPixelsX;
|
||||||
|
nsy=nSubPixelsY;
|
||||||
|
return nSubPixelsX*nSubPixelsY*nPixelsX*nPixelsY;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
int getImageSize() {
|
||||||
|
return nSubPixelsX*nSubPixelsY*nPixelsX*nPixelsY;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -92,14 +108,14 @@ class slsInterpolation
|
|||||||
//cout << "!" <<endl;
|
//cout << "!" <<endl;
|
||||||
float *gm=NULL;
|
float *gm=NULL;
|
||||||
int *dummy=getInterpolatedImage();
|
int *dummy=getInterpolatedImage();
|
||||||
gm=new float[ nSubPixels* nSubPixels* nPixelsX*nPixelsY];
|
gm=new float[ nSubPixelsX* nSubPixelsY* nPixelsX*nPixelsY];
|
||||||
if (gm) {
|
if (gm) {
|
||||||
for (int ix=0; ix<nPixelsX*nSubPixels; ix++) {
|
for (int ix=0; ix<nPixelsX*nSubPixelsX; ix++) {
|
||||||
for (int iy=0; iy<nPixelsY*nSubPixels; iy++) {
|
for (int iy=0; iy<nPixelsY*nSubPixelsY; iy++) {
|
||||||
gm[iy*nPixelsX*nSubPixels+ix]=dummy[iy*nPixelsX*nSubPixels+ix];
|
gm[iy*nPixelsX*nSubPixelsX+ix]=dummy[iy*nPixelsX*nSubPixelsX+ix];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
WriteToTiff(gm, imgname,nSubPixels* nPixelsX ,nSubPixels* nPixelsY);
|
WriteToTiff(gm, imgname,nSubPixelsY* nPixelsX ,nSubPixelsY* nPixelsY);
|
||||||
delete [] gm;
|
delete [] gm;
|
||||||
} else cout << "Could not allocate float image " << endl;
|
} else cout << "Could not allocate float image " << endl;
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -120,9 +136,9 @@ class slsInterpolation
|
|||||||
virtual void clearInterpolatedImage() {
|
virtual void clearInterpolatedImage() {
|
||||||
|
|
||||||
|
|
||||||
for (int ix=0; ix<nPixelsX*nSubPixels; ix++) {
|
for (int ix=0; ix<nPixelsX*nSubPixelsX; ix++) {
|
||||||
for (int iy=0; iy<nPixelsY*nSubPixels; iy++) {
|
for (int iy=0; iy<nPixelsY*nSubPixelsY; iy++) {
|
||||||
hint[iy*nPixelsX*nSubPixels+ix]=0;
|
hint[iy*nPixelsX*nSubPixelsX+ix]=0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,11 +149,11 @@ class slsInterpolation
|
|||||||
|
|
||||||
|
|
||||||
virtual int *addToImage(double int_x, double int_y){
|
virtual int *addToImage(double int_x, double int_y){
|
||||||
int iy=((double)nSubPixels)*int_y;
|
int iy=((double)nSubPixelsY)*int_y;
|
||||||
int ix=((double)nSubPixels)*int_x;
|
int ix=((double)nSubPixelsX)*int_x;
|
||||||
if (ix>=0 && ix<(nPixelsX*nSubPixels) && iy<(nSubPixels*nPixelsY) && iy>=0 ){
|
if (ix>=0 && ix<(nPixelsX*nSubPixelsX) && iy<(nSubPixelsY*nPixelsY) && iy>=0 ){
|
||||||
// cout << int_x << " " << int_y << " " << " " << ix << " " << iy << " " << ix+iy*nPixelsX*nSubPixels << " " << hint[ix+iy*nPixelsX*nSubPixels];
|
// cout << int_x << " " << int_y << " " << " " << ix << " " << iy << " " << ix+iy*nPixelsX*nSubPixels << " " << hint[ix+iy*nPixelsX*nSubPixels];
|
||||||
(*(hint+ix+iy*nPixelsX*nSubPixels))+=1;
|
(*(hint+ix+iy*nPixelsX*nSubPixelsX))+=1;
|
||||||
// cout << " " << hint[ix+iy*nPixelsX*nSubPixels] << endl;
|
// cout << " " << hint[ix+iy*nPixelsX*nSubPixels] << endl;
|
||||||
}// else
|
}// else
|
||||||
// cout << "bad! "<< int_x << " " << int_y << " " << " " << ix << " " << iy << " " << ix+iy*nPixelsX*nSubPixels << endl;
|
// cout << "bad! "<< int_x << " " << int_y << " " << " " << ix << " " << iy << " " << ix+iy*nPixelsX*nSubPixels << endl;
|
||||||
@ -180,11 +196,12 @@ class slsInterpolation
|
|||||||
/* cluster[2]=cl+6; */
|
/* cluster[2]=cl+6; */
|
||||||
|
|
||||||
sum=0;
|
sum=0;
|
||||||
|
int xoff=0, yoff=0;
|
||||||
|
#ifndef WRITE_QUAD
|
||||||
double sumBL=0;
|
double sumBL=0;
|
||||||
double sumTL=0;
|
double sumTL=0;
|
||||||
double sumBR=0;
|
double sumBR=0;
|
||||||
double sumTR=0;
|
double sumTR=0;
|
||||||
int xoff=0, yoff=0;
|
|
||||||
for (int ix=0; ix<3; ix++) {
|
for (int ix=0; ix<3; ix++) {
|
||||||
for (int iy=0; iy<3; iy++) {
|
for (int iy=0; iy<3; iy++) {
|
||||||
sum+=cl[ix+3*iy];
|
sum+=cl[ix+3*iy];
|
||||||
@ -204,34 +221,95 @@ class slsInterpolation
|
|||||||
|
|
||||||
|
|
||||||
if(sumTL >= totquad){
|
if(sumTL >= totquad){
|
||||||
/* sDum[0][0] = cluster[1][0]; sDum[1][0] = cluster[2][0]; */
|
/* #ifdef WRITE_QUAD */
|
||||||
/* sDum[0][1] = cluster[1][1]; sDum[1][1] = cluster[2][1]; */
|
/* /\* sDum[0][0] = cluster[1][0]; sDum[1][0] = cluster[2][0]; *\/ */
|
||||||
|
/* /\* sDum[0][1] = cluster[1][1]; sDum[1][1] = cluster[2][1]; *\/ */
|
||||||
|
/* if (sumTL ==sum) { */
|
||||||
|
/* #endif */
|
||||||
corner = TOP_LEFT;
|
corner = TOP_LEFT;
|
||||||
totquad=sumTL;
|
totquad=sumTL;
|
||||||
xoff=0;
|
xoff=0;
|
||||||
yoff=1;
|
yoff=1;
|
||||||
|
/* #ifdef WRITE_QUAD */
|
||||||
|
/* } */
|
||||||
|
/* #endif */
|
||||||
}
|
}
|
||||||
|
|
||||||
if(sumBR >= totquad){
|
if(sumBR >= totquad){
|
||||||
/* sDum[0][0] = cluster[0][1]; sDum[1][0] = cluster[1][1]; */
|
/* sDum[0][0] = cluster[0][1]; sDum[1][0] = cluster[1][1]; */
|
||||||
/* sDum[0][1] = cluster[0][2]; sDum[1][1] = cluster[1][2]; */
|
/* sDum[0][1] = cluster[0][2]; sDum[1][1] = cluster[1][2]; */
|
||||||
|
|
||||||
|
/* #ifdef WRITE_QUAD */
|
||||||
|
/* /\* sDum[0][0] = cluster[1][0]; sDum[1][0] = cluster[2][0]; *\/ */
|
||||||
|
/* /\* sDum[0][1] = cluster[1][1]; sDum[1][1] = cluster[2][1]; *\/ */
|
||||||
|
/* if (sumBR ==sum) { */
|
||||||
|
/* #endif */
|
||||||
|
corner = BOTTOM_RIGHT;
|
||||||
xoff=1;
|
xoff=1;
|
||||||
yoff=0;
|
yoff=0;
|
||||||
corner = BOTTOM_RIGHT;
|
|
||||||
totquad=sumBR;
|
totquad=sumBR;
|
||||||
|
/* #ifdef WRITE_QUAD */
|
||||||
|
/* } */
|
||||||
|
/* #endif */
|
||||||
}
|
}
|
||||||
|
|
||||||
if(sumTR >= totquad){
|
if(sumTR >= totquad){
|
||||||
|
/* #ifdef WRITE_QUAD */
|
||||||
|
/* /\* sDum[0][0] = cluster[1][0]; sDum[1][0] = cluster[2][0]; *\/ */
|
||||||
|
/* /\* sDum[0][1] = cluster[1][1]; sDum[1][1] = cluster[2][1]; *\/ */
|
||||||
|
/* if (sumTR ==sum) { */
|
||||||
|
/* #endif */
|
||||||
xoff=1;
|
xoff=1;
|
||||||
yoff=1;
|
yoff=1;
|
||||||
/* sDum[0][0] = cluster[1][1]; sDum[1][0] = cluster[2][1]; */
|
/* sDum[0][0] = cluster[1][1]; sDum[1][0] = cluster[2][1]; */
|
||||||
/* sDum[0][1] = cluster[1][2]; sDum[1][1] = cluster[2][2]; */
|
/* sDum[0][1] = cluster[1][2]; sDum[1][1] = cluster[2][2]; */
|
||||||
corner = TOP_RIGHT;
|
corner = TOP_RIGHT;
|
||||||
totquad=sumTR;
|
totquad=sumTR;
|
||||||
|
/* #ifdef WRITE_QUAD */
|
||||||
|
/* } */
|
||||||
|
/* #endif */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
#ifdef WRITE_QUAD
|
||||||
|
|
||||||
|
double sumB=0;
|
||||||
|
double sumT=0;
|
||||||
|
double sumR=0;
|
||||||
|
double sumL=0;
|
||||||
|
|
||||||
|
for (int ix=0; ix<3; ix++) {
|
||||||
|
for (int iy=0; iy<3; iy++) {
|
||||||
|
sum+=cl[ix+3*iy];
|
||||||
|
if (ix<1 ) sumL+=cl[ix+iy*3];
|
||||||
|
if (ix>1) sumR+=cl[ix+iy*3];
|
||||||
|
if (iy<1) sumB=cl[ix+iy*3];
|
||||||
|
if (iy>1) sumT+=cl[ix+iy*3];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
totquad=sum;
|
||||||
|
if ( sumT==0 && sumR==0) {
|
||||||
|
corner = BOTTOM_LEFT;
|
||||||
|
xoff=0;
|
||||||
|
yoff=0;
|
||||||
|
} else if ( sumB==0 && sumR==0 ) {
|
||||||
|
corner = TOP_LEFT;
|
||||||
|
xoff=0;
|
||||||
|
yoff=1;
|
||||||
|
} else if ( sumT==0 && sumL==0) {
|
||||||
|
corner = BOTTOM_RIGHT;
|
||||||
|
xoff=1;
|
||||||
|
yoff=0;
|
||||||
|
} else if ( sumB==0 && sumL==0) {
|
||||||
|
xoff=1;
|
||||||
|
yoff=1;
|
||||||
|
corner = TOP_RIGHT;
|
||||||
|
} else
|
||||||
|
printf("** bad 2x2 cluster!\n");
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
for (int ix=0; ix<2; ix++) {
|
for (int ix=0; ix<2; ix++) {
|
||||||
for (int iy=0; iy<2; iy++) {
|
for (int iy=0; iy<2; iy++) {
|
||||||
@ -495,7 +573,7 @@ class slsInterpolation
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
int nPixelsX, nPixelsY;
|
int nPixelsX, nPixelsY;
|
||||||
int nSubPixels;
|
int nSubPixelsX, nSubPixelsY;
|
||||||
int id;
|
int id;
|
||||||
int *hint;
|
int *hint;
|
||||||
};
|
};
|
||||||
|
@ -1,18 +1,21 @@
|
|||||||
|
|
||||||
INCDIR= -I. -I../dataStructures ../tiffIO.cpp -I../ -I../interpolations/ -I../../slsSupportLib/include/ -I../../slsReceiverSoftware/include/ -I../../libs/rapidjson/
|
INCDIR= -I. -I../dataStructures ../tiffIO.cpp -I../ -I../interpolations/ -I../../slsSupportLib/include/ -I../../slsReceiverSoftware/include/ -I../../libs/rapidjson/
|
||||||
LDFLAG= -L/usr/lib64/ -lpthread -lm -lstdc++ -lzmq -pthread -lrt -ltiff -O3 -g -std=c++11 -Wall
|
LDFLAG= -L/usr/lib64/ -lpthread -lm -lstdc++ -lzmq -pthread -lrt -ltiff -O3 -std=c++11 -Wall -L../../build/bin/ -lSlsSupport
|
||||||
#-L../../bin -lhdf5 -L.
|
#-L../../bin -lhdf5 -L.
|
||||||
|
|
||||||
#DESTDIR?=../bin
|
#DESTDIR?=../bin
|
||||||
|
|
||||||
all: moenchZmqProcess moenchZmqProcessCtbGui
|
all: moenchZmqProcess moenchZmq04Process
|
||||||
|
#moenchZmqProcessCtbGui
|
||||||
|
|
||||||
moenchZmqProcess: moenchZmqProcess.cpp clean
|
moenchZmqProcess: moenchZmqProcess.cpp clean
|
||||||
g++ -o moenchZmqProcess moenchZmqProcess.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DNEWZMQ -DINTERP
|
g++ -o moenchZmqProcess moenchZmqProcess.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DNEWZMQ -DINTERP
|
||||||
|
|
||||||
moenchZmqProcessCtbGui: moenchZmqProcess.cpp clean
|
moenchZmq04Process: moenchZmqProcess.cpp clean
|
||||||
g++ -o moenchZmqProcessCtbGui moenchZmqProcess.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DNEWZMQ -DINTERP -DCTBGUI
|
g++ -o moench04ZmqProcess moenchZmqProcess.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DNEWZMQ -DINTERP -DMOENCH04
|
||||||
|
|
||||||
|
#moenchZmqProcessCtbGui: moenchZmqProcess.cpp clean
|
||||||
|
# g++ -o moenchZmqProcessCtbGui moenchZmqProcess.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DNEWZMQ -DINTERP -DCTBGUI
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f moenchZmqProcess
|
rm -f moenchZmqProcess
|
||||||
|
@ -16,7 +16,8 @@
|
|||||||
|
|
||||||
//#include "etaInterpolationPosXY.h"
|
//#include "etaInterpolationPosXY.h"
|
||||||
#include "noInterpolation.h"
|
#include "noInterpolation.h"
|
||||||
#include "etaInterpolationCleverAdaptiveBins.h"
|
#include "etaInterpolationPosXY.h"
|
||||||
|
//#include "etaInterpolationCleverAdaptiveBins.h"
|
||||||
//#include "etaInterpolationRandomBins.h"
|
//#include "etaInterpolationRandomBins.h"
|
||||||
using namespace std;
|
using namespace std;
|
||||||
#define NC 400
|
#define NC 400
|
||||||
|
@ -1,13 +1,24 @@
|
|||||||
#define WRITE_QUAD
|
//#define WRITE_QUAD
|
||||||
#define DEVELOPER
|
#define DEVELOPER
|
||||||
|
#undef CORR
|
||||||
#define C_GHOST 0.0004
|
#define C_GHOST 0.0004
|
||||||
|
|
||||||
#define CM_ROWS 20
|
#define CM_ROWS 20
|
||||||
|
|
||||||
#include "sls_detector_defs.h"
|
#include "sls_detector_defs.h"
|
||||||
#include "ZmqSocket.h"
|
#include "ZmqSocket.h"
|
||||||
|
#ifndef RECT
|
||||||
|
#ifndef MOENCH04
|
||||||
#include "moench03T1ZmqDataNew.h"
|
#include "moench03T1ZmqDataNew.h"
|
||||||
|
#endif
|
||||||
|
#ifdef MOENCH04
|
||||||
|
#include "moench04CtbZmq10GbData.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
#ifdef RECT
|
||||||
|
#include "moench03T1ZmqDataNewRect.h"
|
||||||
|
#endif
|
||||||
#include "moench03GhostSummation.h"
|
#include "moench03GhostSummation.h"
|
||||||
#include "moench03CommonMode.h"
|
#include "moench03CommonMode.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@ -31,12 +42,12 @@
|
|||||||
#include "ansi.h"
|
#include "ansi.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
//#include <chrono>
|
#include <chrono>
|
||||||
#include <ctime> // time_t
|
#include <ctime> // time_t
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
//using namespace std::chrono;
|
using namespace std::chrono;
|
||||||
|
|
||||||
//#define SLS_DETECTOR_JSON_HEADER_VERSION 0x2
|
//#define SLS_DETECTOR_JSON_HEADER_VERSION 0x2
|
||||||
|
|
||||||
@ -49,10 +60,11 @@ int main(int argc, char *argv[]) {
|
|||||||
*/
|
*/
|
||||||
FILE *of=NULL;
|
FILE *of=NULL;
|
||||||
int fifosize=5000;
|
int fifosize=5000;
|
||||||
int etabins=1000;//nsubpix*2*100;
|
int etabins=1000, etabinsy=1000;//nsubpix*2*100;
|
||||||
double etamin=-1, etamax=2;
|
double etamin=-1, etamax=2;
|
||||||
int nSubPixels=2;
|
int nSubPixelsX=2;
|
||||||
// int emin, emax;
|
// int emin, emax;
|
||||||
|
int nSubPixelsY=2;
|
||||||
// help
|
// help
|
||||||
if (argc < 3 ) {
|
if (argc < 3 ) {
|
||||||
cprintf(RED, "Help: ./trial [receive socket ip] [receive starting port number] [send_socket ip] [send starting port number] [nthreads] [nsubpix] [gainmap] [etafile]\n");
|
cprintf(RED, "Help: ./trial [receive socket ip] [receive starting port number] [send_socket ip] [send starting port number] [nthreads] [nsubpix] [gainmap] [etafile]\n");
|
||||||
@ -67,21 +79,20 @@ int main(int argc, char *argv[]) {
|
|||||||
char* socketip2 = 0;
|
char* socketip2 = 0;
|
||||||
uint32_t portnum2 = 0;
|
uint32_t portnum2 = 0;
|
||||||
|
|
||||||
|
zmqHeader zHeader, outHeader;
|
||||||
|
zHeader.jsonversion = SLS_DETECTOR_JSON_HEADER_VERSION;
|
||||||
|
outHeader.jsonversion = SLS_DETECTOR_JSON_HEADER_VERSION;
|
||||||
|
|
||||||
uint32_t nSigma=5;
|
uint32_t nSigma=5;
|
||||||
|
|
||||||
int ok;
|
int ok;
|
||||||
|
|
||||||
// high_resolution_clock::time_point t1;
|
high_resolution_clock::time_point t1;
|
||||||
// high_resolution_clock::time_point t2 ;
|
high_resolution_clock::time_point t2 ;
|
||||||
time_t begin,end,finished;
|
std::chrono::steady_clock::time_point begin,end,finished;
|
||||||
|
//time_t begin,end,finished;
|
||||||
int rms=0;
|
int rms=0;
|
||||||
|
|
||||||
int nped=1000, nped0=100;
|
|
||||||
|
|
||||||
#ifdef PTC
|
|
||||||
nped=10000;
|
|
||||||
nped0=10000;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
if (argc > 4) {
|
if (argc > 4) {
|
||||||
@ -101,10 +112,14 @@ int main(int argc, char *argv[]) {
|
|||||||
nthreads=atoi(argv[5]);
|
nthreads=atoi(argv[5]);
|
||||||
|
|
||||||
cout << "Number of threads is: " << nthreads << endl;
|
cout << "Number of threads is: " << nthreads << endl;
|
||||||
if (argc>6)
|
if (argc>6) {
|
||||||
nSubPixels=atoi(argv[6]);
|
nSubPixelsX=atoi(argv[6]);
|
||||||
cout << "Number of subpixels is: " << nSubPixels << endl;
|
nSubPixelsY=nSubPixelsX;
|
||||||
|
#ifdef RECT
|
||||||
|
nSubPixelsX=2;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
cout << "Number of subpixels is: " << nSubPixelsX << " " << nSubPixelsY << endl;
|
||||||
|
|
||||||
char *gainfname=NULL;
|
char *gainfname=NULL;
|
||||||
if (argc>7) {
|
if (argc>7) {
|
||||||
@ -119,12 +134,17 @@ int main(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//slsDetectorData *det=new moench03T1ZmqDataNew();
|
//slsDetectorData *det=new moench03T1ZmqDataNew();
|
||||||
moench03T1ZmqDataNew *det=new moench03T1ZmqDataNew(5000,sizeof(int));
|
#ifndef MOENCH04
|
||||||
|
moench03T1ZmqDataNew *det=new moench03T1ZmqDataNew();
|
||||||
|
#endif
|
||||||
|
#ifdef MOENCH04
|
||||||
|
moench04CtbZmq10GbData *det=new moench04CtbZmq10GbData();
|
||||||
|
#endif
|
||||||
cout << endl << " det" <<endl;
|
cout << endl << " det" <<endl;
|
||||||
int npx, npy;
|
int npx, npy;
|
||||||
det->getDetectorSize(npx, npy);
|
det->getDetectorSize(npx, npy);
|
||||||
|
|
||||||
|
int send_something=0;
|
||||||
|
|
||||||
|
|
||||||
int maxSize = npx*npy*2;//32*2*8192;//5000;//atoi(argv[3]);
|
int maxSize = npx*npy*2;//32*2*8192;//5000;//atoi(argv[3]);
|
||||||
@ -135,17 +155,16 @@ int main(int argc, char *argv[]) {
|
|||||||
char dummybuff[size];
|
char dummybuff[size];
|
||||||
|
|
||||||
|
|
||||||
int ncol_cm=CM_ROWS;
|
|
||||||
double xt_ghost=C_GHOST;
|
|
||||||
|
|
||||||
|
|
||||||
moench03CommonMode *cm=NULL;
|
moench03CommonMode *cm=NULL;
|
||||||
moench03GhostSummation *gs=NULL;
|
moench03GhostSummation *gs=NULL;
|
||||||
#ifdef CORR
|
#ifdef CORR
|
||||||
cm=new moench03CommonMode(ncol_cm);
|
|
||||||
gs=new moench03GhostSummation(det, xt_ghost);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
//int ncol_cm=CM_ROWS;
|
||||||
|
//double xt_ghost=C_GHOST;
|
||||||
|
|
||||||
|
cm=new moench03CommonMode(CM_ROWS);
|
||||||
|
gs=new moench03GhostSummation(det, C_GHOST);
|
||||||
|
#endif
|
||||||
double *gainmap=NULL;
|
double *gainmap=NULL;
|
||||||
float *gm;
|
float *gm;
|
||||||
double *gmap=NULL;
|
double *gmap=NULL;
|
||||||
@ -173,18 +192,18 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
//analogDetector<uint16_t> *filter=new analogDetector<uint16_t>(det,1,NULL,1000);
|
//analogDetector<uint16_t> *filter=new analogDetector<uint16_t>(det,1,NULL,1000);
|
||||||
#ifndef INTERP
|
#ifndef INTERP
|
||||||
singlePhotonDetector *filter=new singlePhotonDetector(det,3, nSigma, 1, cm, nped, nped0, -1, -1, gainmap, gs);
|
singlePhotonDetector *filter=new singlePhotonDetector(det,3, nSigma, 1, cm, 1000, 100, -1, -1, gainmap, gs);
|
||||||
|
|
||||||
multiThreadedCountingDetector *mt=new multiThreadedCountingDetector(filter,nthreads,fifosize);
|
multiThreadedCountingDetector *mt=new multiThreadedCountingDetector(filter,nthreads,fifosize);
|
||||||
|
|
||||||
// multiThreadedAnalogDetector *mt=new multiThreadedAnalogDetector(filter,nthreads,fifosize);
|
// multiThreadedAnalogDetector *mt=new multiThreadedAnalogDetector(filter,nthreads,fifosize);
|
||||||
#endif
|
#endif
|
||||||
#ifdef INTERP
|
#ifdef INTERP
|
||||||
eta2InterpolationPosXY *interp=new eta2InterpolationPosXY(npx, npy, nSubPixels, etabins, etamin, etamax);
|
eta2InterpolationPosXY *interp=new eta2InterpolationPosXY(npx, npy, nSubPixelsX,nSubPixelsY, etabins, etabinsy, etamin, etamax);
|
||||||
|
|
||||||
if (etafname) interp->readFlatField(etafname);
|
if (etafname) interp->readFlatField(etafname);
|
||||||
|
|
||||||
interpolatingDetector *filter=new interpolatingDetector(det,interp, nSigma, 1, cm, nped, nped0, -1, -1, gainmap, gs);
|
interpolatingDetector *filter=new interpolatingDetector(det,interp, nSigma, 1, cm, 1000, 10, -1, -1, gainmap, gs);
|
||||||
multiThreadedInterpolatingDetector *mt=new multiThreadedInterpolatingDetector(filter,nthreads,fifosize);
|
multiThreadedInterpolatingDetector *mt=new multiThreadedInterpolatingDetector(filter,nthreads,fifosize);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -275,7 +294,17 @@ int main(int argc, char *argv[]) {
|
|||||||
// header variables
|
// header variables
|
||||||
uint64_t acqIndex = -1;
|
uint64_t acqIndex = -1;
|
||||||
uint64_t frameIndex = -1;
|
uint64_t frameIndex = -1;
|
||||||
//uint32_t subFrameIndex = -1;
|
#ifdef MOENCH_BRANCH
|
||||||
|
uint32_t subFrameIndex = -1;
|
||||||
|
int* flippedData = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
uint64_t subframes=0;
|
||||||
|
//uint64_t isubframe=0;
|
||||||
|
uint64_t insubframe=0;
|
||||||
|
double subnorm=1;
|
||||||
|
uint64_t f0=-1, nsubframes=0, nnsubframe=0;
|
||||||
|
|
||||||
uint64_t fileindex = -1;
|
uint64_t fileindex = -1;
|
||||||
string filename = "";
|
string filename = "";
|
||||||
// char* image = new char[size];
|
// char* image = new char[size];
|
||||||
@ -285,10 +314,10 @@ int main(int argc, char *argv[]) {
|
|||||||
int iframe=0;
|
int iframe=0;
|
||||||
char ofname[10000];
|
char ofname[10000];
|
||||||
|
|
||||||
char fname[10000];
|
string fname;
|
||||||
// int length;
|
// int length;
|
||||||
int *detimage;
|
int *detimage=NULL;
|
||||||
int nnx, nny,nns;
|
int nnx, nny,nnsx, nnsy;
|
||||||
//uint32_t imageSize = 0, nPixelsX = 0, nPixelsY = 0,
|
//uint32_t imageSize = 0, nPixelsX = 0, nPixelsY = 0,
|
||||||
//uint32_t dynamicRange = 0;
|
//uint32_t dynamicRange = 0;
|
||||||
// infinite loop
|
// infinite loop
|
||||||
@ -296,20 +325,20 @@ int main(int argc, char *argv[]) {
|
|||||||
uint64_t bunchId = 0;
|
uint64_t bunchId = 0;
|
||||||
uint64_t timestamp = 0;
|
uint64_t timestamp = 0;
|
||||||
int16_t modId = 0;
|
int16_t modId = 0;
|
||||||
|
uint32_t expLength=0;
|
||||||
uint16_t xCoord = 0;
|
uint16_t xCoord = 0;
|
||||||
uint16_t yCoord = 0;
|
uint16_t yCoord = 0;
|
||||||
uint16_t zCoord = 0;
|
//uint16_t zCoord = 0;
|
||||||
uint32_t debug = 0;
|
uint32_t debug = 0;
|
||||||
//uint32_t dr = 16;
|
//uint32_t dr = 16;
|
||||||
//int16_t *dout;//=new int16_t [nnx*nny];
|
//int16_t *dout;//=new int16_t [nnx*nny];
|
||||||
uint32_t dr = 32;
|
uint32_t dr = 32;
|
||||||
int32_t *dout=NULL;//=new int32_t [nnx*nny];
|
int32_t *dout=NULL;//=new int32_t [nnx*nny];
|
||||||
|
float *doutf=NULL;//=new int32_t [nnx*nny];
|
||||||
uint16_t roundRNumber = 0;
|
uint16_t roundRNumber = 0;
|
||||||
uint8_t detType = 0;
|
uint8_t detType = 0;
|
||||||
uint8_t version = 0;
|
uint8_t version = 0;
|
||||||
// int* flippedData = 0;
|
string additionalJsonHeader="" ;
|
||||||
string* additionalJsonHeader = 0;
|
|
||||||
//char* additionalJsonHeader = 0;
|
|
||||||
|
|
||||||
int32_t threshold=0;
|
int32_t threshold=0;
|
||||||
|
|
||||||
@ -327,9 +356,10 @@ int main(int argc, char *argv[]) {
|
|||||||
frameMode fMode=eFrame;
|
frameMode fMode=eFrame;
|
||||||
double *ped;
|
double *ped;
|
||||||
|
|
||||||
filter->getImageSize(nnx, nny,nns);
|
filter->getImageSize(nnx, nny,nnsx, nnsy);
|
||||||
|
|
||||||
|
|
||||||
|
std::map<std::string, std::string> addJsonHeader;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -339,21 +369,21 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
// cout << "+++++++++++++++++++++++++++++++LOOP" << endl;
|
// cout << "+++++++++++++++++++++++++++++++LOOP" << endl;
|
||||||
// get header, (if dummy, fail is on parse error or end of acquisition)
|
// get header, (if dummy, fail is on parse error or end of acquisition)
|
||||||
#ifndef NEWZMQ
|
|
||||||
if (!zmqsocket->ReceiveHeader(0, acqIndex, frameIndex, subframeIndex, filename, fileindex)){
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef NEWZMQ
|
|
||||||
rapidjson::Document doc;
|
|
||||||
if (!zmqsocket->ReceiveHeader(0, doc, SLS_DETECTOR_JSON_HEADER_VERSION)) {
|
// rapidjson::Document doc;
|
||||||
|
if (!zmqsocket->ReceiveHeader(0, zHeader, SLS_DETECTOR_JSON_HEADER_VERSION)) {
|
||||||
/* zmqsocket->CloseHeaderMessage();*/
|
/* zmqsocket->CloseHeaderMessage();*/
|
||||||
|
|
||||||
#endif
|
|
||||||
// if (!zmqsocket->ReceiveHeader(0, acqIndex, frameIndex, subframeIndex, filename, fileindex)) {
|
// if (!zmqsocket->ReceiveHeader(0, acqIndex, frameIndex, subframeIndex, filename, fileindex)) {
|
||||||
// cprintf(RED, "Got Dummy\n");
|
cprintf(RED, "Got Dummy\n");
|
||||||
// t1=high_resolution_clock::now();
|
// t1=high_resolution_clock::now();
|
||||||
time(&end);
|
//time(&end);
|
||||||
|
//cout << "Measurement lasted " << difftime(end,begin) << endl;
|
||||||
|
|
||||||
|
end = std::chrono::steady_clock::now();
|
||||||
|
cout << "Measurement lasted " << (end-begin).count()*0.000001 << " ms" << endl;
|
||||||
|
|
||||||
while (mt->isBusy()) {;}//wait until all data are processed from the queues
|
while (mt->isBusy()) {;}//wait until all data are processed from the queues
|
||||||
|
|
||||||
@ -364,31 +394,68 @@ int main(int argc, char *argv[]) {
|
|||||||
if (newFrame>0) {
|
if (newFrame>0) {
|
||||||
cprintf(RED,"DIDn't receive any data!\n");
|
cprintf(RED,"DIDn't receive any data!\n");
|
||||||
if (send) {
|
if (send) {
|
||||||
zmqsocket2->SendHeaderData(0, true, SLS_DETECTOR_JSON_HEADER_VERSION);
|
|
||||||
|
//zHeader.data = false;
|
||||||
|
outHeader.data=false;
|
||||||
|
// zmqsocket2->SendHeaderData(0, true, SLS_DETECTOR_JSON_HEADER_VERSION);
|
||||||
|
zmqsocket2->SendHeader(0,outHeader);
|
||||||
cprintf(RED, "Sent Dummy\n");
|
cprintf(RED, "Sent Dummy\n");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
send_something=0;
|
||||||
if (fMode==ePedestal) {
|
if (fMode==ePedestal) {
|
||||||
sprintf(ofname,"%s_%ld_ped.tiff",fname,fileindex);
|
sprintf(ofname,"%s_%ld_ped.tiff",fname.c_str(),fileindex);
|
||||||
mt->writePedestal(ofname);
|
mt->writePedestal(ofname);
|
||||||
cout << "Writing pedestal to " << ofname << endl;
|
cout << "Writing pedestal to " << ofname << endl;
|
||||||
if (rms){
|
if (rms){
|
||||||
sprintf(ofname,"%s_%ld_var.tiff",fname,fileindex);
|
sprintf(ofname,"%s_%ld_var.tiff",fname.c_str(),fileindex);
|
||||||
mt->writePedestalRMS(ofname);
|
mt->writePedestalRMS(ofname);
|
||||||
cout << "Writing pedestal variance to " << ofname << endl;
|
|
||||||
}
|
}
|
||||||
|
send_something=1;
|
||||||
}
|
}
|
||||||
#ifdef INTERP
|
#ifdef INTERP
|
||||||
else if (fMode==eFlat) {
|
else if (fMode==eFlat) {
|
||||||
mt->prepareInterpolation(ok);
|
mt->prepareInterpolation(ok);
|
||||||
sprintf(ofname,"%s_%ld_eta.tiff",fname,fileindex);
|
sprintf(ofname,"%s_%ld_eta.tiff",fname.c_str(),fileindex);
|
||||||
mt->writeFlatField(ofname);
|
mt->writeFlatField(ofname);
|
||||||
cout << "Writing eta to " << ofname << endl;
|
cout << "Writing eta to " << ofname << endl;
|
||||||
|
send_something=1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
else {
|
else {
|
||||||
sprintf(ofname,"%s_%ld.tiff",fname,fileindex);
|
if (subframes>0 ) {
|
||||||
|
if (insubframe>0) {
|
||||||
|
sprintf(ofname,"%s_sf%ld_%ld.tiff",fname.c_str(),nnsubframe,fileindex);
|
||||||
|
// mt->writeImage(ofname);
|
||||||
|
doutf= new float[nnx*nny];
|
||||||
|
if (subframes>0 && insubframe!=subframes && insubframe>0)
|
||||||
|
subnorm=((double)subframes)/((double)insubframe);
|
||||||
|
else
|
||||||
|
subnorm=1.;
|
||||||
|
for (int ix=0; ix<nnx*nny; ix++) {
|
||||||
|
doutf[ix]=detimage[ix]*subnorm;
|
||||||
|
if (doutf[ix]<0) doutf[ix]=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
cout << "Writing image to " << ofname << endl;
|
||||||
|
|
||||||
|
WriteToTiff(doutf,ofname ,nnx, nny);
|
||||||
|
|
||||||
|
if (doutf)
|
||||||
|
delete [] doutf;
|
||||||
|
doutf=NULL;
|
||||||
|
|
||||||
|
nsubframes++;
|
||||||
|
insubframe=0;
|
||||||
|
send_something=1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
sprintf(ofname,"%s_%ld.tiff",fname.c_str(),fileindex);
|
||||||
mt->writeImage(ofname);
|
mt->writeImage(ofname);
|
||||||
|
send_something=1;
|
||||||
|
}
|
||||||
|
|
||||||
cout << "Writing image to " << ofname << endl;
|
cout << "Writing image to " << ofname << endl;
|
||||||
}
|
}
|
||||||
// cout << nns*nnx*nny*nns*dr/8 << " " << length << endl;
|
// cout << nns*nnx*nny*nns*dr/8 << " " << length << endl;
|
||||||
@ -397,11 +464,13 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
if (fMode==ePedestal) {
|
if (fMode==ePedestal) {
|
||||||
cprintf(MAGENTA,"Get pedestal!\n");
|
cprintf(MAGENTA,"Get pedestal!\n");
|
||||||
nns=1;
|
nnsx=1;
|
||||||
|
nnsy=1;
|
||||||
|
|
||||||
nnx=npx;
|
nnx=npx;
|
||||||
nny=npy;
|
nny=npy;
|
||||||
//dout= new int16_t[nnx*nny*nns*nns];
|
//dout= new int16_t[nnx*nny*nns*nns];
|
||||||
dout= new int32_t[nnx*nny*nns*nns];
|
dout= new int32_t[nnx*nny*nnsx*nnsy];
|
||||||
// cout << "get pedestal " << endl;
|
// cout << "get pedestal " << endl;
|
||||||
ped=mt->getPedestal();
|
ped=mt->getPedestal();
|
||||||
// cout << "got pedestal " << endl;
|
// cout << "got pedestal " << endl;
|
||||||
@ -409,7 +478,7 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
dout[ix]=ped[ix];
|
dout[ix]=ped[ix];
|
||||||
// if (ix<100*400)
|
// if (ix<100*400)
|
||||||
// cout << ix << " " << ped[ix] << " "<< dout[ix] << endl;
|
// cout << ix << " " << ped[ix] << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -427,15 +496,19 @@ int main(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
else {
|
else {
|
||||||
detimage=mt->getImage(nnx,nny,nns);
|
detimage=mt->getImage(nnx,nny,nnsx, nnsy);
|
||||||
cprintf(MAGENTA,"Get image!\n");
|
cprintf(MAGENTA,"Get image!\n");
|
||||||
cout << nnx << " " << nny << " " << nns << endl;
|
cout << nnx << " " << nny << " " << nnsx << " " << nnsy << endl;
|
||||||
// nns=1;
|
// nns=1;
|
||||||
// nnx=npx;
|
// nnx=npx;
|
||||||
// nny=npy;
|
// nny=npy;
|
||||||
// nnx=nnx*nns;
|
// nnx=nnx*nns;
|
||||||
//nny=nny*nns;
|
//nny=nny*nns;
|
||||||
dout= new int32_t[nnx*nny];
|
dout= new int32_t[nnx*nny];
|
||||||
|
if (subframes>0 && insubframe!=subframes && insubframe>0)
|
||||||
|
subnorm=((double)subframes)/((double)insubframe);
|
||||||
|
else
|
||||||
|
subnorm=1.;
|
||||||
for (int ix=0; ix<nnx*nny; ix++) {
|
for (int ix=0; ix<nnx*nny; ix++) {
|
||||||
// for (int iy=0; iy<nny*nns; iy++) {
|
// for (int iy=0; iy<nny*nns; iy++) {
|
||||||
// for (int isx=0; isx<nns; isx++) {
|
// for (int isx=0; isx<nns; isx++) {
|
||||||
@ -447,48 +520,49 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
dout[ix]=detimage[ix];
|
dout[ix]=detimage[ix]*subnorm;
|
||||||
if (dout[ix]<0) dout[ix]=0;
|
if (dout[ix]<0) dout[ix]=0;
|
||||||
// cout << ix << " " << dout[ix] << endl;
|
// cout << ix << " " << dout[ix] << endl;
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//if ((insubframe>0 && subframes>0) || (subframes<=0) ){
|
||||||
|
|
||||||
|
if(send_something) {
|
||||||
|
|
||||||
//// int SendHeaderData ( int index, bool dummy, uint32_t jsonversion, uint32_t dynamicrange = 0, uint64_t fileIndex = 0,
|
// zmqsocket2->SendHeaderData (0, false,SLS_DETECTOR_JSON_HEADER_VERSION , dr, fileindex, 1,1,nnx,nny,nnx*nny*dr/8,acqIndex, frameIndex, fname,acqIndex,0 , packetNumber,bunchId, timestamp, modId,xCoord, yCoord, zCoord,debug, roundRNumber, detType, version, 0,0, 0,&additionalJsonHeader);
|
||||||
// uint32_t ndetx = 0, uint32_t ndety = 0, uint32_t npixelsx = 0, uint32_t npixelsy = 0, uint32_t imageSize = 0,
|
|
||||||
// uint64_t acqIndex = 0, uint64_t fIndex = 0, const char* fname = NULL,
|
|
||||||
// uint64_t frameNumber = 0, uint32_t expLength = 0, uint32_t packetNumber = 0,
|
|
||||||
// uint64_t bunchId = 0, uint64_t timestamp = 0,
|
|
||||||
// uint16_t modId = 0, uint16_t row = 0, uint16_t column = 0, uint16_t reserved = 0,
|
|
||||||
// uint32_t debug = 0, uint16_t roundRNumber = 0,
|
|
||||||
// uint8_t detType = 0, uint8_t version = 0, int gapPixelsEnable = 0, int flippedDataX = 0,
|
|
||||||
// char* additionalJsonHeader = 0) {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// cout << "Sending image size " << nnx << " " << nny << endl;
|
|
||||||
|
|
||||||
// #ifndef DEVELOPER
|
|
||||||
// #ifndef MOENCH_BRANCH
|
|
||||||
// zmqsocket2->SendHeaderData (0, false, SLS_DETECTOR_JSON_HEADER_VERSION, dr, fileindex, 1,1, nnx, nny, nnx*nny*dr/8,acqIndex, frameIndex, fname, acqIndex,0 , packetNumber,bunchId, timestamp, modId, xCoord, yCoord, zCoord,debug, roundRNumber, detType, version, 0,0, additionalJsonHeader);
|
|
||||||
// #endif
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
|
|
||||||
// #ifdef DEVELOPER
|
|
||||||
// #ifdef CTBGUI
|
|
||||||
// zmqsocket2->SendHeaderData (0, false,SLS_DETECTOR_JSON_HEADER_VERSION , dr, fileindex, 0,0,nnx,nny,nnx*nny*dr/8,acqIndex, frameIndex, fname,acqIndex,0 , packetNumber,bunchId, timestamp, modId,xCoord, yCoord, zCoord,debug, roundRNumber, detType, version, 0,0, 0,additionalJsonHeader);
|
|
||||||
// #endif
|
|
||||||
// #ifndef CTBGUI
|
|
||||||
zmqsocket2->SendHeaderData (0, false,SLS_DETECTOR_JSON_HEADER_VERSION , dr, fileindex, 1,1,nnx,nny,nnx*nny*dr/8,acqIndex, frameIndex, fname,acqIndex,0 , packetNumber,bunchId, timestamp, modId,xCoord, yCoord, zCoord,debug, roundRNumber, detType, version, 0,0, 0,additionalJsonHeader);
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
|
outHeader.data=true;
|
||||||
|
outHeader.dynamicRange=dr;
|
||||||
|
outHeader.fileIndex=fileindex;
|
||||||
|
outHeader.ndetx=1;
|
||||||
|
outHeader.ndety=1;
|
||||||
|
outHeader.npixelsx=nnx;
|
||||||
|
outHeader.npixelsy=nny;
|
||||||
|
outHeader.imageSize=nnx*nny*dr/8;
|
||||||
|
outHeader.acqIndex=acqIndex;
|
||||||
|
outHeader.frameIndex=frameIndex;
|
||||||
|
outHeader.fname=fname;
|
||||||
|
outHeader.frameNumber=acqIndex;
|
||||||
|
outHeader.expLength=expLength;
|
||||||
|
outHeader.packetNumber=packetNumber;
|
||||||
|
outHeader.bunchId=bunchId;
|
||||||
|
outHeader.timestamp=timestamp;
|
||||||
|
outHeader.modId=modId;
|
||||||
|
outHeader.row=xCoord;
|
||||||
|
outHeader.column=yCoord;
|
||||||
|
outHeader.debug=debug;
|
||||||
|
outHeader.roundRNumber=roundRNumber;
|
||||||
|
outHeader.detType=detType;
|
||||||
|
outHeader.version=version;
|
||||||
|
|
||||||
|
zmqsocket2->SendHeader(0,outHeader);
|
||||||
zmqsocket2->SendData((char*)dout,nnx*nny*dr/8);
|
zmqsocket2->SendData((char*)dout,nnx*nny*dr/8);
|
||||||
cprintf(GREEN, "Sent Data\n");
|
cprintf(GREEN, "Sent Data\n");
|
||||||
|
}
|
||||||
zmqsocket2->SendHeaderData(0, true, SLS_DETECTOR_JSON_HEADER_VERSION);
|
outHeader.data=false;
|
||||||
|
zmqsocket2->SendHeader(0,outHeader);
|
||||||
|
// zmqsocket2->SendHeaderData(0, true, SLS_DETECTOR_JSON_HEADER_VERSION);
|
||||||
cprintf(RED, "Sent Dummy\n");
|
cprintf(RED, "Sent Dummy\n");
|
||||||
if (dout)
|
if (dout)
|
||||||
delete [] dout;
|
delete [] dout;
|
||||||
@ -500,49 +574,103 @@ int main(int argc, char *argv[]) {
|
|||||||
mt->clearImage();
|
mt->clearImage();
|
||||||
|
|
||||||
newFrame=1;
|
newFrame=1;
|
||||||
//t2 = high_resolution_clock::now();
|
|
||||||
|
|
||||||
time(&finished);
|
|
||||||
// auto meas_duration = duration_cast<microseconds>( t2 - t0 ).count();
|
|
||||||
// auto real_duration = duration_cast<microseconds>( t2 - t1 ).count();
|
|
||||||
|
|
||||||
cout << "Measurement lasted " << difftime(end,begin) << endl;
|
//time(&finished);
|
||||||
cout << "Processing lasted " << difftime(finished,begin) << endl;
|
//cout << "Processing lasted " << difftime(finished,begin) << endl;
|
||||||
|
|
||||||
|
finished = std::chrono::steady_clock::now();
|
||||||
|
cout << "Processing lasted " << (finished-begin).count()*0.000001 << " ms" << endl;
|
||||||
|
#ifdef OPTIMIZE
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
continue; //continue to not get out
|
continue; //continue to not get out
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef NEWZMQ
|
//#ifdef NEWZMQ
|
||||||
if (newFrame) {
|
if (newFrame) {
|
||||||
time(&begin);
|
begin = std::chrono::steady_clock::now();
|
||||||
// t0 = high_resolution_clock::now();
|
|
||||||
//cout <<"new frame" << endl;
|
|
||||||
|
|
||||||
// acqIndex, frameIndex, subframeIndex, filename, fileindex
|
size = zHeader.imageSize;//doc["size"].GetUint();
|
||||||
size = doc["size"].GetUint();
|
|
||||||
// multisize = size;// * zmqsocket->size();
|
|
||||||
// dynamicRange = doc["bitmode"].GetUint();
|
|
||||||
// nPixelsX = doc["shape"][0].GetUint();
|
|
||||||
// nPixelsY = doc["shape"][1].GetUint();
|
|
||||||
filename = doc["fname"].GetString();
|
|
||||||
//acqIndex = doc["acqIndex"].GetUint64();
|
|
||||||
//frameIndex = doc["fIndex"].GetUint64();
|
|
||||||
fileindex = doc["fileIndex"].GetUint64();
|
|
||||||
//subFrameIndex = doc["expLength"].GetUint();
|
|
||||||
//packetNumber=doc["packetNumber"].GetUint();
|
|
||||||
//bunchId=doc["bunchId"].GetUint();
|
|
||||||
//timestamp=doc["timestamp"].GetUint();
|
|
||||||
//modId=doc["modId"].GetUint();
|
|
||||||
//debug=doc["debug"].GetUint();
|
|
||||||
//roundRNumber=doc["roundRNumber"].GetUint();
|
|
||||||
//detType=doc["detType"].GetUint();
|
|
||||||
//version=doc["version"].GetUint();
|
|
||||||
|
|
||||||
|
// dynamicRange = zheader.dynamicRange; //doc["bitmode"].GetUint();
|
||||||
|
// nPixelsX = zHeader.npixelsx; //doc["shape"][0].GetUint();
|
||||||
|
// nPixelsY = zHeader.npixelsy;// doc["shape"][1].GetUint();
|
||||||
|
filename = zHeader.fname;//doc["fname"].GetString();
|
||||||
|
acqIndex = zHeader.acqIndex; //doc["acqIndex"].GetUint64();
|
||||||
|
// frameIndex = zHeader.frameIndex;//doc["fIndex"].GetUint64();
|
||||||
|
fileindex = zHeader.fileIndex;//doc["fileIndex"].GetUint64();
|
||||||
|
expLength = zHeader.expLength;//doc["expLength"].GetUint();
|
||||||
|
packetNumber=zHeader.packetNumber;//doc["packetNumber"].GetUint();
|
||||||
|
bunchId=zHeader.bunchId;//doc["bunchId"].GetUint();
|
||||||
|
timestamp=zHeader.timestamp;//doc["timestamp"].GetUint();
|
||||||
|
modId=zHeader.modId;//doc["modId"].GetUint();
|
||||||
|
debug=zHeader.debug;//doc["debug"].GetUint();
|
||||||
|
// roundRNumber=r.roundRNumber;//doc["roundRNumber"].GetUint();
|
||||||
|
detType=zHeader.detType;//doc["detType"].GetUint();
|
||||||
|
version=zHeader.version;//doc["version"].GetUint();
|
||||||
|
/*document["bitmode"].GetUint(); zHeader.dynamicRange
|
||||||
|
|
||||||
|
document["fileIndex"].GetUint64(); zHeader.fileIndex
|
||||||
|
|
||||||
|
document["detshape"][0].GetUint();
|
||||||
|
zHeader.ndetx
|
||||||
|
|
||||||
|
document["detshape"][1].GetUint();
|
||||||
|
zHeader.ndety
|
||||||
|
|
||||||
|
document["shape"][0].GetUint();
|
||||||
|
zHeader.npixelsx
|
||||||
|
|
||||||
|
document["shape"][1].GetUint();
|
||||||
|
zHeader.npixelsy
|
||||||
|
|
||||||
|
document["size"].GetUint(); zHeader.imageSize
|
||||||
|
|
||||||
|
document["acqIndex"].GetUint64(); zHeader.acqIndex
|
||||||
|
|
||||||
|
document["frameIndex"].GetUint64(); zHeader.frameIndex
|
||||||
|
|
||||||
|
document["fname"].GetString(); zHeader.fname
|
||||||
|
|
||||||
|
document["frameNumber"].GetUint64(); zHeader.frameNumber
|
||||||
|
|
||||||
|
document["expLength"].GetUint(); zHeader.expLength
|
||||||
|
|
||||||
|
document["packetNumber"].GetUint(); zHeader.packetNumber
|
||||||
|
|
||||||
|
document["bunchId"].GetUint64(); zHeader.bunchId
|
||||||
|
|
||||||
|
document["timestamp"].GetUint64(); zHeader.timestamp
|
||||||
|
|
||||||
|
document["modId"].GetUint(); zHeader.modId
|
||||||
|
|
||||||
|
document["row"].GetUint(); zHeader.row
|
||||||
|
|
||||||
|
document["column"].GetUint(); zHeader.column
|
||||||
|
|
||||||
|
document["reserved"].GetUint(); zHeader.reserved
|
||||||
|
|
||||||
|
document["debug"].GetUint(); zHeader.debug
|
||||||
|
|
||||||
|
document["roundRNumber"].GetUint(); zHeader.roundRNumber
|
||||||
|
|
||||||
|
document["detType"].GetUint(); zHeader.detType
|
||||||
|
|
||||||
|
document["version"].GetUint(); zHeader.version
|
||||||
|
|
||||||
|
document["flippedDataX"].GetUint(); zHeader.flippedDataX
|
||||||
|
|
||||||
|
document["quad"].GetUint(); zHeader.quad
|
||||||
|
|
||||||
|
document["completeImage"].GetUint(); zHeader.completeImage
|
||||||
|
*/
|
||||||
//dataSize=size;
|
//dataSize=size;
|
||||||
|
|
||||||
strcpy(fname,filename.c_str());
|
//strcpy(fname,filename.c_str());
|
||||||
|
fname=filename;
|
||||||
// cprintf(BLUE, "Header Info:\n"
|
// cprintf(BLUE, "Header Info:\n"
|
||||||
// "size: %u\n"
|
// "size: %u\n"
|
||||||
// "multisize: %u\n"
|
// "multisize: %u\n"
|
||||||
@ -572,6 +700,8 @@ int main(int argc, char *argv[]) {
|
|||||||
// xCoord, yCoord,zCoord,
|
// xCoord, yCoord,zCoord,
|
||||||
// flippedDataX, packetNumber, bunchId, timestamp, modId, debug, roundRNumber, detType, version);
|
// flippedDataX, packetNumber, bunchId, timestamp, modId, debug, roundRNumber, detType, version);
|
||||||
|
|
||||||
|
addJsonHeader=zHeader.addJsonHeader;
|
||||||
|
|
||||||
/* Analog detector commands */
|
/* Analog detector commands */
|
||||||
//isPedestal=0;
|
//isPedestal=0;
|
||||||
//isFlat=0;
|
//isFlat=0;
|
||||||
@ -579,13 +709,14 @@ int main(int argc, char *argv[]) {
|
|||||||
fMode=eFrame;
|
fMode=eFrame;
|
||||||
frameMode_s="frame";
|
frameMode_s="frame";
|
||||||
cprintf(MAGENTA, "Frame mode: ");
|
cprintf(MAGENTA, "Frame mode: ");
|
||||||
if (doc.HasMember("frameMode")) {
|
// if (doc.HasMember("frameMode")) {
|
||||||
if (doc["frameMode"].IsString()) {
|
if (addJsonHeader.find("frameMode")!= addJsonHeader.end()) {
|
||||||
frameMode_s=doc["frameMode"].GetString();
|
// if (doc["frameMode"].IsString()) {
|
||||||
|
frameMode_s=addJsonHeader.at("frameMode");//doc["frameMode"].GetString();
|
||||||
if (frameMode_s == "pedestal"){
|
if (frameMode_s == "pedestal"){
|
||||||
fMode=ePedestal;
|
fMode=ePedestal;
|
||||||
//isPedestal=1;
|
//isPedestal=1;
|
||||||
} else if (frameMode_s == "newpedestal"){
|
} else if (frameMode_s == "newPedestal"){
|
||||||
mt->newDataSet(); //resets pedestal
|
mt->newDataSet(); //resets pedestal
|
||||||
// cprintf(MAGENTA, "Resetting pedestal\n");
|
// cprintf(MAGENTA, "Resetting pedestal\n");
|
||||||
fMode=ePedestal;
|
fMode=ePedestal;
|
||||||
@ -594,8 +725,8 @@ int main(int argc, char *argv[]) {
|
|||||||
mt->newDataSet(); //resets pedestal
|
mt->newDataSet(); //resets pedestal
|
||||||
// cprintf(MAGENTA, "Resetting pedestal\n");
|
// cprintf(MAGENTA, "Resetting pedestal\n");
|
||||||
fMode=ePedestal;
|
fMode=ePedestal;
|
||||||
rms=1;
|
|
||||||
//isPedestal=1;
|
//isPedestal=1;
|
||||||
|
rms=1;
|
||||||
}
|
}
|
||||||
#ifdef INTERP
|
#ifdef INTERP
|
||||||
else if (frameMode_s == "flatfield") {
|
else if (frameMode_s == "flatfield") {
|
||||||
@ -607,7 +738,7 @@ int main(int argc, char *argv[]) {
|
|||||||
cprintf(MAGENTA, "Resetting flatfield\n");
|
cprintf(MAGENTA, "Resetting flatfield\n");
|
||||||
fMode=eFlat;
|
fMode=eFlat;
|
||||||
}
|
}
|
||||||
#endif
|
//#endif
|
||||||
else {
|
else {
|
||||||
fMode=eFrame;
|
fMode=eFrame;
|
||||||
//isPedestal=0;
|
//isPedestal=0;
|
||||||
@ -615,21 +746,23 @@ int main(int argc, char *argv[]) {
|
|||||||
fMode=eFrame;
|
fMode=eFrame;
|
||||||
frameMode_s="frame";
|
frameMode_s="frame";
|
||||||
}
|
}
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
cprintf(MAGENTA, "%s\n" , frameMode_s.c_str());
|
cprintf(MAGENTA, "%s\n" , frameMode_s.c_str());
|
||||||
} else
|
|
||||||
cprintf(RED, "%s\n" , frameMode_s.c_str());
|
|
||||||
|
|
||||||
mt->setFrameMode(fMode);
|
mt->setFrameMode(fMode);
|
||||||
|
|
||||||
threshold=0;
|
// threshold=0;
|
||||||
cprintf(MAGENTA, "Threshold: ");
|
cprintf(MAGENTA, "Threshold: ");
|
||||||
if (doc.HasMember("threshold")) {
|
if (addJsonHeader.find("threshold")!= addJsonHeader.end()) {
|
||||||
if (doc["threshold"].IsInt()) {
|
istringstream(addJsonHeader.at("threshold")) >>threshold;
|
||||||
threshold=doc["threshold"].GetInt();
|
// threshold=atoi(addJsonHeader.at("threshold").c_str());//doc["frameMode"].GetString();
|
||||||
|
}
|
||||||
|
//if (doc.HasMember("threshold")) {
|
||||||
|
//if (doc["threshold"].IsInt()) {
|
||||||
|
// threshold=doc["threshold"].GetInt();
|
||||||
mt->setThreshold(threshold);
|
mt->setThreshold(threshold);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
cprintf(MAGENTA, "%d\n", threshold);
|
cprintf(MAGENTA, "%d\n", threshold);
|
||||||
|
|
||||||
xmin=0;
|
xmin=0;
|
||||||
@ -637,40 +770,47 @@ int main(int argc, char *argv[]) {
|
|||||||
ymin=0;
|
ymin=0;
|
||||||
ymax=npy;
|
ymax=npy;
|
||||||
cprintf(MAGENTA, "ROI: ");
|
cprintf(MAGENTA, "ROI: ");
|
||||||
if (doc.HasMember("roi")) {
|
|
||||||
if (doc["roi"].IsArray()) {
|
|
||||||
if (doc["roi"].Size() > 0 )
|
|
||||||
if (doc["roi"][0].IsInt())
|
|
||||||
xmin=doc["roi"][0].GetInt();
|
|
||||||
|
|
||||||
if (doc["roi"].Size() > 1 )
|
if (addJsonHeader.find("roi")!= addJsonHeader.end()) {
|
||||||
if (doc["roi"][1].IsInt())
|
istringstream(addJsonHeader.at("roi")) >> xmin >> xmax >> ymin >> ymax ;
|
||||||
xmax=doc["roi"][1].GetInt();
|
// if (doc.HasMember("roi")) {
|
||||||
|
//if (doc["roi"].IsArray()) {
|
||||||
|
// if (doc["roi"].Size() > 0 )
|
||||||
|
// if (doc["roi"][0].IsInt())
|
||||||
|
// xmin=doc["roi"][0].GetInt();
|
||||||
|
|
||||||
if (doc["roi"].Size() > 2 )
|
// if (doc["roi"].Size() > 1 )
|
||||||
if (doc["roi"][2].IsInt())
|
// if (doc["roi"][1].IsInt())
|
||||||
ymin=doc["roi"][2].GetInt();
|
// xmax=doc["roi"][1].GetInt();
|
||||||
|
|
||||||
if (doc["roi"].Size() > 3 )
|
// if (doc["roi"].Size() > 2 )
|
||||||
if (doc["roi"][3].IsInt())
|
// if (doc["roi"][2].IsInt())
|
||||||
ymax=doc["roi"][3].GetInt();
|
// ymin=doc["roi"][2].GetInt();
|
||||||
}
|
|
||||||
|
// if (doc["roi"].Size() > 3 )
|
||||||
|
// if (doc["roi"][3].IsInt())
|
||||||
|
// ymax=doc["roi"][3].GetInt();
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
cprintf(MAGENTA, "%d %d %d %d\n", xmin, xmax, ymin, ymax);
|
cprintf(MAGENTA, "%d %d %d %d\n", xmin, xmax, ymin, ymax);
|
||||||
mt->setROI(xmin, xmax, ymin, ymax);
|
mt->setROI(xmin, xmax, ymin, ymax);
|
||||||
|
if (addJsonHeader.find("dynamicRange")!= addJsonHeader.end()) {
|
||||||
if (doc.HasMember("dynamicRange")) {
|
istringstream(addJsonHeader.at("dynamicRange")) >> dr ;
|
||||||
dr=doc["dynamicRange"].GetUint();
|
|
||||||
dr=32;
|
dr=32;
|
||||||
}
|
}
|
||||||
|
// if (doc.HasMember("dynamicRange")) {
|
||||||
|
// dr=doc["dynamicRange"].GetUint();
|
||||||
|
// dr=32;
|
||||||
|
// }
|
||||||
|
|
||||||
dMode=eAnalog;
|
dMode=eAnalog;
|
||||||
detectorMode_s="analog";
|
detectorMode_s="analog";
|
||||||
cprintf(MAGENTA, "Detector mode: ");
|
cprintf(MAGENTA, "Detector mode: ");
|
||||||
if (doc.HasMember("detectorMode")) {
|
if (addJsonHeader.find("detectorMode")!= addJsonHeader.end()) {;
|
||||||
if (doc["detectorMode"].IsString()) {
|
//if (doc.HasMember("detectorMode")) {
|
||||||
detectorMode_s=doc["detectorMode"].GetString();
|
//if (doc["detectorMode"].IsString()) {
|
||||||
|
detectorMode_s=addJsonHeader.at("detectorMode");//=doc["detectorMode"].GetString();
|
||||||
#ifdef INTERP
|
#ifdef INTERP
|
||||||
if (detectorMode_s == "interpolating"){
|
if (detectorMode_s == "interpolating"){
|
||||||
dMode=eInterpolating;
|
dMode=eInterpolating;
|
||||||
@ -688,13 +828,12 @@ int main(int argc, char *argv[]) {
|
|||||||
mt->setInterpolation(NULL);
|
mt->setInterpolation(NULL);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cprintf(MAGENTA, "%s\n" , detectorMode_s.c_str());
|
|
||||||
} else
|
|
||||||
cprintf(RED, "%s\n" , frameMode_s.c_str());
|
|
||||||
|
|
||||||
mt->setDetectorMode(dMode);
|
mt->setDetectorMode(dMode);
|
||||||
|
cprintf(MAGENTA, "%s\n" , detectorMode_s.c_str());
|
||||||
|
|
||||||
// cout << "done " << endl;
|
// cout << "done " << endl;
|
||||||
|
|
||||||
@ -737,6 +876,21 @@ int main(int argc, char *argv[]) {
|
|||||||
// mt->setNSubPixels(nSubPixels);
|
// mt->setNSubPixels(nSubPixels);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
// threshold=0;
|
||||||
|
// cprintf(MAGENTA, "Subframes: ");
|
||||||
|
// subframes=0;
|
||||||
|
// //isubframe=0;
|
||||||
|
// insubframe=0;
|
||||||
|
// subnorm=1;
|
||||||
|
// f0=0;
|
||||||
|
// nnsubframe=0;
|
||||||
|
// if (doc.HasMember("subframes")) {
|
||||||
|
// if (doc["subframes"].IsInt()) {
|
||||||
|
// subframes=doc["subframes"].GetInt();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// cprintf(MAGENTA, "%ld\n", subframes);
|
||||||
|
|
||||||
|
|
||||||
newFrame=0;
|
newFrame=0;
|
||||||
/* zmqsocket->CloseHeaderMessage();*/
|
/* zmqsocket->CloseHeaderMessage();*/
|
||||||
@ -745,7 +899,7 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
// cout << "file" << endl;
|
// cout << "file" << endl;
|
||||||
// cout << "data " << endl;
|
// cout << "data " << endl;
|
||||||
if (of==NULL && dMode!=eAnalog && fMode!=ePedestal && threshold<=0) {
|
if (of==NULL) {
|
||||||
#ifdef WRITE_QUAD
|
#ifdef WRITE_QUAD
|
||||||
sprintf(ofname,"%s_%ld.clust2",filename.c_str(),fileindex);
|
sprintf(ofname,"%s_%ld.clust2",filename.c_str(),fileindex);
|
||||||
#endif
|
#endif
|
||||||
@ -762,31 +916,98 @@ int main(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// cout << "data" << endl;
|
// cout << "data" << endl;
|
||||||
// get data
|
// get data
|
||||||
// acqIndex = doc["acqIndex"].GetUint64();
|
// acqIndex = doc["acqIndex"].GetUint64();
|
||||||
frameIndex = doc["fIndex"].GetUint64();
|
|
||||||
|
frameIndex = zHeader.frameIndex;////doc["fIndex"].GetUint64();
|
||||||
|
|
||||||
// subFrameIndex = doc["expLength"].GetUint();
|
// subFrameIndex = doc["expLength"].GetUint();
|
||||||
|
|
||||||
// bunchId=doc["bunchId"].GetUint();
|
// bunchId=doc["bunchId"].GetUint();
|
||||||
// timestamp=doc["timestamp"].GetUint();
|
// timestamp=doc["timestamp"].GetUint();
|
||||||
packetNumber=doc["packetNumber"].GetUint();
|
packetNumber=zHeader.packetNumber; //doc["packetNumber"].GetUint();
|
||||||
// cout << acqIndex << " " << frameIndex << " " << subFrameIndex << " "<< bunchId << " " << timestamp << " " << packetNumber << endl;
|
// cout << acqIndex << " " << frameIndex << " " << subFrameIndex << " "<< bunchId << " " << timestamp << " " << packetNumber << endl;
|
||||||
|
//cprintf(GREEN, "frame\n");
|
||||||
if (packetNumber>=40) {
|
if (packetNumber>=40) {
|
||||||
//*((int*)buff)=frameIndex;
|
//*((int*)buff)=frameIndex;
|
||||||
|
if (insubframe==0) f0=frameIndex;
|
||||||
memcpy(buff,&frameIndex,sizeof(int));
|
memcpy(buff,&frameIndex,sizeof(int));
|
||||||
//length =
|
//length =
|
||||||
zmqsocket->ReceiveData(0, buff+sizeof(int), size);
|
zmqsocket->ReceiveData(0, buff+sizeof(int), size);
|
||||||
mt->pushData(buff);
|
mt->pushData(buff);
|
||||||
mt->nextThread();
|
mt->nextThread();
|
||||||
mt->popFree(buff);
|
mt->popFree(buff);
|
||||||
cprintf(GREEN, "Frame\n");
|
insubframe++;
|
||||||
|
nsubframes=frameIndex+1-f0;
|
||||||
} else {
|
} else {
|
||||||
cprintf(RED, "Incomplete frame: received only %d packet\n", packetNumber);
|
cprintf(RED, "Incomplete frame: received only %d packet\n", packetNumber);
|
||||||
//length =
|
//length =
|
||||||
zmqsocket->ReceiveData(0, dummybuff, size);
|
zmqsocket->ReceiveData(0, dummybuff, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (subframes>0 && insubframe>=subframes && fMode==eFrame) {
|
||||||
|
while (mt->isBusy()) {;}//wait until all data are processed from the queues
|
||||||
|
detimage=mt->getImage(nnx,nny,nnsx, nnsy);
|
||||||
|
cprintf(MAGENTA,"Get image!\n");
|
||||||
|
dout= new int32_t[nnx*nny];
|
||||||
|
doutf= new float[nnx*nny];
|
||||||
|
if (subframes>0 && insubframe!=subframes && insubframe>0)
|
||||||
|
subnorm=((double)subframes)/((double)insubframe);
|
||||||
|
else
|
||||||
|
subnorm=1.;
|
||||||
|
for (int ix=0; ix<nnx*nny; ix++) {
|
||||||
|
dout[ix]=detimage[ix]*subnorm;
|
||||||
|
if (dout[ix]<0) dout[ix]=0;
|
||||||
|
doutf[ix]=dout[ix];
|
||||||
|
}
|
||||||
|
sprintf(ofname,"%s_sf%ld_%ld.tiff",fname.c_str(),nnsubframe,fileindex);
|
||||||
|
|
||||||
|
cout << "Writing image to " << ofname << endl;
|
||||||
|
|
||||||
|
WriteToTiff(doutf,ofname ,nnx, nny);
|
||||||
|
nsubframes++;
|
||||||
|
insubframe=0;
|
||||||
|
nnsubframe++;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// zmqsocket2->SendHeaderData (0, false,SLS_DETECTOR_JSON_HEADER_VERSION , dr, fileindex, 1,1,nnx,nny,nnx*nny*dr/8,acqIndex, frameIndex, fname,acqIndex,0 , packetNumber,bunchId, timestamp, modId,xCoord, yCoord, zCoord,debug, roundRNumber, detType, version, 0,0, 0,&additionalJsonHeader);
|
||||||
|
zHeader.data = true;
|
||||||
|
zmqsocket2->SendHeader(0,zHeader);
|
||||||
|
zmqsocket2->SendData((char*)dout,nnx*nny*dr/8);
|
||||||
|
cprintf(GREEN, "Sent subdata\n");
|
||||||
|
|
||||||
|
|
||||||
|
if (dout)
|
||||||
|
delete [] dout;
|
||||||
|
dout=NULL;
|
||||||
|
|
||||||
|
if (doutf)
|
||||||
|
delete [] doutf;
|
||||||
|
doutf=NULL;
|
||||||
|
|
||||||
|
mt->clearImage();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
iframe++;
|
iframe++;
|
||||||
|
|
||||||
} // exiting infinite loop
|
} // exiting infinite loop
|
||||||
|
@ -95,7 +95,7 @@ public:
|
|||||||
virtual int *getImage() {
|
virtual int *getImage() {
|
||||||
return det->getImage();
|
return det->getImage();
|
||||||
}
|
}
|
||||||
virtual int getImageSize(int &nnx, int &nny, int &ns) {return det->getImageSize(nnx, nny, ns);};
|
virtual int getImageSize(int &nnx, int &nny, int &ns, int &nsy) {return det->getImageSize(nnx, nny, ns, nsy);};
|
||||||
virtual int getDetectorSize(int &nnx, int &nny) {return det->getDetectorSize(nnx, nny);};
|
virtual int getDetectorSize(int &nnx, int &nny) {return det->getDetectorSize(nnx, nny);};
|
||||||
|
|
||||||
virtual ~threadedAnalogDetector() {StopThread(); delete fifoFree; delete fifoData;}
|
virtual ~threadedAnalogDetector() {StopThread(); delete fifoFree; delete fifoData;}
|
||||||
@ -123,7 +123,7 @@ public:
|
|||||||
return fifoFree->pop(ptr);
|
return fifoFree->pop(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int isBusy() {return busy;}
|
virtual int isBusy() {if (fifoData->isEmpty() && busy==0) return 0; else return 1;}
|
||||||
|
|
||||||
//protected:
|
//protected:
|
||||||
/** Implement this method in your subclass with the code you want your thread to run. */
|
/** Implement this method in your subclass with the code you want your thread to run. */
|
||||||
@ -221,10 +221,10 @@ FILE *getFilePointer(){return det->getFilePointer();};
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
virtual int setNSubPixels(int ns) {
|
virtual int setNSubPixels(int ns, int nsy) {
|
||||||
slsInterpolation *interp=(det)->getInterpolation();
|
slsInterpolation *interp=(det)->getInterpolation();
|
||||||
if (interp) return interp->setNSubPixels(ns);
|
if (interp) interp->setNSubPixels(ns, nsy);
|
||||||
else return 1;};
|
return 1;};
|
||||||
|
|
||||||
|
|
||||||
virtual slsInterpolation *setInterpolation(slsInterpolation *f){
|
virtual slsInterpolation *setInterpolation(slsInterpolation *f){
|
||||||
@ -249,7 +249,7 @@ protected:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void * processData() {
|
void * processData() {
|
||||||
busy=1;
|
// busy=1;
|
||||||
while (!stop) {
|
while (!stop) {
|
||||||
if (fifoData->isEmpty()) {
|
if (fifoData->isEmpty()) {
|
||||||
busy=0;
|
busy=0;
|
||||||
@ -259,6 +259,7 @@ protected:
|
|||||||
fifoData->pop(data); //blocking!
|
fifoData->pop(data); //blocking!
|
||||||
det->processData(data);
|
det->processData(data);
|
||||||
fifoFree->push(data);
|
fifoFree->push(data);
|
||||||
|
//busy=0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -313,13 +314,13 @@ public:
|
|||||||
|
|
||||||
virtual void newDataSet(){for (int i=0; i<nThreads; i++) dets[i]->newDataSet();};
|
virtual void newDataSet(){for (int i=0; i<nThreads; i++) dets[i]->newDataSet();};
|
||||||
|
|
||||||
virtual int *getImage(int &nnx, int &nny, int &ns) {
|
virtual int *getImage(int &nnx, int &nny, int &ns, int &nsy) {
|
||||||
int *img;
|
int *img;
|
||||||
// int nnx, nny, ns;
|
// int nnx, nny, ns;
|
||||||
// int nnx, nny, ns;
|
// int nnx, nny, ns;
|
||||||
int nn=dets[0]->getImageSize(nnx, nny,ns);
|
int nn=dets[0]->getImageSize(nnx, nny,ns, nsy);
|
||||||
if (image) {
|
if (image) {
|
||||||
delete image;
|
delete [] image;
|
||||||
image=NULL;
|
image=NULL;
|
||||||
}
|
}
|
||||||
image=new int[nn];
|
image=new int[nn];
|
||||||
@ -362,10 +363,10 @@ public:
|
|||||||
/* dets[ii]->writeImage(tit); */
|
/* dets[ii]->writeImage(tit); */
|
||||||
/* } */
|
/* } */
|
||||||
/* #endif */
|
/* #endif */
|
||||||
int nnx, nny, ns;
|
int nnx, nny, ns, nsy;
|
||||||
getImage(nnx, nny, ns);
|
getImage(nnx, nny, ns,nsy);
|
||||||
//int nnx, nny, ns;
|
//int nnx, nny, ns;
|
||||||
int nn=dets[0]->getImageSize(nnx, nny, ns);
|
int nn=dets[0]->getImageSize(nnx, nny, ns, nsy);
|
||||||
float *gm=new float[nn];
|
float *gm=new float[nn];
|
||||||
if (gm) {
|
if (gm) {
|
||||||
for (int ix=0; ix<nn; ix++) {
|
for (int ix=0; ix<nn; ix++) {
|
||||||
|
@ -46,7 +46,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
virtual int setNSubPixels(int ns) { return (dets[0])->setNSubPixels(ns);};
|
/* virtual int setNSubPixels(int ns) { return (dets[0])->setNSubPixels(ns);}; */
|
||||||
|
|
||||||
virtual void resetFlatField() {(dets[0])->resetFlatField();};
|
virtual void resetFlatField() {(dets[0])->resetFlatField();};
|
||||||
|
|
||||||
@ -69,13 +69,13 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
virtual int *getImage(int &nnx, int &nny, int &ns) {
|
virtual int *getImage(int &nnx, int &nny, int &nsx, int &nsy) {
|
||||||
if (getInterpolation()==NULL) return multiThreadedAnalogDetector::getImage(nnx,nny,ns);
|
if (getInterpolation()==NULL) return multiThreadedAnalogDetector::getImage(nnx,nny,nsx, nsy);
|
||||||
//if one interpolates, the whole image is stored in detector 0;
|
//if one interpolates, the whole image is stored in detector 0;
|
||||||
int *img;
|
int *img;
|
||||||
// int nnx, nny, ns;
|
// int nnx, nny, ns;
|
||||||
// int nnx, nny, ns;
|
// int nnx, nny, ns;
|
||||||
int nn=dets[0]->getImageSize(nnx, nny,ns);
|
int nn=dets[0]->getImageSize(nnx, nny,nsx, nsy);
|
||||||
if (image) {
|
if (image) {
|
||||||
delete image;
|
delete image;
|
||||||
image=NULL;
|
image=NULL;
|
||||||
|
@ -10,7 +10,7 @@ class pedestalSubtraction {
|
|||||||
\param nn number of samples to calculate the moving average (defaults to 1000)
|
\param nn number of samples to calculate the moving average (defaults to 1000)
|
||||||
*/
|
*/
|
||||||
pedestalSubtraction (int nn=1000) : stat(nn) {};
|
pedestalSubtraction (int nn=1000) : stat(nn) {};
|
||||||
|
/* void setPointers(double *me, double *va) {mean=me; var=va; stat.setPointers(mean, var);}; */
|
||||||
/** virtual destructorr
|
/** virtual destructorr
|
||||||
*/
|
*/
|
||||||
virtual ~pedestalSubtraction() {};
|
virtual ~pedestalSubtraction() {};
|
||||||
|
@ -51,14 +51,13 @@ public analogDetector<uint16_t> {
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
singlePhotonDetector(slsDetectorData<uint16_t> *d,
|
singlePhotonDetector(slsDetectorData<uint16_t> *d,
|
||||||
int csize=3,
|
int csize=3,
|
||||||
double nsigma=5,
|
double nsigma=5,
|
||||||
int sign=1,
|
int sign=1,
|
||||||
commonModeSubtraction *cm=NULL,
|
commonModeSubtraction *cm=NULL,
|
||||||
int nped=1000,
|
int nped=1000,
|
||||||
int nd=100, int nnx=-1, int nny=-1, double *gm=NULL, ghostSummation<uint16_t> *gs=NULL) : analogDetector<uint16_t>(d, sign, cm, nped, nnx, nny, gm, gs), nDark(nd), eventMask(NULL),nSigma (nsigma), eMin(-1), eMax(-1), clusterSize(csize), clusterSizeY(csize), clusters(NULL), quad(UNDEFINED_QUADRANT), tot(0), quadTot(0) {
|
int nd=100, int nnx=-1, int nny=-1, double *gm=NULL, ghostSummation<uint16_t> *gs=NULL) : analogDetector<uint16_t>(d, sign, cm, nped, nnx, nny, gm, gs), nDark(nd), eventMask(NULL),nSigma (nsigma), eMin(-1), eMax(-1), clusterSize(csize), clusterSizeY(csize), c2(1),c3(1), clusters(NULL), quad(UNDEFINED_QUADRANT), tot(0), quadTot(0) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -66,13 +65,18 @@ public analogDetector<uint16_t> {
|
|||||||
fm=new pthread_mutex_t ;
|
fm=new pthread_mutex_t ;
|
||||||
|
|
||||||
eventMask=new eventType*[ny];
|
eventMask=new eventType*[ny];
|
||||||
|
// val=new double*[ny];
|
||||||
for (int i=0; i<ny; i++) {
|
for (int i=0; i<ny; i++) {
|
||||||
eventMask[i]=new eventType[nx];
|
eventMask[i]=new eventType[nx];
|
||||||
|
// val[i]=new double[nx];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ny==1)
|
if (ny==1)
|
||||||
clusterSizeY=1;
|
clusterSizeY=1;
|
||||||
|
|
||||||
|
|
||||||
|
c2=sqrt((clusterSizeY+1)/2* (clusterSize+1)/2);
|
||||||
|
c3=sqrt(clusterSizeY*clusterSize);
|
||||||
// cluster=new single_photon_hit(clusterSize,clusterSizeY);
|
// cluster=new single_photon_hit(clusterSize,clusterSizeY);
|
||||||
clusters=new single_photon_hit[nx*ny];
|
clusters=new single_photon_hit[nx*ny];
|
||||||
|
|
||||||
@ -100,8 +104,10 @@ public analogDetector<uint16_t> {
|
|||||||
myFile=orig->myFile;
|
myFile=orig->myFile;
|
||||||
|
|
||||||
eventMask=new eventType*[ny];
|
eventMask=new eventType*[ny];
|
||||||
|
// val=new double*[ny];
|
||||||
for (int i=0; i<ny; i++) {
|
for (int i=0; i<ny; i++) {
|
||||||
eventMask[i]=new eventType[nx];
|
eventMask[i]=new eventType[nx];
|
||||||
|
// val[i]=new double[nx];
|
||||||
}
|
}
|
||||||
eMin=orig->eMin;
|
eMin=orig->eMin;
|
||||||
eMax=orig->eMax;
|
eMax=orig->eMax;
|
||||||
@ -111,6 +117,10 @@ public analogDetector<uint16_t> {
|
|||||||
clusterSize=orig->clusterSize;
|
clusterSize=orig->clusterSize;
|
||||||
clusterSizeY=orig->clusterSizeY;
|
clusterSizeY=orig->clusterSizeY;
|
||||||
// cluster=new single_photon_hit(clusterSize,clusterSizeY);
|
// cluster=new single_photon_hit(clusterSize,clusterSizeY);
|
||||||
|
|
||||||
|
c2=sqrt((clusterSizeY+1)/2* (clusterSize+1)/2);
|
||||||
|
c3=sqrt(clusterSizeY*clusterSize);
|
||||||
|
|
||||||
clusters=new single_photon_hit[nx*ny];
|
clusters=new single_photon_hit[nx*ny];
|
||||||
|
|
||||||
// cluster=clusters;
|
// cluster=clusters;
|
||||||
@ -124,6 +134,8 @@ public analogDetector<uint16_t> {
|
|||||||
gmap=orig->gmap;
|
gmap=orig->gmap;
|
||||||
nphTot=0;
|
nphTot=0;
|
||||||
nphFrame=0;
|
nphFrame=0;
|
||||||
|
nphTot=0;
|
||||||
|
nphFrame=0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -196,7 +208,6 @@ public analogDetector<uint16_t> {
|
|||||||
int nn=0;
|
int nn=0;
|
||||||
double max=0, tl=0, tr=0, bl=0,br=0, v;
|
double max=0, tl=0, tr=0, bl=0,br=0, v;
|
||||||
double rms=0;
|
double rms=0;
|
||||||
|
|
||||||
int cm=0;
|
int cm=0;
|
||||||
if (cmSub) cm=1;
|
if (cmSub) cm=1;
|
||||||
|
|
||||||
@ -218,8 +229,8 @@ public analogDetector<uint16_t> {
|
|||||||
cout << "add to common mode?"<< endl;
|
cout << "add to common mode?"<< endl;
|
||||||
addToCommonMode(data);
|
addToCommonMode(data);
|
||||||
}
|
}
|
||||||
for (int iy=ymin; iy<ymax; iy++) {
|
for (iy=ymin; iy<ymax; ++iy) {
|
||||||
for (int ix=xmin; ix<xmax; ix++) {
|
for (ix=xmin; ix<xmax; ++ix) {
|
||||||
if (det->isGood(ix,iy)) {
|
if (det->isGood(ix,iy)) {
|
||||||
val=subtractPedestal(data,ix,iy, cm);
|
val=subtractPedestal(data,ix,iy, cm);
|
||||||
|
|
||||||
@ -236,8 +247,8 @@ public analogDetector<uint16_t> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int iy=ymin; iy<ymax; iy++) {
|
for (iy=ymin; iy<ymax; ++iy) {
|
||||||
for (int ix=xmin; ix<xmax; ix++) {
|
for (ix=xmin; ix<xmax; ++ix) {
|
||||||
|
|
||||||
if (det->isGood(ix,iy)) {
|
if (det->isGood(ix,iy)) {
|
||||||
eventMask[iy][ix]=PEDESTAL;
|
eventMask[iy][ix]=PEDESTAL;
|
||||||
@ -346,15 +357,20 @@ int *getClusters(char *data, int *ph=NULL) {
|
|||||||
|
|
||||||
|
|
||||||
int nph=0;
|
int nph=0;
|
||||||
double val[ny][nx];
|
// const int cy=(clusterSizeY+1)/2;
|
||||||
int cy=(clusterSizeY+1)/2;
|
//const int cs=(clusterSize+1)/2;
|
||||||
int cs=(clusterSize+1)/2;
|
|
||||||
//int ir, ic;
|
|
||||||
|
|
||||||
|
//int ir, ic;
|
||||||
|
eventType ee;
|
||||||
double max=0, tl=0, tr=0, bl=0,br=0, *v;
|
double max=0, tl=0, tr=0, bl=0,br=0, *v;
|
||||||
int cm=0;
|
int cm=0;
|
||||||
int good=1;
|
int good=1;
|
||||||
if (cmSub) cm=1;
|
int ir, ic;
|
||||||
|
// double quadTot;
|
||||||
|
//quadrant quad;
|
||||||
|
double rms;
|
||||||
|
//if (cmSub) cm=1;
|
||||||
|
double val[ny][nx];
|
||||||
if (ph==NULL)
|
if (ph==NULL)
|
||||||
ph=image;
|
ph=image;
|
||||||
|
|
||||||
@ -366,13 +382,15 @@ int *getClusters(char *data, int *ph=NULL) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (cm)
|
if (cmSub) {
|
||||||
addToCommonMode(data);
|
addToCommonMode(data);
|
||||||
|
cm=1;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (iy=ymin; iy<ymax; ++iy) {
|
||||||
|
for (ix=xmin; ix<xmax; ++ix) {
|
||||||
|
if (det->isGood(ix,iy)==0) continue;
|
||||||
|
|
||||||
for (int iy=ymin; iy<ymax; iy++) {
|
|
||||||
for (int ix=xmin; ix<xmax; ix++) {
|
|
||||||
if (det->isGood(ix,iy)) {
|
|
||||||
max=0;
|
max=0;
|
||||||
tl=0;
|
tl=0;
|
||||||
tr=0;
|
tr=0;
|
||||||
@ -384,20 +402,19 @@ int *getClusters(char *data, int *ph=NULL) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
eventMask[iy][ix]=PEDESTAL;
|
//eventMask[iy][ix]
|
||||||
|
ee=PEDESTAL;
|
||||||
|
|
||||||
|
|
||||||
(clusters+nph)->rms=getPedestalRMS(ix,iy);
|
rms=getPedestalRMS(ix,iy);
|
||||||
// cluster=clusters+nph;
|
// cluster=clusters+nph;
|
||||||
|
|
||||||
|
// cout << ix << " " << iy << endl;
|
||||||
for (int ir=-(clusterSizeY/2); ir<(clusterSizeY/2)+1; ir++) {
|
for (ir=-(clusterSizeY/2); ir<(clusterSizeY/2)+1; ir++) {
|
||||||
for (int ic=-(clusterSize/2); ic<(clusterSize/2)+1; ic++) {
|
for (ic=-(clusterSize/2); ic<(clusterSize/2)+1; ic++) {
|
||||||
|
|
||||||
if ((iy+ir)>=iy && (iy+ir)<ny && (ix+ic)>=ix && (ix+ic)<nx) {
|
if ((iy+ir)>=iy && (iy+ir)<ny && (ix+ic)>=ix && (ix+ic)<nx) {
|
||||||
val[iy+ir][ix+ic]=subtractPedestal(data,ix+ic,iy+ir, cm);
|
val[iy+ir][ix+ic]=subtractPedestal(data,ix+ic,iy+ir, cm);
|
||||||
}
|
|
||||||
|
|
||||||
v=&(val[iy+ir][ix+ic]);
|
v=&(val[iy+ir][ix+ic]);
|
||||||
tot+=*v;
|
tot+=*v;
|
||||||
if (ir<=0 && ic<=0)
|
if (ir<=0 && ic<=0)
|
||||||
@ -412,44 +429,68 @@ int *getClusters(char *data, int *ph=NULL) {
|
|||||||
max=*v;
|
max=*v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (ir==0 && ic==0) {
|
|
||||||
if (*v<-nSigma*(clusters+nph)->rms)
|
|
||||||
eventMask[iy][ix]=NEGATIVE_PEDESTAL;
|
|
||||||
else if (*v>nSigma*(clusters+nph)->rms)
|
|
||||||
eventMask[iy][ix]=PHOTON;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (eventMask[iy][ix]==PHOTON && val[iy][ix]<max)
|
/* if (ix==50 && iy==50) */
|
||||||
|
/* cout << id << " " << ix << " " << iy << " " << det->getValue(data,ix,iy)<< " " << val[iy][ix] << " " << getPedestal(ix,iy) << " " << rms << endl; */
|
||||||
|
if (val[iy][ix]<-nSigma*rms){
|
||||||
|
ee=NEGATIVE_PEDESTAL;
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
if (bl>=br && bl>=tl && bl>=tr) {
|
if (max>nSigma*rms){
|
||||||
(clusters+nph)->quad=BOTTOM_LEFT;
|
// cout << "ph1 " << max << " " << nSigma*rms << endl;
|
||||||
(clusters+nph)->quadTot=bl;
|
ee=PHOTON;
|
||||||
} else if (br>=bl && br>=tl && br>=tr) {
|
if (val[iy][ix]<max)
|
||||||
(clusters+nph)->quad=BOTTOM_RIGHT;
|
continue;
|
||||||
(clusters+nph)->quadTot=br;
|
}
|
||||||
} else if (tl>=br && tl>=bl && tl>=tr) {
|
else if (tot>c3*nSigma*rms) {
|
||||||
(clusters+nph)->quad=TOP_LEFT;
|
// cout << "ph3 " << tot << " " << c3*nSigma*rms << endl;
|
||||||
(clusters+nph)->quadTot=tl;
|
ee=PHOTON;
|
||||||
} else if (tr>=bl && tr>=tl && tr>=br) {
|
}
|
||||||
(clusters+nph)->quad=TOP_RIGHT;
|
#ifndef WRITE_QUAD
|
||||||
(clusters+nph)->quadTot=tr;
|
else {
|
||||||
|
#endif
|
||||||
|
quad=BOTTOM_RIGHT;
|
||||||
|
quadTot=br;
|
||||||
|
if (bl>=quadTot) {
|
||||||
|
quad=BOTTOM_LEFT;
|
||||||
|
quadTot=bl;
|
||||||
|
}
|
||||||
|
if (tl>=quadTot) {
|
||||||
|
quad=TOP_LEFT;
|
||||||
|
quadTot=tl;
|
||||||
|
}
|
||||||
|
if (tr>=quadTot) {
|
||||||
|
quad=TOP_RIGHT;
|
||||||
|
quadTot=tr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (max>nSigma*(clusters+nph)->rms || tot>sqrt(clusterSizeY*clusterSize)*nSigma*(clusters+nph)->rms || ((clusters+nph)->quadTot)>sqrt(cy*cs)*nSigma*(clusters+nph)->rms) {
|
if (quadTot>c2*nSigma*rms) {
|
||||||
if (val[iy][ix]>=max) {
|
// cout << "ph2 " << quadTot << " " << c2*nSigma*rms << endl;
|
||||||
eventMask[iy][ix]=PHOTON_MAX;
|
ee=PHOTON;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifndef WRITE_QUAD
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if (ee==PHOTON && val[iy][ix]==max) {
|
||||||
|
ee=PHOTON_MAX;
|
||||||
|
// cout << "**" <<id<< " " << iframe << " " << nDark << " " << ix << " " << iy << " " << rms << " " << max << " " << quadTot << " " << tot << endl;
|
||||||
(clusters+nph)->tot=tot;
|
(clusters+nph)->tot=tot;
|
||||||
(clusters+nph)->x=ix;
|
(clusters+nph)->x=ix;
|
||||||
(clusters+nph)->y=iy;
|
(clusters+nph)->y=iy;
|
||||||
|
(clusters+nph)->quad=quad;
|
||||||
|
(clusters+nph)->quadTot=quadTot;
|
||||||
|
//(clusters+nph)->rms=rms;
|
||||||
// (clusters+nph)->iframe=det->getFrameNumber(data);
|
// (clusters+nph)->iframe=det->getFrameNumber(data);
|
||||||
// cout << det->getFrameNumber(data) << " " << (clusters+nph)->iframe << endl;
|
// cout << det->getFrameNumber(data) << " " << (clusters+nph)->iframe << endl;
|
||||||
(clusters+nph)->ped=getPedestal(ix,iy,0);
|
// (clusters+nph)->ped=getPedestal(ix,iy,0);
|
||||||
for (int ir=-(clusterSizeY/2); ir<(clusterSizeY/2)+1; ir++) {
|
for (ir=-(clusterSizeY/2); ir<(clusterSizeY/2)+1; ir++) {
|
||||||
for (int ic=-(clusterSize/2); ic<(clusterSize/2)+1; ic++) {
|
for (ic=-(clusterSize/2); ic<(clusterSize/2)+1; ic++) {
|
||||||
|
if ((iy+ir)>=0 && (iy+ir)<ny && (ix+ic)>=0 && (ix+ic)<nx)
|
||||||
(clusters+nph)->set_data(val[iy+ir][ix+ic],ic,ir);
|
(clusters+nph)->set_data(val[iy+ir][ix+ic],ic,ir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -462,19 +503,19 @@ int *getClusters(char *data, int *ph=NULL) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else if (ee==PEDESTAL) {
|
||||||
eventMask[iy][ix]=PHOTON;
|
|
||||||
}
|
|
||||||
} else if (eventMask[iy][ix]==PEDESTAL) {
|
|
||||||
addToPedestal(data,ix,iy,cm);
|
addToPedestal(data,ix,iy,cm);
|
||||||
|
} /*else {
|
||||||
|
eventMask[iy][ix]=PHOTON;
|
||||||
|
}*/
|
||||||
|
//eventMask[iy][ix]=ee;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
nphFrame=nph;
|
nphFrame=nph;
|
||||||
nphTot+=nph;
|
nphTot+=nph;
|
||||||
//cout << nphFrame << endl;
|
//cout << nphFrame << endl;
|
||||||
// cout <<"**********************************"<< det->getFrameNumber(data) << " " << nphFrame << endl;
|
//cout <<id << " **********************************"<< iframe << " " << det->getFrameNumber(data) << " " << nphFrame << endl;
|
||||||
writeClusters(det->getFrameNumber(data));
|
writeClusters(det->getFrameNumber(data));
|
||||||
return image;
|
return image;
|
||||||
|
|
||||||
@ -561,13 +602,20 @@ int *getClusters(char *data, int *ph=NULL) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static void writeClusters(FILE *f, single_photon_hit *cl, int nph, int fn=0){
|
static void writeClusters(FILE *f, single_photon_hit *cl, int nph, int fn=0){
|
||||||
|
if (nph>0) {
|
||||||
/* #ifndef OLDFORMAT */
|
#ifndef OLDFORMAT
|
||||||
/* if (fwrite((void*)&fn, 1, sizeof(int), f)) */
|
if (fwrite((void*)&fn, 1, sizeof(int), f))
|
||||||
/* if (fwrite((void*)&nph, 1, sizeof(int), f)) */
|
if (fwrite((void*)&nph, 1, sizeof(int), f))
|
||||||
/* #endif */
|
#endif
|
||||||
for (int i=0; i<nph; i++) (cl+i)->write(f);
|
for (int i=0; i<nph; i++) (cl+i)->write(f);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void writeClusters(FILE *f, int fn=0){
|
void writeClusters(FILE *f, int fn=0){
|
||||||
writeClusters(f,clusters,nphFrame, fn);
|
writeClusters(f,clusters,nphFrame, fn);
|
||||||
//for (int i=0; i<nphFrame; i++)
|
//for (int i=0; i<nphFrame; i++)
|
||||||
@ -623,6 +671,7 @@ int *getClusters(char *data, int *ph=NULL) {
|
|||||||
double eMin, eMax;
|
double eMin, eMax;
|
||||||
int clusterSize; /**< cluster size in the x direction */
|
int clusterSize; /**< cluster size in the x direction */
|
||||||
int clusterSizeY; /**< cluster size in the y direction i.e. 1 for strips, clusterSize for pixels */
|
int clusterSizeY; /**< cluster size in the y direction i.e. 1 for strips, clusterSize for pixels */
|
||||||
|
double c2, c3;
|
||||||
// single_photon_hit *cluster; /**< single photon hit data structure */
|
// single_photon_hit *cluster; /**< single photon hit data structure */
|
||||||
single_photon_hit *clusters; /**< single photon hit data structure */
|
single_photon_hit *clusters; /**< single photon hit data structure */
|
||||||
quadrant quad; /**< quadrant where the photon is located */
|
quadrant quad; /**< quadrant where the photon is located */
|
||||||
@ -631,6 +680,7 @@ int *getClusters(char *data, int *ph=NULL) {
|
|||||||
int nphTot;
|
int nphTot;
|
||||||
int nphFrame;
|
int nphFrame;
|
||||||
|
|
||||||
|
// double **val;
|
||||||
pthread_mutex_t *fm;
|
pthread_mutex_t *fm;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -36,16 +36,14 @@ class single_photon_hit {
|
|||||||
\param myFile file descriptor
|
\param myFile file descriptor
|
||||||
*/
|
*/
|
||||||
size_t write(FILE *myFile) {
|
size_t write(FILE *myFile) {
|
||||||
//fwrite((void*)this, 1, 3*sizeof(int)+4*sizeof(double)+sizeof(quad), myFile);
|
//fwrite((void*)this, 1, 3*sizeof(int)+4*sizeof(double)+sizeof(quad), myFile); // if (fwrite((void*)this, 1, sizeof(int)+2*sizeof(int16_t), myFile))
|
||||||
|
#ifdef OLDFORMAT
|
||||||
// if (fwrite((void*)this, 1, sizeof(int)+2*sizeof(int16_t), myFile))
|
|
||||||
//#ifdef OLDFORMAT
|
|
||||||
if (fwrite((void*)&iframe, 1, sizeof(int), myFile)) {};
|
if (fwrite((void*)&iframe, 1, sizeof(int), myFile)) {};
|
||||||
//#endif
|
#endif
|
||||||
#ifndef WRITE_QUAD
|
#ifndef WRITE_QUAD
|
||||||
//printf("no quad ");
|
//printf("no quad ");
|
||||||
if (fwrite((void*)&x, 2, sizeof(int16_t), myFile))
|
if (fwrite((void*)&x, sizeof(int16_t), 2, myFile))
|
||||||
return fwrite((void*)data, 1, dx*dy*sizeof(int), myFile);
|
return fwrite((void*)data, sizeof(int), dx*dy, myFile);
|
||||||
#endif
|
#endif
|
||||||
#ifdef WRITE_QUAD
|
#ifdef WRITE_QUAD
|
||||||
// printf("quad ");
|
// printf("quad ");
|
||||||
@ -91,8 +89,8 @@ class single_photon_hit {
|
|||||||
default:
|
default:
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
if (fwrite((void*)&x, 2, sizeof(int16_t), myFile))
|
if (fwrite((void*)&x, sizeof(int16_t), 2, myFile))
|
||||||
return fwrite((void*)qq, 1, 4*sizeof(int), myFile);
|
return fwrite((void*)qq, sizeof(int), 4, myFile);
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
@ -104,19 +102,19 @@ class single_photon_hit {
|
|||||||
size_t read(FILE *myFile) {
|
size_t read(FILE *myFile) {
|
||||||
//fread((void*)this, 1, 3*sizeof(int)+4*sizeof(double)+sizeof(quad), myFile);
|
//fread((void*)this, 1, 3*sizeof(int)+4*sizeof(double)+sizeof(quad), myFile);
|
||||||
|
|
||||||
//#ifdef OLDFORMAT
|
#ifdef OLDFORMAT
|
||||||
if (fread((void*)&iframe, 1, sizeof(int), myFile)) {}
|
if (fread((void*)&iframe, 1, sizeof(int), myFile)) {}
|
||||||
//#endif
|
#endif
|
||||||
#ifndef WRITE_QUAD
|
#ifndef WRITE_QUAD
|
||||||
// printf( "no quad \n");
|
// printf( "no quad \n");
|
||||||
if (fread((void*)&x, 2, sizeof(int16_t), myFile))
|
if (fread((void*)&x, sizeof(int16_t),2, myFile))
|
||||||
return fread((void*)data, 1, dx*dy*sizeof(int), myFile);
|
return fread((void*)data, sizeof(int), dx*dy,myFile);
|
||||||
#endif
|
#endif
|
||||||
#ifdef WRITE_QUAD
|
#ifdef WRITE_QUAD
|
||||||
int qq[4];
|
int qq[4];
|
||||||
// printf( "quad \n");
|
printf( "quad \n");
|
||||||
if (fread((void*)&x, 2, sizeof(int16_t), myFile))
|
if (fread((void*)&x, sizeof(int16_t), 2, myFile))
|
||||||
if (fread((void*)qq, 1, 4*sizeof(int), myFile)) {
|
if (fread((void*)qq, sizeof(int), 4, myFile)) {
|
||||||
|
|
||||||
quad=TOP_RIGHT;
|
quad=TOP_RIGHT;
|
||||||
/* int mm=qq[0]; */
|
/* int mm=qq[0]; */
|
||||||
@ -216,7 +214,6 @@ class single_photon_hit {
|
|||||||
for (int iy=0; iy<dy; iy++) {
|
for (int iy=0; iy<dy; iy++) {
|
||||||
for (int ix=0; ix<dx; ix++) {
|
for (int ix=0; ix<dx; ix++) {
|
||||||
printf("%d \t",data[ix+iy*dx]);
|
printf("%d \t",data[ix+iy*dx]);
|
||||||
|
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
@ -246,8 +243,6 @@ class single_photon_hit {
|
|||||||
int *get_cluster() {return data;};
|
int *get_cluster() {return data;};
|
||||||
|
|
||||||
int iframe; /**< frame number */
|
int iframe; /**< frame number */
|
||||||
int16_t x; /**< x-coordinate of the center of hit */
|
|
||||||
int16_t y; /**< x-coordinate of the center of hit */
|
|
||||||
double rms; /**< noise of central pixel l -- at some point it can be removed*/
|
double rms; /**< noise of central pixel l -- at some point it can be removed*/
|
||||||
double ped; /**< pedestal of the central pixel -- at some point it can be removed*/
|
double ped; /**< pedestal of the central pixel -- at some point it can be removed*/
|
||||||
double tot; /**< sum of the 3x3 cluster */
|
double tot; /**< sum of the 3x3 cluster */
|
||||||
@ -255,6 +250,8 @@ class single_photon_hit {
|
|||||||
double quadTot; /**< sum of the maximum 2x2cluster */
|
double quadTot; /**< sum of the maximum 2x2cluster */
|
||||||
int dx; /**< size of data cluster in x */
|
int dx; /**< size of data cluster in x */
|
||||||
int dy; /**< size of data cluster in y */
|
int dy; /**< size of data cluster in y */
|
||||||
|
int16_t x; /**< x-coordinate of the center of hit */
|
||||||
|
int16_t y; /**< x-coordinate of the center of hit */
|
||||||
int *data; /**< pointer to data */
|
int *data; /**< pointer to data */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -88,6 +88,7 @@ target_include_directories(slsDetectorGui PUBLIC
|
|||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(slsDetectorGui PUBLIC
|
target_link_libraries(slsDetectorGui PUBLIC
|
||||||
|
slsProjectWarnings
|
||||||
slsDetectorShared
|
slsDetectorShared
|
||||||
${QT_QTCORE_LIBRARIES}
|
${QT_QTCORE_LIBRARIES}
|
||||||
${QT_QTGUI_LIBRARIES}
|
${QT_QTGUI_LIBRARIES}
|
||||||
@ -103,10 +104,10 @@ set_target_properties(slsDetectorGui PROPERTIES
|
|||||||
)
|
)
|
||||||
|
|
||||||
install(TARGETS slsDetectorGui
|
install(TARGETS slsDetectorGui
|
||||||
EXPORT "${TARGETS_EXPORT_NAME}"
|
# EXPORT "${TARGETS_EXPORT_NAME}"
|
||||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
# LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
# ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
# PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -55,6 +55,149 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="lblCompleteImage">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="palette">
|
||||||
|
<palette>
|
||||||
|
<active>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>0</red>
|
||||||
|
<green>150</green>
|
||||||
|
<blue>110</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</active>
|
||||||
|
<inactive>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>0</red>
|
||||||
|
<green>150</green>
|
||||||
|
<blue>110</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</inactive>
|
||||||
|
<disabled>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>139</red>
|
||||||
|
<green>142</green>
|
||||||
|
<blue>142</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</disabled>
|
||||||
|
</palette>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Complete Image</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QLabel" name="lblInCompleteImage">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="palette">
|
||||||
|
<palette>
|
||||||
|
<active>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>255</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</active>
|
||||||
|
<inactive>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>255</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</inactive>
|
||||||
|
<disabled>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>139</red>
|
||||||
|
<green>142</green>
|
||||||
|
<blue>142</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</disabled>
|
||||||
|
</palette>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Missing Packets</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="2">
|
||||||
|
<spacer name="horizontalSpacer_3">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>117</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0" colspan="3">
|
||||||
<widget class="QWidget" name="widgetStatistics" native="true">
|
<widget class="QWidget" name="widgetStatistics" native="true">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
@ -241,7 +384,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>376</width>
|
<width>376</width>
|
||||||
<height>28</height>
|
<height>27</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QMenu" name="menuSave">
|
<widget class="QMenu" name="menuSave">
|
||||||
|
@ -19,47 +19,8 @@
|
|||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Form</string>
|
<string>Form</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="layout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<property name="margin">
|
<item row="2" column="0" colspan="4">
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QGroupBox" name="boxPlot">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<family>Sans Serif</family>
|
|
||||||
<pointsize>10</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="title">
|
|
||||||
<string>Sample Plot</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignCenter</set>
|
|
||||||
</property>
|
|
||||||
<property name="flat">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="plotLayout">
|
|
||||||
<property name="margin">
|
|
||||||
<number>9</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QWidget" name="widgetStatistics" native="true">
|
<widget class="QWidget" name="widgetStatistics" native="true">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
@ -86,73 +47,6 @@
|
|||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="0" column="6">
|
|
||||||
<widget class="QLabel" name="lblSum">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>16777215</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Sum: </string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="2">
|
|
||||||
<spacer name="horizontalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QLabel" name="lblMinDisp">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>-</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="4">
|
|
||||||
<widget class="QLabel" name="lblMaxDisp">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>-</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="3">
|
<item row="0" column="3">
|
||||||
<widget class="QLabel" name="lblMax">
|
<widget class="QLabel" name="lblMax">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@ -181,8 +75,8 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="7">
|
<item row="0" column="1">
|
||||||
<widget class="QLabel" name="lblSumDisp">
|
<widget class="QLabel" name="lblMinDisp">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
@ -194,6 +88,19 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="0" column="2">
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="lblMin">
|
<widget class="QLabel" name="lblMin">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@ -222,6 +129,32 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="0" column="4">
|
||||||
|
<widget class="QLabel" name="lblMaxDisp">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>-</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="7">
|
||||||
|
<widget class="QLabel" name="lblSumDisp">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>-</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="0" column="5">
|
<item row="0" column="5">
|
||||||
<spacer name="horizontalSpacer_2">
|
<spacer name="horizontalSpacer_2">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
@ -235,9 +168,213 @@
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="0" column="6">
|
||||||
|
<widget class="QLabel" name="lblSum">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Sum: </string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="1" column="3">
|
||||||
|
<spacer name="horizontalSpacer_3">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>419</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0" colspan="4">
|
||||||
|
<widget class="QGroupBox" name="boxPlot">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<family>Sans Serif</family>
|
||||||
|
<pointsize>10</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="title">
|
||||||
|
<string>Sample Plot</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="plotLayout">
|
||||||
|
<property name="margin">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="2">
|
||||||
|
<widget class="QLabel" name="lblInCompleteImage">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="palette">
|
||||||
|
<palette>
|
||||||
|
<active>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>255</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</active>
|
||||||
|
<inactive>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>255</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</inactive>
|
||||||
|
<disabled>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>139</red>
|
||||||
|
<green>142</green>
|
||||||
|
<blue>142</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</disabled>
|
||||||
|
</palette>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Missing Packets</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QLabel" name="lblCompleteImage">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="palette">
|
||||||
|
<palette>
|
||||||
|
<active>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>0</red>
|
||||||
|
<green>150</green>
|
||||||
|
<blue>110</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</active>
|
||||||
|
<inactive>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>0</red>
|
||||||
|
<green>150</green>
|
||||||
|
<blue>110</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</inactive>
|
||||||
|
<disabled>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>139</red>
|
||||||
|
<green>142</green>
|
||||||
|
<blue>142</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</disabled>
|
||||||
|
</palette>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Complete Image</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
|
@ -1066,239 +1066,6 @@
|
|||||||
<string>Acquisition</string>
|
<string>Acquisition</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QGridLayout" name="gridLayout_6">
|
<layout class="QGridLayout" name="gridLayout_6">
|
||||||
<item row="1" column="4">
|
|
||||||
<spacer name="horizontalSpacer_3">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Expanding</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="lblNumStoragecells">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string><html><head/><body><p>Number of additional storage cells. For Jungfrau only. </p><p>Default: 0. </p><p>Number of Images received: #frames * #triggers * (#storagecells+1) </p><p> #storagecells#</p><p><br/></p></body></html></string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Number of Storage cells:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<spacer name="horizontalSpacer_8">
|
|
||||||
<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="4" column="2">
|
|
||||||
<spacer name="verticalSpacer_2">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Expanding</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="2" colspan="2">
|
|
||||||
<widget class="QSpinBox" name="spinNumStoragecells">
|
|
||||||
<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="toolTip">
|
|
||||||
<string><html><head/><body><p>Number of additional storage cells. For Jungfrau only. </p><p>Default: 0. </p><p>Number of Images received: #frames * #triggers * (#storagecells+1) </p><p> #storagecells#</p><p><br/></p></body></html></string>
|
|
||||||
</property>
|
|
||||||
<property name="statusTip">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="whatsThis">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
<property name="keyboardTracking">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="suffix">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="minimum">
|
|
||||||
<number>-1</number>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>15</number>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="2">
|
|
||||||
<widget class="QDoubleSpinBox" name="spinSubExpTime">
|
|
||||||
<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="toolTip">
|
|
||||||
<string><nobr>
|
|
||||||
Exposure Time of a sub frame. Only for Eiger in 32 bit mode
|
|
||||||
</nobr><br><nobr>
|
|
||||||
#subexptime#
|
|
||||||
</nobr></string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
<property name="keyboardTracking">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="decimals">
|
|
||||||
<number>9</number>
|
|
||||||
</property>
|
|
||||||
<property name="minimum">
|
|
||||||
<double>-1.000000000000000</double>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<double>2000000000.000000000000000</double>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<double>1.000000000000000</double>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QLabel" name="lblSubDeadTime">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string><nobr>
|
|
||||||
Dead time between sub frames. Only for Eiger in 32 bit mode.
|
|
||||||
</nobr><br><nobr>
|
|
||||||
Default value is 0. A value less than the required minimum is ignored.
|
|
||||||
</nobr><br><nobr>
|
|
||||||
#subdeadtime#
|
|
||||||
</nobr></string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Sub Frame Dead Time:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="2">
|
|
||||||
<widget class="QDoubleSpinBox" name="spinSubDeadTime">
|
|
||||||
<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="toolTip">
|
|
||||||
<string><nobr>
|
|
||||||
Period between sub frames. Only for Eiger in 32 bit mode.
|
|
||||||
</nobr><br><nobr>
|
|
||||||
Default value is 0. A value less than the required minimum is ignored.
|
|
||||||
</nobr><br><nobr>
|
|
||||||
#subperiod#
|
|
||||||
</nobr></string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
<property name="keyboardTracking">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="decimals">
|
|
||||||
<number>9</number>
|
|
||||||
</property>
|
|
||||||
<property name="minimum">
|
|
||||||
<double>-1.000000000000000</double>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<double>2000000000.000000000000000</double>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<double>1.000000000000000</double>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="lblSubExpTime">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string><nobr>
|
|
||||||
Exposure Time of a sub frame. Only for Eiger in 32 bit mode
|
|
||||||
</nobr><br><nobr>
|
|
||||||
#subexptime#
|
|
||||||
</nobr></string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Sub Frame Exposure Time:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="3">
|
<item row="2" column="3">
|
||||||
<widget class="QComboBox" name="comboSubDeadTimeUnit">
|
<widget class="QComboBox" name="comboSubDeadTimeUnit">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
@ -1425,6 +1192,98 @@ Exposure Time of a sub frame. Only for Eiger in 32 bit mode
|
|||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="lblNumStoragecells">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>Number of additional storage cells. For Jungfrau only. </p><p>Default: 0. </p><p>Number of Images received: #frames * #triggers * (#storagecells+1) </p><p> #storagecells#</p><p><br/></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Number of Storage cells:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<spacer name="horizontalSpacer_8">
|
||||||
|
<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="2" column="2">
|
||||||
|
<widget class="QDoubleSpinBox" name="spinSubDeadTime">
|
||||||
|
<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="toolTip">
|
||||||
|
<string><nobr>
|
||||||
|
Period between sub frames. Only for Eiger in 32 bit mode.
|
||||||
|
</nobr><br><nobr>
|
||||||
|
Default value is 0. A value less than the required minimum is ignored.
|
||||||
|
</nobr><br><nobr>
|
||||||
|
#subperiod#
|
||||||
|
</nobr></string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
<property name="keyboardTracking">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="decimals">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<double>-1.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<double>2000000000.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<double>1.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="lblSubExpTime">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><nobr>
|
||||||
|
Exposure Time of a sub frame. Only for Eiger in 32 bit mode
|
||||||
|
</nobr><br><nobr>
|
||||||
|
#subexptime#
|
||||||
|
</nobr></string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Sub Frame Exposure Time:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="3" column="0">
|
<item row="3" column="0">
|
||||||
<widget class="QLabel" name="lblDiscardBits">
|
<widget class="QLabel" name="lblDiscardBits">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
@ -1490,6 +1349,428 @@ Default value is 0. A value less than the required minimum is ignored.
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="1" column="4">
|
||||||
|
<spacer name="horizontalSpacer_3">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Expanding</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="8" column="2">
|
||||||
|
<spacer name="verticalSpacer_2">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Expanding</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="2" colspan="2">
|
||||||
|
<widget class="QSpinBox" name="spinNumStoragecells">
|
||||||
|
<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="toolTip">
|
||||||
|
<string><html><head/><body><p>Number of additional storage cells. For Jungfrau only. </p><p>Default: 0. </p><p>Number of Images received: #frames * #triggers * (#storagecells+1) </p><p> #storagecells#</p><p><br/></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="statusTip">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="whatsThis">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
<property name="keyboardTracking">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="suffix">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>-1</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>15</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="2">
|
||||||
|
<widget class="QDoubleSpinBox" name="spinSubExpTime">
|
||||||
|
<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="toolTip">
|
||||||
|
<string><nobr>
|
||||||
|
Exposure Time of a sub frame. Only for Eiger in 32 bit mode
|
||||||
|
</nobr><br><nobr>
|
||||||
|
#subexptime#
|
||||||
|
</nobr></string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
<property name="keyboardTracking">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="decimals">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<double>-1.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<double>2000000000.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<double>1.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="lblSubDeadTime">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><nobr>
|
||||||
|
Dead time between sub frames. Only for Eiger in 32 bit mode.
|
||||||
|
</nobr><br><nobr>
|
||||||
|
Default value is 0. A value less than the required minimum is ignored.
|
||||||
|
</nobr><br><nobr>
|
||||||
|
#subdeadtime#
|
||||||
|
</nobr></string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Sub Frame Dead Time:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="3">
|
||||||
|
<widget class="QComboBox" name="comboExpTimeUnit">
|
||||||
|
<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="toolTip">
|
||||||
|
<string><html><head/><body><p>Exposure Time of a corresonding gate signal index. <br/>#exptime1# </p><p>#exptime2#</p><p>#exptime3# </p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="layoutDirection">
|
||||||
|
<enum>Qt::LeftToRight</enum>
|
||||||
|
</property>
|
||||||
|
<property name="currentIndex">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>hr</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>min</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>s</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>ms</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>us</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>ns</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="2">
|
||||||
|
<widget class="QDoubleSpinBox" name="spinExpTime">
|
||||||
|
<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="toolTip">
|
||||||
|
<string><html><head/><body><p>Exposure Time of a corresonding gate signal index. <br/>#exptime1# </p><p>#exptime2#</p><p>#exptime3# </p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
<property name="keyboardTracking">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="decimals">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<double>-1.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<double>2000000000.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<double>1.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="2">
|
||||||
|
<widget class="QSpinBox" name="spinGateIndex">
|
||||||
|
<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="toolTip">
|
||||||
|
<string><html><head/><body><p>Gate index. It will get exposure time and gate delay for corresponding gate signal.</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="statusTip">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="whatsThis">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
<property name="keyboardTracking">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="suffix">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="0">
|
||||||
|
<widget class="QLabel" name="lblGateDelay">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>Number of additional storage cells. For Jungfrau only. </p><p>Default: 0. </p><p>Number of Images received: #frames * #triggers * (#storagecells+1) </p><p> #storagecells#</p><p><br/></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Gate Delay:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="2">
|
||||||
|
<widget class="QDoubleSpinBox" name="spinGateDelay">
|
||||||
|
<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="toolTip">
|
||||||
|
<string><html><head/><body><p>Gate Delay of a corresonding gate signal index. <br/>#gatedelay1# </p><p>#gatedelay2#</p><p>#gatedelay3# </p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
<property name="keyboardTracking">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="decimals">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<double>-1.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<double>2000000000.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<double>1.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="3">
|
||||||
|
<widget class="QComboBox" name="comboGateDelayUnit">
|
||||||
|
<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="toolTip">
|
||||||
|
<string><html><head/><body><p>Gate Delay of a corresonding gate signal index. <br/>#gatedelay1# </p><p>#gatedelay2#</p><p>#gatedelay3# </p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="layoutDirection">
|
||||||
|
<enum>Qt::LeftToRight</enum>
|
||||||
|
</property>
|
||||||
|
<property name="currentIndex">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>hr</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>min</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>s</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>ms</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>us</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>ns</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="0">
|
||||||
|
<widget class="QLabel" name="lblExpTime">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>Number of additional storage cells. For Jungfrau only. </p><p>Default: 0. </p><p>Number of Images received: #frames * #triggers * (#storagecells+1) </p><p> #storagecells#</p><p><br/></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Expososure Time:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0">
|
||||||
|
<widget class="QLabel" name="lblGateIndex">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>Number of additional storage cells. For Jungfrau only. </p><p>Default: 0. </p><p>Number of Images received: #frames * #triggers * (#storagecells+1) </p><p> #storagecells#</p><p><br/></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Gate Index:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
|
@ -409,7 +409,7 @@
|
|||||||
<widget class="QFrame" name="frameTimeResolved">
|
<widget class="QFrame" name="frameTimeResolved">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>400</width>
|
<width>410</width>
|
||||||
<height>0</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
@ -432,6 +432,77 @@
|
|||||||
<property name="verticalSpacing">
|
<property name="verticalSpacing">
|
||||||
<number>4</number>
|
<number>4</number>
|
||||||
</property>
|
</property>
|
||||||
|
<item row="5" column="0">
|
||||||
|
<widget class="QStackedWidget" name="stackedLblTriggerBurst">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>171</width>
|
||||||
|
<height>32</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>171</width>
|
||||||
|
<height>32</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="currentIndex">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="pageLblTrigger">
|
||||||
|
<layout class="QGridLayout" name="gridLblTrigger">
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="lblNumTriggers">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>Number of Triggers to be expected.</p><p> #triggers#</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Number of Triggers:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="pageLblBurst">
|
||||||
|
<layout class="QGridLayout" name="gridLblBurst">
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="lblNumBursts">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>Number of Triggers to be expected.</p><p> #triggers#</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Number of Bursts:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="4" column="3">
|
<item row="4" column="3">
|
||||||
<widget class="QComboBox" name="comboPeriodUnit">
|
<widget class="QComboBox" name="comboPeriodUnit">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
@ -501,53 +572,6 @@ Frame period between exposures.
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="2" colspan="2">
|
|
||||||
<widget class="QSpinBox" name="spinNumSamples">
|
|
||||||
<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="toolTip">
|
|
||||||
<string>Number of Triggers to be expected.
|
|
||||||
#triggers#</string>
|
|
||||||
</property>
|
|
||||||
<property name="statusTip">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="whatsThis">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
<property name="keyboardTracking">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="suffix">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="minimum">
|
|
||||||
<number>-1</number>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>2000000000</number>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<number>1</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="2" colspan="2">
|
<item row="1" column="2" colspan="2">
|
||||||
<widget class="QSpinBox" name="spinNumMeasurements">
|
<widget class="QSpinBox" name="spinNumMeasurements">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@ -594,25 +618,17 @@ Frame period between exposures.
|
|||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="label_5">
|
<widget class="QLabel" name="label_5">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>175</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Number of Measurements:</string>
|
<string>Number of Measurements:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="0">
|
|
||||||
<widget class="QLabel" name="lblNumSamples">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Number of Triggers to be expected.
|
|
||||||
#triggers#</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Number of Samples:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="2" colspan="2">
|
<item row="0" column="2" colspan="2">
|
||||||
<widget class="QComboBox" name="comboTimingMode">
|
<widget class="QComboBox" name="comboTimingMode">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@ -651,6 +667,11 @@ Frame period between exposures.
|
|||||||
<string>Burst Trigger</string>
|
<string>Burst Trigger</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Trigger Gated</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="2">
|
<item row="3" column="2">
|
||||||
@ -910,77 +931,6 @@ Frame period between exposures.
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0">
|
|
||||||
<widget class="QStackedWidget" name="stackedLblTriggerBurst">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>171</width>
|
|
||||||
<height>32</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>171</width>
|
|
||||||
<height>32</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="currentIndex">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<widget class="QWidget" name="pageLblTrigger">
|
|
||||||
<layout class="QGridLayout" name="gridLblTrigger">
|
|
||||||
<property name="margin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="lblNumTriggers">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string><html><head/><body><p>Number of Triggers to be expected.</p><p> #triggers#</p></body></html></string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Number of Triggers:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="pageLblBurst">
|
|
||||||
<layout class="QGridLayout" name="gridLblBurst">
|
|
||||||
<property name="margin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="lblNumBursts">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string><html><head/><body><p>Number of Triggers to be expected.</p><p> #triggers#</p></body></html></string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Number of Bursts:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="5" column="2">
|
<item row="5" column="2">
|
||||||
<widget class="QStackedWidget" name="stackedSpinTriggerBurst">
|
<widget class="QStackedWidget" name="stackedSpinTriggerBurst">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@ -1481,6 +1431,214 @@ Frame period between exposures.
|
|||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="7" column="0">
|
||||||
|
<widget class="QStackedWidget" name="stackedLblSamplesGates">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>171</width>
|
||||||
|
<height>32</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>171</width>
|
||||||
|
<height>32</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="currentIndex">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="pageLblSamples">
|
||||||
|
<layout class="QGridLayout" name="gridLblTrigger_2">
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="lblNumSamples">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>Number of analog samples.</p><p>#asamples#</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Number of Samples:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="pageLblGates">
|
||||||
|
<layout class="QGridLayout" name="gridLblBurst_2">
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="lblNumGates">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>Number of external gates.</p><p>#gates#</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Number of Gates:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="7" column="2">
|
||||||
|
<widget class="QStackedWidget" name="stackedSpinSamplesGates">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>208</width>
|
||||||
|
<height>32</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>208</width>
|
||||||
|
<height>32</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="currentIndex">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="pageSpinSamples">
|
||||||
|
<layout class="QGridLayout" name="gridSpinTrigger_2">
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QSpinBox" name="spinNumSamples">
|
||||||
|
<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="toolTip">
|
||||||
|
<string><html><head/><body><p>Number of analog samples.</p><p>#asamples#</p><p><br/></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="statusTip">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="whatsThis">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
<property name="keyboardTracking">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="suffix">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>-1</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>2000000000</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="pageSpinGates">
|
||||||
|
<layout class="QGridLayout" name="gridSpinBurst_2">
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QSpinBox" name="spinNumGates">
|
||||||
|
<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="toolTip">
|
||||||
|
<string><html><head/><body><p>Number of external gates.</p><p>#gates#</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="statusTip">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="whatsThis">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
<property name="keyboardTracking">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="suffix">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>-1</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>2000000000</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -1513,7 +1671,6 @@ Frame period between exposures.
|
|||||||
<tabstop>comboExpUnit</tabstop>
|
<tabstop>comboExpUnit</tabstop>
|
||||||
<tabstop>spinPeriod</tabstop>
|
<tabstop>spinPeriod</tabstop>
|
||||||
<tabstop>comboPeriodUnit</tabstop>
|
<tabstop>comboPeriodUnit</tabstop>
|
||||||
<tabstop>spinNumSamples</tabstop>
|
|
||||||
</tabstops>
|
</tabstops>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../include/icons.qrc"/>
|
<include location="../include/icons.qrc"/>
|
||||||
|
@ -14,7 +14,8 @@ class qCloneWidget : public QMainWindow, private Ui::ClonePlotObject {
|
|||||||
qCloneWidget(QWidget *parent, SlsQt1DPlot *p1, SlsQt2DPlot *p2,
|
qCloneWidget(QWidget *parent, SlsQt1DPlot *p1, SlsQt2DPlot *p2,
|
||||||
SlsQt1DPlot *gp1, SlsQt2DPlot *gp, QString title,
|
SlsQt1DPlot *gp1, SlsQt2DPlot *gp, QString title,
|
||||||
QString filePath, QString fileName, int64_t aIndex,
|
QString filePath, QString fileName, int64_t aIndex,
|
||||||
bool displayStats, QString min, QString max, QString sum);
|
bool displayStats, QString min, QString max, QString sum,
|
||||||
|
bool completeImage);
|
||||||
|
|
||||||
~qCloneWidget();
|
~qCloneWidget();
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "ui_form_dac.h"
|
|
||||||
#include "Detector.h"
|
#include "Detector.h"
|
||||||
#include "sls_detector_defs.h"
|
#include "sls_detector_defs.h"
|
||||||
|
#include "ui_form_dac.h"
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
class qDacWidget : public QWidget, private Ui::WidgetDacObject {
|
class qDacWidget : public QWidget, private Ui::WidgetDacObject {
|
||||||
|
@ -1,14 +1,15 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "logger.h"
|
||||||
#include "sls_detector_defs.h"
|
#include "sls_detector_defs.h"
|
||||||
|
|
||||||
#include <QAbstractButton>
|
#include <QAbstractButton>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
#include <cstdint>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
#include <cstdint>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
using std::chrono::duration;
|
using std::chrono::duration;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "ui_form_detectormain.h"
|
|
||||||
#include "qDefs.h"
|
|
||||||
#include "Detector.h"
|
#include "Detector.h"
|
||||||
|
#include "qDefs.h"
|
||||||
|
#include "ui_form_detectormain.h"
|
||||||
#include <QTabWidget>
|
#include <QTabWidget>
|
||||||
|
|
||||||
class qDrawPlot;
|
class qDrawPlot;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "ui_form_plot.h"
|
|
||||||
#include "qDefs.h"
|
|
||||||
#include "Detector.h"
|
#include "Detector.h"
|
||||||
|
#include "qDefs.h"
|
||||||
|
#include "ui_form_plot.h"
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
|
||||||
class SlsQt1DPlot;
|
class SlsQt1DPlot;
|
||||||
@ -59,11 +59,9 @@ class qDrawPlot : public QWidget, private Ui::PlotObject {
|
|||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void SetSaveFileName(QString val);
|
void SetSaveFileName(QString val);
|
||||||
void AcquireThread();
|
|
||||||
void UpdatePlot();
|
void UpdatePlot();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void StartAcquireSignal();
|
|
||||||
void AcquireFinishedSignal();
|
void AcquireFinishedSignal();
|
||||||
void AbortSignal();
|
void AbortSignal();
|
||||||
void UpdateSignal();
|
void UpdateSignal();
|
||||||
@ -74,6 +72,7 @@ class qDrawPlot : public QWidget, private Ui::PlotObject {
|
|||||||
void SetupPlots();
|
void SetupPlots();
|
||||||
void GetStatistics(double &min, double &max, double &sum);
|
void GetStatistics(double &min, double &max, double &sum);
|
||||||
void DetachHists();
|
void DetachHists();
|
||||||
|
void AcquireThread();
|
||||||
static void GetAcquisitionFinishedCallBack(double currentProgress,
|
static void GetAcquisitionFinishedCallBack(double currentProgress,
|
||||||
int detectorStatus,
|
int detectorStatus,
|
||||||
void *this_pointer);
|
void *this_pointer);
|
||||||
@ -114,6 +113,7 @@ class qDrawPlot : public QWidget, private Ui::PlotObject {
|
|||||||
QString zTitle2d{"Intensity"};
|
QString zTitle2d{"Intensity"};
|
||||||
QString plotTitle{""};
|
QString plotTitle{""};
|
||||||
QString indexTitle{""};
|
QString indexTitle{""};
|
||||||
|
bool completeImage{false};
|
||||||
bool xyRangeChanged{false};
|
bool xyRangeChanged{false};
|
||||||
double xyRange[4]{0, 0, 0, 0};
|
double xyRange[4]{0, 0, 0, 0};
|
||||||
bool isXYRange[4]{false, false, false, false};
|
bool isXYRange[4]{false, false, false, false};
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "ui_form_tab_advanced.h"
|
|
||||||
#include "Detector.h"
|
#include "Detector.h"
|
||||||
|
#include "ui_form_tab_advanced.h"
|
||||||
|
|
||||||
class qDrawPlot;
|
class qDrawPlot;
|
||||||
|
|
||||||
@ -36,6 +36,9 @@ class qTabAdvanced : public QWidget, private Ui::TabAdvancedObject {
|
|||||||
void SetNumStoragecells(int value);
|
void SetNumStoragecells(int value);
|
||||||
void SetSubExposureTime();
|
void SetSubExposureTime();
|
||||||
void SetSubDeadTime();
|
void SetSubDeadTime();
|
||||||
|
void SetGateIndex(int value);
|
||||||
|
void SetExposureTime();
|
||||||
|
void SetGateDelay();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void SetupWidgetWindow();
|
void SetupWidgetWindow();
|
||||||
@ -59,6 +62,8 @@ class qTabAdvanced : public QWidget, private Ui::TabAdvancedObject {
|
|||||||
void GetNumStoragecells();
|
void GetNumStoragecells();
|
||||||
void GetSubExposureTime();
|
void GetSubExposureTime();
|
||||||
void GetSubDeadTime();
|
void GetSubDeadTime();
|
||||||
|
void GetExposureTime();
|
||||||
|
void GetGateDelay();
|
||||||
|
|
||||||
sls::Detector *det;
|
sls::Detector *det;
|
||||||
qDrawPlot *plot;
|
qDrawPlot *plot;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "ui_form_tab_dataoutput.h"
|
|
||||||
#include "Detector.h"
|
#include "Detector.h"
|
||||||
|
#include "ui_form_tab_dataoutput.h"
|
||||||
|
|
||||||
class qTabDataOutput : public QWidget, private Ui::TabDataOutputObject {
|
class qTabDataOutput : public QWidget, private Ui::TabDataOutputObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "ui_form_tab_debugging.h"
|
|
||||||
#include "Detector.h"
|
#include "Detector.h"
|
||||||
|
#include "ui_form_tab_debugging.h"
|
||||||
|
|
||||||
class QTreeWidget;
|
class QTreeWidget;
|
||||||
class QTreeWidgetItem;
|
class QTreeWidgetItem;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "ui_form_tab_developer.h"
|
|
||||||
#include "Detector.h"
|
#include "Detector.h"
|
||||||
#include "sls_detector_defs.h"
|
#include "sls_detector_defs.h"
|
||||||
|
#include "ui_form_tab_developer.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
class qDacWidget;
|
class qDacWidget;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "ui_form_tab_measurement.h"
|
|
||||||
#include "Detector.h"
|
#include "Detector.h"
|
||||||
|
#include "ui_form_tab_measurement.h"
|
||||||
|
|
||||||
class qDrawPlot;
|
class qDrawPlot;
|
||||||
class QStandardItemModel;
|
class QStandardItemModel;
|
||||||
@ -25,6 +25,7 @@ class qTabMeasurement : public QWidget, private Ui::TabMeasurementObject {
|
|||||||
void SetNumTriggers(int val);
|
void SetNumTriggers(int val);
|
||||||
void SetNumBursts(int val);
|
void SetNumBursts(int val);
|
||||||
void SetNumSamples(int val);
|
void SetNumSamples(int val);
|
||||||
|
void SetNumGates(int val);
|
||||||
void SetExposureTime();
|
void SetExposureTime();
|
||||||
void SetAcquisitionPeriod();
|
void SetAcquisitionPeriod();
|
||||||
void SetDelay();
|
void SetDelay();
|
||||||
@ -45,6 +46,7 @@ class qTabMeasurement : public QWidget, private Ui::TabMeasurementObject {
|
|||||||
* show bursts and burst period
|
* show bursts and burst period
|
||||||
*/
|
*/
|
||||||
void ShowTriggerDelay();
|
void ShowTriggerDelay();
|
||||||
|
void ShowGates();
|
||||||
void SetupTimingMode();
|
void SetupTimingMode();
|
||||||
void EnableWidgetsforTimingMode();
|
void EnableWidgetsforTimingMode();
|
||||||
|
|
||||||
@ -53,6 +55,7 @@ class qTabMeasurement : public QWidget, private Ui::TabMeasurementObject {
|
|||||||
void GetNumTriggers();
|
void GetNumTriggers();
|
||||||
void GetNumBursts();
|
void GetNumBursts();
|
||||||
void GetNumSamples();
|
void GetNumSamples();
|
||||||
|
void GetNumGates();
|
||||||
void GetExposureTime();
|
void GetExposureTime();
|
||||||
void GetAcquisitionPeriod();
|
void GetAcquisitionPeriod();
|
||||||
void CheckAcqPeriodGreaterThanExp();
|
void CheckAcqPeriodGreaterThanExp();
|
||||||
@ -76,7 +79,7 @@ class qTabMeasurement : public QWidget, private Ui::TabMeasurementObject {
|
|||||||
sls::Detector *det;
|
sls::Detector *det;
|
||||||
qDrawPlot *plot;
|
qDrawPlot *plot;
|
||||||
// enum for the timing mode
|
// enum for the timing mode
|
||||||
enum { AUTO, TRIGGER, GATED, BURST_TRIGGER, NUMTIMINGMODES };
|
enum { AUTO, TRIGGER, GATED, BURST_TRIGGER, TRIGGER_GATED, NUMTIMINGMODES };
|
||||||
QTimer *progressTimer;
|
QTimer *progressTimer;
|
||||||
// tool tip variables
|
// tool tip variables
|
||||||
QString acqPeriodTip;
|
QString acqPeriodTip;
|
||||||
@ -84,6 +87,7 @@ class qTabMeasurement : public QWidget, private Ui::TabMeasurementObject {
|
|||||||
QPalette red;
|
QPalette red;
|
||||||
bool delayImplemented;
|
bool delayImplemented;
|
||||||
bool sampleImplemented;
|
bool sampleImplemented;
|
||||||
|
bool gateImplemented;
|
||||||
bool startingFnumImplemented;
|
bool startingFnumImplemented;
|
||||||
bool isAcquisitionStopped{false};
|
bool isAcquisitionStopped{false};
|
||||||
int numMeasurements{1};
|
int numMeasurements{1};
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "ui_form_tab_plot.h"
|
|
||||||
#include "Detector.h"
|
#include "Detector.h"
|
||||||
|
#include "ui_form_tab_plot.h"
|
||||||
|
|
||||||
class qDrawPlot;
|
class qDrawPlot;
|
||||||
class QButtonGroup;
|
class QButtonGroup;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "ui_form_tab_settings.h"
|
|
||||||
#include "Detector.h"
|
#include "Detector.h"
|
||||||
|
#include "ui_form_tab_settings.h"
|
||||||
|
|
||||||
class qTabSettings : public QWidget, private Ui::TabSettingsObject {
|
class qTabSettings : public QWidget, private Ui::TabSettingsObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#ifndef SLSQT1DPLOT_H
|
#ifndef SLSQT1DPLOT_H
|
||||||
#define SLSQT1DPLOT_H
|
#define SLSQT1DPLOT_H
|
||||||
|
|
||||||
#include "ansi.h"
|
|
||||||
#include "SlsQt1DZoomer.h"
|
#include "SlsQt1DZoomer.h"
|
||||||
|
#include "ansi.h"
|
||||||
#include <qwt_plot.h>
|
#include <qwt_plot.h>
|
||||||
#include <qwt_plot_curve.h>
|
#include <qwt_plot_curve.h>
|
||||||
#include <qwt_plot_marker.h>
|
#include <qwt_plot_marker.h>
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#ifndef SLSQT2DZOOMER_H
|
#ifndef SLSQT2DZOOMER_H
|
||||||
#define SLSQT2DZOOMER_H
|
#define SLSQT2DZOOMER_H
|
||||||
#include "SlsQt2DHist.h"
|
#include "SlsQt2DHist.h"
|
||||||
|
#include <cstdio>
|
||||||
#include <qwt_plot_panner.h>
|
#include <qwt_plot_panner.h>
|
||||||
#include <qwt_plot_zoomer.h>
|
#include <qwt_plot_zoomer.h>
|
||||||
#include <cstdio>
|
|
||||||
|
|
||||||
class SlsQt2DZoomer : public QwtPlotZoomer {
|
class SlsQt2DZoomer : public QwtPlotZoomer {
|
||||||
private:
|
private:
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* TODO! short description */
|
/* TODO! short description */
|
||||||
#include "SlsQt1DPlot.h"
|
#include "SlsQt1DPlot.h"
|
||||||
#include <qwt_symbol.h>
|
#include <iostream>
|
||||||
#include <qwt_legend.h>
|
#include <qwt_legend.h>
|
||||||
#include <qwt_math.h>
|
#include <qwt_math.h>
|
||||||
#include <qwt_painter.h>
|
#include <qwt_painter.h>
|
||||||
@ -10,8 +10,8 @@
|
|||||||
#include <qwt_scale_draw.h>
|
#include <qwt_scale_draw.h>
|
||||||
#include <qwt_scale_engine.h>
|
#include <qwt_scale_engine.h>
|
||||||
#include <qwt_scale_widget.h>
|
#include <qwt_scale_widget.h>
|
||||||
|
#include <qwt_symbol.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#define QwtLog10ScaleEngine QwtLogScaleEngine // hmm
|
#define QwtLog10ScaleEngine QwtLogScaleEngine // hmm
|
||||||
|
|
||||||
@ -314,7 +314,8 @@ void SlsQtH1DList::Remove(SlsQtH1D *hist) {
|
|||||||
hl = hl->the_next;
|
hl = hl->the_next;
|
||||||
else { // match
|
else { // match
|
||||||
if (!hl->the_next)
|
if (!hl->the_next)
|
||||||
hl->the_hist = nullptr; // first the_hist is zero when there's no next
|
hl->the_hist =
|
||||||
|
nullptr; // first the_hist is zero when there's no next
|
||||||
else {
|
else {
|
||||||
SlsQtH1DList *t = hl->the_next;
|
SlsQtH1DList *t = hl->the_next;
|
||||||
hl->the_hist = t->the_hist;
|
hl->the_hist = t->the_hist;
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
/* TODO! short description */
|
/* TODO! short description */
|
||||||
#include "SlsQt1DZoomer.h"
|
#include "SlsQt1DZoomer.h"
|
||||||
#include "SlsQt1DPlot.h"
|
#include "SlsQt1DPlot.h"
|
||||||
|
#include <iostream>
|
||||||
#include <qwt_plot.h>
|
#include <qwt_plot.h>
|
||||||
#include <qwt_scale_div.h>
|
#include <qwt_scale_div.h>
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
void SlsQt1DZoomer::ResetZoomBase() {
|
void SlsQt1DZoomer::ResetZoomBase() {
|
||||||
SetZoomBase(x0, y0, x1 - x0,
|
SetZoomBase(x0, y0, x1 - x0,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "SlsQt2DPlot.h"
|
#include "SlsQt2DPlot.h"
|
||||||
#include "ansi.h"
|
// #include "ansi.h"
|
||||||
|
|
||||||
#include <qlist.h>
|
#include <qlist.h>
|
||||||
#include <qprinter.h>
|
#include <qprinter.h>
|
||||||
@ -224,7 +224,6 @@ QwtLinearColorMap *SlsQt2DPlot::myColourMap(int log) {
|
|||||||
return myColourMap(cs);
|
return myColourMap(cs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SlsQt2DPlot::Update() {
|
void SlsQt2DPlot::Update() {
|
||||||
if (isLog)
|
if (isLog)
|
||||||
hist->SetMinimumToFirstGreaterThanZero();
|
hist->SetMinimumToFirstGreaterThanZero();
|
||||||
|
@ -15,13 +15,20 @@ qCloneWidget::qCloneWidget(QWidget *parent, SlsQt1DPlot *p1, SlsQt2DPlot *p2,
|
|||||||
SlsQt1DPlot *gp1, SlsQt2DPlot *gp, QString title,
|
SlsQt1DPlot *gp1, SlsQt2DPlot *gp, QString title,
|
||||||
QString fPath, QString fName, int64_t aIndex,
|
QString fPath, QString fName, int64_t aIndex,
|
||||||
bool displayStats, QString min, QString max,
|
bool displayStats, QString min, QString max,
|
||||||
QString sum)
|
QString sum, bool completeImage)
|
||||||
: QMainWindow(parent), plot1d(p1), plot2d(p2), gainplot1d(gp1),
|
: QMainWindow(parent), plot1d(p1), plot2d(p2), gainplot1d(gp1),
|
||||||
gainplot2d(gp), filePath(fPath), fileName(fName), acqIndex(aIndex) {
|
gainplot2d(gp), filePath(fPath), fileName(fName), acqIndex(aIndex) {
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
id = qCloneWidget::NumClones++;
|
id = qCloneWidget::NumClones++;
|
||||||
SetupWidgetWindow(title);
|
SetupWidgetWindow(title);
|
||||||
DisplayStats(displayStats, min, max, sum);
|
DisplayStats(displayStats, min, max, sum);
|
||||||
|
lblCompleteImage->hide();
|
||||||
|
lblInCompleteImage->hide();
|
||||||
|
if (completeImage) {
|
||||||
|
lblCompleteImage->show();
|
||||||
|
} else {
|
||||||
|
lblInCompleteImage->show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
qCloneWidget::~qCloneWidget() {
|
qCloneWidget::~qCloneWidget() {
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
#include "qDacWidget.h"
|
#include "qDacWidget.h"
|
||||||
#include "qDefs.h"
|
#include "qDefs.h"
|
||||||
|
|
||||||
|
|
||||||
qDacWidget::qDacWidget(QWidget *parent, sls::Detector *detector, bool d,
|
qDacWidget::qDacWidget(QWidget *parent, sls::Detector *detector, bool d,
|
||||||
std::string n, slsDetectorDefs::dacIndex i)
|
std::string n, slsDetectorDefs::dacIndex i)
|
||||||
: QWidget(parent), det(detector), isDac(d), index(i) {
|
: QWidget(parent), det(detector), isDac(d), index(i) {
|
||||||
@ -56,8 +55,8 @@ void qDacWidget::GetDac() {
|
|||||||
|
|
||||||
void qDacWidget::SetDac() {
|
void qDacWidget::SetDac() {
|
||||||
int val = (int)spinDac->value();
|
int val = (int)spinDac->value();
|
||||||
LOG(logINFO) << "Setting dac:" << lblDac->text().toAscii().data()
|
LOG(logINFO) << "Setting dac:" << lblDac->text().toAscii().data() << " : "
|
||||||
<< " : " << val;
|
<< val;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
det->setDAC(index, val, 0, {detectorIndex});
|
det->setDAC(index, val, 0, {detectorIndex});
|
||||||
|
@ -19,8 +19,8 @@
|
|||||||
#include <QScrollArea>
|
#include <QScrollArea>
|
||||||
#include <QSizePolicy>
|
#include <QSizePolicy>
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
|
#include <string>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
@ -57,8 +57,7 @@ int main(int argc, char **argv) {
|
|||||||
|
|
||||||
case 'f':
|
case 'f':
|
||||||
fname = optarg;
|
fname = optarg;
|
||||||
LOG(logDEBUG)
|
LOG(logDEBUG) << long_options[option_index].name << " " << optarg;
|
||||||
<< long_options[option_index].name << " " << optarg;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'd':
|
case 'd':
|
||||||
@ -105,9 +104,10 @@ int main(int argc, char **argv) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
qDetectorMain::qDetectorMain(int multiId, const std::string& fname, bool isDevel)
|
qDetectorMain::qDetectorMain(int multiId, const std::string &fname,
|
||||||
: QMainWindow(nullptr), detType(slsDetectorDefs::GENERIC), isDeveloper(isDevel),
|
bool isDevel)
|
||||||
heightPlotWindow(0), heightCentralWidget(0) {
|
: QMainWindow(nullptr), detType(slsDetectorDefs::GENERIC),
|
||||||
|
isDeveloper(isDevel), heightPlotWindow(0), heightCentralWidget(0) {
|
||||||
|
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
SetUpDetector(fname, multiId);
|
SetUpDetector(fname, multiId);
|
||||||
@ -115,8 +115,7 @@ qDetectorMain::qDetectorMain(int multiId, const std::string& fname, bool isDevel
|
|||||||
}
|
}
|
||||||
|
|
||||||
qDetectorMain::~qDetectorMain() {
|
qDetectorMain::~qDetectorMain() {
|
||||||
disconnect(tabs, SIGNAL(currentChanged(int)), this,
|
disconnect(tabs, SIGNAL(currentChanged(int)), this, SLOT(Refresh(int)));
|
||||||
SLOT(Refresh(int)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void qDetectorMain::SetUpWidgetWindow() {
|
void qDetectorMain::SetUpWidgetWindow() {
|
||||||
@ -132,8 +131,7 @@ void qDetectorMain::SetUpWidgetWindow() {
|
|||||||
layoutTabs->addWidget(tabs);
|
layoutTabs->addWidget(tabs);
|
||||||
|
|
||||||
// creating all the other tab widgets
|
// creating all the other tab widgets
|
||||||
tabMeasurement =
|
tabMeasurement = new qTabMeasurement(this, det.get(), plot);
|
||||||
new qTabMeasurement(this, det.get(), plot);
|
|
||||||
tabDataOutput = new qTabDataOutput(this, det.get());
|
tabDataOutput = new qTabDataOutput(this, det.get());
|
||||||
tabPlot = new qTabPlot(this, det.get(), plot);
|
tabPlot = new qTabPlot(this, det.get(), plot);
|
||||||
tabSettings = new qTabSettings(this, det.get());
|
tabSettings = new qTabSettings(this, det.get());
|
||||||
@ -260,8 +258,8 @@ void qDetectorMain::Initialization() {
|
|||||||
// Measurement tab
|
// Measurement tab
|
||||||
connect(tabMeasurement, SIGNAL(EnableTabsSignal(bool)), this,
|
connect(tabMeasurement, SIGNAL(EnableTabsSignal(bool)), this,
|
||||||
SLOT(EnableTabs(bool)));
|
SLOT(EnableTabs(bool)));
|
||||||
connect(tabMeasurement, SIGNAL(FileNameChangedSignal(QString)),
|
connect(tabMeasurement, SIGNAL(FileNameChangedSignal(QString)), plot,
|
||||||
plot, SLOT(SetSaveFileName(QString)));
|
SLOT(SetSaveFileName(QString)));
|
||||||
// Plot tab
|
// Plot tab
|
||||||
connect(tabPlot, SIGNAL(DisableZoomSignal(bool)), this,
|
connect(tabPlot, SIGNAL(DisableZoomSignal(bool)), this,
|
||||||
SLOT(SetZoomToolTip(bool)));
|
SLOT(SetZoomToolTip(bool)));
|
||||||
@ -269,8 +267,7 @@ void qDetectorMain::Initialization() {
|
|||||||
// Plotting
|
// Plotting
|
||||||
connect(plot, SIGNAL(AcquireFinishedSignal()), tabMeasurement,
|
connect(plot, SIGNAL(AcquireFinishedSignal()), tabMeasurement,
|
||||||
SLOT(AcquireFinished()));
|
SLOT(AcquireFinished()));
|
||||||
connect(plot, SIGNAL(AbortSignal()), tabMeasurement,
|
connect(plot, SIGNAL(AbortSignal()), tabMeasurement, SLOT(AbortAcquire()));
|
||||||
SLOT(AbortAcquire()));
|
|
||||||
|
|
||||||
// menubar
|
// menubar
|
||||||
// Modes Menu
|
// Modes Menu
|
||||||
@ -372,8 +369,7 @@ void qDetectorMain::ExecuteUtilities(QAction *action) {
|
|||||||
"The Configuration Parameters have been "
|
"The Configuration Parameters have been "
|
||||||
"configured successfully.",
|
"configured successfully.",
|
||||||
"qDetectorMain::ExecuteUtilities");
|
"qDetectorMain::ExecuteUtilities");
|
||||||
LOG(logINFO)
|
LOG(logINFO) << "Configuration Parameters loaded successfully";
|
||||||
<< "Configuration Parameters loaded successfully";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,7 +87,6 @@ void qDrawPlot::SetupWidgetWindow() {
|
|||||||
|
|
||||||
void qDrawPlot::Initialization() {
|
void qDrawPlot::Initialization() {
|
||||||
connect(this, SIGNAL(UpdateSignal()), this, SLOT(UpdatePlot()));
|
connect(this, SIGNAL(UpdateSignal()), this, SLOT(UpdatePlot()));
|
||||||
connect(this, SIGNAL(StartAcquireSignal()), this, SLOT(AcquireThread()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void qDrawPlot::SetupPlots() {
|
void qDrawPlot::SetupPlots() {
|
||||||
@ -97,27 +96,13 @@ void qDrawPlot::SetupPlots() {
|
|||||||
slsDetectorDefs::xy res = det->getDetectorSize();
|
slsDetectorDefs::xy res = det->getDetectorSize();
|
||||||
nPixelsX = res.x;
|
nPixelsX = res.x;
|
||||||
nPixelsY = res.y;
|
nPixelsY = res.y;
|
||||||
switch (detType) {
|
|
||||||
case slsDetectorDefs::EIGER:
|
|
||||||
try {
|
|
||||||
if (det->getQuad().tsquash("Inconsistent values for quad type")) {
|
|
||||||
nPixelsX /= 2;
|
|
||||||
nPixelsY *= 2;
|
|
||||||
if (nPixelsX != nPixelsY) {
|
|
||||||
--nPixelsX;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
CATCH_DISPLAY("Could not get quad.", "qDrawPlot::SetupPlots")
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
LOG(logINFO) << "nPixelsX:" << nPixelsX;
|
LOG(logINFO) << "nPixelsX:" << nPixelsX;
|
||||||
LOG(logINFO) << "nPixelsY:" << nPixelsY;
|
LOG(logINFO) << "nPixelsY:" << nPixelsY;
|
||||||
|
|
||||||
boxPlot->setFont(QFont("Sans Serif", qDefs::Q_FONT_SIZE, QFont::Normal));
|
boxPlot->setFont(QFont("Sans Serif", qDefs::Q_FONT_SIZE, QFont::Normal));
|
||||||
widgetStatistics->hide();
|
widgetStatistics->hide();
|
||||||
|
lblCompleteImage->hide();
|
||||||
|
lblInCompleteImage->hide();
|
||||||
|
|
||||||
// setup 1d data
|
// setup 1d data
|
||||||
|
|
||||||
@ -292,8 +277,7 @@ void qDrawPlot::SetPlotTitlePrefix(QString title) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void qDrawPlot::SetXAxisTitle(QString title) {
|
void qDrawPlot::SetXAxisTitle(QString title) {
|
||||||
LOG(logINFO) << "Setting X Axis Title to "
|
LOG(logINFO) << "Setting X Axis Title to " << title.toAscii().constData();
|
||||||
<< title.toAscii().constData();
|
|
||||||
if (is1d) {
|
if (is1d) {
|
||||||
xTitle1d = title;
|
xTitle1d = title;
|
||||||
} else {
|
} else {
|
||||||
@ -302,8 +286,7 @@ void qDrawPlot::SetXAxisTitle(QString title) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void qDrawPlot::SetYAxisTitle(QString title) {
|
void qDrawPlot::SetYAxisTitle(QString title) {
|
||||||
LOG(logINFO) << "Setting Y Axis Title to "
|
LOG(logINFO) << "Setting Y Axis Title to " << title.toAscii().constData();
|
||||||
<< title.toAscii().constData();
|
|
||||||
if (is1d) {
|
if (is1d) {
|
||||||
yTitle1d = title;
|
yTitle1d = title;
|
||||||
} else {
|
} else {
|
||||||
@ -312,8 +295,7 @@ void qDrawPlot::SetYAxisTitle(QString title) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void qDrawPlot::SetZAxisTitle(QString title) {
|
void qDrawPlot::SetZAxisTitle(QString title) {
|
||||||
LOG(logINFO) << "Setting Z Axis Title to "
|
LOG(logINFO) << "Setting Z Axis Title to " << title.toAscii().constData();
|
||||||
<< title.toAscii().constData();
|
|
||||||
zTitle2d = title;
|
zTitle2d = title;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -324,8 +306,8 @@ void qDrawPlot::SetXYRangeChanged(bool disable, double *xy, bool *isXY) {
|
|||||||
std::copy(xy, xy + 4, xyRange);
|
std::copy(xy, xy + 4, xyRange);
|
||||||
std::copy(isXY, isXY + 4, isXYRange);
|
std::copy(isXY, isXY + 4, isXYRange);
|
||||||
|
|
||||||
LOG(logDEBUG) << "Setting Disable zoom to " << std::boolalpha
|
LOG(logDEBUG) << "Setting Disable zoom to " << std::boolalpha << disable
|
||||||
<< disable << std::noboolalpha;
|
<< std::noboolalpha;
|
||||||
disableZoom = disable;
|
disableZoom = disable;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -363,18 +345,22 @@ double qDrawPlot::GetYMaximum() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void qDrawPlot::SetDataCallBack(bool enable) {
|
void qDrawPlot::SetDataCallBack(bool enable) {
|
||||||
LOG(logINFO) << "Setting data call back to " << std::boolalpha
|
LOG(logINFO) << "Setting data call back to " << std::boolalpha << enable
|
||||||
<< enable << std::noboolalpha;
|
<< std::noboolalpha;
|
||||||
|
try {
|
||||||
if (enable) {
|
if (enable) {
|
||||||
isPlot = true;
|
isPlot = true;
|
||||||
det->setRxZmqDataStream(true);
|
|
||||||
det->registerDataCallback(&(GetDataCallBack), this);
|
det->registerDataCallback(&(GetDataCallBack), this);
|
||||||
|
det->setRxZmqDataStream(true);
|
||||||
} else {
|
} else {
|
||||||
isPlot = false;
|
isPlot = false;
|
||||||
det->setRxZmqDataStream(false);
|
|
||||||
det->registerDataCallback(nullptr, this);
|
det->registerDataCallback(nullptr, this);
|
||||||
|
det->setRxZmqDataStream(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CATCH_DISPLAY("Could not get set rxr data streaming enable.",
|
||||||
|
"qDrawPlot::SetDataCallBack")
|
||||||
|
}
|
||||||
|
|
||||||
void qDrawPlot::SetBinary(bool enable, int from, int to) {
|
void qDrawPlot::SetBinary(bool enable, int from, int to) {
|
||||||
LOG(logINFO) << (enable ? "Enabling" : "Disabling")
|
LOG(logINFO) << (enable ? "Enabling" : "Disabling")
|
||||||
@ -582,8 +568,8 @@ void qDrawPlot::ClonePlot() {
|
|||||||
new qCloneWidget(this, cloneplot1D, cloneplot2D, clonegainplot1D,
|
new qCloneWidget(this, cloneplot1D, cloneplot2D, clonegainplot1D,
|
||||||
clonegainplot2D, boxPlot->title(), fileSavePath,
|
clonegainplot2D, boxPlot->title(), fileSavePath,
|
||||||
fileSaveName, currentAcqIndex, displayStatistics,
|
fileSaveName, currentAcqIndex, displayStatistics,
|
||||||
lblMinDisp->text(), lblMaxDisp->text(),
|
lblMinDisp->text(), lblMaxDisp->text(), lblSumDisp->text(),
|
||||||
lblSumDisp->text());
|
completeImage);
|
||||||
}
|
}
|
||||||
|
|
||||||
void qDrawPlot::SavePlot() {
|
void qDrawPlot::SavePlot() {
|
||||||
@ -668,7 +654,8 @@ void qDrawPlot::StartAcquisition() {
|
|||||||
xyRangeChanged = true;
|
xyRangeChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
emit StartAcquireSignal();
|
QtConcurrent::run(this, &qDrawPlot::AcquireThread);
|
||||||
|
|
||||||
LOG(logDEBUG) << "End of Starting Acquisition in qDrawPlot";
|
LOG(logDEBUG) << "End of Starting Acquisition in qDrawPlot";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -684,8 +671,7 @@ void qDrawPlot::AcquireThread() {
|
|||||||
// exception in acquire will not call acquisition finished call back, so
|
// exception in acquire will not call acquisition finished call back, so
|
||||||
// handle it
|
// handle it
|
||||||
if (!mess.empty()) {
|
if (!mess.empty()) {
|
||||||
LOG(logERROR) << "Acquisition Finished with an exception: "
|
LOG(logERROR) << "Acquisition Finished with an exception: " << mess;
|
||||||
<< mess;
|
|
||||||
qDefs::ExceptionMessage("Acquire unsuccessful.", mess,
|
qDefs::ExceptionMessage("Acquire unsuccessful.", mess,
|
||||||
"qDrawPlot::AcquireFinished");
|
"qDrawPlot::AcquireFinished");
|
||||||
try {
|
try {
|
||||||
@ -750,16 +736,16 @@ void qDrawPlot::GetData(detectorData *data, uint64_t frameIndex,
|
|||||||
<< " \t nx: " << data->nx << std::endl
|
<< " \t nx: " << data->nx << std::endl
|
||||||
<< " \t ny: " << data->ny << std::endl
|
<< " \t ny: " << data->ny << std::endl
|
||||||
<< " \t data bytes: " << data->databytes << std::endl
|
<< " \t data bytes: " << data->databytes << std::endl
|
||||||
<< " \t dynamic range: " << data->dynamicRange
|
<< " \t dynamic range: " << data->dynamicRange << std::endl
|
||||||
<< std::endl
|
|
||||||
<< " \t file index: " << data->fileIndex << std::endl
|
<< " \t file index: " << data->fileIndex << std::endl
|
||||||
|
<< " \t complete image: " << data->completeImage << std::endl
|
||||||
<< " ]";
|
<< " ]";
|
||||||
|
|
||||||
progress = (int)data->progressIndex;
|
progress = (int)data->progressIndex;
|
||||||
currentAcqIndex = data->fileIndex;
|
currentAcqIndex = data->fileIndex;
|
||||||
currentFrame = frameIndex;
|
currentFrame = frameIndex;
|
||||||
LOG(logDEBUG) << "[ Progress:" << progress
|
LOG(logDEBUG) << "[ Progress:" << progress << ", Frame:" << currentFrame
|
||||||
<< ", Frame:" << currentFrame << " ]";
|
<< " ]";
|
||||||
|
|
||||||
// 2d (only image, not gain data, not pedestalvals),
|
// 2d (only image, not gain data, not pedestalvals),
|
||||||
// check if npixelsX and npixelsY is the same (quad is different)
|
// check if npixelsX and npixelsY is the same (quad is different)
|
||||||
@ -767,12 +753,17 @@ void qDrawPlot::GetData(detectorData *data, uint64_t frameIndex,
|
|||||||
static_cast<int>(nPixelsY) != data->ny)) {
|
static_cast<int>(nPixelsY) != data->ny)) {
|
||||||
nPixelsX = data->nx;
|
nPixelsX = data->nx;
|
||||||
nPixelsY = data->ny;
|
nPixelsY = data->ny;
|
||||||
LOG(logINFO) << "Change in Detector Shape:\n\tnPixelsX:"
|
LOG(logINFO) << "Change in Detector Shape:\n\tnPixelsX:" << nPixelsX
|
||||||
<< nPixelsX << " nPixelsY:" << nPixelsY;
|
<< " nPixelsY:" << nPixelsY;
|
||||||
|
|
||||||
delete[] data2d;
|
delete[] data2d;
|
||||||
data2d = new double[nPixelsY * nPixelsX];
|
data2d = new double[nPixelsY * nPixelsX];
|
||||||
std::fill(data2d, data2d + nPixelsX * nPixelsY, 0);
|
std::fill(data2d, data2d + nPixelsX * nPixelsY, 0);
|
||||||
|
if (gainData) {
|
||||||
|
delete[] gainData;
|
||||||
|
gainData = new double[nPixelsY * nPixelsX];
|
||||||
|
std::fill(gainData, gainData + nPixelsX * nPixelsY, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// convert data to double
|
// convert data to double
|
||||||
@ -795,6 +786,7 @@ void qDrawPlot::GetData(detectorData *data, uint64_t frameIndex,
|
|||||||
if ((int)subFrameIndex != -1) {
|
if ((int)subFrameIndex != -1) {
|
||||||
indexTitle = QString("%1 %2").arg(frameIndex, subFrameIndex);
|
indexTitle = QString("%1 %2").arg(frameIndex, subFrameIndex);
|
||||||
}
|
}
|
||||||
|
completeImage = data->completeImage;
|
||||||
|
|
||||||
// reset pedestal
|
// reset pedestal
|
||||||
if (resetPedestal) {
|
if (resetPedestal) {
|
||||||
@ -819,8 +811,8 @@ void qDrawPlot::GetData(detectorData *data, uint64_t frameIndex,
|
|||||||
}
|
}
|
||||||
// calculate the pedestal value
|
// calculate the pedestal value
|
||||||
if (pedestalCount == NUM_PEDESTAL_FRAMES) {
|
if (pedestalCount == NUM_PEDESTAL_FRAMES) {
|
||||||
LOG(logINFO) << "Pedestal Calculated after "
|
LOG(logINFO) << "Pedestal Calculated after " << NUM_PEDESTAL_FRAMES
|
||||||
<< NUM_PEDESTAL_FRAMES << " frames";
|
<< " frames";
|
||||||
for (unsigned int px = 0; px < nPixels; ++px)
|
for (unsigned int px = 0; px < nPixels; ++px)
|
||||||
tempPedestalVals[px] =
|
tempPedestalVals[px] =
|
||||||
tempPedestalVals[px] / (double)NUM_PEDESTAL_FRAMES;
|
tempPedestalVals[px] / (double)NUM_PEDESTAL_FRAMES;
|
||||||
@ -1115,6 +1107,16 @@ void qDrawPlot::UpdatePlot() {
|
|||||||
LOG(logDEBUG) << "Update Plot";
|
LOG(logDEBUG) << "Update Plot";
|
||||||
|
|
||||||
boxPlot->setTitle(plotTitle);
|
boxPlot->setTitle(plotTitle);
|
||||||
|
|
||||||
|
// notify of incomplete images
|
||||||
|
lblCompleteImage->hide();
|
||||||
|
lblInCompleteImage->hide();
|
||||||
|
if (completeImage) {
|
||||||
|
lblCompleteImage->show();
|
||||||
|
} else {
|
||||||
|
lblInCompleteImage->show();
|
||||||
|
}
|
||||||
|
|
||||||
if (is1d) {
|
if (is1d) {
|
||||||
Update1dPlot();
|
Update1dPlot();
|
||||||
} else {
|
} else {
|
||||||
|
@ -29,9 +29,21 @@ void qTabAdvanced::SetupWidgetWindow() {
|
|||||||
tab_roi->setEnabled(true);
|
tab_roi->setEnabled(true);
|
||||||
break;
|
break;
|
||||||
case slsDetectorDefs::MYTHEN3:
|
case slsDetectorDefs::MYTHEN3:
|
||||||
|
lblDiscardBits->setEnabled(true);
|
||||||
|
spinDiscardBits->setEnabled(true);
|
||||||
|
lblGateIndex->setEnabled(true);
|
||||||
|
spinGateIndex->setEnabled(true);
|
||||||
|
lblExpTime->setEnabled(true);
|
||||||
|
spinExpTime->setEnabled(true);
|
||||||
|
comboExpTimeUnit->setEnabled(true);
|
||||||
|
lblGateDelay->setEnabled(true);
|
||||||
|
spinGateDelay->setEnabled(true);
|
||||||
|
comboGateDelayUnit->setEnabled(true);
|
||||||
|
break;
|
||||||
case slsDetectorDefs::GOTTHARD2:
|
case slsDetectorDefs::GOTTHARD2:
|
||||||
lblDiscardBits->setEnabled(true);
|
lblDiscardBits->setEnabled(true);
|
||||||
spinDiscardBits->setEnabled(true);
|
spinDiscardBits->setEnabled(true);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -116,6 +128,28 @@ void qTabAdvanced::Initialization() {
|
|||||||
connect(spinDiscardBits, SIGNAL(valueChanged(int)), plot,
|
connect(spinDiscardBits, SIGNAL(valueChanged(int)), plot,
|
||||||
SLOT(SetNumDiscardBits(int)));
|
SLOT(SetNumDiscardBits(int)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// gate index
|
||||||
|
if (lblGateIndex->isEnabled()) {
|
||||||
|
connect(spinGateIndex, SIGNAL(valueChanged(int)), this,
|
||||||
|
SLOT(SetGateIndex(int)));
|
||||||
|
}
|
||||||
|
|
||||||
|
// exptime1, exptime2, exptme3
|
||||||
|
if (lblExpTime->isEnabled()) {
|
||||||
|
connect(spinExpTime, SIGNAL(valueChanged(double)), this,
|
||||||
|
SLOT(SetExposureTime()));
|
||||||
|
connect(comboExpTimeUnit, SIGNAL(currentIndexChanged(int)), this,
|
||||||
|
SLOT(SetExposureTime()));
|
||||||
|
}
|
||||||
|
|
||||||
|
// gatedelay1, gatedelay2, gatedelay3
|
||||||
|
if (lblGateDelay->isEnabled()) {
|
||||||
|
connect(spinGateDelay, SIGNAL(valueChanged(double)), this,
|
||||||
|
SLOT(SetGateDelay()));
|
||||||
|
connect(comboGateDelayUnit, SIGNAL(currentIndexChanged(int)), this,
|
||||||
|
SLOT(SetGateDelay()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void qTabAdvanced::PopulateDetectors() {
|
void qTabAdvanced::PopulateDetectors() {
|
||||||
@ -531,8 +565,7 @@ void qTabAdvanced::SetROI() {
|
|||||||
roi.xmax = spinXmax->value();
|
roi.xmax = spinXmax->value();
|
||||||
|
|
||||||
// set roi
|
// set roi
|
||||||
LOG(logINFO) << "Setting ROI: [" << roi.xmin << ", " << roi.xmax
|
LOG(logINFO) << "Setting ROI: [" << roi.xmin << ", " << roi.xmax << "]";
|
||||||
<< "]";
|
|
||||||
try {
|
try {
|
||||||
det->setROI(roi, {comboReadout->currentIndex()});
|
det->setROI(roi, {comboReadout->currentIndex()});
|
||||||
}
|
}
|
||||||
@ -586,8 +619,7 @@ void qTabAdvanced::GetNumStoragecells() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void qTabAdvanced::SetNumStoragecells(int value) {
|
void qTabAdvanced::SetNumStoragecells(int value) {
|
||||||
LOG(logINFO) << "Setting number of additional stoarge cells: "
|
LOG(logINFO) << "Setting number of additional stoarge cells: " << value;
|
||||||
<< value;
|
|
||||||
try {
|
try {
|
||||||
det->setNumberOfAdditionalStorageCells(value);
|
det->setNumberOfAdditionalStorageCells(value);
|
||||||
}
|
}
|
||||||
@ -621,8 +653,8 @@ void qTabAdvanced::SetSubExposureTime() {
|
|||||||
auto timeNS = qDefs::getNSTime(std::make_pair(
|
auto timeNS = qDefs::getNSTime(std::make_pair(
|
||||||
spinSubExpTime->value(),
|
spinSubExpTime->value(),
|
||||||
static_cast<qDefs::timeUnit>(comboSubExpTimeUnit->currentIndex())));
|
static_cast<qDefs::timeUnit>(comboSubExpTimeUnit->currentIndex())));
|
||||||
LOG(logINFO)
|
LOG(logINFO) << "Setting sub frame acquisition time to " << timeNS.count()
|
||||||
<< "Setting sub frame acquisition time to " << timeNS.count() << " ns"
|
<< " ns"
|
||||||
<< "/" << spinSubExpTime->value()
|
<< "/" << spinSubExpTime->value()
|
||||||
<< qDefs::getUnitString(
|
<< qDefs::getUnitString(
|
||||||
(qDefs::timeUnit)comboSubExpTimeUnit->currentIndex());
|
(qDefs::timeUnit)comboSubExpTimeUnit->currentIndex());
|
||||||
@ -661,8 +693,7 @@ void qTabAdvanced::SetSubDeadTime() {
|
|||||||
spinSubDeadTime->value(),
|
spinSubDeadTime->value(),
|
||||||
static_cast<qDefs::timeUnit>(comboSubDeadTimeUnit->currentIndex())));
|
static_cast<qDefs::timeUnit>(comboSubDeadTimeUnit->currentIndex())));
|
||||||
|
|
||||||
LOG(logINFO)
|
LOG(logINFO) << "Setting sub frame dead time to " << timeNS.count() << " ns"
|
||||||
<< "Setting sub frame dead time to " << timeNS.count() << " ns"
|
|
||||||
<< "/" << spinSubDeadTime->value()
|
<< "/" << spinSubDeadTime->value()
|
||||||
<< qDefs::getUnitString(
|
<< qDefs::getUnitString(
|
||||||
(qDefs::timeUnit)comboSubDeadTimeUnit->currentIndex());
|
(qDefs::timeUnit)comboSubDeadTimeUnit->currentIndex());
|
||||||
@ -674,6 +705,92 @@ void qTabAdvanced::SetSubDeadTime() {
|
|||||||
GetSubDeadTime();
|
GetSubDeadTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void qTabAdvanced::SetGateIndex(int value) {
|
||||||
|
LOG(logINFO) << "Getting exptime and gate delay for gate index: " << value;
|
||||||
|
GetExposureTime();
|
||||||
|
GetGateDelay();
|
||||||
|
}
|
||||||
|
|
||||||
|
void qTabAdvanced::GetExposureTime() {
|
||||||
|
int gateIndex = spinGateIndex->value();
|
||||||
|
LOG(logDEBUG) << "Getting exposure time" << gateIndex;
|
||||||
|
disconnect(spinExpTime, SIGNAL(valueChanged(double)), this,
|
||||||
|
SLOT(SetExposureTime()));
|
||||||
|
disconnect(comboExpTimeUnit, SIGNAL(currentIndexChanged(int)), this,
|
||||||
|
SLOT(SetExposureTime()));
|
||||||
|
try {
|
||||||
|
auto retval = det->getExptime(gateIndex).tsquash(
|
||||||
|
"Exptime is inconsistent for all detectors.");
|
||||||
|
auto time = qDefs::getUserFriendlyTime(retval);
|
||||||
|
spinExpTime->setValue(time.first);
|
||||||
|
comboExpTimeUnit->setCurrentIndex(static_cast<int>(time.second));
|
||||||
|
}
|
||||||
|
CATCH_DISPLAY("Could not get exposure time.",
|
||||||
|
"qTabSettings::GetExposureTime")
|
||||||
|
connect(spinExpTime, SIGNAL(valueChanged(double)), this,
|
||||||
|
SLOT(SetExposureTime()));
|
||||||
|
connect(comboExpTimeUnit, SIGNAL(currentIndexChanged(int)), this,
|
||||||
|
SLOT(SetExposureTime()));
|
||||||
|
}
|
||||||
|
|
||||||
|
void qTabAdvanced::SetExposureTime() {
|
||||||
|
int gateIndex = spinGateIndex->value();
|
||||||
|
auto timeNS = qDefs::getNSTime(std::make_pair(
|
||||||
|
spinExpTime->value(),
|
||||||
|
static_cast<qDefs::timeUnit>(comboExpTimeUnit->currentIndex())));
|
||||||
|
LOG(logINFO) << "Setting exptime" << gateIndex << " to " << timeNS.count()
|
||||||
|
<< " ns"
|
||||||
|
<< "/" << spinExpTime->value()
|
||||||
|
<< qDefs::getUnitString(
|
||||||
|
(qDefs::timeUnit)comboExpTimeUnit->currentIndex());
|
||||||
|
try {
|
||||||
|
det->setExptime(gateIndex, timeNS);
|
||||||
|
}
|
||||||
|
CATCH_DISPLAY("Could not set exposure time.",
|
||||||
|
"qTabAdvanced::SetExposureTime")
|
||||||
|
|
||||||
|
GetExposureTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
void qTabAdvanced::GetGateDelay() {
|
||||||
|
int gateIndex = spinGateIndex->value();
|
||||||
|
LOG(logDEBUG) << "Getting gate delay" << gateIndex;
|
||||||
|
disconnect(spinGateDelay, SIGNAL(valueChanged(double)), this,
|
||||||
|
SLOT(SetGateDelay()));
|
||||||
|
disconnect(comboGateDelayUnit, SIGNAL(currentIndexChanged(int)), this,
|
||||||
|
SLOT(SetGateDelay()));
|
||||||
|
try {
|
||||||
|
auto retval = det->getGateDelay(gateIndex).tsquash(
|
||||||
|
"GateDelay is inconsistent for all detectors.");
|
||||||
|
auto time = qDefs::getUserFriendlyTime(retval);
|
||||||
|
spinGateDelay->setValue(time.first);
|
||||||
|
comboGateDelayUnit->setCurrentIndex(static_cast<int>(time.second));
|
||||||
|
}
|
||||||
|
CATCH_DISPLAY("Could not get gate delay.", "qTabSettings::GetGateDelay")
|
||||||
|
connect(spinGateDelay, SIGNAL(valueChanged(double)), this,
|
||||||
|
SLOT(SetGateDelay()));
|
||||||
|
connect(comboGateDelayUnit, SIGNAL(currentIndexChanged(int)), this,
|
||||||
|
SLOT(SetGateDelay()));
|
||||||
|
}
|
||||||
|
|
||||||
|
void qTabAdvanced::SetGateDelay() {
|
||||||
|
int gateIndex = spinGateIndex->value();
|
||||||
|
auto timeNS = qDefs::getNSTime(std::make_pair(
|
||||||
|
spinGateDelay->value(),
|
||||||
|
static_cast<qDefs::timeUnit>(comboGateDelayUnit->currentIndex())));
|
||||||
|
LOG(logINFO) << "Setting gatedelay" << gateIndex << " to " << timeNS.count()
|
||||||
|
<< " ns"
|
||||||
|
<< "/" << spinGateDelay->value()
|
||||||
|
<< qDefs::getUnitString(
|
||||||
|
(qDefs::timeUnit)comboGateDelayUnit->currentIndex());
|
||||||
|
try {
|
||||||
|
det->setGateDelay(gateIndex, timeNS);
|
||||||
|
}
|
||||||
|
CATCH_DISPLAY("Could not set gate delay.", "qTabAdvanced::SetGateDelay")
|
||||||
|
|
||||||
|
GetGateDelay();
|
||||||
|
}
|
||||||
|
|
||||||
void qTabAdvanced::Refresh() {
|
void qTabAdvanced::Refresh() {
|
||||||
LOG(logDEBUG) << "**Updating Advanced Tab";
|
LOG(logDEBUG) << "**Updating Advanced Tab";
|
||||||
|
|
||||||
@ -701,5 +818,14 @@ void qTabAdvanced::Refresh() {
|
|||||||
GetSubDeadTime();
|
GetSubDeadTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// exptime1, exptime2, exptme3
|
||||||
|
if (lblExpTime->isEnabled()) {
|
||||||
|
GetExposureTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
// gatedelay1, gatedelay2, gatedelay3
|
||||||
|
if (lblGateDelay->isEnabled()) {
|
||||||
|
GetGateDelay();
|
||||||
|
}
|
||||||
LOG(logDEBUG) << "**Updated Advanced Tab";
|
LOG(logDEBUG) << "**Updated Advanced Tab";
|
||||||
}
|
}
|
||||||
|
@ -334,15 +334,13 @@ void qTabDataOutput::SetRateCorrection() {
|
|||||||
// custom dead time
|
// custom dead time
|
||||||
if (radioCustomDeadtime->isChecked()) {
|
if (radioCustomDeadtime->isChecked()) {
|
||||||
int64_t deadtime = spinCustomDeadTime->value();
|
int64_t deadtime = spinCustomDeadTime->value();
|
||||||
LOG(logINFO)
|
LOG(logINFO) << "Setting Rate Correction with custom dead time: "
|
||||||
<< "Setting Rate Correction with custom dead time: "
|
|
||||||
<< deadtime;
|
<< deadtime;
|
||||||
det->setRateCorrection(sls::ns(deadtime));
|
det->setRateCorrection(sls::ns(deadtime));
|
||||||
}
|
}
|
||||||
// default dead time
|
// default dead time
|
||||||
else {
|
else {
|
||||||
LOG(logINFO)
|
LOG(logINFO) << "Setting Rate Correction with default dead time";
|
||||||
<< "Setting Rate Correction with default dead time";
|
|
||||||
det->setDefaultRateCorrection();
|
det->setDefaultRateCorrection();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -398,8 +396,7 @@ void qTabDataOutput::SetFlags() {
|
|||||||
auto mode =
|
auto mode =
|
||||||
comboEigerParallelFlag->currentIndex() == PARALLEL ? true : false;
|
comboEigerParallelFlag->currentIndex() == PARALLEL ? true : false;
|
||||||
try {
|
try {
|
||||||
LOG(logINFO)
|
LOG(logINFO) << "Setting Readout Flags to "
|
||||||
<< "Setting Readout Flags to "
|
|
||||||
<< comboEigerParallelFlag->currentText().toAscii().data();
|
<< comboEigerParallelFlag->currentText().toAscii().data();
|
||||||
det->setParallelMode(mode);
|
det->setParallelMode(mode);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "qTabDebugging.h"
|
#include "qTabDebugging.h"
|
||||||
#include "qDefs.h"
|
|
||||||
#include "ToString.h"
|
#include "ToString.h"
|
||||||
|
#include "qDefs.h"
|
||||||
#include <QDesktopWidget>
|
#include <QDesktopWidget>
|
||||||
#include <QGridLayout>
|
#include <QGridLayout>
|
||||||
#include <QTreeWidget>
|
#include <QTreeWidget>
|
||||||
@ -105,8 +105,9 @@ void qTabDebugging::GetInfo() {
|
|||||||
treeDet->setHeaderLabel("Eiger Detector");
|
treeDet->setHeaderLabel("Eiger Detector");
|
||||||
// get num modules
|
// get num modules
|
||||||
for (int i = 0; i < comboDetector->count() / 2; ++i)
|
for (int i = 0; i < comboDetector->count() / 2; ++i)
|
||||||
items.append(new QTreeWidgetItem(
|
items.append(
|
||||||
(QTreeWidget *)nullptr, QStringList(QString("Module %1").arg(i))));
|
new QTreeWidgetItem((QTreeWidget *)nullptr,
|
||||||
|
QStringList(QString("Module %1").arg(i))));
|
||||||
treeDet->insertTopLevelItems(0, items);
|
treeDet->insertTopLevelItems(0, items);
|
||||||
// gets det names
|
// gets det names
|
||||||
for (int i = 0; i < comboDetector->count(); ++i) {
|
for (int i = 0; i < comboDetector->count(); ++i) {
|
||||||
|
@ -31,6 +31,7 @@ void qTabMeasurement::SetupWidgetWindow() {
|
|||||||
progressTimer = new QTimer(this);
|
progressTimer = new QTimer(this);
|
||||||
|
|
||||||
sampleImplemented = false;
|
sampleImplemented = false;
|
||||||
|
gateImplemented = false;
|
||||||
delayImplemented = true;
|
delayImplemented = true;
|
||||||
startingFnumImplemented = false;
|
startingFnumImplemented = false;
|
||||||
// by default, delay and starting fnum is disabled in form
|
// by default, delay and starting fnum is disabled in form
|
||||||
@ -41,6 +42,8 @@ void qTabMeasurement::SetupWidgetWindow() {
|
|||||||
// default is triggers and delay (not #bursts and burst period for gotthard2
|
// default is triggers and delay (not #bursts and burst period for gotthard2
|
||||||
// in auto mode)
|
// in auto mode)
|
||||||
ShowTriggerDelay();
|
ShowTriggerDelay();
|
||||||
|
// default is to show samples, mythen3, show gates
|
||||||
|
ShowGates();
|
||||||
|
|
||||||
// enabling according to det type
|
// enabling according to det type
|
||||||
switch (det->getDetectorType().squash()) {
|
switch (det->getDetectorType().squash()) {
|
||||||
@ -67,6 +70,9 @@ void qTabMeasurement::SetupWidgetWindow() {
|
|||||||
spinBurstPeriod->setEnabled(true);
|
spinBurstPeriod->setEnabled(true);
|
||||||
comboBurstPeriodUnit->setEnabled(true);
|
comboBurstPeriodUnit->setEnabled(true);
|
||||||
break;
|
break;
|
||||||
|
case slsDetectorDefs::MYTHEN3:
|
||||||
|
gateImplemented = true;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -97,6 +103,10 @@ void qTabMeasurement::Initialization() {
|
|||||||
connect(spinNumSamples, SIGNAL(valueChanged(int)), this,
|
connect(spinNumSamples, SIGNAL(valueChanged(int)), this,
|
||||||
SLOT(SetNumSamples(int)));
|
SLOT(SetNumSamples(int)));
|
||||||
}
|
}
|
||||||
|
if (gateImplemented) {
|
||||||
|
connect(spinNumGates, SIGNAL(valueChanged(int)), this,
|
||||||
|
SLOT(SetNumGates(int)));
|
||||||
|
}
|
||||||
connect(spinExpTime, SIGNAL(valueChanged(double)), this,
|
connect(spinExpTime, SIGNAL(valueChanged(double)), this,
|
||||||
SLOT(SetExposureTime()));
|
SLOT(SetExposureTime()));
|
||||||
connect(comboExpUnit, SIGNAL(currentIndexChanged(int)), this,
|
connect(comboExpUnit, SIGNAL(currentIndexChanged(int)), this,
|
||||||
@ -161,6 +171,16 @@ void qTabMeasurement::ShowTriggerDelay() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void qTabMeasurement::ShowGates() {
|
||||||
|
if (det->getDetectorType().squash() == slsDetectorDefs::MYTHEN3) {
|
||||||
|
stackedLblSamplesGates->setCurrentWidget(pageLblGates);
|
||||||
|
stackedSpinSamplesGates->setCurrentWidget(pageSpinGates);
|
||||||
|
} else {
|
||||||
|
stackedLblSamplesGates->setCurrentWidget(pageLblSamples);
|
||||||
|
stackedSpinSamplesGates->setCurrentWidget(pageSpinSamples);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void qTabMeasurement::SetupTimingMode() {
|
void qTabMeasurement::SetupTimingMode() {
|
||||||
QStandardItemModel *model =
|
QStandardItemModel *model =
|
||||||
qobject_cast<QStandardItemModel *>(comboTimingMode->model());
|
qobject_cast<QStandardItemModel *>(comboTimingMode->model());
|
||||||
@ -173,9 +193,20 @@ void qTabMeasurement::SetupTimingMode() {
|
|||||||
item[i] = model->itemFromIndex(index[i]);
|
item[i] = model->itemFromIndex(index[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (det->getDetectorType().squash() != slsDetectorDefs::EIGER) {
|
|
||||||
item[(int)GATED]->setEnabled(false);
|
item[(int)GATED]->setEnabled(false);
|
||||||
item[(int)BURST_TRIGGER]->setEnabled(false);
|
item[(int)BURST_TRIGGER]->setEnabled(false);
|
||||||
|
item[(int)TRIGGER_GATED]->setEnabled(false);
|
||||||
|
switch (det->getDetectorType().squash()) {
|
||||||
|
case slsDetectorDefs::EIGER:
|
||||||
|
item[(int)GATED]->setEnabled(true);
|
||||||
|
item[(int)BURST_TRIGGER]->setEnabled(true);
|
||||||
|
break;
|
||||||
|
case slsDetectorDefs::MYTHEN3:
|
||||||
|
item[(int)GATED]->setEnabled(true);
|
||||||
|
item[(int)TRIGGER_GATED]->setEnabled(true);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -197,6 +228,8 @@ void qTabMeasurement::EnableWidgetsforTimingMode() {
|
|||||||
lblDelay->setEnabled(false);
|
lblDelay->setEnabled(false);
|
||||||
spinDelay->setEnabled(false);
|
spinDelay->setEnabled(false);
|
||||||
comboDelayUnit->setEnabled(false);
|
comboDelayUnit->setEnabled(false);
|
||||||
|
lblNumGates->setEnabled(false);
|
||||||
|
spinNumGates->setEnabled(false);
|
||||||
|
|
||||||
switch (comboTimingMode->currentIndex()) {
|
switch (comboTimingMode->currentIndex()) {
|
||||||
case AUTO:
|
case AUTO:
|
||||||
@ -223,6 +256,7 @@ void qTabMeasurement::EnableWidgetsforTimingMode() {
|
|||||||
lblExpTime->setEnabled(true);
|
lblExpTime->setEnabled(true);
|
||||||
spinExpTime->setEnabled(true);
|
spinExpTime->setEnabled(true);
|
||||||
comboExpUnit->setEnabled(true);
|
comboExpUnit->setEnabled(true);
|
||||||
|
// not implemented in FW to have multiple frames for eiger
|
||||||
if (det->getDetectorType().squash() == slsDetectorDefs::EIGER) {
|
if (det->getDetectorType().squash() == slsDetectorDefs::EIGER) {
|
||||||
spinNumFrames->setValue(1);
|
spinNumFrames->setValue(1);
|
||||||
} else {
|
} else {
|
||||||
@ -241,8 +275,12 @@ void qTabMeasurement::EnableWidgetsforTimingMode() {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GATED:
|
case GATED:
|
||||||
// #frames
|
// #frames, #gates(mythen3)
|
||||||
spinNumTriggers->setValue(1);
|
spinNumTriggers->setValue(1);
|
||||||
|
if (det->getDetectorType().squash() == slsDetectorDefs::MYTHEN3) {
|
||||||
|
lblNumGates->setEnabled(true);
|
||||||
|
spinNumGates->setEnabled(true);
|
||||||
|
}
|
||||||
lblNumFrames->setEnabled(true);
|
lblNumFrames->setEnabled(true);
|
||||||
spinNumFrames->setEnabled(true);
|
spinNumFrames->setEnabled(true);
|
||||||
break;
|
break;
|
||||||
@ -258,6 +296,18 @@ void qTabMeasurement::EnableWidgetsforTimingMode() {
|
|||||||
spinPeriod->setEnabled(true);
|
spinPeriod->setEnabled(true);
|
||||||
comboPeriodUnit->setEnabled(true);
|
comboPeriodUnit->setEnabled(true);
|
||||||
break;
|
break;
|
||||||
|
case TRIGGER_GATED:
|
||||||
|
// #triggers, delay, #frames, #gates
|
||||||
|
lblNumTriggers->setEnabled(true);
|
||||||
|
spinNumTriggers->setEnabled(true);
|
||||||
|
lblDelay->setEnabled(true);
|
||||||
|
spinDelay->setEnabled(true);
|
||||||
|
comboDelayUnit->setEnabled(true);
|
||||||
|
lblNumFrames->setEnabled(true);
|
||||||
|
spinNumFrames->setEnabled(true);
|
||||||
|
lblNumGates->setEnabled(true);
|
||||||
|
spinNumGates->setEnabled(true);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -278,6 +328,7 @@ void qTabMeasurement::GetTimingMode() {
|
|||||||
case slsDetectorDefs::TRIGGER_EXPOSURE:
|
case slsDetectorDefs::TRIGGER_EXPOSURE:
|
||||||
case slsDetectorDefs::GATED:
|
case slsDetectorDefs::GATED:
|
||||||
case slsDetectorDefs::BURST_TRIGGER:
|
case slsDetectorDefs::BURST_TRIGGER:
|
||||||
|
case slsDetectorDefs::TRIGGER_GATED:
|
||||||
comboTimingMode->setCurrentIndex((int)retval);
|
comboTimingMode->setCurrentIndex((int)retval);
|
||||||
// update widget enable only if different
|
// update widget enable only if different
|
||||||
if (oldMode != comboTimingMode->currentIndex()) {
|
if (oldMode != comboTimingMode->currentIndex()) {
|
||||||
@ -411,6 +462,31 @@ void qTabMeasurement::SetNumSamples(int val) {
|
|||||||
&qTabMeasurement::GetNumSamples)
|
&qTabMeasurement::GetNumSamples)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void qTabMeasurement::GetNumGates() {
|
||||||
|
LOG(logDEBUG) << "Getting number of gates";
|
||||||
|
disconnect(spinNumGates, SIGNAL(valueChanged(int)), this,
|
||||||
|
SLOT(SetNumGates(int)));
|
||||||
|
try {
|
||||||
|
auto retval = det->getNumberOfGates().tsquash(
|
||||||
|
"Inconsistent number of gates for all detectors.");
|
||||||
|
spinNumGates->setValue(retval);
|
||||||
|
}
|
||||||
|
CATCH_DISPLAY("Could not get number of gates.",
|
||||||
|
"qTabMeasurement::GetNumGates")
|
||||||
|
connect(spinNumGates, SIGNAL(valueChanged(int)), this,
|
||||||
|
SLOT(SetNumGates(int)));
|
||||||
|
}
|
||||||
|
|
||||||
|
void qTabMeasurement::SetNumGates(int val) {
|
||||||
|
LOG(logINFO) << "Setting number of external gates to " << val;
|
||||||
|
try {
|
||||||
|
det->setNumberOfGates(val);
|
||||||
|
}
|
||||||
|
CATCH_HANDLE("Could not set number of gates.",
|
||||||
|
"qTabMeasurement::SetNumGates", this,
|
||||||
|
&qTabMeasurement::GetNumGates)
|
||||||
|
}
|
||||||
|
|
||||||
void qTabMeasurement::GetExposureTime() {
|
void qTabMeasurement::GetExposureTime() {
|
||||||
LOG(logDEBUG) << "Getting exposure time";
|
LOG(logDEBUG) << "Getting exposure time";
|
||||||
disconnect(spinExpTime, SIGNAL(valueChanged(double)), this,
|
disconnect(spinExpTime, SIGNAL(valueChanged(double)), this,
|
||||||
@ -419,13 +495,31 @@ void qTabMeasurement::GetExposureTime() {
|
|||||||
SLOT(SetExposureTime()));
|
SLOT(SetExposureTime()));
|
||||||
try {
|
try {
|
||||||
spinExpTime->setValue(-1);
|
spinExpTime->setValue(-1);
|
||||||
auto retval = det->getExptime().tsquash(
|
|
||||||
|
bool inconsistentGateValues = false;
|
||||||
|
std::chrono::nanoseconds retval;
|
||||||
|
if (det->getDetectorType().squash() == slsDetectorDefs::MYTHEN3) {
|
||||||
|
auto retvals = det->getExptimeForAllGates().tsquash(
|
||||||
"Inconsistent exposure time for all detectors.");
|
"Inconsistent exposure time for all detectors.");
|
||||||
|
// all gates have same value
|
||||||
|
if (retvals[0] == retvals[1] && retvals[1] == retvals[2]) {
|
||||||
|
retval = retvals[0];
|
||||||
|
} else {
|
||||||
|
// dont throw, just leave it as -1
|
||||||
|
inconsistentGateValues = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
retval = det->getExptime().tsquash(
|
||||||
|
"Inconsistent exposure time for all detectors.");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!inconsistentGateValues) {
|
||||||
auto time = qDefs::getUserFriendlyTime(retval);
|
auto time = qDefs::getUserFriendlyTime(retval);
|
||||||
spinExpTime->setValue(time.first);
|
spinExpTime->setValue(time.first);
|
||||||
comboExpUnit->setCurrentIndex(static_cast<int>(time.second));
|
comboExpUnit->setCurrentIndex(static_cast<int>(time.second));
|
||||||
CheckAcqPeriodGreaterThanExp();
|
CheckAcqPeriodGreaterThanExp();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
CATCH_DISPLAY("Could not get exposure time.",
|
CATCH_DISPLAY("Could not get exposure time.",
|
||||||
"qTabMeasurement::GetExposureTime")
|
"qTabMeasurement::GetExposureTime")
|
||||||
connect(spinExpTime, SIGNAL(valueChanged(double)), this,
|
connect(spinExpTime, SIGNAL(valueChanged(double)), this,
|
||||||
@ -771,8 +865,7 @@ void qTabMeasurement::AcquireFinished() {
|
|||||||
if (startingFnumImplemented) {
|
if (startingFnumImplemented) {
|
||||||
GetStartingFrameNumber();
|
GetStartingFrameNumber();
|
||||||
}
|
}
|
||||||
LOG(logDEBUG) << "Measurement " << currentMeasurement
|
LOG(logDEBUG) << "Measurement " << currentMeasurement << " finished";
|
||||||
<< " finished";
|
|
||||||
// next measurement if acq is not stopped
|
// next measurement if acq is not stopped
|
||||||
if (!isAcquisitionStopped &&
|
if (!isAcquisitionStopped &&
|
||||||
((currentMeasurement + 1) < numMeasurements)) {
|
((currentMeasurement + 1) < numMeasurements)) {
|
||||||
@ -801,8 +894,9 @@ void qTabMeasurement::Enable(bool enable) {
|
|||||||
frameNotTimeResolved->setEnabled(enable);
|
frameNotTimeResolved->setEnabled(enable);
|
||||||
|
|
||||||
// shortcut each time, else it doesnt work a second time
|
// shortcut each time, else it doesnt work a second time
|
||||||
btnStart->setShortcut(QApplication::translate(
|
btnStart->setShortcut(QApplication::translate("TabMeasurementObject",
|
||||||
"TabMeasurementObject", "Shift+Space", nullptr, QApplication::UnicodeUTF8));
|
"Shift+Space", nullptr,
|
||||||
|
QApplication::UnicodeUTF8));
|
||||||
}
|
}
|
||||||
|
|
||||||
void qTabMeasurement::Refresh() {
|
void qTabMeasurement::Refresh() {
|
||||||
@ -826,6 +920,9 @@ void qTabMeasurement::Refresh() {
|
|||||||
if (sampleImplemented) {
|
if (sampleImplemented) {
|
||||||
GetNumSamples();
|
GetNumSamples();
|
||||||
}
|
}
|
||||||
|
if (gateImplemented) {
|
||||||
|
GetNumGates();
|
||||||
|
}
|
||||||
GetFileWrite();
|
GetFileWrite();
|
||||||
GetFileName();
|
GetFileName();
|
||||||
GetRunIndex();
|
GetRunIndex();
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
#include <QStackedLayout>
|
#include <QStackedLayout>
|
||||||
#include <QStandardItemModel>
|
#include <QStandardItemModel>
|
||||||
|
|
||||||
|
|
||||||
QString qTabPlot::defaultPlotTitle("");
|
QString qTabPlot::defaultPlotTitle("");
|
||||||
QString qTabPlot::defaultHistXAxisTitle("Channel Number");
|
QString qTabPlot::defaultHistXAxisTitle("Channel Number");
|
||||||
QString qTabPlot::defaultHistYAxisTitle("Counts");
|
QString qTabPlot::defaultHistYAxisTitle("Counts");
|
||||||
@ -64,6 +63,7 @@ void qTabPlot::SetupWidgetWindow() {
|
|||||||
chkGapPixels->setEnabled(true);
|
chkGapPixels->setEnabled(true);
|
||||||
break;
|
break;
|
||||||
case slsDetectorDefs::JUNGFRAU:
|
case slsDetectorDefs::JUNGFRAU:
|
||||||
|
chkGapPixels->setEnabled(true);
|
||||||
chkGainPlot->setEnabled(true);
|
chkGainPlot->setEnabled(true);
|
||||||
chkGainPlot->setChecked(true);
|
chkGainPlot->setChecked(true);
|
||||||
plot->EnableGainPlot(true);
|
plot->EnableGainPlot(true);
|
||||||
@ -289,16 +289,14 @@ void qTabPlot::SetBinary() {
|
|||||||
bool binary1D = chkBinary->isChecked();
|
bool binary1D = chkBinary->isChecked();
|
||||||
bool binary2D = chkBinary_2->isChecked();
|
bool binary2D = chkBinary_2->isChecked();
|
||||||
if (is1d) {
|
if (is1d) {
|
||||||
LOG(logINFO) << "Binary Plot "
|
LOG(logINFO) << "Binary Plot " << (binary1D ? "enabled" : "disabled");
|
||||||
<< (binary1D ? "enabled" : "disabled");
|
|
||||||
lblFrom->setEnabled(binary1D);
|
lblFrom->setEnabled(binary1D);
|
||||||
lblTo->setEnabled(binary1D);
|
lblTo->setEnabled(binary1D);
|
||||||
spinFrom->setEnabled(binary1D);
|
spinFrom->setEnabled(binary1D);
|
||||||
spinTo->setEnabled(binary1D);
|
spinTo->setEnabled(binary1D);
|
||||||
plot->SetBinary(binary1D, spinFrom->value(), spinTo->value());
|
plot->SetBinary(binary1D, spinFrom->value(), spinTo->value());
|
||||||
} else {
|
} else {
|
||||||
LOG(logINFO) << "Binary Plot "
|
LOG(logINFO) << "Binary Plot " << (binary2D ? "enabled" : "disabled");
|
||||||
<< (binary2D ? "enabled" : "disabled");
|
|
||||||
lblFrom_2->setEnabled(binary2D);
|
lblFrom_2->setEnabled(binary2D);
|
||||||
lblTo_2->setEnabled(binary2D);
|
lblTo_2->setEnabled(binary2D);
|
||||||
spinFrom_2->setEnabled(binary2D);
|
spinFrom_2->setEnabled(binary2D);
|
||||||
@ -312,8 +310,7 @@ void qTabPlot::GetGapPixels() {
|
|||||||
disconnect(chkGapPixels, SIGNAL(toggled(bool)), this,
|
disconnect(chkGapPixels, SIGNAL(toggled(bool)), this,
|
||||||
SLOT(SetGapPixels(bool)));
|
SLOT(SetGapPixels(bool)));
|
||||||
try {
|
try {
|
||||||
auto retval = det->getRxAddGapPixels().tsquash(
|
auto retval = det->getGapPixelsinCallback();
|
||||||
"Inconsistent gap pixels enabled for all detectors.");
|
|
||||||
chkGapPixels->setChecked(retval);
|
chkGapPixels->setChecked(retval);
|
||||||
}
|
}
|
||||||
CATCH_DISPLAY("Could not get gap pixels enable.", "qTabPlot::GetGapPixels")
|
CATCH_DISPLAY("Could not get gap pixels enable.", "qTabPlot::GetGapPixels")
|
||||||
@ -324,7 +321,7 @@ void qTabPlot::GetGapPixels() {
|
|||||||
void qTabPlot::SetGapPixels(bool enable) {
|
void qTabPlot::SetGapPixels(bool enable) {
|
||||||
LOG(logINFO) << "Setting Gap Pixels Enable to " << enable;
|
LOG(logINFO) << "Setting Gap Pixels Enable to " << enable;
|
||||||
try {
|
try {
|
||||||
det->setRxAddGapPixels(enable);
|
det->setGapPixelsinCallback(enable);
|
||||||
}
|
}
|
||||||
CATCH_HANDLE("Could not set gap pixels enable.", "qTabPlot::SetGapPixels",
|
CATCH_HANDLE("Could not set gap pixels enable.", "qTabPlot::SetGapPixels",
|
||||||
this, &qTabPlot::GetGapPixels)
|
this, &qTabPlot::GetGapPixels)
|
||||||
@ -434,9 +431,9 @@ void qTabPlot::SetXYRange() {
|
|||||||
for (int i = 0; i < 4; ++i) {
|
for (int i = 0; i < 4; ++i) {
|
||||||
if (chkVal[i] && !dispVal[i].isEmpty()) {
|
if (chkVal[i] && !dispVal[i].isEmpty()) {
|
||||||
double val = dispVal[i].toDouble();
|
double val = dispVal[i].toDouble();
|
||||||
LOG(logDEBUG)
|
LOG(logDEBUG) << "Setting "
|
||||||
<< "Setting "
|
<< qDefs::getRangeAsString(
|
||||||
<< qDefs::getRangeAsString(static_cast<qDefs::range>(i))
|
static_cast<qDefs::range>(i))
|
||||||
<< " to " << val;
|
<< " to " << val;
|
||||||
xyRange[i] = val;
|
xyRange[i] = val;
|
||||||
isRange[i] = true;
|
isRange[i] = true;
|
||||||
@ -482,10 +479,10 @@ void qTabPlot::MaintainAspectRatio(int dimension) {
|
|||||||
ranges[qDefs::YMAX] = plot->GetYMaximum();
|
ranges[qDefs::YMAX] = plot->GetYMaximum();
|
||||||
double idealAspectratio = (ranges[qDefs::XMAX] - ranges[qDefs::XMIN]) /
|
double idealAspectratio = (ranges[qDefs::XMAX] - ranges[qDefs::XMIN]) /
|
||||||
(ranges[qDefs::YMAX] - ranges[qDefs::YMIN]);
|
(ranges[qDefs::YMAX] - ranges[qDefs::YMIN]);
|
||||||
LOG(logDEBUG) << "Ideal Aspect ratio: " << idealAspectratio
|
LOG(logDEBUG) << "Ideal Aspect ratio: " << idealAspectratio << " for x("
|
||||||
<< " for x(" << ranges[qDefs::XMIN] << " - "
|
<< ranges[qDefs::XMIN] << " - " << ranges[qDefs::XMAX]
|
||||||
<< ranges[qDefs::XMAX] << "), y(" << ranges[qDefs::YMIN]
|
<< "), y(" << ranges[qDefs::YMIN] << " - "
|
||||||
<< " - " << ranges[qDefs::YMAX] << ")";
|
<< ranges[qDefs::YMAX] << ")";
|
||||||
|
|
||||||
// calculate current aspect ratio
|
// calculate current aspect ratio
|
||||||
ranges[qDefs::XMIN] = dispXMin->text().toDouble();
|
ranges[qDefs::XMIN] = dispXMin->text().toDouble();
|
||||||
@ -494,10 +491,10 @@ void qTabPlot::MaintainAspectRatio(int dimension) {
|
|||||||
ranges[qDefs::YMAX] = dispYMax->text().toDouble();
|
ranges[qDefs::YMAX] = dispYMax->text().toDouble();
|
||||||
double currentAspectRatio = (ranges[qDefs::XMAX] - ranges[qDefs::XMIN]) /
|
double currentAspectRatio = (ranges[qDefs::XMAX] - ranges[qDefs::XMIN]) /
|
||||||
(ranges[qDefs::YMAX] - ranges[qDefs::YMIN]);
|
(ranges[qDefs::YMAX] - ranges[qDefs::YMIN]);
|
||||||
LOG(logDEBUG) << "Current Aspect ratio: " << currentAspectRatio
|
LOG(logDEBUG) << "Current Aspect ratio: " << currentAspectRatio << " for x("
|
||||||
<< " for x(" << ranges[qDefs::XMIN] << " - "
|
<< ranges[qDefs::XMIN] << " - " << ranges[qDefs::XMAX]
|
||||||
<< ranges[qDefs::XMAX] << "), y(" << ranges[qDefs::YMIN]
|
<< "), y(" << ranges[qDefs::YMIN] << " - "
|
||||||
<< " - " << ranges[qDefs::YMAX] << ")";
|
<< ranges[qDefs::YMAX] << ")";
|
||||||
|
|
||||||
if (currentAspectRatio != idealAspectratio) {
|
if (currentAspectRatio != idealAspectratio) {
|
||||||
// dimension: 1(x changed: y adjusted), 0(y changed: x adjusted),
|
// dimension: 1(x changed: y adjusted), 0(y changed: x adjusted),
|
||||||
@ -672,6 +669,8 @@ void qTabPlot::Refresh() {
|
|||||||
break;
|
break;
|
||||||
case slsDetectorDefs::JUNGFRAU:
|
case slsDetectorDefs::JUNGFRAU:
|
||||||
chkGainPlot->setEnabled(true);
|
chkGainPlot->setEnabled(true);
|
||||||
|
chkGapPixels->setEnabled(true);
|
||||||
|
GetGapPixels();
|
||||||
break;
|
break;
|
||||||
case slsDetectorDefs::GOTTHARD2:
|
case slsDetectorDefs::GOTTHARD2:
|
||||||
chkGainPlot1D->setEnabled(true);
|
chkGainPlot1D->setEnabled(true);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "qTabSettings.h"
|
#include "qTabSettings.h"
|
||||||
#include "qDefs.h"
|
|
||||||
#include "ToString.h"
|
#include "ToString.h"
|
||||||
|
#include "qDefs.h"
|
||||||
#include <QStandardItemModel>
|
#include <QStandardItemModel>
|
||||||
|
|
||||||
qTabSettings::qTabSettings(QWidget *parent, sls::Detector *detector)
|
qTabSettings::qTabSettings(QWidget *parent, sls::Detector *detector)
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
add_library(slsProjectCWarnings INTERFACE)
|
add_library(slsProjectCSettings INTERFACE)
|
||||||
target_compile_options(slsProjectCWarnings INTERFACE
|
target_compile_features(slsProjectCSettings INTERFACE c_std_99)
|
||||||
|
target_compile_options(slsProjectCSettings INTERFACE
|
||||||
-Wall
|
-Wall
|
||||||
-Wextra
|
-Wextra
|
||||||
-Wno-unused-parameter #Needs to be slowly mitigated
|
-Wno-unused-parameter #Needs to be slowly mitigated
|
||||||
@ -13,7 +14,7 @@ target_compile_options(slsProjectCWarnings INTERFACE
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Install fake the library
|
# Install fake the library
|
||||||
install(TARGETS slsProjectCWarnings
|
install(TARGETS slsProjectCSettings
|
||||||
EXPORT "${TARGETS_EXPORT_NAME}"
|
EXPORT "${TARGETS_EXPORT_NAME}"
|
||||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
|
@ -16,6 +16,7 @@ add_executable(ctbDetectorServer_virtual
|
|||||||
../slsDetectorServer/src/LTC2620.c
|
../slsDetectorServer/src/LTC2620.c
|
||||||
../slsDetectorServer/src/MAX1932.c
|
../slsDetectorServer/src/MAX1932.c
|
||||||
../slsDetectorServer/src/programFpgaBlackfin.c
|
../slsDetectorServer/src/programFpgaBlackfin.c
|
||||||
|
../slsDetectorServer/src/communication_virtual.c
|
||||||
)
|
)
|
||||||
|
|
||||||
include_directories(
|
include_directories(
|
||||||
@ -32,7 +33,8 @@ target_compile_definitions(ctbDetectorServer_virtual
|
|||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(ctbDetectorServer_virtual
|
target_link_libraries(ctbDetectorServer_virtual
|
||||||
PUBLIC pthread rt slsProjectCWarnings
|
PUBLIC pthread rt slsProjectCSettings
|
||||||
|
m
|
||||||
)
|
)
|
||||||
|
|
||||||
set_target_properties(ctbDetectorServer_virtual PROPERTIES
|
set_target_properties(ctbDetectorServer_virtual PROPERTIES
|
||||||
|
126
slsDetectorServers/ctbDetectorServer/RegisterDefs.h
Executable file → Normal file
126
slsDetectorServers/ctbDetectorServer/RegisterDefs.h
Executable file → Normal file
@ -10,7 +10,8 @@
|
|||||||
#define FPGA_VERSION_BRD_RVSN_MSK (0x00FFFFFF << FPGA_VERSION_BRD_RVSN_OFST)
|
#define FPGA_VERSION_BRD_RVSN_MSK (0x00FFFFFF << FPGA_VERSION_BRD_RVSN_OFST)
|
||||||
#define FPGA_VERSION_DTCTR_TYP_OFST (24)
|
#define FPGA_VERSION_DTCTR_TYP_OFST (24)
|
||||||
#define FPGA_VERSION_DTCTR_TYP_MSK (0x000000FF << FPGA_VERSION_DTCTR_TYP_OFST)
|
#define FPGA_VERSION_DTCTR_TYP_MSK (0x000000FF << FPGA_VERSION_DTCTR_TYP_OFST)
|
||||||
#define FPGA_VERSION_DTCTR_TYP_CTB_VAL ((0x4 << FPGA_VERSION_DTCTR_TYP_OFST) & FPGA_VERSION_DTCTR_TYP_MSK)
|
#define FPGA_VERSION_DTCTR_TYP_CTB_VAL \
|
||||||
|
((0x4 << FPGA_VERSION_DTCTR_TYP_OFST) & FPGA_VERSION_DTCTR_TYP_MSK)
|
||||||
|
|
||||||
/* Fix pattern RO register */
|
/* Fix pattern RO register */
|
||||||
#define FIX_PATT_REG (0x01 << MEM_MAP_SHIFT)
|
#define FIX_PATT_REG (0x01 << MEM_MAP_SHIFT)
|
||||||
@ -57,7 +58,8 @@
|
|||||||
#define STATUS_PLL_PHS_DN_OFST (23)
|
#define STATUS_PLL_PHS_DN_OFST (23)
|
||||||
#define STATUS_PLL_PHS_DN_MSK (0x00000001 << STATUS_PLL_PHS_DN_OFST)
|
#define STATUS_PLL_PHS_DN_MSK (0x00000001 << STATUS_PLL_PHS_DN_OFST)
|
||||||
#define STATUS_PT_CNTRL_STTS_OFF_OFST (24)
|
#define STATUS_PT_CNTRL_STTS_OFF_OFST (24)
|
||||||
#define STATUS_PT_CNTRL_STTS_OFF_MSK (0x000000FF << STATUS_PT_CNTRL_STTS_OFF_OFST)
|
#define STATUS_PT_CNTRL_STTS_OFF_MSK \
|
||||||
|
(0x000000FF << STATUS_PT_CNTRL_STTS_OFF_OFST)
|
||||||
#define STATUS_IDLE_MSK (0x677FF)
|
#define STATUS_IDLE_MSK (0x677FF)
|
||||||
|
|
||||||
/* Look at me RO register TODO */
|
/* Look at me RO register TODO */
|
||||||
@ -67,24 +69,30 @@
|
|||||||
#define SYSTEM_STATUS_REG (0x04 << MEM_MAP_SHIFT)
|
#define SYSTEM_STATUS_REG (0x04 << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
#define SYSTEM_STATUS_DDR3_CLBRTN_OK_OFST (0)
|
#define SYSTEM_STATUS_DDR3_CLBRTN_OK_OFST (0)
|
||||||
#define SYSTEM_STATUS_DDR3_CLBRTN_OK_MSK (0x00000001 << SYSTEM_STATUS_DDR3_CLBRTN_OK_OFST)
|
#define SYSTEM_STATUS_DDR3_CLBRTN_OK_MSK \
|
||||||
|
(0x00000001 << SYSTEM_STATUS_DDR3_CLBRTN_OK_OFST)
|
||||||
#define SYSTEM_STATUS_DDR3_CLBRTN_FL_OFST (1)
|
#define SYSTEM_STATUS_DDR3_CLBRTN_FL_OFST (1)
|
||||||
#define SYSTEM_STATUS_DDR3_CLBRTN_FL_MSK (0x00000001 << SYSTEM_STATUS_DDR3_CLBRTN_FL_OFST)
|
#define SYSTEM_STATUS_DDR3_CLBRTN_FL_MSK \
|
||||||
|
(0x00000001 << SYSTEM_STATUS_DDR3_CLBRTN_FL_OFST)
|
||||||
#define SYSTEM_STATUS_DDR3_INT_DN_OFST (2)
|
#define SYSTEM_STATUS_DDR3_INT_DN_OFST (2)
|
||||||
#define SYSTEM_STATUS_DDR3_INT_DN_MSK (0x00000001 << SYSTEM_STATUS_DDR3_INT_DN_OFST)
|
#define SYSTEM_STATUS_DDR3_INT_DN_MSK \
|
||||||
|
(0x00000001 << SYSTEM_STATUS_DDR3_INT_DN_OFST)
|
||||||
#define SYSTEM_STATUS_RCNFG_PLL_LCK_OFST (3)
|
#define SYSTEM_STATUS_RCNFG_PLL_LCK_OFST (3)
|
||||||
#define SYSTEM_STATUS_RCNFG_PLL_LCK_MSK (0x00000001 << SYSTEM_STATUS_RCNFG_PLL_LCK_OFST)
|
#define SYSTEM_STATUS_RCNFG_PLL_LCK_MSK \
|
||||||
|
(0x00000001 << SYSTEM_STATUS_RCNFG_PLL_LCK_OFST)
|
||||||
#define SYSTEM_STATUS_PLL_A_LCK_OFST (4)
|
#define SYSTEM_STATUS_PLL_A_LCK_OFST (4)
|
||||||
#define SYSTEM_STATUS_PLL_A_LCK_MSK (0x00000001 << SYSTEM_STATUS_PLL_A_LCK_OFST)
|
#define SYSTEM_STATUS_PLL_A_LCK_MSK (0x00000001 << SYSTEM_STATUS_PLL_A_LCK_OFST)
|
||||||
|
|
||||||
/* PLL Param (Reconfiguratble PLL Parameter) RO register TODO FIXME: Same as PLL_PARAM_REG 0x50 */
|
/* PLL Param (Reconfiguratble PLL Parameter) RO register TODO FIXME: Same as
|
||||||
|
* PLL_PARAM_REG 0x50 */
|
||||||
//#define PLL_PARAM_REG (0x05 << MEM_MAP_SHIFT)
|
//#define PLL_PARAM_REG (0x05 << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
/* FIFO Data RO register TODO */
|
/* FIFO Data RO register TODO */
|
||||||
#define FIFO_DATA_REG (0x06 << MEM_MAP_SHIFT)
|
#define FIFO_DATA_REG (0x06 << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
#define FIFO_DATA_HRDWR_SRL_NMBR_OFST (0)
|
#define FIFO_DATA_HRDWR_SRL_NMBR_OFST (0)
|
||||||
#define FIFO_DATA_HRDWR_SRL_NMBR_MSK (0x0000FFFF << FIFO_DATA_HRDWR_SRL_NMBR_OFST)
|
#define FIFO_DATA_HRDWR_SRL_NMBR_MSK \
|
||||||
|
(0x0000FFFF << FIFO_DATA_HRDWR_SRL_NMBR_OFST)
|
||||||
//#define FIFO_DATA_WRD_OFST (16)
|
//#define FIFO_DATA_WRD_OFST (16)
|
||||||
//#define FIFO_DATA_WRD_MSK (0x0000FFFF << FIFO_DATA_WRD_OFST)
|
//#define FIFO_DATA_WRD_MSK (0x0000FFFF << FIFO_DATA_WRD_OFST)
|
||||||
|
|
||||||
@ -114,7 +122,8 @@
|
|||||||
#define API_VERSION_DTCTR_TYP_OFST (24)
|
#define API_VERSION_DTCTR_TYP_OFST (24)
|
||||||
#define API_VERSION_DTCTR_TYP_MSK (0x000000FF << API_VERSION_DTCTR_TYP_OFST)
|
#define API_VERSION_DTCTR_TYP_MSK (0x000000FF << API_VERSION_DTCTR_TYP_OFST)
|
||||||
|
|
||||||
/* Time from Start 64 bit RO register. t = GCLK x 50 ns. Reset using CONTROL_CRST. TODO */
|
/* Time from Start 64 bit RO register. t = GCLK x 50 ns. Reset using
|
||||||
|
* CONTROL_CRST. TODO */
|
||||||
#define TIME_FROM_START_LSB_REG (0x10 << MEM_MAP_SHIFT)
|
#define TIME_FROM_START_LSB_REG (0x10 << MEM_MAP_SHIFT)
|
||||||
#define TIME_FROM_START_MSB_REG (0x11 << MEM_MAP_SHIFT)
|
#define TIME_FROM_START_MSB_REG (0x11 << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
@ -135,12 +144,16 @@
|
|||||||
#define PERIOD_LEFT_MSB_REG (0x19 << MEM_MAP_SHIFT)
|
#define PERIOD_LEFT_MSB_REG (0x19 << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
/* Exposure Time Left 64 bit RO register */
|
/* Exposure Time Left 64 bit RO register */
|
||||||
//#define EXPTIME_LEFT_LSB_REG (0x1A << MEM_MAP_SHIFT) // Not used in FW
|
//#define EXPTIME_LEFT_LSB_REG (0x1A << MEM_MAP_SHIFT) // Not
|
||||||
//#define EXPTIME_LEFT_MSB_REG (0x1B << MEM_MAP_SHIFT) // Not used in FW
|
// used in FW #define EXPTIME_LEFT_MSB_REG (0x1B <<
|
||||||
|
// MEM_MAP_SHIFT)
|
||||||
|
//// Not used in FW
|
||||||
|
|
||||||
/* Gates Left 64 bit RO register */
|
/* Gates Left 64 bit RO register */
|
||||||
//#define GATES_LEFT_LSB_REG (0x1C << MEM_MAP_SHIFT) // Not used in FW
|
//#define GATES_LEFT_LSB_REG (0x1C << MEM_MAP_SHIFT) // Not
|
||||||
//#define GATES_LEFT_MSB_REG (0x1D << MEM_MAP_SHIFT) // Not used in FW
|
// used in FW #define GATES_LEFT_MSB_REG (0x1D <<
|
||||||
|
// MEM_MAP_SHIFT)
|
||||||
|
//// Not used in FW
|
||||||
|
|
||||||
/* Data In 64 bit RO register TODO */
|
/* Data In 64 bit RO register TODO */
|
||||||
#define DATA_IN_LSB_REG (0x1E << MEM_MAP_SHIFT)
|
#define DATA_IN_LSB_REG (0x1E << MEM_MAP_SHIFT)
|
||||||
@ -151,14 +164,17 @@
|
|||||||
#define PATTERN_OUT_MSB_REG (0x21 << MEM_MAP_SHIFT)
|
#define PATTERN_OUT_MSB_REG (0x21 << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
/* Frames From Start 64 bit RO register TODO */
|
/* Frames From Start 64 bit RO register TODO */
|
||||||
//#define FRAMES_FROM_START_LSB_REG (0x22 << MEM_MAP_SHIFT) // Not used in FW
|
//#define FRAMES_FROM_START_LSB_REG (0x22 << MEM_MAP_SHIFT) // Not
|
||||||
//#define FRAMES_FROM_START_MSB_REG (0x23 << MEM_MAP_SHIFT) // Not used in FW
|
// used in FW #define FRAMES_FROM_START_MSB_REG (0x23 <<
|
||||||
|
// MEM_MAP_SHIFT)
|
||||||
|
//// Not used in FW
|
||||||
|
|
||||||
/* Frames From Start PG 64 bit RO register. Reset using CONTROL_CRST. TODO */
|
/* Frames From Start PG 64 bit RO register. Reset using CONTROL_CRST. TODO */
|
||||||
#define FRAMES_FROM_START_PG_LSB_REG (0x24 << MEM_MAP_SHIFT)
|
#define FRAMES_FROM_START_PG_LSB_REG (0x24 << MEM_MAP_SHIFT)
|
||||||
#define FRAMES_FROM_START_PG_MSB_REG (0x25 << MEM_MAP_SHIFT)
|
#define FRAMES_FROM_START_PG_MSB_REG (0x25 << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
/* Start Frame Time (Measurement Time) 64 bit register (timestamp at a frame start until reset) TODO */
|
/* Start Frame Time (Measurement Time) 64 bit register (timestamp at a frame
|
||||||
|
* start until reset) TODO */
|
||||||
#define START_FRAME_TIME_LSB_REG (0x26 << MEM_MAP_SHIFT)
|
#define START_FRAME_TIME_LSB_REG (0x26 << MEM_MAP_SHIFT)
|
||||||
#define START_FRAME_TIME_MSB_REG (0x27 << MEM_MAP_SHIFT)
|
#define START_FRAME_TIME_MSB_REG (0x27 << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
@ -177,9 +193,11 @@
|
|||||||
/* FIFO Digital In Status RO register */
|
/* FIFO Digital In Status RO register */
|
||||||
#define FIFO_DIN_STATUS_REG (0x3B << MEM_MAP_SHIFT)
|
#define FIFO_DIN_STATUS_REG (0x3B << MEM_MAP_SHIFT)
|
||||||
#define FIFO_DIN_STATUS_FIFO_FULL_OFST (30)
|
#define FIFO_DIN_STATUS_FIFO_FULL_OFST (30)
|
||||||
#define FIFO_DIN_STATUS_FIFO_FULL_MSK (0x00000001 << FIFO_DIN_STATUS_FIFO_FULL_OFST)
|
#define FIFO_DIN_STATUS_FIFO_FULL_MSK \
|
||||||
|
(0x00000001 << FIFO_DIN_STATUS_FIFO_FULL_OFST)
|
||||||
#define FIFO_DIN_STATUS_FIFO_EMPTY_OFST (31)
|
#define FIFO_DIN_STATUS_FIFO_EMPTY_OFST (31)
|
||||||
#define FIFO_DIN_STATUS_FIFO_EMPTY_MSK (0x00000001 << FIFO_DIN_STATUS_FIFO_EMPTY_OFST)
|
#define FIFO_DIN_STATUS_FIFO_EMPTY_MSK \
|
||||||
|
(0x00000001 << FIFO_DIN_STATUS_FIFO_EMPTY_OFST)
|
||||||
|
|
||||||
/* FIFO Digital In 64 bit RO register */
|
/* FIFO Digital In 64 bit RO register */
|
||||||
#define FIFO_DIN_LSB_REG (0x3C << MEM_MAP_SHIFT)
|
#define FIFO_DIN_LSB_REG (0x3C << MEM_MAP_SHIFT)
|
||||||
@ -243,9 +261,11 @@
|
|||||||
#define DUMMY_FIFO_CHNNL_SLCT_OFST (0)
|
#define DUMMY_FIFO_CHNNL_SLCT_OFST (0)
|
||||||
#define DUMMY_FIFO_CHNNL_SLCT_MSK (0x0000003F << DUMMY_FIFO_CHNNL_SLCT_OFST)
|
#define DUMMY_FIFO_CHNNL_SLCT_MSK (0x0000003F << DUMMY_FIFO_CHNNL_SLCT_OFST)
|
||||||
#define DUMMY_ANLG_FIFO_RD_STRBE_OFST (8)
|
#define DUMMY_ANLG_FIFO_RD_STRBE_OFST (8)
|
||||||
#define DUMMY_ANLG_FIFO_RD_STRBE_MSK (0x00000001 << DUMMY_ANLG_FIFO_RD_STRBE_OFST)
|
#define DUMMY_ANLG_FIFO_RD_STRBE_MSK \
|
||||||
|
(0x00000001 << DUMMY_ANLG_FIFO_RD_STRBE_OFST)
|
||||||
#define DUMMY_DGTL_FIFO_RD_STRBE_OFST (9)
|
#define DUMMY_DGTL_FIFO_RD_STRBE_OFST (9)
|
||||||
#define DUMMY_DGTL_FIFO_RD_STRBE_MSK (0x00000001 << DUMMY_DGTL_FIFO_RD_STRBE_OFST)
|
#define DUMMY_DGTL_FIFO_RD_STRBE_MSK \
|
||||||
|
(0x00000001 << DUMMY_DGTL_FIFO_RD_STRBE_OFST)
|
||||||
|
|
||||||
/* Receiver IP Address RW register */
|
/* Receiver IP Address RW register */
|
||||||
#define RX_IP_REG (0x45 << MEM_MAP_SHIFT)
|
#define RX_IP_REG (0x45 << MEM_MAP_SHIFT)
|
||||||
@ -313,21 +333,23 @@
|
|||||||
#define CONTROL_STP_ACQSTN_OFST (1)
|
#define CONTROL_STP_ACQSTN_OFST (1)
|
||||||
#define CONTROL_STP_ACQSTN_MSK (0x00000001 << CONTROL_STP_ACQSTN_OFST)
|
#define CONTROL_STP_ACQSTN_MSK (0x00000001 << CONTROL_STP_ACQSTN_OFST)
|
||||||
//#define CONTROL_STRT_FF_TST_OFST (2)
|
//#define CONTROL_STRT_FF_TST_OFST (2)
|
||||||
//#define CONTROL_STRT_FF_TST_MSK (0x00000001 << CONTROL_STRT_FF_TST_OFST)
|
//#define CONTROL_STRT_FF_TST_MSK (0x00000001 <<
|
||||||
//#define CONTROL_STP_FF_TST_OFST (3)
|
// CONTROL_STRT_FF_TST_OFST) #define CONTROL_STP_FF_TST_OFST (3)
|
||||||
//#define CONTROL_STP_FF_TST_MSK (0x00000001 << CONTROL_STP_FF_TST_OFST)
|
//#define CONTROL_STP_FF_TST_MSK (0x00000001 <<
|
||||||
//#define CONTROL_STRT_RDT_OFST (4)
|
// CONTROL_STP_FF_TST_OFST) #define CONTROL_STRT_RDT_OFST (4)
|
||||||
//#define CONTROL_STRT_RDT_MSK (0x00000001 << CONTROL_STRT_RDT_OFST)
|
//#define CONTROL_STRT_RDT_MSK (0x00000001 <<
|
||||||
//#define CONTROL_STP_RDT_OFST (5)
|
// CONTROL_STRT_RDT_OFST) #define CONTROL_STP_RDT_OFST (5)
|
||||||
//#define CONTROL_STP_RDT_MSK (0x00000001 << CONTROL_STP_RDT_OFST)
|
// #define CONTROL_STP_RDT_MSK (0x00000001 <<
|
||||||
|
// CONTROL_STP_RDT_OFST)
|
||||||
#define CONTROL_STRT_EXPSR_OFST (6)
|
#define CONTROL_STRT_EXPSR_OFST (6)
|
||||||
#define CONTROL_STRT_EXPSR_MSK (0x00000001 << CONTROL_STRT_EXPSR_OFST)
|
#define CONTROL_STRT_EXPSR_MSK (0x00000001 << CONTROL_STRT_EXPSR_OFST)
|
||||||
//#define CONTROL_STP_EXPSR_OFST (7)
|
//#define CONTROL_STP_EXPSR_OFST (7)
|
||||||
//#define CONTROL_STP_EXPSR_MSK (0x00000001 << CONTROL_STP_RDT_OFST)
|
//#define CONTROL_STP_EXPSR_MSK (0x00000001 <<
|
||||||
//#define CONTROL_STRT_TRN_OFST (8)
|
// CONTROL_STP_RDT_OFST) #define CONTROL_STRT_TRN_OFST (8) #define
|
||||||
//#define CONTROL_STRT_TRN_MSK (0x00000001 << CONTROL_STRT_RDT_OFST)
|
// CONTROL_STRT_TRN_MSK (0x00000001 << CONTROL_STRT_RDT_OFST)
|
||||||
//#define CONTROL_STP_TRN_OFST (9)
|
//#define CONTROL_STP_TRN_OFST (9)
|
||||||
//#define CONTROL_STP_TRN_MSK (0x00000001 << CONTROL_STP_RDT_OFST)
|
//#define CONTROL_STP_TRN_MSK (0x00000001 <<
|
||||||
|
// CONTROL_STP_RDT_OFST)
|
||||||
#define CONTROL_CRE_RST_OFST (10)
|
#define CONTROL_CRE_RST_OFST (10)
|
||||||
#define CONTROL_CRE_RST_MSK (0x00000001 << CONTROL_CRE_RST_OFST)
|
#define CONTROL_CRE_RST_MSK (0x00000001 << CONTROL_CRE_RST_OFST)
|
||||||
#define CONTROL_PRPHRL_RST_OFST (11) // Only GBE10?
|
#define CONTROL_PRPHRL_RST_OFST (11) // Only GBE10?
|
||||||
@ -335,7 +357,8 @@
|
|||||||
#define CONTROL_MMRY_RST_OFST (12)
|
#define CONTROL_MMRY_RST_OFST (12)
|
||||||
#define CONTROL_MMRY_RST_MSK (0x00000001 << CONTROL_MMRY_RST_OFST)
|
#define CONTROL_MMRY_RST_MSK (0x00000001 << CONTROL_MMRY_RST_OFST)
|
||||||
//#define CONTROL_PLL_RCNFG_WR_OFST (13)
|
//#define CONTROL_PLL_RCNFG_WR_OFST (13)
|
||||||
//#define CONTROL_PLL_RCNFG_WR_MSK (0x00000001 << CONTROL_PLL_RCNFG_WR_OFST)
|
//#define CONTROL_PLL_RCNFG_WR_MSK (0x00000001 <<
|
||||||
|
// CONTROL_PLL_RCNFG_WR_OFST)
|
||||||
#define CONTROL_SND_10GB_PCKT_OFST (14)
|
#define CONTROL_SND_10GB_PCKT_OFST (14)
|
||||||
#define CONTROL_SND_10GB_PCKT_MSK (0x00000001 << CONTROL_SND_10GB_PCKT_OFST)
|
#define CONTROL_SND_10GB_PCKT_MSK (0x00000001 << CONTROL_SND_10GB_PCKT_OFST)
|
||||||
#define CONTROL_CLR_ACQSTN_FIFO_OFST (15)
|
#define CONTROL_CLR_ACQSTN_FIFO_OFST (15)
|
||||||
@ -348,7 +371,8 @@
|
|||||||
#define PLL_CNTRL_REG (0x51 << MEM_MAP_SHIFT)
|
#define PLL_CNTRL_REG (0x51 << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
#define PLL_CNTRL_RCNFG_PRMTR_RST_OFST (0)
|
#define PLL_CNTRL_RCNFG_PRMTR_RST_OFST (0)
|
||||||
#define PLL_CNTRL_RCNFG_PRMTR_RST_MSK (0x00000001 << PLL_CNTRL_RCNFG_PRMTR_RST_OFST)
|
#define PLL_CNTRL_RCNFG_PRMTR_RST_MSK \
|
||||||
|
(0x00000001 << PLL_CNTRL_RCNFG_PRMTR_RST_OFST)
|
||||||
#define PLL_CNTRL_WR_PRMTR_OFST (2)
|
#define PLL_CNTRL_WR_PRMTR_OFST (2)
|
||||||
#define PLL_CNTRL_WR_PRMTR_MSK (0x00000001 << PLL_CNTRL_WR_PRMTR_OFST)
|
#define PLL_CNTRL_WR_PRMTR_MSK (0x00000001 << PLL_CNTRL_WR_PRMTR_OFST)
|
||||||
#define PLL_CNTRL_PLL_RST_OFST (3)
|
#define PLL_CNTRL_PLL_RST_OFST (3)
|
||||||
@ -378,7 +402,8 @@
|
|||||||
#define PATTERN_LOOP_0_ADDR_REG (0x54 << MEM_MAP_SHIFT)
|
#define PATTERN_LOOP_0_ADDR_REG (0x54 << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
#define PATTERN_LOOP_0_ADDR_STRT_OFST (0)
|
#define PATTERN_LOOP_0_ADDR_STRT_OFST (0)
|
||||||
#define PATTERN_LOOP_0_ADDR_STRT_MSK (0x00001FFF << PATTERN_LOOP_0_ADDR_STRT_OFST)
|
#define PATTERN_LOOP_0_ADDR_STRT_MSK \
|
||||||
|
(0x00001FFF << PATTERN_LOOP_0_ADDR_STRT_OFST)
|
||||||
#define PATTERN_LOOP_0_ADDR_STP_OFST (16)
|
#define PATTERN_LOOP_0_ADDR_STP_OFST (16)
|
||||||
#define PATTERN_LOOP_0_ADDR_STP_MSK (0x00001FFF << PATTERN_LOOP_0_ADDR_STP_OFST)
|
#define PATTERN_LOOP_0_ADDR_STP_MSK (0x00001FFF << PATTERN_LOOP_0_ADDR_STP_OFST)
|
||||||
|
|
||||||
@ -389,7 +414,8 @@
|
|||||||
#define PATTERN_LOOP_1_ADDR_REG (0x56 << MEM_MAP_SHIFT)
|
#define PATTERN_LOOP_1_ADDR_REG (0x56 << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
#define PATTERN_LOOP_1_ADDR_STRT_OFST (0)
|
#define PATTERN_LOOP_1_ADDR_STRT_OFST (0)
|
||||||
#define PATTERN_LOOP_1_ADDR_STRT_MSK (0x00001FFF << PATTERN_LOOP_1_ADDR_STRT_OFST)
|
#define PATTERN_LOOP_1_ADDR_STRT_MSK \
|
||||||
|
(0x00001FFF << PATTERN_LOOP_1_ADDR_STRT_OFST)
|
||||||
#define PATTERN_LOOP_1_ADDR_STP_OFST (16)
|
#define PATTERN_LOOP_1_ADDR_STP_OFST (16)
|
||||||
#define PATTERN_LOOP_1_ADDR_STP_MSK (0x00001FFF << PATTERN_LOOP_1_ADDR_STP_OFST)
|
#define PATTERN_LOOP_1_ADDR_STP_MSK (0x00001FFF << PATTERN_LOOP_1_ADDR_STP_OFST)
|
||||||
|
|
||||||
@ -400,7 +426,8 @@
|
|||||||
#define PATTERN_LOOP_2_ADDR_REG (0x58 << MEM_MAP_SHIFT)
|
#define PATTERN_LOOP_2_ADDR_REG (0x58 << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
#define PATTERN_LOOP_2_ADDR_STRT_OFST (0)
|
#define PATTERN_LOOP_2_ADDR_STRT_OFST (0)
|
||||||
#define PATTERN_LOOP_2_ADDR_STRT_MSK (0x00001FFF << PATTERN_LOOP_2_ADDR_STRT_OFST)
|
#define PATTERN_LOOP_2_ADDR_STRT_MSK \
|
||||||
|
(0x00001FFF << PATTERN_LOOP_2_ADDR_STRT_OFST)
|
||||||
#define PATTERN_LOOP_2_ADDR_STP_OFST (16)
|
#define PATTERN_LOOP_2_ADDR_STP_OFST (16)
|
||||||
#define PATTERN_LOOP_2_ADDR_STP_MSK (0x00001FFF << PATTERN_LOOP_2_ADDR_STP_OFST)
|
#define PATTERN_LOOP_2_ADDR_STP_MSK (0x00001FFF << PATTERN_LOOP_2_ADDR_STP_OFST)
|
||||||
|
|
||||||
@ -445,7 +472,6 @@
|
|||||||
/* Number of Words RW register TODO */
|
/* Number of Words RW register TODO */
|
||||||
#define NUMBER_OF_WORDS_REG (0x5F << MEM_MAP_SHIFT)
|
#define NUMBER_OF_WORDS_REG (0x5F << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
|
|
||||||
/* Delay 64 bit RW register. t = DLY x 50 ns. */
|
/* Delay 64 bit RW register. t = DLY x 50 ns. */
|
||||||
#define DELAY_LSB_REG (0x60 << MEM_MAP_SHIFT)
|
#define DELAY_LSB_REG (0x60 << MEM_MAP_SHIFT)
|
||||||
#define DELAY_MSB_REG (0x61 << MEM_MAP_SHIFT)
|
#define DELAY_MSB_REG (0x61 << MEM_MAP_SHIFT)
|
||||||
@ -463,12 +489,14 @@
|
|||||||
#define PERIOD_MSB_REG (0x67 << MEM_MAP_SHIFT)
|
#define PERIOD_MSB_REG (0x67 << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
/* Period 64 bit RW register */
|
/* Period 64 bit RW register */
|
||||||
//#define EXPTIME_LSB_REG (0x68 << MEM_MAP_SHIFT) // Not used in FW
|
//#define EXPTIME_LSB_REG (0x68 << MEM_MAP_SHIFT) //
|
||||||
//#define EXPTIME_MSB_REG (0x69 << MEM_MAP_SHIFT) // Not used in FW
|
// Not used in FW #define EXPTIME_MSB_REG (0x69 <<
|
||||||
|
// MEM_MAP_SHIFT) // Not used in FW
|
||||||
|
|
||||||
/* Gates 64 bit RW register */
|
/* Gates 64 bit RW register */
|
||||||
//#define GATES_LSB_REG (0x6A << MEM_MAP_SHIFT) // Not used in FW
|
//#define GATES_LSB_REG (0x6A << MEM_MAP_SHIFT) // Not used
|
||||||
//#define GATES_MSB_REG (0x6B << MEM_MAP_SHIFT) // Not used in FW
|
// in FW #define GATES_MSB_REG (0x6B << MEM_MAP_SHIFT) //
|
||||||
|
// Not used in FW
|
||||||
|
|
||||||
/* Pattern IO Control 64 bit RW regiser
|
/* Pattern IO Control 64 bit RW regiser
|
||||||
* Each bit configured as output(1)/ input(0) */
|
* Each bit configured as output(1)/ input(0) */
|
||||||
@ -505,7 +533,6 @@
|
|||||||
#define READOUT_10G_ENABLE_DGTL_OFST (8)
|
#define READOUT_10G_ENABLE_DGTL_OFST (8)
|
||||||
#define READOUT_10G_ENABLE_DGTL_MSK (0x00000001 << READOUT_10G_ENABLE_DGTL_OFST)
|
#define READOUT_10G_ENABLE_DGTL_MSK (0x00000001 << READOUT_10G_ENABLE_DGTL_OFST)
|
||||||
|
|
||||||
|
|
||||||
/* Digital Bit External Trigger RW register */
|
/* Digital Bit External Trigger RW register */
|
||||||
#define DBIT_EXT_TRG_REG (0x7B << MEM_MAP_SHIFT)
|
#define DBIT_EXT_TRG_REG (0x7B << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
@ -517,11 +544,15 @@
|
|||||||
/* Pin Delay 0 RW register */
|
/* Pin Delay 0 RW register */
|
||||||
#define OUTPUT_DELAY_0_REG (0x7C << MEM_MAP_SHIFT)
|
#define OUTPUT_DELAY_0_REG (0x7C << MEM_MAP_SHIFT)
|
||||||
#define OUTPUT_DELAY_0_OTPT_STTNG_STEPS (25)
|
#define OUTPUT_DELAY_0_OTPT_STTNG_STEPS (25)
|
||||||
#define OUTPUT_DELAY_0_OTPT_STTNG_OFST (0) //t = OTPT_STTNG * 25 ps, max for Cyclone V = 775 ps
|
#define OUTPUT_DELAY_0_OTPT_STTNG_OFST \
|
||||||
#define OUTPUT_DELAY_0_OTPT_STTNG_MSK (0x0000001F << OUTPUT_DELAY_0_OTPT_STTNG_OFST)
|
(0) // t = OTPT_STTNG * 25 ps, max for Cyclone V = 775 ps
|
||||||
// 1: load dynamic output settings, 0: trigger start of dynamic output delay configuration pn falling edge of ODT (output delay trigger) bit
|
#define OUTPUT_DELAY_0_OTPT_STTNG_MSK \
|
||||||
|
(0x0000001F << OUTPUT_DELAY_0_OTPT_STTNG_OFST)
|
||||||
|
// 1: load dynamic output settings, 0: trigger start of dynamic output delay
|
||||||
|
// configuration pn falling edge of ODT (output delay trigger) bit
|
||||||
#define OUTPUT_DELAY_0_OTPT_TRGGR_OFST (31)
|
#define OUTPUT_DELAY_0_OTPT_TRGGR_OFST (31)
|
||||||
#define OUTPUT_DELAY_0_OTPT_TRGGR_MSK (0x00000001 << OUTPUT_DELAY_0_OTPT_TRGGR_OFST)
|
#define OUTPUT_DELAY_0_OTPT_TRGGR_MSK \
|
||||||
|
(0x00000001 << OUTPUT_DELAY_0_OTPT_TRGGR_OFST)
|
||||||
#define OUTPUT_DELAY_0_OTPT_TRGGR_LD_VAL (1)
|
#define OUTPUT_DELAY_0_OTPT_TRGGR_LD_VAL (1)
|
||||||
#define OUTPUT_DELAY_0_OTPT_TRGGR_STRT_VAL (0)
|
#define OUTPUT_DELAY_0_OTPT_TRGGR_STRT_VAL (0)
|
||||||
|
|
||||||
@ -550,6 +581,3 @@
|
|||||||
|
|
||||||
/* Round Robin */
|
/* Round Robin */
|
||||||
#define RXR_ENDPOINT_START_REG (0x1000 << MEM_MAP_SHIFT)
|
#define RXR_ENDPOINT_START_REG (0x1000 << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Binary file not shown.
847
slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c
Executable file → Normal file
847
slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
66
slsDetectorServers/ctbDetectorServer/slsDetectorServer_defs.h
Executable file → Normal file
66
slsDetectorServers/ctbDetectorServer/slsDetectorServer_defs.h
Executable file → Normal file
@ -1,7 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "sls_detector_defs.h"
|
|
||||||
#include "RegisterDefs.h"
|
#include "RegisterDefs.h"
|
||||||
|
#include "sls_detector_defs.h"
|
||||||
|
|
||||||
#define MIN_REQRD_VRSN_T_RD_API 0x181130
|
#define MIN_REQRD_VRSN_T_RD_API 0x181130
|
||||||
#define REQRD_FRMWR_VRSN 0x191127
|
#define REQRD_FRMWR_VRSN 0x191127
|
||||||
@ -36,10 +35,53 @@ typedef struct udp_header_struct {
|
|||||||
#define UDP_IP_HEADER_LENGTH_BYTES (28)
|
#define UDP_IP_HEADER_LENGTH_BYTES (28)
|
||||||
|
|
||||||
/* Enums */
|
/* Enums */
|
||||||
enum ADCINDEX {V_PWR_IO, V_PWR_A, V_PWR_B, V_PWR_C, V_PWR_D, I_PWR_IO, I_PWR_A, I_PWR_B, I_PWR_C, I_PWR_D, S_ADC0, S_ADC1, S_ADC2, S_ADC3, S_ADC4, S_ADC5, S_ADC6, S_ADC7, S_TMP};
|
enum ADCINDEX {
|
||||||
enum DACINDEX {D0, D1, D2, D3, D4, D5, D6, D7, D8, D9,
|
V_PWR_IO,
|
||||||
D10, D11, D12, D13, D14, D15, D16, D17,
|
V_PWR_A,
|
||||||
D_PWR_D, D_PWR_CHIP, D_PWR_C, D_PWR_B, D_PWR_A, D_PWR_IO};
|
V_PWR_B,
|
||||||
|
V_PWR_C,
|
||||||
|
V_PWR_D,
|
||||||
|
I_PWR_IO,
|
||||||
|
I_PWR_A,
|
||||||
|
I_PWR_B,
|
||||||
|
I_PWR_C,
|
||||||
|
I_PWR_D,
|
||||||
|
S_ADC0,
|
||||||
|
S_ADC1,
|
||||||
|
S_ADC2,
|
||||||
|
S_ADC3,
|
||||||
|
S_ADC4,
|
||||||
|
S_ADC5,
|
||||||
|
S_ADC6,
|
||||||
|
S_ADC7,
|
||||||
|
S_TMP
|
||||||
|
};
|
||||||
|
enum DACINDEX {
|
||||||
|
D0,
|
||||||
|
D1,
|
||||||
|
D2,
|
||||||
|
D3,
|
||||||
|
D4,
|
||||||
|
D5,
|
||||||
|
D6,
|
||||||
|
D7,
|
||||||
|
D8,
|
||||||
|
D9,
|
||||||
|
D10,
|
||||||
|
D11,
|
||||||
|
D12,
|
||||||
|
D13,
|
||||||
|
D14,
|
||||||
|
D15,
|
||||||
|
D16,
|
||||||
|
D17,
|
||||||
|
D_PWR_D,
|
||||||
|
D_PWR_CHIP,
|
||||||
|
D_PWR_C,
|
||||||
|
D_PWR_B,
|
||||||
|
D_PWR_A,
|
||||||
|
D_PWR_IO
|
||||||
|
};
|
||||||
enum CLKINDEX { RUN_CLK, ADC_CLK, SYNC_CLK, DBIT_CLK, NUM_CLOCKS };
|
enum CLKINDEX { RUN_CLK, ADC_CLK, SYNC_CLK, DBIT_CLK, NUM_CLOCKS };
|
||||||
#define CLK_NAMES "run", "adc", "sync", "dbit"
|
#define CLK_NAMES "run", "adc", "sync", "dbit"
|
||||||
|
|
||||||
@ -85,16 +127,21 @@ enum CLKINDEX {RUN_CLK, ADC_CLK, SYNC_CLK, DBIT_CLK, NUM_CLOCKS};
|
|||||||
#define VCHIP_MIN_MV (1673)
|
#define VCHIP_MIN_MV (1673)
|
||||||
#define VCHIP_MAX_MV (2668) // min dac val
|
#define VCHIP_MAX_MV (2668) // min dac val
|
||||||
#define POWER_RGLTR_MIN (636)
|
#define POWER_RGLTR_MIN (636)
|
||||||
#define POWER_RGLTR_MAX (2638) // min dac val (not vchip-max) because of dac conversions
|
#define POWER_RGLTR_MAX \
|
||||||
|
(2638) // min dac val (not vchip-max) because of dac conversions
|
||||||
#define VCHIP_POWER_INCRMNT (200)
|
#define VCHIP_POWER_INCRMNT (200)
|
||||||
#define VIO_MIN_MV (1200) // for fpga to function
|
#define VIO_MIN_MV (1200) // for fpga to function
|
||||||
|
|
||||||
/* Defines in the Firmware */
|
/* Defines in the Firmware */
|
||||||
#define MAX_PATTERN_LENGTH (0x2000)
|
#define MAX_PATTERN_LENGTH (0x2000)
|
||||||
#define DIGITAL_IO_DELAY_MAXIMUM_PS ((OUTPUT_DELAY_0_OTPT_STTNG_MSK >> OUTPUT_DELAY_0_OTPT_STTNG_OFST) * OUTPUT_DELAY_0_OTPT_STTNG_STEPS)
|
#define DIGITAL_IO_DELAY_MAXIMUM_PS \
|
||||||
|
((OUTPUT_DELAY_0_OTPT_STTNG_MSK >> OUTPUT_DELAY_0_OTPT_STTNG_OFST) * \
|
||||||
|
OUTPUT_DELAY_0_OTPT_STTNG_STEPS)
|
||||||
#define MAX_PHASE_SHIFTS_STEPS (8)
|
#define MAX_PHASE_SHIFTS_STEPS (8)
|
||||||
|
|
||||||
#define WAIT_TME_US_FR_ACQDONE_REG (100) // wait time in us after acquisition done to ensure there is no data in fifo
|
#define WAIT_TME_US_FR_ACQDONE_REG \
|
||||||
|
(100) // wait time in us after acquisition done to ensure there is no data
|
||||||
|
// in fifo
|
||||||
#define WAIT_TIME_US_PLL (10 * 1000)
|
#define WAIT_TIME_US_PLL (10 * 1000)
|
||||||
#define WAIT_TIME_US_STP_ACQ (100)
|
#define WAIT_TIME_US_STP_ACQ (100)
|
||||||
#define WAIT_TIME_CONFIGURE_MAC (2 * 1000 * 1000)
|
#define WAIT_TIME_CONFIGURE_MAC (2 * 1000 * 1000)
|
||||||
@ -109,4 +156,3 @@ enum CLKINDEX {RUN_CLK, ADC_CLK, SYNC_CLK, DBIT_CLK, NUM_CLOCKS};
|
|||||||
|
|
||||||
#define MAXIMUM_ADC_CLK (65)
|
#define MAXIMUM_ADC_CLK (65)
|
||||||
#define PLL_VCO_FREQ_MHZ (800)
|
#define PLL_VCO_FREQ_MHZ (800)
|
||||||
|
|
||||||
|
33
slsDetectorServers/eigerDetectorServer/9mhvserial_bf.c
Executable file → Normal file
33
slsDetectorServers/eigerDetectorServer/9mhvserial_bf.c
Executable file → Normal file
@ -1,14 +1,14 @@
|
|||||||
#include "ansi.h"
|
#include "ansi.h"
|
||||||
|
|
||||||
#include <termios.h> /* POSIX terminal control definitions */
|
#include <errno.h>
|
||||||
|
#include <fcntl.h> // File control definitions
|
||||||
|
#include <linux/i2c-dev.h> // I2C_SLAVE, __u8 reg
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h> // atoi
|
#include <stdlib.h> // atoi
|
||||||
#include <fcntl.h> // File control definitions
|
|
||||||
#include <sys/ioctl.h> // ioctl
|
|
||||||
#include <unistd.h> // read, close
|
|
||||||
#include <string.h> // memset
|
#include <string.h> // memset
|
||||||
#include <linux/i2c-dev.h> // I2C_SLAVE, __u8 reg
|
#include <sys/ioctl.h> // ioctl
|
||||||
#include <errno.h>
|
#include <termios.h> /* POSIX terminal control definitions */
|
||||||
|
#include <unistd.h> // read, close
|
||||||
|
|
||||||
#define PORTNAME "/dev/ttyBF1"
|
#define PORTNAME "/dev/ttyBF1"
|
||||||
#define GOODBYE 200
|
#define GOODBYE 200
|
||||||
@ -18,8 +18,6 @@
|
|||||||
//#define I2C_DEVICE_ADDRESS 0x48
|
//#define I2C_DEVICE_ADDRESS 0x48
|
||||||
#define I2C_REGISTER_ADDRESS 0x40
|
#define I2C_REGISTER_ADDRESS 0x40
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int i2c_open(const char *file, unsigned int addr) {
|
int i2c_open(const char *file, unsigned int addr) {
|
||||||
|
|
||||||
// device file
|
// device file
|
||||||
@ -37,7 +35,6 @@ int i2c_open(const char* file,unsigned int addr){
|
|||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int i2c_read() {
|
int i2c_read() {
|
||||||
|
|
||||||
int fd = i2c_open(I2C_DEVICE_FILE, I2C_DEVICE_ADDRESS);
|
int fd = i2c_open(I2C_DEVICE_FILE, I2C_DEVICE_ADDRESS);
|
||||||
@ -45,7 +42,8 @@ int i2c_read(){
|
|||||||
|
|
||||||
unsigned char buf = reg;
|
unsigned char buf = reg;
|
||||||
if (write(fd, &buf, 1) != 1) {
|
if (write(fd, &buf, 1) != 1) {
|
||||||
LOG(logERROR, ("Warning: Unable to write read request to register %d\n", reg));
|
LOG(logERROR,
|
||||||
|
("Warning: Unable to write read request to register %d\n", reg));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
// read and update value (but old value read out)
|
// read and update value (but old value read out)
|
||||||
@ -62,7 +60,6 @@ int i2c_read(){
|
|||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int i2c_write(unsigned int value) {
|
int i2c_write(unsigned int value) {
|
||||||
|
|
||||||
__u8 val = value & 0xff;
|
__u8 val = value & 0xff;
|
||||||
@ -76,7 +73,8 @@ int i2c_write(unsigned int value){
|
|||||||
buf[0] = reg;
|
buf[0] = reg;
|
||||||
buf[1] = val;
|
buf[1] = val;
|
||||||
if (write(fd, buf, 2) != 2) {
|
if (write(fd, buf, 2) != 2) {
|
||||||
LOG(logERROR, ("Warning: Unable to write %d to register %d\n",val, reg));
|
LOG(logERROR,
|
||||||
|
("Warning: Unable to write %d to register %d\n", val, reg));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,10 +82,6 @@ int i2c_write(unsigned int value){
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
|
|
||||||
int fd = open(PORTNAME, O_RDWR | O_NOCTTY | O_SYNC);
|
int fd = open(PORTNAME, O_RDWR | O_NOCTTY | O_SYNC);
|
||||||
@ -113,7 +107,8 @@ int main(int argc, char* argv[]) {
|
|||||||
LOG(logERROR, ("Warning: error form tcflush %d\n", errno));
|
LOG(logERROR, ("Warning: error form tcflush %d\n", errno));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
// set new options for the port, TCSANOW:changes occur immediately without waiting for data to complete
|
// set new options for the port, TCSANOW:changes occur immediately without
|
||||||
|
// waiting for data to complete
|
||||||
if (tcsetattr(fd, TCSANOW, &serial_conf) < 0) {
|
if (tcsetattr(fd, TCSANOW, &serial_conf) < 0) {
|
||||||
LOG(logERROR, ("Warning: error form tcsetattr %d\n", errno));
|
LOG(logERROR, ("Warning: error form tcsetattr %d\n", errno));
|
||||||
return 0;
|
return 0;
|
||||||
@ -132,7 +127,6 @@ int main(int argc, char* argv[]) {
|
|||||||
buffer[BUFFERSIZE - 1] = '\n';
|
buffer[BUFFERSIZE - 1] = '\n';
|
||||||
LOG(logINFO, ("Ready...\n"));
|
LOG(logINFO, ("Ready...\n"));
|
||||||
|
|
||||||
|
|
||||||
while (ret != GOODBYE) {
|
while (ret != GOODBYE) {
|
||||||
memset(buffer, 0, BUFFERSIZE);
|
memset(buffer, 0, BUFFERSIZE);
|
||||||
n = read(fd, buffer, BUFFERSIZE);
|
n = read(fd, buffer, BUFFERSIZE);
|
||||||
@ -183,7 +177,8 @@ int main(int argc, char* argv[]) {
|
|||||||
sprintf(buffer, "%d ", ival);
|
sprintf(buffer, "%d ", ival);
|
||||||
n = write(fd, buffer, BUFFERSIZE);
|
n = write(fd, buffer, BUFFERSIZE);
|
||||||
LOG(logINFO, ("Sent %d Bytes\n", n));
|
LOG(logINFO, ("Sent %d Bytes\n", n));
|
||||||
}else LOG(logERROR, ("%s\n",buffer));
|
} else
|
||||||
|
LOG(logERROR, ("%s\n", buffer));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'e':
|
case 'e':
|
||||||
|
1025
slsDetectorServers/eigerDetectorServer/Beb.c
Executable file → Normal file
1025
slsDetectorServers/eigerDetectorServer/Beb.c
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user