mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-17 23:37:14 +02:00
Compare commits
38 Commits
2020.06.08
...
udp
Author | SHA1 | Date | |
---|---|---|---|
f08006db46 | |||
d5df63ce49 | |||
64d59b1dff | |||
a0bc843018 | |||
6126a401d0 | |||
7665d7b33a | |||
d3d8d7ba8e | |||
938d90bfb8 | |||
990f32397b | |||
53b1456f1a | |||
fbb901c8cc | |||
7b7641fb53 | |||
4de49906d4 | |||
c9b5db4d7f | |||
2e6378f241 | |||
692584ced8 | |||
4ae93dbc73 | |||
f37ceaf517 | |||
75a9002f2c | |||
cfec18e441 | |||
3ff7654c29 | |||
9781dbe49e | |||
e777c0fa79 | |||
9981632b2d | |||
d8436da540 | |||
4dc4c1ec0a | |||
6537aa1ceb | |||
467be41ccb | |||
73a39fcafe | |||
041c9fefa0 | |||
4f4f3baefc | |||
3523de8ba9 | |||
e77a93021d | |||
4dc14bf9d6 | |||
a5cdd687e6 | |||
89175586b4 | |||
c3bbe45b68 | |||
8f64449117 |
@ -4,4 +4,3 @@ IndentWidth: 4
|
|||||||
UseTab: Never
|
UseTab: Never
|
||||||
ColumnLimit: 80
|
ColumnLimit: 80
|
||||||
AlignConsecutiveAssignments: false
|
AlignConsecutiveAssignments: false
|
||||||
AlignConsecutiveMacros: true
|
|
@ -17,8 +17,7 @@ Checks: '*,
|
|||||||
-google-runtime-references,
|
-google-runtime-references,
|
||||||
-google-readability-todo,
|
-google-readability-todo,
|
||||||
-google-readability-braces-around-statements,
|
-google-readability-braces-around-statements,
|
||||||
-modernize-use-trailing-return-type,
|
-modernize-use-trailing-return-type'
|
||||||
-readability-isolate-declaration'
|
|
||||||
|
|
||||||
HeaderFilterRegex: \.h
|
HeaderFilterRegex: \.h
|
||||||
AnalyzeTemporaryDtors: false
|
AnalyzeTemporaryDtors: false
|
||||||
|
@ -4,6 +4,12 @@ language: cpp
|
|||||||
|
|
||||||
os: linux
|
os: linux
|
||||||
|
|
||||||
|
# env:
|
||||||
|
# matrix:
|
||||||
|
# - CONDA_PY="3.7"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
dist: bionic
|
dist: bionic
|
||||||
|
|
||||||
install:
|
install:
|
||||||
@ -33,6 +39,5 @@ deploy:
|
|||||||
provider: script
|
provider: script
|
||||||
script: find $HOME/miniconda/envs/testenv/conda-bld/${TRAVIS_OS_NAME}-64 -name "*.tar.bz2" -exec anaconda -t $CONDA_TOKEN upload --force {} \;
|
script: find $HOME/miniconda/envs/testenv/conda-bld/${TRAVIS_OS_NAME}-64 -name "*.tar.bz2" -exec anaconda -t $CONDA_TOKEN upload --force {} \;
|
||||||
on:
|
on:
|
||||||
branch: developer
|
branch: udp
|
||||||
tags: true
|
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.12)
|
|||||||
project(slsDetectorPackage)
|
project(slsDetectorPackage)
|
||||||
set(PROJECT_VERSION 5.0.0)
|
set(PROJECT_VERSION 5.0.0)
|
||||||
include(CheckIPOSupported)
|
include(CheckIPOSupported)
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
|
|
||||||
|
|
||||||
cmake_policy(SET CMP0074 NEW)
|
cmake_policy(SET CMP0074 NEW)
|
||||||
include(cmake/project_version.cmake)
|
include(cmake/project_version.cmake)
|
||||||
@ -44,35 +44,6 @@ option(SLS_USE_PYTHON "Python bindings" OFF)
|
|||||||
option(SLS_USE_CTBGUI "ctb GUI" OFF)
|
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_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)
|
||||||
@ -140,11 +111,6 @@ if(SLS_USE_SANITIZER)
|
|||||||
# target_link_libraries(slsProjectOptions INTERFACE -fsanitize=thread)
|
# target_link_libraries(slsProjectOptions INTERFACE -fsanitize=thread)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(SLS_TUNE_LOCAL)
|
|
||||||
target_compile_options(slsProjectOptions INTERFACE -mtune=native -march=native)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
#rapidjson
|
#rapidjson
|
||||||
add_library(rapidjson INTERFACE)
|
add_library(rapidjson INTERFACE)
|
||||||
target_include_directories(rapidjson INTERFACE
|
target_include_directories(rapidjson INTERFACE
|
||||||
@ -193,7 +159,7 @@ endif (SLS_USE_RECEIVER)
|
|||||||
|
|
||||||
if (SLS_USE_GUI)
|
if (SLS_USE_GUI)
|
||||||
find_package(Qt4 REQUIRED)
|
find_package(Qt4 REQUIRED)
|
||||||
find_package(Qwt 6.1 REQUIRED)
|
find_package(Qwt 6 REQUIRED)
|
||||||
if (QT4_FOUND AND QWT_FOUND)
|
if (QT4_FOUND AND QWT_FOUND)
|
||||||
add_subdirectory(slsDetectorGui)
|
add_subdirectory(slsDetectorGui)
|
||||||
endif()
|
endif()
|
||||||
@ -229,9 +195,11 @@ 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 "share/cmake/${PROJECT_NAME}")
|
set(CMAKE_INSTALL_DIR ${CMAKE_INSTALL_DATADIR}/cmake/sls)
|
||||||
# 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
|
||||||
|
111
README.md
111
README.md
@ -2,67 +2,90 @@
|
|||||||
Detailed documentation can be found on the [official site.](https://www.psi.ch/detectors/users-support)
|
Detailed documentation can be found on the [official site.](https://www.psi.ch/detectors/users-support)
|
||||||
|
|
||||||
### Binaries
|
### Binaries
|
||||||
Binaries for the slsDetectorPackage are available through conda.
|
Documentation to obtain the binaries via the conda package is available for [lib](https://github.com/slsdetectorgroup/sls_detector_lib) and [gui](https://github.com/slsdetectorgroup/sls_detector_gui)
|
||||||
```
|
|
||||||
#Add conda channels
|
|
||||||
conda config --add channels conda-forge
|
|
||||||
conda config --add channels slsdetectorgroup
|
|
||||||
|
|
||||||
conda install slsdetlib #only shared lib and command line
|
|
||||||
conda install slsdet #python bindings (includes slsdetlib)
|
|
||||||
conda install slsdetgui #gui (includes qt4)
|
|
||||||
|
|
||||||
#Install specific version
|
|
||||||
conda install slsdet=2020.03.02.dev0 #developer version from 3 March 2020
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
### Source code
|
### Source code
|
||||||
One can also obtain the source code from this repository and compile.
|
One can also obtain the source code from this repository and compile while realizing the setup dependencies as required.
|
||||||
```
|
```
|
||||||
git clone https://github.com/slsdetectorgroup/slsDetectorPackage.git
|
git clone https://github.com/slsdetectorgroup/slsDetectorPackage.git
|
||||||
|
|
||||||
```
|
```
|
||||||
#### Dependencies
|
#### Setup dependencies
|
||||||
* Lib: c++11 compiler (gcc=>4.8), ZeroMQ 4
|
* Gui Client <br>
|
||||||
* Gui: Qt 4.8 and Qwt 6.0
|
Requirements: Qt 4.8 and Qwt 6.0
|
||||||
* Calibration wizards and ctbGUI: ROOT
|
```
|
||||||
* Optional: HDF5
|
export QTDIR=/usr/local/Trolltech/
|
||||||
|
export QWTDIR=/usr/local/qwt-6.0.1/
|
||||||
|
```
|
||||||
|
If either of them does not exist, the GUI client will not be built.
|
||||||
|
|
||||||
|
* Advanced user Calibration wizards<br>
|
||||||
|
Requirements: ROOT
|
||||||
|
```
|
||||||
|
export ROOTSYS=/usr/local/root-5.34
|
||||||
|
```
|
||||||
|
|
||||||
#### Compilation
|
#### Compilation
|
||||||
|
|
||||||
Compiling can be done in two ways. Either with the convenience script
|
Compiling can be done in two ways.
|
||||||
cmk.sh or directly with cmake for more control.
|
|
||||||
|
|
||||||
**1. Compile using script cmk.sh**<br>
|
**1. Compile using script cmk.sh**<br>
|
||||||
|
|
||||||
After compiling, the libraries and executables will be found in `slsDetectorPackage/build/bin` directory<br>
|
After compiling, the libraries and executables will be found in `slsDetectorPackage/build/bin` directory<br>
|
||||||
|
|
||||||
Usage: [-c] [-b] [-p] [e] [t] [r] [g] [s] [u] [i] [-h] [-d <HDF5 directory>] [-j] <Number of threads>
|
Usage: [-c] [-b] [-h] [-d HDF5 directory] [-j]<br>
|
||||||
-[no option]: only make
|
* -[no option]: only make<br>
|
||||||
-c: Clean
|
* -c: Clean<br>
|
||||||
-b: Builds/Rebuilds CMake files normal mode
|
* -b: Builds/Rebuilds CMake files normal mode<br>
|
||||||
-p: Builds/Rebuilds Python API
|
* -h: Builds/Rebuilds Cmake files with HDF5 package<br>
|
||||||
-h: Builds/Rebuilds Cmake files with HDF5 package
|
* -d: HDF5 Custom Directory<br>
|
||||||
-d: HDF5 Custom Directory
|
* -t: Build/Rebuilds only text client<br>
|
||||||
-t: Build/Rebuilds only text client
|
* -r: Build/Rebuilds only receiver<br>
|
||||||
-r: Build/Rebuilds only receiver
|
* -g: Build/Rebuilds only gui<br>
|
||||||
-g: Build/Rebuilds only gui
|
* -j: Number of threads to compile through<br>
|
||||||
-s: Simulator
|
* -e: Debug mode
|
||||||
-u: Chip Test Gui
|
|
||||||
-j: Number of threads to compile through
|
Basic Option:
|
||||||
-e: Debug mode
|
./cmk.sh -b
|
||||||
-i: Builds tests
|
|
||||||
|
For only make:
|
||||||
|
./cmk.sh
|
||||||
|
|
||||||
|
For make clean;make:
|
||||||
|
./cmk.sh -c
|
||||||
|
|
||||||
|
For using hdf5 without custom dir /blabla:
|
||||||
|
./cmk.sh -h -d /blabla
|
||||||
|
|
||||||
|
For rebuilding cmake without hdf5
|
||||||
|
./cmk.sh -b
|
||||||
|
|
||||||
|
For using multiple cores to compile faster:
|
||||||
|
./cmk.sh -j9<br>
|
||||||
|
|
||||||
|
|
||||||
|
For rebuilding only certain sections<br>
|
||||||
|
./cmk.sh -tg #only text client and gui<br>
|
||||||
|
./cmk.sh -r #only receiver<br>
|
||||||
|
|
||||||
eg. Rebuild when you switch to a new build and compile in parallel:
|
|
||||||
./cmk.sh -bj5
|
|
||||||
|
|
||||||
**2. Compile without script**<br>
|
**2. Compile without script**<br>
|
||||||
Use cmake to create out-of-source builds, by creating a build folder parallel to source directory. This would create a debug build with address sanitizers.
|
Use cmake to create out-of-source builds, by creating a build folder parallel to source directory.
|
||||||
```
|
```
|
||||||
$ mkdir build
|
$ cd ..
|
||||||
$ cd build
|
$ mkdir slsDetectorPackage-build
|
||||||
$ cmake ../slsDetectorPackage -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_SANITIZER=ON
|
$ cd slsDetectorPackage-build
|
||||||
$ make -j12 #or whatever number of threads wanted
|
$ cmake ../slsDetectorPackage -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_HDF5=OFF
|
||||||
|
$ make
|
||||||
|
```
|
||||||
|
|
||||||
|
Use the following as an example to compile statically and using specific hdf5 folder
|
||||||
|
```
|
||||||
|
$ HDF5_ROOT=/opt/hdf5v1.10.0 cmake ../slsDetectorPackage -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_HDF5=ON
|
||||||
|
```
|
||||||
|
After compiling, the libraries and executables will be found at `bin` directory
|
||||||
|
```
|
||||||
|
$ ls bin/
|
||||||
|
gui_client libSlsDetector.a libSlsDetector.so libSlsReceiver.a libSlsReceiver.so
|
||||||
|
sls_detector_acquire sls_detector_get slsDetectorGui sls_detector_help sls_detector_put slsReceiver slsMultiReceiver
|
||||||
```
|
```
|
||||||
|
@ -1,39 +0,0 @@
|
|||||||
# 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()
|
|
@ -1,47 +0,0 @@
|
|||||||
# 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,20 +15,17 @@ 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_DIR}
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME_LOWER})
|
||||||
)
|
|
||||||
|
|
||||||
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_DIR}
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME_LOWER})
|
||||||
)
|
|
||||||
endif ()
|
endif ()
|
||||||
|
23
cmk.sh
23
cmk.sh
@ -11,7 +11,6 @@ PYTHON=0
|
|||||||
TESTS=0
|
TESTS=0
|
||||||
SIMULATOR=0
|
SIMULATOR=0
|
||||||
CTBGUI=0
|
CTBGUI=0
|
||||||
MANUALS=0
|
|
||||||
|
|
||||||
|
|
||||||
CLEAN=0
|
CLEAN=0
|
||||||
@ -20,7 +19,7 @@ CMAKE_PRE=""
|
|||||||
CMAKE_POST=""
|
CMAKE_POST=""
|
||||||
|
|
||||||
usage() { echo -e "
|
usage() { echo -e "
|
||||||
Usage: $0 [-c] [-b] [-p] [e] [t] [r] [g] [s] [u] [i] [m] [-h] [-d <HDF5 directory>] [-j] <Number of threads>
|
Usage: $0 [-c] [-b] [-p] [e] [t] [r] [g] [s] [u] [i] [-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
|
||||||
@ -35,7 +34,6 @@ Usage: $0 [-c] [-b] [-p] [e] [t] [r] [g] [s] [u] [i] [m] [-h] [-d <HDF5 director
|
|||||||
-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
|
||||||
@ -71,7 +69,7 @@ For rebuilding only certain sections
|
|||||||
|
|
||||||
" ; exit 1; }
|
" ; exit 1; }
|
||||||
|
|
||||||
while getopts ":bpchd:j:trgeisum" opt ; do
|
while getopts ":bpchd:j:trgeisu" opt ; do
|
||||||
case $opt in
|
case $opt in
|
||||||
b)
|
b)
|
||||||
echo "Building of CMake files Required"
|
echo "Building of CMake files Required"
|
||||||
@ -126,10 +124,6 @@ while getopts ":bpchd:j:trgeisum" 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
|
||||||
@ -193,8 +187,8 @@ fi
|
|||||||
|
|
||||||
#Debug
|
#Debug
|
||||||
if [ $DEBUG -eq 1 ]; then
|
if [ $DEBUG -eq 1 ]; then
|
||||||
# CMAKE_POST+=" -DCMAKE_BUILD_TYPE=Debug "
|
CMAKE_POST+=" -DCMAKE_BUILD_TYPE=Debug "
|
||||||
CMAKE_POST+=" -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_SANITIZER=ON "
|
# CMAKE_POST+=" -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_SANITIZER=ON "
|
||||||
echo "Debug Option enabled"
|
echo "Debug Option enabled"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -204,12 +198,6 @@ 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 "
|
||||||
@ -263,9 +251,6 @@ else
|
|||||||
make
|
make
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $MANUALS -eq 1 ]; then
|
|
||||||
make docs
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,20 +5,18 @@ 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/install/bin/sls_detector_acquire $PREFIX/bin/.
|
cp build/bin/sls_detector_acquire $PREFIX/bin/.
|
||||||
cp build/install/bin/sls_detector_get $PREFIX/bin/.
|
cp build/bin/sls_detector_get $PREFIX/bin/.
|
||||||
cp build/install/bin/sls_detector_put $PREFIX/bin/.
|
cp build/bin/sls_detector_put $PREFIX/bin/.
|
||||||
cp build/install/bin/sls_detector_help $PREFIX/bin/.
|
cp build/bin/sls_detector_help $PREFIX/bin/.
|
||||||
cp build/install/bin/slsReceiver $PREFIX/bin/.
|
cp build/bin/slsReceiver $PREFIX/bin/.
|
||||||
cp build/install/bin/slsMultiReceiver $PREFIX/bin/.
|
cp build/bin/slsMultiReceiver $PREFIX/bin/.
|
||||||
|
|
||||||
|
#Which headers do we need for development??
|
||||||
cp build/install/include/* $PREFIX/include/
|
cp build/install/include/* $PREFIX/include/slsDetectorPackage/
|
||||||
cp -r build/install/share/ $PREFIX/share
|
# cp include/some_lib.h $PREFIX/include/.
|
@ -1,13 +1,13 @@
|
|||||||
|
|
||||||
package:
|
package:
|
||||||
name: sls_detector_software
|
name: sls_detector_software
|
||||||
version: {{ environ.get('GIT_DESCRIBE_TAG', '') }}
|
version: "udp"
|
||||||
|
|
||||||
source:
|
source:
|
||||||
- path: ..
|
- path: ..
|
||||||
|
|
||||||
build:
|
build:
|
||||||
number: 0
|
number: 1
|
||||||
binary_relocation: True
|
binary_relocation: True
|
||||||
rpaths:
|
rpaths:
|
||||||
- lib/
|
- lib/
|
||||||
@ -37,7 +37,6 @@ requirements:
|
|||||||
host:
|
host:
|
||||||
- libstdcxx-ng
|
- libstdcxx-ng
|
||||||
- libgcc-ng
|
- libgcc-ng
|
||||||
- zeromq
|
|
||||||
- xorg-libx11
|
- xorg-libx11
|
||||||
- xorg-libice
|
- xorg-libice
|
||||||
- xorg-libxext
|
- xorg-libxext
|
||||||
@ -47,7 +46,6 @@ requirements:
|
|||||||
- xorg-libxfixes
|
- xorg-libxfixes
|
||||||
|
|
||||||
run:
|
run:
|
||||||
- zeromq
|
|
||||||
- libstdcxx-ng
|
- libstdcxx-ng
|
||||||
- libgcc-ng
|
- libgcc-ng
|
||||||
|
|
||||||
|
@ -29,10 +29,9 @@
|
|||||||
#include "sls_detector_defs.h"
|
#include "sls_detector_defs.h"
|
||||||
#include "ctbMain.h"
|
#include "ctbMain.h"
|
||||||
#include "moench03CtbData.h"
|
#include "moench03CtbData.h"
|
||||||
//#include "moench03TCtbData.h"
|
#include "moench03TCtbData.h"
|
||||||
//#include "moench03T1CtbData.h"
|
#include "moench03T1CtbData.h"
|
||||||
#include "moench03CommonMode.h"
|
#include "moench03CommonMode.h"
|
||||||
#include "moench03T1ZmqDataNew.h"
|
|
||||||
#include "moench02CtbData.h"
|
#include "moench02CtbData.h"
|
||||||
//#include "jungfrau10ModuleData.h"
|
//#include "jungfrau10ModuleData.h"
|
||||||
#include "moenchCommonMode.h"
|
#include "moenchCommonMode.h"
|
||||||
@ -44,9 +43,6 @@
|
|||||||
#include "moench04CtbZmq10GbData.h"
|
#include "moench04CtbZmq10GbData.h"
|
||||||
#include "deserializer.h"
|
#include "deserializer.h"
|
||||||
#include "detectorData.h"
|
#include "detectorData.h"
|
||||||
#include "imageZmq16bit.h"
|
|
||||||
#include "imageZmq32bit.h"
|
|
||||||
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@ -236,10 +232,7 @@ hframe=new TGHorizontalFrame(this, 800,50);
|
|||||||
cbDetType->AddEntry("MOENCH02", MOENCH02);
|
cbDetType->AddEntry("MOENCH02", MOENCH02);
|
||||||
cbDetType->AddEntry("MOENCH04", MOENCH04);
|
cbDetType->AddEntry("MOENCH04", MOENCH04);
|
||||||
// cbDetType->AddEntry("JUNGFRAU1.0", 2);
|
// cbDetType->AddEntry("JUNGFRAU1.0", 2);
|
||||||
cbDetType->AddEntry("MOENCH03",MOENCH03);
|
//cbDetType->AddEntry("MOENCH03 T", iiii++);
|
||||||
cbDetType->AddEntry("IMAGE32BIT",IMAGE32B);
|
|
||||||
cbDetType->AddEntry("IMAGE16BIT",IMAGE16B);
|
|
||||||
|
|
||||||
//cbDetType->AddEntry("MOENCH03", iiii++);
|
//cbDetType->AddEntry("MOENCH03", iiii++);
|
||||||
// cbDetType->AddEntry("MYTHEN3 0.1", MYTHEN301);
|
// cbDetType->AddEntry("MYTHEN3 0.1", MYTHEN301);
|
||||||
// cbDetType->AddEntry("ADCSAR2", ADCSAR2);
|
// cbDetType->AddEntry("ADCSAR2", ADCSAR2);
|
||||||
@ -278,7 +271,7 @@ hframe=new TGHorizontalFrame(this, 800,50);
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// cout << "off "<< endl;
|
cout << "off "<< endl;
|
||||||
|
|
||||||
|
|
||||||
hframe=new TGHorizontalFrame(this, 800,50);
|
hframe=new TGHorizontalFrame(this, 800,50);
|
||||||
@ -297,8 +290,8 @@ hframe=new TGHorizontalFrame(this, 800,50);
|
|||||||
TGNumberFormat::kNEANonNegative,
|
TGNumberFormat::kNEANonNegative,
|
||||||
TGNumberFormat::kNELLimitMinMax,0,16535);
|
TGNumberFormat::kNELLimitMinMax,0,16535);
|
||||||
hframe->AddFrame(eSerOff,new TGLayoutHints(kLHintsTop | kLHintsExpandX, 1, 1, 1, 1));
|
hframe->AddFrame(eSerOff,new TGLayoutHints(kLHintsTop | kLHintsExpandX, 1, 1, 1, 1));
|
||||||
eSerOff->MapWindow();
|
eSerOff->MapWindow();;
|
||||||
eSerOff->SetNumber(0);
|
eSerOff->SetNumber(5);
|
||||||
e= eSerOff->TGNumberEntry::GetNumberEntry();
|
e= eSerOff->TGNumberEntry::GetNumberEntry();
|
||||||
eSerOff->Connect("ValueSet(Long_t)","ctbAcquisition",this,"ChangeSerialOffset(Long_t)");
|
eSerOff->Connect("ValueSet(Long_t)","ctbAcquisition",this,"ChangeSerialOffset(Long_t)");
|
||||||
e->Connect("ReturnPressed()","ctbAcquisition",this,"ChangeSerialOffset()");
|
e->Connect("ReturnPressed()","ctbAcquisition",this,"ChangeSerialOffset()");
|
||||||
@ -344,53 +337,6 @@ hframe=new TGHorizontalFrame(this, 800,50);
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
hframe=new TGHorizontalFrame(this, 800,50);
|
|
||||||
AddFrame(hframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 10,10,10,10));
|
|
||||||
hframe->MapWindow();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
label=new TGLabel(hframe,"Image Pixels");
|
|
||||||
hframe->AddFrame(label,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 5, 5, 5, 5));
|
|
||||||
label->MapWindow();
|
|
||||||
label->SetTextJustify(kTextLeft);
|
|
||||||
|
|
||||||
|
|
||||||
label=new TGLabel(hframe,"X: ");
|
|
||||||
hframe->AddFrame(label,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 5, 5, 5, 5));
|
|
||||||
label->MapWindow();
|
|
||||||
label->SetTextJustify(kTextRight);
|
|
||||||
|
|
||||||
|
|
||||||
ePixX=new TGNumberEntry(hframe, 0, 9,999, TGNumberFormat::kNESInteger,
|
|
||||||
TGNumberFormat::kNEANonNegative,
|
|
||||||
TGNumberFormat::kNELLimitMinMax,0,16535);
|
|
||||||
hframe->AddFrame(ePixX,new TGLayoutHints(kLHintsTop | kLHintsExpandX, 1, 1, 1, 1));
|
|
||||||
ePixX->MapWindow();
|
|
||||||
ePixX->SetNumber(400);
|
|
||||||
e= ePixX->TGNumberEntry::GetNumberEntry();
|
|
||||||
ePixX->Connect("ValueSet(Long_t)","ctbAcquisition",this,"ChangeImagePixels(Long_t)");
|
|
||||||
e->Connect("ReturnPressed()","ctbAcquisition",this,"ChangeImagePixels()");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
label=new TGLabel(hframe,"Y: ");
|
|
||||||
hframe->AddFrame(label,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 5, 5, 5, 5));
|
|
||||||
label->MapWindow();
|
|
||||||
label->SetTextJustify(kTextRight);
|
|
||||||
|
|
||||||
|
|
||||||
ePixY=new TGNumberEntry(hframe, 0, 9,999, TGNumberFormat::kNESInteger,
|
|
||||||
TGNumberFormat::kNEANonNegative,
|
|
||||||
TGNumberFormat::kNELLimitMinMax,0,16535);
|
|
||||||
hframe->AddFrame(ePixY,new TGLayoutHints(kLHintsTop | kLHintsExpandX, 1, 1, 1, 1));
|
|
||||||
ePixY->MapWindow();
|
|
||||||
ePixY->SetNumber(400);
|
|
||||||
e= ePixY->TGNumberEntry::GetNumberEntry();
|
|
||||||
ePixY->Connect("ValueSet(Long_t)","ctbAcquisition",this,"ChangeImagePixels(Long_t)");
|
|
||||||
e->Connect("ReturnPressed()","ctbAcquisition",this,"ChangeImagePixels()");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
hframe=new TGHorizontalFrame(this, 800,50);
|
hframe=new TGHorizontalFrame(this, 800,50);
|
||||||
@ -664,9 +610,7 @@ hframe=new TGHorizontalFrame(this, 800,50);
|
|||||||
try {
|
try {
|
||||||
myDet->registerDataCallback(&dataCallback, (void*)this);
|
myDet->registerDataCallback(&dataCallback, (void*)this);
|
||||||
} CATCH_DISPLAY ("Could not get register call back.", "ctbAcquisition::ctbAcquisition")
|
} CATCH_DISPLAY ("Could not get register call back.", "ctbAcquisition::ctbAcquisition")
|
||||||
try {
|
|
||||||
myDet->setRxZmqDataStream(true);
|
|
||||||
} CATCH_DISPLAY ("Could not get set RxZmqDataStream.", "ctbAcquisition::ctbAcquisition")
|
|
||||||
cout <<"Done" << endl;
|
cout <<"Done" << endl;
|
||||||
|
|
||||||
// mgAdcs=new TMultiGraph();
|
// mgAdcs=new TMultiGraph();
|
||||||
@ -888,7 +832,7 @@ sample1 (dbit0 + dbit1 +...)if (cmd == "rx_dbitlist") {
|
|||||||
|
|
||||||
// cout <<"global plot is " << globalPlot << endl;
|
// cout <<"global plot is " << globalPlot << endl;
|
||||||
// cout << "*******************************************" <<endl;
|
// cout << "*******************************************" <<endl;
|
||||||
cout <<"------Plot: "<< index << " prog:" << data->progressIndex << " nx:" << data->nx << " ny: " << data->ny << " " << data->fileName << " bytes: " << data->databytes << " dr:"<< data->dynamicRange << " fi: " << data ->fileIndex << endl;
|
// cout <<"------Plot: "<< index << " prog:" << data->progressIndex << " npoints:" << data->npoints << " npy: " << data->npy << " " << data->fileName << " bytes: " << data->databytes << " dr:"<< data->dynamicRange << " fi: " << data ->fileIndex << endl;
|
||||||
if (globalPlot || cbGetPedestal->IsOn()) {
|
if (globalPlot || cbGetPedestal->IsOn()) {
|
||||||
//#ifdef TESTADC
|
//#ifdef TESTADC
|
||||||
// cout <<"------"<< index << " " << ip << " " << data->npoints << endl;
|
// cout <<"------"<< index << " " << ip << " " << data->npoints << endl;
|
||||||
@ -915,11 +859,6 @@ sample1 (dbit0 + dbit1 +...)if (cmd == "rx_dbitlist") {
|
|||||||
nx=eNumCount->GetIntNumber();
|
nx=eNumCount->GetIntNumber();
|
||||||
dr=eDynRange->GetIntNumber();
|
dr=eDynRange->GetIntNumber();
|
||||||
soff=eSerOff->GetIntNumber();
|
soff=eSerOff->GetIntNumber();
|
||||||
// cout <<"deserializer: " << endl;
|
|
||||||
// cout << "Number of chans:\t" << nx << endl;
|
|
||||||
// cout << "Serial Offset:\t" << soff << endl;
|
|
||||||
// cout << "Dynamic range:\t" << dr << endl;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
i=0;
|
i=0;
|
||||||
@ -984,8 +923,7 @@ sample1 (dbit0 + dbit1 +...)if (cmd == "rx_dbitlist") {
|
|||||||
for (int y=0; y<ny; y++) {
|
for (int y=0; y<ny; y++) {
|
||||||
ped=0;
|
ped=0;
|
||||||
aval=dataStructure->getValue(data->data,x,y);
|
aval=dataStructure->getValue(data->data,x,y);
|
||||||
//aval=dataStructure->getChannel(data->data,x,y);
|
|
||||||
cout << x << " " <<y << " "<< aval << endl;
|
|
||||||
if (cbGetPedestal->IsOn()) {
|
if (cbGetPedestal->IsOn()) {
|
||||||
if (photonFinder) {
|
if (photonFinder) {
|
||||||
photonFinder->addToPedestal(aval,x,y);
|
photonFinder->addToPedestal(aval,x,y);
|
||||||
@ -1157,19 +1095,7 @@ void ctbAcquisition::changePlot(){
|
|||||||
if (rbPlotOff->IsOn()) {
|
if (rbPlotOff->IsOn()) {
|
||||||
adcPlot=0;
|
adcPlot=0;
|
||||||
dbitPlot=0;
|
dbitPlot=0;
|
||||||
try {
|
|
||||||
myDet->registerDataCallback(nullptr, this);
|
|
||||||
} CATCH_DISPLAY ("Could not get unregister call back.", "ctbAcquisition::ctbAcquisition")
|
|
||||||
try {
|
|
||||||
myDet->setRxZmqDataStream(false);
|
|
||||||
} CATCH_DISPLAY ("Could not get unset RxZmqDataStream.", "ctbAcquisition::ctbAcquisition")
|
|
||||||
} else {
|
} else {
|
||||||
try {
|
|
||||||
myDet->registerDataCallback(&dataCallback, (void*)this);
|
|
||||||
} CATCH_DISPLAY ("Could not get register call back.", "ctbAcquisition::ctbAcquisition")
|
|
||||||
try {
|
|
||||||
myDet->setRxZmqDataStream(true);
|
|
||||||
} CATCH_DISPLAY ("Could not get set RxZmqDataStream.", "ctbAcquisition::ctbAcquisition")
|
|
||||||
adcPlot=0;
|
adcPlot=0;
|
||||||
dbitPlot=0;
|
dbitPlot=0;
|
||||||
for (int ii=0; ii<NADCS; ii++)
|
for (int ii=0; ii<NADCS; ii++)
|
||||||
@ -1274,9 +1200,6 @@ void ctbAcquisition::changeDetector(){
|
|||||||
eNumCount->SetState(kFALSE);
|
eNumCount->SetState(kFALSE);
|
||||||
eDynRange->SetState(kFALSE);
|
eDynRange->SetState(kFALSE);
|
||||||
eSerOff->SetState(kFALSE);
|
eSerOff->SetState(kFALSE);
|
||||||
ePixX->SetState(kFALSE);
|
|
||||||
ePixY->SetState(kFALSE);
|
|
||||||
|
|
||||||
deserializer=0;
|
deserializer=0;
|
||||||
if (rb2D->IsOn() ) {//|| rbScan->IsOn()
|
if (rb2D->IsOn() ) {//|| rbScan->IsOn()
|
||||||
switch (cbDetType->GetSelected()) {
|
switch (cbDetType->GetSelected()) {
|
||||||
@ -1287,6 +1210,7 @@ void ctbAcquisition::changeDetector(){
|
|||||||
// commonMode=new moench03CommonMode();
|
// commonMode=new moench03CommonMode();
|
||||||
break;
|
break;
|
||||||
case MOENCH04:
|
case MOENCH04:
|
||||||
|
|
||||||
try {
|
try {
|
||||||
auto retval = myDet->getTenGiga().tsquash("Different values");
|
auto retval = myDet->getTenGiga().tsquash("Different values");
|
||||||
if (retval) {
|
if (retval) {
|
||||||
@ -1299,54 +1223,6 @@ void ctbAcquisition::changeDetector(){
|
|||||||
cout << "MOENCH 0.4!" << endl;
|
cout << "MOENCH 0.4!" << endl;
|
||||||
commonMode=new moench03CommonMode();
|
commonMode=new moench03CommonMode();
|
||||||
break;
|
break;
|
||||||
case MOENCH03:
|
|
||||||
//try {
|
|
||||||
// auto retval = myDet->getTenGiga().tsquash("Different values");
|
|
||||||
// if (retval) {
|
|
||||||
dataStructure=new moench03T1ZmqDataNew(nAnalogSamples);
|
|
||||||
// } else {
|
|
||||||
// dataStructure=new moench04CtbZmqData(nAnalogSamples, nDigitalSamples);
|
|
||||||
// }
|
|
||||||
//} CATCH_DISPLAY ("Could not get ten giga enable.", "ctbAcquisition::changeDetector")
|
|
||||||
|
|
||||||
cout << "MOENCH 0.3! USE JUNGFRAU MODULE!" << endl;
|
|
||||||
commonMode=new moench03CommonMode();
|
|
||||||
break;
|
|
||||||
case IMAGE32B:
|
|
||||||
//try {
|
|
||||||
// auto retval = myDet->getTenGiga().tsquash("Different values");
|
|
||||||
// if (retval) {
|
|
||||||
// if (deserializer) {
|
|
||||||
ePixX->SetState(kTRUE);
|
|
||||||
ePixY->SetState(kTRUE);
|
|
||||||
// }
|
|
||||||
dataStructure=new imageZmq32bit(ePixX->GetIntNumber(),ePixY->GetIntNumber());
|
|
||||||
// } else {
|
|
||||||
// dataStructure=new moench04CtbZmqData(nAnalogSamples, nDigitalSamples);
|
|
||||||
// }
|
|
||||||
//} CATCH_DISPLAY ("Could not get ten giga enable.", "ctbAcquisition::changeDetector")
|
|
||||||
|
|
||||||
cout << "Image 32bit, no channel shuffling" << endl;
|
|
||||||
commonMode=NULL;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case IMAGE16B:
|
|
||||||
//try {
|
|
||||||
// auto retval = myDet->getTenGiga().tsquash("Different values");
|
|
||||||
// if (retval) {
|
|
||||||
// if (deserializer) {
|
|
||||||
ePixX->SetState(kTRUE);
|
|
||||||
ePixY->SetState(kTRUE);
|
|
||||||
// }
|
|
||||||
dataStructure=new imageZmq16bit(ePixX->GetIntNumber(),ePixY->GetIntNumber());
|
|
||||||
// } else {
|
|
||||||
// dataStructure=new moench04CtbZmqData(nAnalogSamples, nDigitalSamples);
|
|
||||||
// }
|
|
||||||
//} CATCH_DISPLAY ("Could not get ten giga enable.", "ctbAcquisition::changeDetector")
|
|
||||||
|
|
||||||
cout << "Image 16bit, no channel shuffling" << endl;
|
|
||||||
commonMode=NULL;
|
|
||||||
break;
|
|
||||||
|
|
||||||
// case 1:
|
// case 1:
|
||||||
// cout << "************** T!!!!!!!!!!" << endl;
|
// cout << "************** T!!!!!!!!!!" << endl;
|
||||||
@ -1410,7 +1286,6 @@ void ctbAcquisition::changeDetector(){
|
|||||||
photonFinder=new singlePhotonDetector(dataStructure,csize,nsigma,1,cm); //sign is positive - should correct with ADC mask, no common mode
|
photonFinder=new singlePhotonDetector(dataStructure,csize,nsigma,1,cm); //sign is positive - should correct with ADC mask, no common mode
|
||||||
//photonFinder=new singlePhotonDetector(dataStructure,csize,nsigma,1,cm); //sign is positive - should correct with ADC mask, no common mode
|
//photonFinder=new singlePhotonDetector(dataStructure,csize,nsigma,1,cm); //sign is positive - should correct with ADC mask, no common mode
|
||||||
dataStructure->getDetectorSize(nx,ny);
|
dataStructure->getDetectorSize(nx,ny);
|
||||||
|
|
||||||
}
|
}
|
||||||
if (deserializer) {
|
if (deserializer) {
|
||||||
ny=1;
|
ny=1;
|
||||||
@ -1636,23 +1511,20 @@ void ctbAcquisition::update() {
|
|||||||
|
|
||||||
if (dataStructure) {
|
if (dataStructure) {
|
||||||
cout << cbDetType->GetSelected()<< endl;
|
cout << cbDetType->GetSelected()<< endl;
|
||||||
// if (cbDetType->GetSelected()==MYTHEN301 || cbDetType->GetSelected()==MYTHEN302){
|
if (cbDetType->GetSelected()==MYTHEN301 || cbDetType->GetSelected()==MYTHEN302){
|
||||||
// cout << "settings deserialiation parameters for MYTHEN" << endl;
|
cout << "settings deserialiation parameters for MYTHEN" << endl;
|
||||||
// mythen3_01_jctbData* ms=(mythen3_01_jctbData*)dataStructure;
|
mythen3_01_jctbData* ms=(mythen3_01_jctbData*)dataStructure;
|
||||||
// eSerOff->SetNumber( ms->setSerialOffset(-1));
|
eSerOff->SetNumber( ms->setSerialOffset(-1));
|
||||||
// eDynRange->SetNumber( ms->setDynamicRange(-1));
|
eDynRange->SetNumber( ms->setDynamicRange(-1));
|
||||||
// eNumCount->SetNumber( ms->setNumberOfCounters(-1));
|
eNumCount->SetNumber( ms->setNumberOfCounters(-1));
|
||||||
// }
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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")
|
||||||
@ -1738,13 +1610,9 @@ 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"));
|
||||||
@ -1981,9 +1849,6 @@ 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();
|
||||||
@ -1992,7 +1857,6 @@ 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 {
|
||||||
@ -2113,22 +1977,20 @@ void ctbAcquisition::ChangeNumberOfChannels(Long_t a){
|
|||||||
|
|
||||||
|
|
||||||
void ctbAcquisition::ChangeSerialOffset(){
|
void ctbAcquisition::ChangeSerialOffset(){
|
||||||
changeDetector();
|
|
||||||
// if (dataStructure) {
|
// if (dataStructure) {
|
||||||
|
|
||||||
// cout << cbDetType->GetSelected()<< endl;
|
// // cout << cbDetType->GetSelected()<< endl;
|
||||||
// if (cbDetType->GetSelected()==MYTHEN301 || cbDetType->GetSelected()==MYTHEN302 ){
|
// // if (cbDetType->GetSelected()==MYTHEN301 || cbDetType->GetSelected()==MYTHEN302 ){
|
||||||
// cout << "settings offsets for MYTHEN" << endl;
|
// // cout << "settings offsets for MYTHEN" << endl;
|
||||||
// mythen3_01_jctbData* ms=(mythen3_01_jctbData*)dataStructure;
|
// // mythen3_01_jctbData* ms=(mythen3_01_jctbData*)dataStructure;
|
||||||
// ms->setSerialOffset(eSerOff->GetIntNumber());
|
// // ms->setSerialOffset(eSerOff->GetIntNumber());
|
||||||
|
|
||||||
// }
|
// // }
|
||||||
// }
|
// }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
void ctbAcquisition::ChangeDynamicRange(){
|
void ctbAcquisition::ChangeDynamicRange(){
|
||||||
changeDetector();
|
|
||||||
// if (dataStructure) {
|
// if (dataStructure) {
|
||||||
|
|
||||||
// cout << cbDetType->GetSelected()<< endl;
|
// cout << cbDetType->GetSelected()<< endl;
|
||||||
@ -2142,7 +2004,6 @@ void ctbAcquisition::ChangeDynamicRange(){
|
|||||||
};
|
};
|
||||||
|
|
||||||
void ctbAcquisition::ChangeNumberOfChannels(){
|
void ctbAcquisition::ChangeNumberOfChannels(){
|
||||||
changeDetector();
|
|
||||||
// if (dataStructure) {
|
// if (dataStructure) {
|
||||||
// cout << cbDetType->GetSelected()<< endl;
|
// cout << cbDetType->GetSelected()<< endl;
|
||||||
// if (cbDetType->GetSelected()==MYTHEN301 || cbDetType->GetSelected()==MYTHEN302){
|
// if (cbDetType->GetSelected()==MYTHEN301 || cbDetType->GetSelected()==MYTHEN302){
|
||||||
@ -2156,24 +2017,6 @@ void ctbAcquisition::ChangeNumberOfChannels(){
|
|||||||
changePlot();
|
changePlot();
|
||||||
};
|
};
|
||||||
|
|
||||||
void ctbAcquisition::ChangeImagePixels(Long_t a){
|
|
||||||
ChangeImagePixels();
|
|
||||||
};
|
|
||||||
|
|
||||||
void ctbAcquisition::ChangeImagePixels(){
|
|
||||||
changeDetector();
|
|
||||||
// if (dataStructure) {
|
|
||||||
// cout << cbDetType->GetSelected()<< endl;
|
|
||||||
// if (cbDetType->GetSelected()==MYTHEN301 || cbDetType->GetSelected()==MYTHEN302){
|
|
||||||
// cout << "settings number of channels for MYTHEN" << endl;
|
|
||||||
// mythen3_01_jctbData* ms=(mythen3_01_jctbData*)dataStructure;
|
|
||||||
// ms->setNumberOfCounters(eNumCount->GetIntNumber());
|
|
||||||
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// if (deserializer)
|
|
||||||
// changePlot();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
void ctbAcquisition::ChangeHistoLimitsPedSub(Long_t a){
|
void ctbAcquisition::ChangeHistoLimitsPedSub(Long_t a){
|
||||||
|
@ -42,7 +42,7 @@ using namespace std;
|
|||||||
class ctbAcquisition : public TGGroupFrame {
|
class ctbAcquisition : public TGGroupFrame {
|
||||||
|
|
||||||
|
|
||||||
enum {DESERIALIZER, MOENCH04, MOENCH02, MOENCH03, IMAGE32B, IMAGE16B, ADCSAR2, MYTHEN301, MYTHEN302};
|
enum {DESERIALIZER, MOENCH04, MOENCH02, ADCSAR2, MYTHEN301, MYTHEN302};
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -57,9 +57,6 @@ class ctbAcquisition : public TGGroupFrame {
|
|||||||
TGNumberEntry *eNumCount;
|
TGNumberEntry *eNumCount;
|
||||||
|
|
||||||
|
|
||||||
TGNumberEntry *ePixX;
|
|
||||||
TGNumberEntry *ePixY;
|
|
||||||
|
|
||||||
TGNumberEntry *eFitADC;
|
TGNumberEntry *eFitADC;
|
||||||
TGNumberEntry *eBitPlot;
|
TGNumberEntry *eBitPlot;
|
||||||
TGNumberEntry *eMinRaw;
|
TGNumberEntry *eMinRaw;
|
||||||
@ -234,8 +231,7 @@ class ctbAcquisition : public TGGroupFrame {
|
|||||||
void ChangeNumberOfChannels(Long_t);
|
void ChangeNumberOfChannels(Long_t);
|
||||||
void ChangeDynamicRange();
|
void ChangeDynamicRange();
|
||||||
void ChangeDynamicRange(Long_t);
|
void ChangeDynamicRange(Long_t);
|
||||||
void ChangeImagePixels();
|
|
||||||
void ChangeImagePixels(Long_t);
|
|
||||||
|
|
||||||
void canvasClicked();
|
void canvasClicked();
|
||||||
void FitADC();
|
void FitADC();
|
||||||
|
@ -108,26 +108,15 @@ string ctbDac::getLabel() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int ctbDac::getMoenchDacId() {
|
|
||||||
slsDetectorDefs::dacIndex moenchDacIndices[8] = {slsDetectorDefs::VBP_COLBUF, slsDetectorDefs::VIPRE, slsDetectorDefs::VIN_CM, slsDetectorDefs::VB_SDA, slsDetectorDefs::VCASC_SFP, slsDetectorDefs::VOUT_CM, slsDetectorDefs::VIPRE_CDS, slsDetectorDefs::IBIAS_SFP};
|
|
||||||
|
|
||||||
if (id >= 8) {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
return static_cast<int>(moenchDacIndices[id]);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ctbDac::setValue(Long_t a) {setValue();}
|
void ctbDac::setValue(Long_t a) {setValue();}
|
||||||
|
|
||||||
void ctbDac::setValue() {
|
void ctbDac::setValue() {
|
||||||
|
|
||||||
cout << "setting dac! "<< id << " value " << dacsEntry->GetIntNumber() << " units " << dacsUnit->IsOn() << endl;
|
cout << "setting dac! "<< id << " value " << dacsEntry->GetIntNumber() << " units " << dacsUnit->IsOn() << endl;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
int sid = id;
|
myDet->setDAC(static_cast<slsDetectorDefs::dacIndex>(id), dacsEntry->GetIntNumber(), dacsUnit->IsOn());
|
||||||
if (myDet->getDetectorType().squash() == slsDetectorDefs::MOENCH) {
|
|
||||||
sid = getMoenchDacId();
|
|
||||||
}
|
|
||||||
myDet->setDAC(static_cast<slsDetectorDefs::dacIndex>(sid), dacsEntry->GetIntNumber(), dacsUnit->IsOn());
|
|
||||||
} CATCH_DISPLAY ("Could not set dac " + to_string(id) + ".", "ctbDac::setValue")
|
} CATCH_DISPLAY ("Could not set dac " + to_string(id) + ".", "ctbDac::setValue")
|
||||||
|
|
||||||
getValue();
|
getValue();
|
||||||
@ -139,11 +128,7 @@ void ctbDac::setOn(Bool_t b) {
|
|||||||
setValue();
|
setValue();
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
int sid = id;
|
myDet->setDAC(static_cast<slsDetectorDefs::dacIndex>(id), -100, false);
|
||||||
if (myDet->getDetectorType().squash() == slsDetectorDefs::MOENCH) {
|
|
||||||
sid = getMoenchDacId();
|
|
||||||
}
|
|
||||||
myDet->setDAC(static_cast<slsDetectorDefs::dacIndex>(sid), -100, false);
|
|
||||||
} CATCH_DISPLAY ("Could not power off dac " + to_string(id) + ".", "ctbDac::setOn")
|
} CATCH_DISPLAY ("Could not power off dac " + to_string(id) + ".", "ctbDac::setOn")
|
||||||
}
|
}
|
||||||
getValue();
|
getValue();
|
||||||
@ -151,11 +136,7 @@ void ctbDac::setOn(Bool_t b) {
|
|||||||
|
|
||||||
int ctbDac::getValue() {
|
int ctbDac::getValue() {
|
||||||
try {
|
try {
|
||||||
int sid = id;
|
int val = myDet->getDAC(static_cast<slsDetectorDefs::dacIndex>(id), dacsUnit->IsOn()).tsquash("Different values");
|
||||||
if (myDet->getDetectorType().squash() == slsDetectorDefs::MOENCH) {
|
|
||||||
sid = getMoenchDacId();
|
|
||||||
}
|
|
||||||
int val = myDet->getDAC(static_cast<slsDetectorDefs::dacIndex>(sid), dacsUnit->IsOn()).tsquash("Different values");
|
|
||||||
cout << "dac " << id << " " << val << endl;
|
cout << "dac " << id << " " << val << endl;
|
||||||
dacsValue->SetText(to_string(val).c_str());
|
dacsValue->SetText(to_string(val).c_str());
|
||||||
if (val >= 0) {
|
if (val >= 0) {
|
||||||
|
@ -45,7 +45,7 @@ class ctbDac : public TGHorizontalFrame {
|
|||||||
|
|
||||||
int setLabel(char *tit, int mv);
|
int setLabel(char *tit, int mv);
|
||||||
string getLabel();
|
string getLabel();
|
||||||
int getMoenchDacId();
|
|
||||||
|
|
||||||
|
|
||||||
ClassDef(ctbDac,0)
|
ClassDef(ctbDac,0)
|
||||||
@ -54,6 +54,8 @@ int getMoenchDacId();
|
|||||||
class ctbDacs : public TGGroupFrame {
|
class ctbDacs : public TGGroupFrame {
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ctbDac *dacs[NDACS+2];
|
ctbDac *dacs[NDACS+2];
|
||||||
|
|
||||||
sls::Detector* myDet;
|
sls::Detector* myDet;
|
||||||
|
@ -71,10 +71,10 @@ class ctbDefs {
|
|||||||
std::string exceptionMessage,
|
std::string exceptionMessage,
|
||||||
std::string source) {
|
std::string source) {
|
||||||
// because sls_detector_exceptions cannot be included
|
// because sls_detector_exceptions cannot be included
|
||||||
if (exceptionMessage.find("hared memory") != std::string::npos) {
|
if (exceptionMessage.find("hared memory")) {
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
if (exceptionMessage.find("annot connect") != std::string::npos) {
|
if (exceptionMessage.find("annot connect")) {
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
cprintf(RED, "Warning (%s): %s [Caught Exception: %s]\n", source.c_str(), message.c_str(), exceptionMessage.c_str());
|
cprintf(RED, "Warning (%s): %s [Caught Exception: %s]\n", source.c_str(), message.c_str(), exceptionMessage.c_str());
|
||||||
|
@ -259,10 +259,8 @@ ctbMain::ctbMain(const TGWindow *p, sls::Detector *det)
|
|||||||
|
|
||||||
cout << "connect mtab" << endl;
|
cout << "connect mtab" << endl;
|
||||||
|
|
||||||
try{
|
|
||||||
setReadoutMode(pat->getReadoutMode());
|
|
||||||
} CATCH_DISPLAY ("Could not get readout flags", "ctbPattern::getReadoutMode")
|
|
||||||
|
|
||||||
|
setReadoutMode(pat->getReadoutMode());
|
||||||
setADCEnable(adcs->setEnable());
|
setADCEnable(adcs->setEnable());
|
||||||
setAnalogSamples(pat->getAnalogSamples());
|
setAnalogSamples(pat->getAnalogSamples());
|
||||||
setDigitalSamples(pat->getDigitalSamples());
|
setDigitalSamples(pat->getDigitalSamples());
|
||||||
|
@ -1036,13 +1036,8 @@ void ctbPattern::readoutModeChanged(int flags) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int ctbPattern::getReadoutMode() {
|
int ctbPattern::getReadoutMode() {
|
||||||
int retval=slsDetectorDefs::ANALOG_ONLY;
|
|
||||||
|
|
||||||
if (myDet->getDetectorType().squash() == slsDetectorDefs::CHIPTESTBOARD) {
|
|
||||||
try{
|
try{
|
||||||
retval = myDet->getReadoutMode().tsquash("Different values");
|
auto retval = myDet->getReadoutMode().tsquash("Different values");
|
||||||
} CATCH_DISPLAY ("Could not get readout flags", "ctbPattern::getReadoutMode")
|
|
||||||
|
|
||||||
switch(retval) {
|
switch(retval) {
|
||||||
case slsDetectorDefs::ANALOG_AND_DIGITAL:
|
case slsDetectorDefs::ANALOG_AND_DIGITAL:
|
||||||
cout << "analog and digital" << endl;
|
cout << "analog and digital" << endl;
|
||||||
@ -1062,15 +1057,11 @@ int ctbPattern::getReadoutMode() {
|
|||||||
default:
|
default:
|
||||||
throw("unknown readout flag");
|
throw("unknown readout flag");
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
cbAnalog->SetOn(kTRUE);
|
|
||||||
cbDigital->SetOn(kFALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
Emit("readoutModeChanged(int)",static_cast<int>(retval));
|
Emit("readoutModeChanged(int)",static_cast<int>(retval));
|
||||||
return retval;
|
return retval;
|
||||||
|
} CATCH_DISPLAY ("Could not get readout flags", "ctbPattern::getReadoutMode")
|
||||||
|
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ctbPattern::getAnalogSamples() {
|
int ctbPattern::getAnalogSamples() {
|
||||||
@ -1085,16 +1076,12 @@ int ctbPattern::getAnalogSamples() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int ctbPattern::getDigitalSamples() {
|
int ctbPattern::getDigitalSamples() {
|
||||||
int retval=0;
|
|
||||||
if (myDet->getDetectorType().squash() == slsDetectorDefs::CHIPTESTBOARD) {
|
|
||||||
try{
|
try{
|
||||||
auto retval = myDet->getNumberOfDigitalSamples().tsquash("Different values");
|
auto retval = myDet->getNumberOfDigitalSamples().tsquash("Different values");
|
||||||
} CATCH_DISPLAY ("Could not get number of digital samples.", "ctbPattern::getDigitalSamples")
|
|
||||||
}
|
|
||||||
eDigitalSamples->SetNumber((Double_t)retval);
|
eDigitalSamples->SetNumber((Double_t)retval);
|
||||||
Emit("digitalSamplesChanged(const int)", eDigitalSamples->GetNumber());
|
Emit("digitalSamplesChanged(const int)", eDigitalSamples->GetNumber());
|
||||||
return eDigitalSamples->GetNumber();
|
return eDigitalSamples->GetNumber();
|
||||||
|
} CATCH_DISPLAY ("Could not get number of triggers.", "ctbPattern::update")
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -374,16 +374,6 @@ 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");
|
||||||
@ -410,7 +400,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,7 +21,6 @@ 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 REQUIRED)
|
find_package(Doxygen)
|
||||||
find_package(Sphinx REQUIRED)
|
find_package(Sphinx)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
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,7 +30,6 @@ set(SPHINX_BUILD ${CMAKE_CURRENT_BINARY_DIR})
|
|||||||
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
|
||||||
@ -42,7 +41,6 @@ set(SPHINX_SOURCE_FILES
|
|||||||
src/result.rst
|
src/result.rst
|
||||||
src/type_traits.rst
|
src/type_traits.rst
|
||||||
src/ToString.rst
|
src/ToString.rst
|
||||||
src/examples.rst
|
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -66,4 +64,6 @@ add_custom_target(docs
|
|||||||
${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)
|
||||||
|
@ -1,116 +0,0 @@
|
|||||||
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.12
|
* CMake > 3.9
|
||||||
* 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.1
|
* Qwt 6
|
||||||
|
|
||||||
-----------------------
|
-----------------------
|
||||||
Python bindings
|
Python bindings
|
||||||
|
@ -1,115 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
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,6 +9,7 @@
|
|||||||
#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"
|
||||||
@ -51,4 +52,5 @@ 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,18 +6,12 @@
|
|||||||
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
|
||||||
@ -26,7 +20,6 @@ Welcome to slsDetectorPackage's documentation!
|
|||||||
detector
|
detector
|
||||||
result
|
result
|
||||||
receiver
|
receiver
|
||||||
examples
|
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
:caption: Python API
|
:caption: Python API
|
||||||
|
@ -2,68 +2,4 @@
|
|||||||
Installation
|
Installation
|
||||||
==============================================
|
==============================================
|
||||||
|
|
||||||
Build from source using CMake
|
get the source etc.
|
||||||
---------------------------------
|
|
||||||
|
|
||||||
.. 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:: slsdet
|
.. py:currentmodule:: sls_detector
|
||||||
|
|
||||||
.. autoclass:: Detector
|
.. autoclass:: ExperimentalDetector
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
@ -1,29 +0,0 @@
|
|||||||
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
|
|
||||||
|
|
||||||
|
|
||||||
|
|
140
examples/jctb_moench03_T1.config → examples/moench01_T1_lab.config
Normal file → Executable file
140
examples/jctb_moench03_T1.config → examples/moench01_T1_lab.config
Normal file → Executable file
@ -1,14 +1,4 @@
|
|||||||
initialchecks 0
|
hostname bchip085+
|
||||||
#############################################
|
|
||||||
### edit with hostname or IP address of your detector
|
|
||||||
############################################
|
|
||||||
hostname bchip181+
|
|
||||||
runclk 40
|
|
||||||
adcclk 20
|
|
||||||
dbitclk 40
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
patword 0000 0000000000000000
|
patword 0000 0000000000000000
|
||||||
patword 0001 0000000000000000
|
patword 0001 0000000000000000
|
||||||
@ -418,84 +408,84 @@ patnloop1 0
|
|||||||
patloop2 0400 0400
|
patloop2 0400 0400
|
||||||
patnloop2 0
|
patnloop2 0
|
||||||
patwait0 00aa
|
patwait0 00aa
|
||||||
patwaittime0 10000
|
patwaittime0 40000
|
||||||
patwait1 0400
|
patwait1 0400
|
||||||
patwaittime1 0
|
patwaittime1 0
|
||||||
patwait2 0400
|
patwait2 0400
|
||||||
patwaittime2 0
|
patwaittime2 0
|
||||||
|
|
||||||
|
|
||||||
#0:rx_tcpport 1977
|
####mcp2011
|
||||||
|
#0:rx_udpip 10.1.1.102
|
||||||
|
#0:detectorip 10.1.1.19
|
||||||
|
#0:rx_udpport 32410
|
||||||
|
####gui listening to
|
||||||
|
#zmqip 129.129.202.131
|
||||||
|
#zmqport 30001
|
||||||
|
####data streaming out of
|
||||||
|
#rx_zmqip 10.1.2.103
|
||||||
|
#rx_zmqport 30003
|
||||||
|
#0:rx_hostname mpc2011
|
||||||
|
|
||||||
#############################################
|
####mx-test-1
|
||||||
### edit with 10 Gbs IP of your server
|
0:rx_udpip 10.1.1.100
|
||||||
############################################
|
0:detectorip 10.1.1.19
|
||||||
0:udp_dstip 10.1.1.102
|
0:rx_udpport 32410
|
||||||
#0:udp_dstip 129.129.202.136
|
####gui listening to (on receiver pc)
|
||||||
#############################################
|
zmqip 129.129.202.92
|
||||||
### edit with any number in the subnet of your server (first 3 numbers as above)
|
zmqport 30001
|
||||||
############################################
|
####data streaming out of
|
||||||
0:udp_srcip 10.1.1.19
|
rx_zmqip 10.1.1.100
|
||||||
#0:udp_srcip 129.129.202.13
|
rx_zmqport 30003
|
||||||
|
0:rx_hostname pcmoench01
|
||||||
0:udp_dstport 33410
|
|
||||||
#############################################
|
|
||||||
### edit with 10 Gbs IP of your server
|
|
||||||
############################################
|
|
||||||
#zmqip 129.129.202.110
|
|
||||||
#rx_zmqip 10.1.1.102
|
|
||||||
#rx_zmqport 30001
|
|
||||||
#############################################
|
|
||||||
### edit with 1 Gbs IP of PC where you will run the GUI
|
|
||||||
############################################
|
|
||||||
#zmqip 129.129.202.110
|
|
||||||
#zmqport 50001
|
|
||||||
|
|
||||||
|
|
||||||
#############################################
|
|
||||||
### edit with hostname or 1Gbs IP address of your server
|
|
||||||
############################################
|
|
||||||
rx_hostname mpc2011
|
|
||||||
|
|
||||||
tengiga 1
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#turn on datastream from commandline
|
||||||
rx_datastream 1
|
rx_datastream 1
|
||||||
rx_readfreq 1
|
|
||||||
|
r_readfreq 1
|
||||||
|
|
||||||
|
#0:configuremac -1
|
||||||
|
rx_datastream 1
|
||||||
|
|
||||||
|
r_readfreq 1
|
||||||
|
|
||||||
|
|
||||||
dac 6 800
|
dac:6 800
|
||||||
dac 0 1300
|
dac:0 1300
|
||||||
dac 4 1428
|
dac:4 1428
|
||||||
dac 1 1000
|
dac:1 1000
|
||||||
dac 7 900
|
dac:7 900
|
||||||
dac 3 680
|
dac:3 680
|
||||||
dac 2 1400
|
dac:2 1400
|
||||||
dac 5 1200
|
dac:5 1200
|
||||||
adcinvert 4a342593
|
adcinvert 4a342593
|
||||||
#0xb5cbda6c
|
samples 5000
|
||||||
asamples 5000
|
adcphase 90
|
||||||
dsamples 0
|
adcpipeline 15
|
||||||
adcphase 30 deg
|
|
||||||
adcpipeline 14
|
|
||||||
adcreg 14 40
|
adcreg 14 40
|
||||||
|
powerchip 1
|
||||||
|
|
||||||
frames 1000
|
|
||||||
period 0.001
|
|
||||||
#############################################
|
|
||||||
### edit with directory you want to write to
|
|
||||||
############################################
|
|
||||||
fpath /tmp/
|
|
||||||
fwrite 0
|
|
||||||
|
|
||||||
romode analog
|
|
||||||
#rx_jsonaddheader frameMode
|
|
||||||
rx_jsonpara frameMode newpedestal
|
|
||||||
#rx_jsonaddheader detectorMode
|
|
||||||
rx_jsonpara detectorMode analog
|
|
||||||
#flags newpedestal
|
|
||||||
#flags analog
|
|
||||||
|
|
||||||
reg 0x5e 0x00010000
|
|
||||||
#powerchip 1
|
|
||||||
vhighvoltage 90
|
vhighvoltage 90
|
||||||
|
period 0.005
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
frames 100
|
||||||
|
period 0.1
|
||||||
|
outdir /scratch/
|
||||||
|
enablefwrite 0
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,63 +0,0 @@
|
|||||||
initialchecks 0
|
|
||||||
#############################################
|
|
||||||
### edit with hostname or IP address of your detector
|
|
||||||
############################################
|
|
||||||
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
|
|
||||||
############################################
|
|
||||||
udp_dstip 10.1.1.102
|
|
||||||
#############################################
|
|
||||||
### edit with any number in the subnet of your server (first 3 numbers as above)
|
|
||||||
############################################
|
|
||||||
udp_srcip 10.1.1.19
|
|
||||||
udp_dstport 32411
|
|
||||||
|
|
||||||
#############################################
|
|
||||||
### edit with 10 Gbs IP of your server
|
|
||||||
############################################
|
|
||||||
rx_zmqip 10.1.1.102
|
|
||||||
rx_zmqport 50003
|
|
||||||
#############################################
|
|
||||||
### edit with 1 Gbs IP of PC where you will run the GUI
|
|
||||||
############################################
|
|
||||||
zmqip 129.129.202.136
|
|
||||||
zmqport 50001
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
tengiga 1
|
|
||||||
rx_datastream 1
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
frames 100000
|
|
||||||
period 0.0006
|
|
||||||
#############################################
|
|
||||||
### edit with directory you want to write to
|
|
||||||
############################################
|
|
||||||
fpath /mnt/moench_data/scratch/
|
|
||||||
fwrite 0
|
|
||||||
rx_datastream 1
|
|
||||||
|
|
||||||
rx_jsonpara frameMode frame
|
|
||||||
rx_jsonpara detectorMode counting
|
|
||||||
rx_discardpolicy discardpartial
|
|
||||||
|
|
||||||
|
|
||||||
adcpipeline 15
|
|
||||||
|
|
||||||
powerchip 1
|
|
||||||
vhighvoltage 90
|
|
||||||
|
|
||||||
#adcreg 0x14 0x40
|
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
#include "DetectorImpl.h"
|
|
||||||
#include "catch.hpp"
|
#include "catch.hpp"
|
||||||
|
#include "DetectorImpl.h"
|
||||||
#include "string_utils.h"
|
#include "string_utils.h"
|
||||||
#include "tests/globals.h"
|
#include "tests/globals.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
54
integrationTests/test-integrationDectector.cpp
Normal file → Executable file
54
integrationTests/test-integrationDectector.cpp
Normal file → Executable file
@ -2,9 +2,9 @@
|
|||||||
#include "catch.hpp"
|
#include "catch.hpp"
|
||||||
|
|
||||||
#include "ClientSocket.h"
|
#include "ClientSocket.h"
|
||||||
#include "DetectorImpl.h"
|
|
||||||
#include "Module.h"
|
|
||||||
#include "logger.h"
|
#include "logger.h"
|
||||||
|
#include "DetectorImpl.h"
|
||||||
|
#include "slsDetector.h"
|
||||||
#include "sls_detector_defs.h"
|
#include "sls_detector_defs.h"
|
||||||
|
|
||||||
#include "Timer.h"
|
#include "Timer.h"
|
||||||
@ -23,10 +23,10 @@
|
|||||||
// extern dt type;
|
// extern dt type;
|
||||||
|
|
||||||
TEST_CASE("Single detector no receiver", "[.integration][.single]") {
|
TEST_CASE("Single detector no receiver", "[.integration][.single]") {
|
||||||
auto t = Module::getTypeFromDetector(test::hostname);
|
auto t = slsDetector::getTypeFromDetector(test::hostname);
|
||||||
CHECK(t == test::type);
|
CHECK(t == test::type);
|
||||||
|
|
||||||
Module d(t);
|
slsDetector d(t);
|
||||||
CHECK(d.getDetectorTypeAsEnum() == t);
|
CHECK(d.getDetectorTypeAsEnum() == t);
|
||||||
CHECK(d.getDetectorTypeAsString() == test::detector_type);
|
CHECK(d.getDetectorTypeAsString() == test::detector_type);
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ TEST_CASE("Set control port then create a new object with this control port",
|
|||||||
int new_cport = 1993;
|
int new_cport = 1993;
|
||||||
int new_sport = 2000;
|
int new_sport = 2000;
|
||||||
{
|
{
|
||||||
Module d(test::type);
|
slsDetector d(test::type);
|
||||||
d.setHostname(test::hostname);
|
d.setHostname(test::hostname);
|
||||||
CHECK(d.getControlPort() == old_cport);
|
CHECK(d.getControlPort() == old_cport);
|
||||||
d.setControlPort(new_cport);
|
d.setControlPort(new_cport);
|
||||||
@ -60,7 +60,7 @@ TEST_CASE("Set control port then create a new object with this control port",
|
|||||||
d.freeSharedMemory();
|
d.freeSharedMemory();
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
Module d(test::type);
|
slsDetector d(test::type);
|
||||||
d.setHostname(test::hostname);
|
d.setHostname(test::hostname);
|
||||||
d.setControlPort(new_cport);
|
d.setControlPort(new_cport);
|
||||||
d.setStopPort(new_sport);
|
d.setStopPort(new_sport);
|
||||||
@ -73,23 +73,24 @@ TEST_CASE("Set control port then create a new object with this control port",
|
|||||||
d.freeSharedMemory();
|
d.freeSharedMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
Module d(test::type);
|
slsDetector d(test::type);
|
||||||
d.setHostname(test::hostname);
|
d.setHostname(test::hostname);
|
||||||
CHECK(d.getStopPort() == DEFAULT_PORTNO + 1);
|
CHECK(d.getStopPort() == DEFAULT_PORTNO + 1);
|
||||||
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
|
||||||
SingleDetectorConfig c;
|
SingleDetectorConfig c;
|
||||||
|
|
||||||
// Read type by connecting to the detector
|
// Read type by connecting to the detector
|
||||||
auto type = Module::getTypeFromDetector(c.hostname);
|
auto type = slsDetector::getTypeFromDetector(c.hostname);
|
||||||
CHECK(type == c.type_enum);
|
CHECK(type == c.type_enum);
|
||||||
|
|
||||||
// Create Module of said type and set hostname and detector online
|
// Create slsDetector of said type and set hostname and detector online
|
||||||
Module d(type);
|
slsDetector d(type);
|
||||||
CHECK(d.getDetectorTypeAsEnum() == type);
|
CHECK(d.getDetectorTypeAsEnum() == type);
|
||||||
CHECK(d.getDetectorTypeAsString() == c.type_string);
|
CHECK(d.getDetectorTypeAsString() == c.type_string);
|
||||||
|
|
||||||
@ -129,8 +130,10 @@ 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);
|
slsDetector d(test::type);
|
||||||
d.setHostname(test::hostname);
|
d.setHostname(test::hostname);
|
||||||
|
|
||||||
// Check that detector server is unlocked then lock
|
// Check that detector server is unlocked then lock
|
||||||
@ -152,11 +155,12 @@ TEST_CASE("Locking mechanism and last ip", "[.integration][.single]") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("Set settings", "[.integration][.single]"){
|
TEST_CASE("Set settings", "[.integration][.single]"){
|
||||||
Module d(test::type);
|
slsDetector d(test::type);
|
||||||
d.setHostname(test::hostname);
|
d.setHostname(test::hostname);
|
||||||
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,
|
||||||
@ -181,7 +185,7 @@ TEST_CASE("Timer functions", "[.integration][cli]") {
|
|||||||
// MEASURED_SUBPERIOD, /**< measured subperiod */
|
// MEASURED_SUBPERIOD, /**< measured subperiod */
|
||||||
// MAX_TIMERS
|
// MAX_TIMERS
|
||||||
|
|
||||||
Module d(test::type);
|
slsDetector d(test::type);
|
||||||
d.setHostname(test::hostname);
|
d.setHostname(test::hostname);
|
||||||
|
|
||||||
// Number of frames
|
// Number of frames
|
||||||
@ -200,7 +204,8 @@ 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() == delay);
|
CHECK(d.getDelayAfterTrigger() ==
|
||||||
|
delay);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto triggers = 2;
|
auto triggers = 2;
|
||||||
@ -216,12 +221,13 @@ TEST_CASE("Timer functions", "[.integration][cli]") {
|
|||||||
d.startAndReadAll();
|
d.startAndReadAll();
|
||||||
|
|
||||||
d.freeSharedMemory();
|
d.freeSharedMemory();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TEST_CASE("Aquire", "[.integration][eiger]"){
|
// TEST_CASE("Aquire", "[.integration][eiger]"){
|
||||||
// SingleDetectorConfig c;
|
// SingleDetectorConfig c;
|
||||||
// auto type = Module::getTypeFromDetector(c.hostname);
|
// auto type = slsDetector::getTypeFromDetector(c.hostname);
|
||||||
// Module d(type);
|
// slsDetector d(type);
|
||||||
// d.setHostname(c.hostname);
|
// d.setHostname(c.hostname);
|
||||||
|
|
||||||
// auto period = 1000000000;
|
// auto period = 1000000000;
|
||||||
@ -376,8 +382,8 @@ TEST_CASE("Chiptestboard Loading Patterns", "[.ctbintegration]") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("Chiptestboard Dbit offset, list, sampling, advinvert",
|
|
||||||
"[.ctbintegration][dbit]") {
|
TEST_CASE("Chiptestboard Dbit offset, list, sampling, advinvert", "[.ctbintegration][dbit]") {
|
||||||
SingleDetectorConfig c;
|
SingleDetectorConfig c;
|
||||||
|
|
||||||
// pick up multi detector from shm id 0
|
// pick up multi detector from shm id 0
|
||||||
@ -444,20 +450,17 @@ TEST_CASE("Chiptestboard Dbit offset, list, sampling, advinvert",
|
|||||||
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",
|
TEST_CASE("Eiger or Jungfrau startingfnum", "[.eigerintegration][.jungfrauintegration][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(
|
REQUIRE(((m.getDetectorTypeAsEnum() == slsDetectorDefs::detectorType::EIGER) || (m.getDetectorTypeAsEnum() == slsDetectorDefs::detectorType::JUNGFRAU)));
|
||||||
((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);
|
||||||
@ -495,8 +498,7 @@ TEST_CASE("Eiger readnlines", "[.eigerintegration][readnlines]") {
|
|||||||
DetectorImpl m(0);
|
DetectorImpl m(0);
|
||||||
|
|
||||||
// ensure detector type, hostname
|
// ensure detector type, hostname
|
||||||
REQUIRE(
|
REQUIRE((m.getDetectorTypeAsEnum() == slsDetectorDefs::detectorType::EIGER));
|
||||||
(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
Normal file → Executable file
6
integrationTests/test-integrationMulti.cpp
Normal file → Executable file
@ -1,5 +1,5 @@
|
|||||||
#include "DetectorImpl.h"
|
|
||||||
#include "catch.hpp"
|
#include "catch.hpp"
|
||||||
|
#include "DetectorImpl.h"
|
||||||
#include "string_utils.h"
|
#include "string_utils.h"
|
||||||
#include "tests/globals.h"
|
#include "tests/globals.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@ -24,6 +24,8 @@ 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);
|
||||||
@ -55,6 +57,7 @@ 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,
|
||||||
@ -75,6 +78,7 @@ 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);
|
||||||
|
@ -176,7 +176,6 @@ One can configure all the detector settings in a parameter file {\tt{setup.det}}
|
|||||||
\begin{verbatim}
|
\begin{verbatim}
|
||||||
sls_detector_put 0-parameters setup.det
|
sls_detector_put 0-parameters setup.det
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
Note that the parameter file for any realease before 4.1.1 has not the possibility to understand parameters to be set differently for different half modules, i.e. {\tt{0:txndelay\_left xxxxx},\tt{1:txndelay\_left yyyyy}}.
|
|
||||||
|
|
||||||
In the case of \E, the proper bias voltage of the sensor has to be setup, i.e. the {\tt{setup.det}} file needs to contain the line {\tt{vhighvoltage 150}}. Other detector functionality, which are rarely changed can be setup here.
|
In the case of \E, the proper bias voltage of the sensor has to be setup, i.e. the {\tt{setup.det}} file needs to contain the line {\tt{vhighvoltage 150}}. Other detector functionality, which are rarely changed can be setup here.
|
||||||
Other important settings that are configured in the {\tt{setup.det}} file are:
|
Other important settings that are configured in the {\tt{setup.det}} file are:
|
||||||
@ -610,19 +609,18 @@ The detector can be setup such to receive external triggers. Connect a LEMO sign
|
|||||||
\begin{verbatim}
|
\begin{verbatim}
|
||||||
sls_detector_put 0-timing [auto/trigger/burst_trigger/gating]
|
sls_detector_put 0-timing [auto/trigger/burst_trigger/gating]
|
||||||
sls_detector_put 0-frames x
|
sls_detector_put 0-frames x
|
||||||
sls_detector_put 0-cycles y
|
sls_detector_put 0-triggers y
|
||||||
sls_detector_acquire 0-
|
sls_detector_acquire 0-
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
No timeout is expected between the start of the acquisition and the arrival of the first trigger.
|
No timeout is expected between the start of the acquisition and the arrival of the first trigger.
|
||||||
|
|
||||||
Here are the implemented options so far:
|
Here are the implemented options so far:
|
||||||
\begin{itemize}
|
\begin{itemize}
|
||||||
\item {\tt{auto}} is the software controlled acquisition (does not use triggers), where {\tt{exptime}} and {\tt{period}} have to be set. Set number of cycles (i.e. triggers) to 1 using {\tt{cycles}}. Set number of frames using {\tt{frames}}.
|
\item {\tt{auto}} is the software controlled acquisition (does not use triggers), where {\tt{exptime}} and {\tt{period}} have to be set. Set number of triggers (i.e. triggers) to 1 using {\tt{triggers}}. Set number of frames using {\tt{frames}}.
|
||||||
\item {\tt{trigger}} 1 frame taken for 1 trigger. Your {\tt{frames}} needs to be 1 always, {\tt{cycles}} can be changed and defines how many triggers are considered. {\tt{exptime}} needs to be set. In the GUI this is called trigger exposure series.
|
\item {\tt{trigger}} 1 frame taken for 1 trigger. Your {\tt{frames}} needs to be 1 always, {\tt{triggers}} can be changed and defines how many triggers are considered. {\tt{exptime}} needs to be set. In the GUI this is called trigger exposure series.
|
||||||
\item {\tt{burst\_trigger}} gets only 1 trigger, but allows to take many frames. With {\tt{frames}} one can change the number of frames. {\tt{cycles}} needs to be 1. {\tt{exptime}} and {\tt{period}} have to be set. In the gui it is called trigger readout.
|
\item {\tt{burst\_trigger}} gets only 1 trigger, but allows to take many frames. With {\tt{frames}} one can change the number of frames. {\tt{triggers}} needs to be 1. {\tt{exptime}} and {\tt{period}} have to be set. In the gui it is called trigger readout.
|
||||||
\item{\tt{gating}} allows to get a frame only when the trigger pulse is gating. Note that in this case the exp time and period only depend on the gating signal. {\tt{cycles}} allows to select how many gates to consider. Set number of frames to 1 using {\tt{frames}}. IMPORTANT: Up to firmware 23, the last subframe is oblige to finish being taken, despite the gate signal going down. This will be configurable from later fw and software version. Also, in gating mode, due to timimg of the state machine, you need to leave 500~$\mu$s deadtime between the end on an acquisition and the next. This is as the state machine is unable to check for changes in the status in the first 500~$\mu$s. ATTENTION: if you are in 16 bit mode and you are applying online rate corrections, as now the exptime is generated by the trigger, you might not have correct rate corrections. If you know what the exposure time is in the gating signal, then you can set the {\tt{exptime}} once and the rate corrections will be correct. In 32 bit mode, it does not matter as the rate corrections depends on the {\tt{subexptime}} which is software set independently from the gate exptime.
|
\item{\tt{gating}} allows to get a frame only when the trigger pulse is gating. Note that in this case the exp time and period only depend on the gating signal. {\tt{triggers}} allows to select how many gates to consider. Set number of frames to 1 using {\tt{frames}}. IMPORTANT: Up to firmware 23, the last subframe is oblige to finish being taken, despite the gate signal going down. This will be configurable from later fw and software version. Also, in gating mode, due to timimg of the state machine, you need to leave 500~$\mu$s deadtime between the end on an acquisition and the next. This is as the state machine is unable to check for changes in the status in the first 500~$\mu$s. ATTENTION: if you are in 16 bit mode and you are applying online rate corrections, as now the exptime is generated by the trigger, you might not have correct rate corrections. If you know what the exposure time is in the gating signal, then you can set the {\tt{exptime}} once and the rate corrections will be correct. In 32 bit mode, it does not matter as the rate corrections depends on the {\tt{subexptime}} which is software set independently from the gate exptime.
|
||||||
|
|
||||||
ATTENTION: From release 4.1.1 with the {\tt{trigger}} option it is possible to have software triggers as a debugging tool (instead of the hardware trigger signal. One should start the acquisition (with the blocking {\tt{sls\_detector\_acquire}} if wanted and with another client one can send the softare trigger {\tt{sls\_detector\_put status trigger}}. This option allows for example to perform a motor scan (moving a motor in between single images) and still writing all images to the same file.
|
|
||||||
When using 32-bit mode, by default the acquisition ends the last complete subframe that was started when still the acquisition time was valid. This has been chosen as many people wants to know the exact acquisition time for when the detector was taking data and also, if {\tt{ratecorr}} are active, the last subframe will be correctly corrected, while otherwise it will be corrected with a wrong subdeadtime.
|
When using 32-bit mode, by default the acquisition ends the last complete subframe that was started when still the acquisition time was valid. This has been chosen as many people wants to know the exact acquisition time for when the detector was taking data and also, if {\tt{ratecorr}} are active, the last subframe will be correctly corrected, while otherwise it will be corrected with a wrong subdeadtime.
|
||||||
However, from 4.1.0, in gating mode, an option to immediately terminate the subframe when the gate signal goes down it is implemented to stop the acquisition at the same time. This option is {\tt{./sls\_detector\_put interruptsubframe 1}} while the default option is {\tt{./sls\_detector\_put interruptsubframe 0}}.
|
However, from 4.1.0, in gating mode, an option to immediately terminate the subframe when the gate signal goes down it is implemented to stop the acquisition at the same time. This option is {\tt{./sls\_detector\_put interruptsubframe 1}} while the default option is {\tt{./sls\_detector\_put interruptsubframe 0}}.
|
||||||
|
|
||||||
@ -630,13 +628,13 @@ However, from 4.1.0, in gating mode, an option to immediately terminate the subf
|
|||||||
|
|
||||||
Hardware-wise, the ENABLE OUT signal outputs when the chips are really acquiring. This means that the single subframes will be output in 32 bit mode. The TRIGGER OUT outputs the sum-up-signal at the moment (which is useless). This will be changed in the future to output the envelop of the enable signal.
|
Hardware-wise, the ENABLE OUT signal outputs when the chips are really acquiring. This means that the single subframes will be output in 32 bit mode. The TRIGGER OUT outputs the sum-up-signal at the moment (which is useless). This will be changed in the future to output the envelop of the enable signal.
|
||||||
|
|
||||||
We are planning to change some functionality, i.e. unify the {\tt{trigger}} and {\tt{burst\_trigger}} trigger modes and make both {\tt{frames}} and {\tt{cycles}} configurable at the same time.
|
We are planning to change some functionality, i.e. unify the {\tt{trigger}} and {\tt{burst\_trigger}} trigger modes and make both {\tt{frames}} and {\tt{triggers}} configurable at the same time.
|
||||||
|
|
||||||
There is the possibility to use {\tt{timing trigger/burst\_trigger}} and send software single commands to fake the trigger. This is done with:
|
There is the possibility to use {\tt{timing trigger/burst\_trigger}} and send software single commands to fake the trigger. This is done with:
|
||||||
\begin{verbatim}
|
\begin{verbatim}
|
||||||
sls_detector_put 0-timing [trigger/burst_trigger]
|
sls_detector_put 0-timing [trigger/burst_trigger]
|
||||||
sls_detector_put 0-frames x
|
sls_detector_put 0-frames x
|
||||||
sls_detector_put 0-cycles y
|
sls_detector_put 0-triggers y
|
||||||
sls_detector_status trigger
|
sls_detector_status trigger
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
Note that this functionality is very (!) useful if you need to do something between and acquisition and the next. This can be used to do a fast threshold scan for example. See section~\ref{sec:fastthresholdscan}.
|
Note that this functionality is very (!) useful if you need to do something between and acquisition and the next. This can be used to do a fast threshold scan for example. See section~\ref{sec:fastthresholdscan}.
|
||||||
@ -717,7 +715,7 @@ If \textbf{dr} is 32 and \textbf{clkdivider} is not 2, whatever the detector get
|
|||||||
Here is a list of parameters that should be reset:
|
Here is a list of parameters that should be reset:
|
||||||
\begin{enumerate}
|
\begin{enumerate}
|
||||||
\item \textbf{resetframescaught} should be reset to zero after every acquisition taken with {\tt{receiver start}},{\tt{status start}},{\tt{receiver stop}}. If the acquisition is taken with {\tt{sls\_detector\_acquire}}, there is no need to reset this.
|
\item \textbf{resetframescaught} should be reset to zero after every acquisition taken with {\tt{receiver start}},{\tt{status start}},{\tt{receiver stop}}. If the acquisition is taken with {\tt{sls\_detector\_acquire}}, there is no need to reset this.
|
||||||
\item After changing the {\tt{timing}} mode of the detector, one should reset to '1' the unused value, in that specific timing mode, between \textbf{frames} and \textbf{cycles}. See section~\ref{triggering} for how to use the timing. At the present moment the detector will acquire more frames than planned if the variable not used between \textbf{frames} and \textbf{cycles} is not reset. In future releases, the unused variable will be ignored. Still resetting is a good practice.
|
\item After changing the {\tt{timing}} mode of the detector, one should reset to '1' the unused value, in that specific timing mode, between \textbf{frames} and \textbf{triggers}. See section~\ref{triggering} for how to use the timing. At the present moment the detector will acquire more frames than planned if the variable not used between \textbf{frames} and \textbf{triggers} is not reset. In future releases, the unused variable will be ignored. Still resetting is a good practice.
|
||||||
|
|
||||||
\end{enumerate}
|
\end{enumerate}
|
||||||
|
|
||||||
@ -990,14 +988,13 @@ Packets Caught Mask : 64 bytes
|
|||||||
Note that if one wants to reconstruct the real time the detector was acquiring in 32 bit (autosumming mode), one would have to multiply the SubExptime (ns) for the SubFrame Number.
|
Note that if one wants to reconstruct the real time the detector was acquiring in 32 bit (autosumming mode), one would have to multiply the SubExptime (ns) for the SubFrame Number.
|
||||||
|
|
||||||
\subsection{Offline image reconstruction}
|
\subsection{Offline image reconstruction}
|
||||||
The offline image reconstruction{\tt{slsImageReconstruction}} is not part of the package anymore. However, it can be retrieved from \\
|
The offline image reconstruction{\tt{slsImageReconstruction}} is not part of the package anymore. The code is still available doing \\
|
||||||
{\tt{git clone https://github.com/slsdetectorgroup/slsImageReconstruction.git slsImageReconstruction}}.\\
|
{\tt{git clone git@git.psi.ch:sls\_detectors\_software/sls\_image\_reconstruction.git slsImageReconstruction}}.
|
||||||
Checkout the {\tt{v3.1}} branch if in a 3.1.X release, the {\tt{v4.0.0}} branch if in 4.0.X release, or the {\tt{v4.1}} branch if in 4.1.X release of the {\tt{slsDetector}} code. There is a {\tt{developer}} branch that has newer updates but needs to be tested.
|
Checkout the {\tt{developer}} branch if in a 3.1.X release, the {\tt{v4.0.0}} branch if in 4.0.X release, or the {\tt{v4.1}} branch if in 4.1.X release of the {\tt{slsDetector}} code.
|
||||||
|
|
||||||
Three possible conversions are possible: into \textbf{cbf}, \textbf{hdf5}. \textbf{tiff} and \textbf{root} format. The detector writes 2 raw files per receiver. An offline image reconstruction executable has been written to collate the possible files together and produce output files. By default an interpolation between the values of the large pixels is performed. Gap pixels between modules are also inserted.
|
Three possible conversions are possible: into \textbf{cbf}, \textbf{hdf5} and \textbf{root} format. The detector writes 4 raw files per receiver. An offline image reconstruction executable has been written to collate the possible files together and produce output files. By default an interpolation between the values of the large pixels is performed. Gap pixels between modules are also inserted.
|
||||||
|
|
||||||
Note that the number of images per file in the 3.1.X release is hardcoded and needs to match whatever you are using in \\
|
Note that the number of images per file in the 3.1.X release is hardcoded and needs to match whatever you are using in {\tt{slsDetectorsPackage/slsReceiverSoftware/include/sls\_receiver\_defs.h}}:
|
||||||
{\tt{slsDetectorsPackage/slsReceiverSoftware/include/sls\_receiver\_defs.h}}:
|
|
||||||
\begin{verbatim}
|
\begin{verbatim}
|
||||||
#define EIGER_MAX_FRAMES_PER_FILE 2000
|
#define EIGER_MAX_FRAMES_PER_FILE 2000
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
@ -1046,12 +1043,11 @@ cbfMaker9M [file_name_with_dir]
|
|||||||
contain the hardcoded geometry for the 1.5M (3 modules horizontal on the long side), the 1.5M OMNY geometry (3 modules next to each other on the long side) and for the 9M at cSAXS: 6(short side)$\times$3 (long side) modules.\\
|
contain the hardcoded geometry for the 1.5M (3 modules horizontal on the long side), the 1.5M OMNY geometry (3 modules next to each other on the long side) and for the 9M at cSAXS: 6(short side)$\times$3 (long side) modules.\\
|
||||||
Missing packets in a frame and border pixels ($\times 2$ and $\times 4$ are given with value $-1$ at the present time.
|
Missing packets in a frame and border pixels ($\times 2$ and $\times 4$ are given with value $-1$ at the present time.
|
||||||
|
|
||||||
From the new {{v4.1.1}} all the define that you see below need only to be modified in the Makefile.
|
|
||||||
|
|
||||||
Make sure the following options are uncommented in the {\tt{slsImageReconstruction/src/main\_csaxs.cpp}} file.
|
Make sure the following options are uncommented in the {\tt{slsImageReconstruction/src/main\_csaxs.cpp}} file.
|
||||||
\begin{verbatim}
|
\begin{verbatim}
|
||||||
#define MYCBF
|
#define MYCBF
|
||||||
##following line only if you need to process with BUBBLE
|
##following line only if you need to process with
|
||||||
|
##BUBBLE (Material Science / uXAS beamlines).
|
||||||
#define MSHeader
|
#define MSHeader
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
Compile it with:
|
Compile it with:
|
||||||
@ -1100,10 +1096,6 @@ To use it any geometry:\\
|
|||||||
eg.
|
eg.
|
||||||
{\tt image /scratch/run\_63\_d0\_f000000000000\_3.raw 3072 512 1 2 ``Eiger'' 0}.\\
|
{\tt image /scratch/run\_63\_d0\_f000000000000\_3.raw 3072 512 1 2 ``Eiger'' 0}.\\
|
||||||
|
|
||||||
With new new software, the new options to run the cbfMaker/hdf5Maker executablesare:
|
|
||||||
|
|
||||||
./hdf5Maker -f [filename] -d [outdirname] -x [npix\_x] -y [npix\_y] -v (v flags that longedge is vertical, no argument) -n [name\_of\_hdf5\_dataset] -m (mask\_hot\_pixels, need to be in file maskpix.txt in the samedir as executable, no argument) -g [0,no filling/1,division/2,interpolation/3,interpolate,alternative]
|
|
||||||
|
|
||||||
\subsection{Read temperatures/HV from boards}
|
\subsection{Read temperatures/HV from boards}
|
||||||
|
|
||||||
With an updated kernel on the linux boards (ask to the SLS detector group for specifications), it is possible to monitor the temperature on the boards:
|
With an updated kernel on the linux boards (ask to the SLS detector group for specifications), it is possible to monitor the temperature on the boards:
|
||||||
@ -1265,7 +1257,7 @@ We have also been requested if we could speed up the threshold scan. At the mome
|
|||||||
./sls_detector_put enablefwrite 0
|
./sls_detector_put enablefwrite 0
|
||||||
./sls_detector_put resetframescaught 0
|
./sls_detector_put resetframescaught 0
|
||||||
./sls_detector_put index 0
|
./sls_detector_put index 0
|
||||||
./sls_detector_put cycles 21
|
./sls_detector_put triggers 21
|
||||||
./sls_detector_put receiver start
|
./sls_detector_put receiver start
|
||||||
./sls_detector_put status start
|
./sls_detector_put status start
|
||||||
for i in $(seq 0 20);
|
for i in $(seq 0 20);
|
||||||
@ -1523,8 +1515,8 @@ frames number
|
|||||||
where {\tt{number}} is a string to be interpreted as an integer.
|
where {\tt{number}} is a string to be interpreted as an integer.
|
||||||
|
|
||||||
\item \begin{verbatim}
|
\item \begin{verbatim}
|
||||||
sls_detector_get cycles
|
sls_detector_get triggers
|
||||||
cycles number
|
triggers number
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
where {\tt{number}} is a string to be interpreted as an integer.
|
where {\tt{number}} is a string to be interpreted as an integer.
|
||||||
|
|
||||||
|
@ -1,82 +0,0 @@
|
|||||||
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
|
|
@ -1,89 +0,0 @@
|
|||||||
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
|
|
@ -3,9 +3,9 @@ import sys
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
sys.path.append(os.path.join(os.getcwd(), 'bin'))
|
sys.path.append(os.path.join(os.getcwd(), 'bin'))
|
||||||
|
|
||||||
from slsdet import Detector, Mythen3, Eiger, Jungfrau, DetectorDacs, Dac, Ctb
|
from sls_detector import Detector, Mythen3, Eiger, Jungfrau, DetectorDacs, Dac, Ctb
|
||||||
from slsdet import dacIndex, readoutMode
|
from sls_detector import dacIndex, readoutMode
|
||||||
from slsdet.lookup import view, find
|
from sls_detector.lookup import view, find
|
||||||
|
|
||||||
d = Detector()
|
d = Detector()
|
||||||
# e = Eiger()
|
# e = Eiger()
|
||||||
|
@ -4,18 +4,17 @@ out = subprocess.run(['g', 'list'], stdout = subprocess.PIPE, encoding=locale.ge
|
|||||||
cmd = out.stdout.splitlines()
|
cmd = out.stdout.splitlines()
|
||||||
cmd.pop(0)
|
cmd.pop(0)
|
||||||
|
|
||||||
from slsdet import Detector, Eiger, Ctb
|
from sls_detector import Detector, Eiger, Ctb
|
||||||
|
|
||||||
pycmd = dir(Detector)+dir(Eiger)+dir(Ctb)
|
pycmd = dir(Detector)+dir(Eiger)+dir(Ctb)
|
||||||
|
|
||||||
#Add commands that we should not expect as direct commands in python
|
|
||||||
pycmd += ['vrf', 'vtr', 'vrs', 'vtgstv', 'vsvn', 'vtrim',
|
pycmd += ['vrf', 'vtr', 'vrs', 'vtgstv', 'vsvn', 'vtrim',
|
||||||
'vsvp', 'vth1', 'vth2', 'vth3', 'vshaper', 'vshaperneg', 'rxb_rb',
|
'vsvp', 'vth1', 'vth2', 'vth3', 'vshaper', 'vshaperneg', 'rxb_rb',
|
||||||
'rxb_lb', 'vref_prech', 'vref_rstore', 'vref_cds',
|
'rxb_lb', 'vref_prech', 'vref_rstore', 'vref_cds',
|
||||||
'vpreamp', 'vref_comp', 'vref_comp_fe vref_ds', 'vref_h_adc',
|
'vpreamp', 'vref_comp', 'vref_comp_fe vref_ds', 'vref_h_adc',
|
||||||
'vref_l_adc', 'iodelay', 'list', 'vref_ds', 'vis', 'vpl',
|
'vref_l_adc', 'iodelay', 'list', 'vref_ds', 'vis', 'vpl',
|
||||||
'vref_comp_fe', 'vph', 'vout_cm', 'vcp', 'vcn', 'vcmp_ll', 'vcmp_lr'
|
'vref_comp_fe', 'vph', 'vout_cm', 'vcp', 'vcn', 'vcmp_ll', 'vcmp_lr'
|
||||||
, 'vcmp_rl', 'vcmp_rr', 'daclist', 'dacvalues', 'vcal', 'vcas']
|
, 'vcmp_rl', 'vcmp_rr']
|
||||||
|
|
||||||
missing = []
|
missing = []
|
||||||
for c in cmd:
|
for c in cmd:
|
||||||
|
@ -11,10 +11,6 @@ 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 = {}
|
||||||
@ -22,15 +18,8 @@ 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,13 +18,7 @@ fpath = "../../slsDetectorSoftware/src/Detector.cpp"
|
|||||||
|
|
||||||
|
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument(
|
parser.add_argument("-p", "--build_path", help="Path to the build database", type = str, default=default_build_path)
|
||||||
"-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)
|
||||||
@ -32,7 +26,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
|
||||||
|
|
||||||
@ -45,9 +39,6 @@ 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()]
|
||||||
@ -55,25 +46,9 @@ 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
|
||||||
|
|
||||||
|
|
||||||
@ -87,37 +62,23 @@ def visit(node):
|
|||||||
):
|
):
|
||||||
m.append(child)
|
m.append(child)
|
||||||
args = get_arguments(child)
|
args = get_arguments(child)
|
||||||
fs = get_fdec(child)
|
lines.append(f'.def(\"{child.spelling}\", &Detector::{child.spelling}{args})')
|
||||||
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'])
|
||||||
|
|
31
python/scripts/list_tested_cmd.py
Executable file → Normal file
31
python/scripts/list_tested_cmd.py
Executable file → Normal file
@ -1,19 +1,11 @@
|
|||||||
"""
|
|
||||||
Utility to find and list which command line functions have tests and
|
|
||||||
where the tests are located
|
|
||||||
"""
|
|
||||||
#local import for for parsing c++
|
|
||||||
import parse
|
import parse
|
||||||
|
from pathlib import Path
|
||||||
#General python stuff
|
|
||||||
import os
|
import os
|
||||||
import locale
|
import locale
|
||||||
import argparse
|
import argparse
|
||||||
import subprocess
|
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
#Realative path from this dir
|
|
||||||
path = Path('../../slsDetectorSoftware/tests/')
|
path = Path('../../slsDetectorSoftware/tests/')
|
||||||
|
import subprocess
|
||||||
|
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument("-s", "--startswith", help="for filter", type = str, default=None)
|
parser.add_argument("-s", "--startswith", help="for filter", type = str, default=None)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
@ -23,12 +15,15 @@ tested = []
|
|||||||
for fname in files:
|
for fname in files:
|
||||||
with open(path/fname) as f:
|
with open(path/fname) as f:
|
||||||
data = f.read()
|
data = f.read()
|
||||||
|
|
||||||
data = parse.remove_comments(data)
|
data = parse.remove_comments(data)
|
||||||
data = data.splitlines()
|
data = data.splitlines()
|
||||||
|
|
||||||
|
|
||||||
for line in data:
|
for line in data:
|
||||||
if 'TEST_CASE' in line or 'SECTION' in line:
|
if 'TEST_CASE' in line or 'SECTION' in line:
|
||||||
cmd = line.split("\"")[1]
|
cmd = line.split("\"")[1]
|
||||||
tested.append([cmd, fname])
|
tested.append(cmd)
|
||||||
|
|
||||||
out = subprocess.run(['g', 'list'], stdout = subprocess.PIPE, encoding=locale.getpreferredencoding())
|
out = subprocess.run(['g', 'list'], stdout = subprocess.PIPE, encoding=locale.getpreferredencoding())
|
||||||
all_cmd = out.stdout.splitlines()
|
all_cmd = out.stdout.splitlines()
|
||||||
@ -38,18 +33,18 @@ all_cmd.pop(0)
|
|||||||
|
|
||||||
if args.startswith is not None:
|
if args.startswith is not None:
|
||||||
all_cmd = [cmd for cmd in all_cmd if cmd.startswith(args.startswith)]
|
all_cmd = [cmd for cmd in all_cmd if cmd.startswith(args.startswith)]
|
||||||
tested = [cmd for cmd in tested if cmd[0].startswith(args.startswith)]
|
tested = [cmd for cmd in tested if cmd.startswith(args.startswith)]
|
||||||
|
|
||||||
tn = [cmd[0] for cmd in tested]
|
|
||||||
|
|
||||||
not_tested = [cmd for cmd in all_cmd if cmd not in tn]
|
|
||||||
misnamed = [cmd for cmd in tn if cmd not in all_cmd]
|
not_tested = [cmd for cmd in all_cmd if cmd not in tested]
|
||||||
tested = [cmd for cmd in tested if cmd[0] in all_cmd]
|
misnamed = [cmd for cmd in tested if cmd not in all_cmd]
|
||||||
|
tested = [cmd for cmd in tested if cmd in all_cmd]
|
||||||
|
|
||||||
|
|
||||||
print("\nThe following commands are tested:")
|
print("\nThe following commands are tested:")
|
||||||
for cmd in tested:
|
for cmd in tested:
|
||||||
print(f'{cmd[0]:>18} : {cmd[1]}')
|
print(cmd)
|
||||||
|
|
||||||
print("\nThe following commands are NOT tested:")
|
print("\nThe following commands are NOT tested:")
|
||||||
for cmd in not_tested:
|
for cmd in not_tested:
|
||||||
|
@ -8,7 +8,7 @@ import sys
|
|||||||
import setuptools
|
import setuptools
|
||||||
import os
|
import os
|
||||||
|
|
||||||
__version__ = os.environ.get('GIT_DESCRIBE_TAG', 'developer')
|
__version__ = 'udp'
|
||||||
|
|
||||||
|
|
||||||
def get_conda_path():
|
def get_conda_path():
|
||||||
@ -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'),
|
os.path.join(get_conda_path(), 'include/slsDetectorPackage'),
|
||||||
|
|
||||||
],
|
],
|
||||||
libraries=['SlsDetector', 'SlsReceiver', 'zmq'],
|
libraries=['SlsDetector', 'SlsReceiver', 'zmq'],
|
||||||
|
@ -1,29 +1,23 @@
|
|||||||
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, reduce_time, is_iterable
|
from .utils import Geometry, to_geo, element
|
||||||
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 key in dir(self):
|
if self._frozen and not hasattr(self, key):
|
||||||
raise AttributeError(
|
raise AttributeError(
|
||||||
"Class {} is frozen. Cannot set {} = {}".format(
|
"Class {} is frozen. Cannot set {} = {}".format(
|
||||||
cls.__name__, key, value
|
cls.__name__, key, value
|
||||||
@ -63,16 +57,23 @@ 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__, self.getShmId())
|
return '{}(id = {})'.format(self.__class__.__name__,
|
||||||
|
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")
|
||||||
@ -160,48 +161,58 @@ 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 reduce_time(res)
|
return element_if_equal([it.total_seconds() for it in res])
|
||||||
|
|
||||||
@exptime.setter
|
@exptime.setter
|
||||||
def exptime(self, t):
|
def exptime(self, t):
|
||||||
self.setExptime(ut.make_timedelta(t))
|
if isinstance(t, dt.timedelta):
|
||||||
|
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 reduce_time(res)
|
return element_if_equal([it.total_seconds() for it in res])
|
||||||
|
|
||||||
@period.setter
|
@period.setter
|
||||||
def period(self, t):
|
def period(self, t):
|
||||||
self.setPeriod(ut.make_timedelta(t))
|
if isinstance(t, dt.timedelta):
|
||||||
|
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
|
||||||
@ -209,6 +220,7 @@ 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())
|
||||||
@ -216,6 +228,9 @@ 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
|
||||||
@ -282,17 +297,10 @@ 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())
|
||||||
@ -407,15 +415,14 @@ 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):
|
||||||
if ip == "auto":
|
self.getDestinationUDPIP(ip)
|
||||||
ip = socket.gethostbyname(self.rx_hostname)
|
|
||||||
self.setDestinationUDPIP(IpAddr(ip))
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def udp_dstip2(self):
|
def udp_dstip2(self):
|
||||||
@ -423,9 +430,7 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@udp_dstip2.setter
|
@udp_dstip2.setter
|
||||||
def udp_dstip2(self, ip):
|
def udp_dstip2(self, ip):
|
||||||
if ip == "auto":
|
self.getDestinationUDPIP2(ip)
|
||||||
ip = socket.gethostbyname(self.rx_hostname)
|
|
||||||
self.setDestinationUDPIP2(IpAddr(ip))
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def udp_dstmac(self):
|
def udp_dstmac(self):
|
||||||
@ -433,7 +438,7 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@udp_dstmac.setter
|
@udp_dstmac.setter
|
||||||
def udp_dstmac(self, mac):
|
def udp_dstmac(self, mac):
|
||||||
self.setDestinationUDPMAC(MacAddr(mac))
|
self.getDestinationUDPMAC2(mac)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def udp_dstmac2(self):
|
def udp_dstmac2(self):
|
||||||
@ -441,7 +446,8 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@udp_dstmac2.setter
|
@udp_dstmac2.setter
|
||||||
def udp_dstmac2(self, mac):
|
def udp_dstmac2(self, mac):
|
||||||
self.setDestinationUDPMAC2(MacAddr(mac))
|
self.getDestinationUDPMAC2(mac)
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def udp_srcip(self):
|
def udp_srcip(self):
|
||||||
@ -449,7 +455,7 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@udp_srcip.setter
|
@udp_srcip.setter
|
||||||
def udp_srcip(self, ip):
|
def udp_srcip(self, ip):
|
||||||
self.setSourceUDPIP(IpAddr(ip))
|
self.setSourceUDPIP(ip)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def udp_srcip2(self):
|
def udp_srcip2(self):
|
||||||
@ -481,7 +487,7 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@src_udpmac.setter
|
@src_udpmac.setter
|
||||||
def src_udpmac(self, mac):
|
def src_udpmac(self, mac):
|
||||||
self.setSourceUDPMAC(MacAddr(mac))
|
self.setSourceUDPMAC(mac)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def src_udpip2(self):
|
def src_udpip2(self):
|
||||||
@ -489,7 +495,7 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@src_udpip2.setter
|
@src_udpip2.setter
|
||||||
def src_udpip2(self, ip):
|
def src_udpip2(self, ip):
|
||||||
self.setSourceUDPIP(IpAddr(ip))
|
self.setSourceUDPIP(ip)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def src_udpip(self):
|
def src_udpip(self):
|
||||||
@ -497,7 +503,8 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@src_udpip.setter
|
@src_udpip.setter
|
||||||
def src_udpip(self, ip):
|
def src_udpip(self, ip):
|
||||||
self.setSourceUDPIP(IpAddr(ip))
|
self.setSourceUDPIP(ip)
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def src_udpmac2(self):
|
def src_udpmac2(self):
|
||||||
@ -505,7 +512,7 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@src_udpmac2.setter
|
@src_udpmac2.setter
|
||||||
def src_udpmac2(self, mac):
|
def src_udpmac2(self, mac):
|
||||||
self.setSourceUDPMAC2(MacAddr(mac))
|
self.setSourceUDPMAC2(mac)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def vhighvoltage(self):
|
def vhighvoltage(self):
|
||||||
@ -535,6 +542,8 @@ 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())
|
||||||
@ -549,7 +558,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):
|
||||||
@ -583,6 +592,7 @@ 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())
|
||||||
@ -641,6 +651,8 @@ 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())
|
||||||
@ -653,27 +665,10 @@ 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())
|
||||||
@ -732,6 +727,7 @@ 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())
|
||||||
@ -740,116 +736,11 @@ 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()
|
||||||
@ -859,6 +750,7 @@ 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))
|
||||||
@ -1066,6 +958,7 @@ 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))
|
||||||
@ -1114,6 +1007,7 @@ 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):
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
from .detector import Detector
|
from .detector import Detector
|
||||||
|
|
||||||
def view(name, det = Detector):
|
def view(name):
|
||||||
names = find(name, det)
|
names = find(name)
|
||||||
for n in names:
|
for n in names:
|
||||||
print(n)
|
print(n)
|
||||||
|
|
||||||
def find(name, det = Detector):
|
def find(name):
|
||||||
return [n for n in dir(det) if name.lower() in n.lower()]
|
return [n for n in dir(Detector) if name in n]
|
@ -7,17 +7,10 @@ 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
|
||||||
@ -48,9 +41,6 @@ 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
|
||||||
@ -59,15 +49,6 @@ 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
|
||||||
@ -88,8 +69,3 @@ 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,17 +8,10 @@
|
|||||||
#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,14 +65,38 @@ 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("INVERSION_ON",
|
.value("RO_TRIGGER_IN_RISING_EDGE",
|
||||||
slsDetectorDefs::externalSignalFlag::INVERSION_ON)
|
slsDetectorDefs::externalSignalFlag::RO_TRIGGER_IN_RISING_EDGE)
|
||||||
.value("INVERSION_OFF",
|
.value("RO_TRIGGER_IN_FALLING_EDGE",
|
||||||
slsDetectorDefs::externalSignalFlag::INVERSION_OFF)
|
slsDetectorDefs::externalSignalFlag::RO_TRIGGER_IN_FALLING_EDGE)
|
||||||
|
.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")
|
||||||
@ -82,9 +106,6 @@ 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")
|
||||||
@ -163,11 +184,6 @@ 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)
|
||||||
@ -208,18 +224,6 @@ 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)
|
||||||
@ -279,13 +283,5 @@ 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();
|
|
||||||
|
|
||||||
py::enum_<slsDetectorDefs::timingSourceType>(Defs, "timingSourceType")
|
|
||||||
.value("TIMING_INTERNAL",
|
|
||||||
slsDetectorDefs::timingSourceType::TIMING_INTERNAL)
|
|
||||||
.value(" TIMING_EXTERNAL",
|
|
||||||
slsDetectorDefs::timingSourceType::TIMING_EXTERNAL)
|
|
||||||
.export_values();
|
.export_values();
|
||||||
}
|
}
|
||||||
|
@ -15,11 +15,10 @@ using sls::IpAddr;
|
|||||||
using sls::MacAddr;
|
using sls::MacAddr;
|
||||||
void init_network(py::module &m) {
|
void init_network(py::module &m) {
|
||||||
|
|
||||||
py::class_ <IpAddr>(m, "IpAddr")
|
py::class_ <IpAddr> IpAddr(m, "IpAddr");
|
||||||
.def(py::init())
|
IpAddr.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)
|
||||||
@ -27,11 +26,10 @@ void init_network(py::module &m) {
|
|||||||
.def("str", &IpAddr::str);
|
.def("str", &IpAddr::str);
|
||||||
|
|
||||||
|
|
||||||
py::class_ <MacAddr>(m, "MacAddr")
|
py::class_ <MacAddr> MacAddr(m, "MacAddr");
|
||||||
.def(py::init())
|
MacAddr.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,28 +5,7 @@ Testing functions from utils.py
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from slsdet.utils import *
|
from sls_detector.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():
|
||||||
@ -81,16 +60,3 @@ 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)
|
|
@ -1,35 +1,36 @@
|
|||||||
add_executable(using_logger using_logger.cpp)
|
add_executable(a api.cpp)
|
||||||
target_link_libraries(using_logger
|
target_link_libraries(a
|
||||||
|
slsDetectorShared
|
||||||
slsSupportLib
|
slsSupportLib
|
||||||
pthread
|
pthread
|
||||||
rt
|
rt
|
||||||
)
|
)
|
||||||
|
|
||||||
set_target_properties(using_logger PROPERTIES
|
set_target_properties(a PROPERTIES
|
||||||
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
# add_executable(result useResult.cpp)
|
add_executable(result useResult.cpp)
|
||||||
# target_link_libraries(result
|
target_link_libraries(result
|
||||||
# slsDetectorShared
|
slsDetectorShared
|
||||||
# )
|
)
|
||||||
|
|
||||||
# set_target_properties(result PROPERTIES
|
set_target_properties(result PROPERTIES
|
||||||
# RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
||||||
# )
|
)
|
||||||
|
|
||||||
# add_executable(udp udp.cpp)
|
add_executable(udp udp.cpp)
|
||||||
# target_link_libraries(udp
|
target_link_libraries(udp
|
||||||
# slsDetectorShared
|
slsDetectorShared
|
||||||
# slsSupportLib
|
slsSupportLib
|
||||||
# pthread
|
pthread
|
||||||
# rt
|
rt
|
||||||
# fmt
|
fmt
|
||||||
# )
|
)
|
||||||
|
|
||||||
# set_target_properties(udp PROPERTIES
|
set_target_properties(udp PROPERTIES
|
||||||
# RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
||||||
# )
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,42 +0,0 @@
|
|||||||
#include "logger.h"
|
|
||||||
#include <iostream>
|
|
||||||
#include <chrono>
|
|
||||||
int main() {
|
|
||||||
|
|
||||||
//compare old and new
|
|
||||||
std::cout << "Compare output between old and new:\n";
|
|
||||||
LOG(logINFO) << "Some info message";
|
|
||||||
LOG(logERROR) << "This is an error";
|
|
||||||
LOG(logWARNING) << "While this is only a warning";
|
|
||||||
|
|
||||||
//Logging level can be configure at runtime
|
|
||||||
std::cout << "\n\n";
|
|
||||||
std::cout << "The default macro controlled level is: "
|
|
||||||
<< sls::Logger::ToString(LOG_MAX_REPORTING_LEVEL) << '\n';
|
|
||||||
|
|
||||||
sls::Logger::ReportingLevel() = logERROR;
|
|
||||||
LOG(logINFO) << "Now this is not written";
|
|
||||||
LOG(logWARNING) << "and also not this";
|
|
||||||
|
|
||||||
sls::Logger::ReportingLevel() = logINFO;
|
|
||||||
LOG(logINFO) << "But now we can see it";
|
|
||||||
|
|
||||||
|
|
||||||
//The output can be redirected to another buffer
|
|
||||||
std::ostringstream local;
|
|
||||||
auto clog_buff = std::clog.rdbuf();
|
|
||||||
std::clog.rdbuf(local.rdbuf());
|
|
||||||
|
|
||||||
LOG(logINFOBLUE) << "A message";
|
|
||||||
LOG(logWARNING) << "And another one";
|
|
||||||
|
|
||||||
std::clog.rdbuf(clog_buff); // restore
|
|
||||||
|
|
||||||
std::cout << "local buf:\n" << local.str();
|
|
||||||
|
|
||||||
LOG(logINFO) << "After reset we should print directly";
|
|
||||||
LOG(logINFOBLUE) << "some infoBLUE text";
|
|
||||||
LOG(logINFOGREEN) << "some infoGREEN text";
|
|
||||||
LOG(logINFORED) << "some infoRED text";
|
|
||||||
|
|
||||||
}
|
|
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) : n(nn), m_n(0), m_newM(0),m_newM2(0) {}
|
MovingStat(int nn=1000) : n(nn), m_n(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;
|
||||||
SetRMS(rms);
|
|
||||||
// cout << "set " << val << " " << m << " " << m_n << " " << m_newM << endl;
|
// cout << "set " << val << " " << m << " " << m_n << " " << m_newM << endl;
|
||||||
|
SetRMS(rms);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
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,15 +42,12 @@ class MovingStat
|
|||||||
void SetRMS(double rms)
|
void SetRMS(double rms)
|
||||||
{
|
{
|
||||||
if (rms<=0) {
|
if (rms<=0) {
|
||||||
if (m_n>0)
|
m_newM2=m_newM*m_newM/n;
|
||||||
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;
|
||||||
}
|
}
|
||||||
@ -105,8 +102,7 @@ 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;
|
||||||
}
|
}
|
||||||
@ -126,8 +122,6 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -144,7 +138,7 @@ class MovingStat
|
|||||||
*/
|
*/
|
||||||
inline double Variance() const
|
inline double Variance() const
|
||||||
{
|
{
|
||||||
return (m_n > 0) ? m_newM2/m_n-m_newM/m_n*m_newM/m_n : 0.0;
|
return ( (m_n > 1) ? (M2()-Mean()*Mean()) : 0.0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
/** returns the standard deviation, 0 if no elements are inside
|
/** returns the standard deviation, 0 if no elements are inside
|
||||||
@ -152,8 +146,7 @@ class MovingStat
|
|||||||
*/
|
*/
|
||||||
inline double StandardDeviation() const
|
inline double StandardDeviation() const
|
||||||
{
|
{
|
||||||
|
return ( (Variance() > 0) ? sqrt( Variance() ) : -1 );
|
||||||
return sqrt(Variance());//
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -68,15 +68,10 @@ 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];
|
||||||
/* pedMean[i]=new double[nx]; */
|
for (int ix=0; ix<nx; ix++) {
|
||||||
/* 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];
|
||||||
@ -100,16 +95,7 @@ template <class dataType> class analogDetector {
|
|||||||
/**
|
/**
|
||||||
destructor. Deletes the pdestalSubtraction array and the image
|
destructor. Deletes the pdestalSubtraction array and the image
|
||||||
*/
|
*/
|
||||||
virtual ~analogDetector() {
|
virtual ~analogDetector() {for (int i=0; i<ny; i++) delete [] stat[i]; delete [] stat; delete [] image;
|
||||||
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
|
||||||
@ -146,23 +132,16 @@ 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 (iy=0; iy<ny; ++iy) {
|
for (int iy=0; iy<ny; iy++) {
|
||||||
for (ix=0; ix<nx; ++ix) {
|
for (int 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];
|
||||||
@ -220,7 +199,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 &nnsx, int &nnsy){nnx=nx; nny=ny; nnsx=1; nnsy=1; return nx*ny;};
|
virtual int getImageSize(int &nnx, int &nny, int &nns){nnx=nx; nny=ny; nns=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
|
||||||
@ -252,8 +231,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 (iy=0; iy<nny; ++iy) {
|
for (int iy=0; iy<nny; iy++) {
|
||||||
for (ix=0; ix<nnx; ++ix) {
|
for (int 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] << " " ;
|
||||||
}
|
}
|
||||||
@ -272,8 +251,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 (iy=0; iy<ny; ++iy) {
|
for (int iy=0; iy<ny; iy++) {
|
||||||
for (ix=0; ix<nx; ++ix) {
|
for (int ix=0; ix<nx; ix++) {
|
||||||
gm[iy*nx+ix]=gmap[iy*nx+ix];
|
gm[iy*nx+ix]=gmap[iy*nx+ix];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -288,8 +267,8 @@ template <class dataType> class analogDetector {
|
|||||||
|
|
||||||
virtual void newDataSet(){
|
virtual void newDataSet(){
|
||||||
iframe=-1;
|
iframe=-1;
|
||||||
for (iy=0; iy<ny; ++iy)
|
for (int iy=0; iy<ny; iy++)
|
||||||
for (ix=0; ix<nx; ++ix) {
|
for (int ix=0; ix<nx; ix++) {
|
||||||
stat[iy][ix].Clear();
|
stat[iy][ix].Clear();
|
||||||
image[iy*nx+ix]=0;
|
image[iy*nx+ix]=0;
|
||||||
}
|
}
|
||||||
@ -306,14 +285,12 @@ 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(); det->newFrame();};
|
virtual void newFrame(){iframe++; if (cmSub) cmSub->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;
|
||||||
};
|
};
|
||||||
@ -382,8 +359,8 @@ template <class dataType> class analogDetector {
|
|||||||
// cout << "+"<< getId() << endl;
|
// cout << "+"<< getId() << endl;
|
||||||
if (cmSub) {
|
if (cmSub) {
|
||||||
//cout << "*" << endl;
|
//cout << "*" << endl;
|
||||||
for (iy=ymin; iy<ymax; ++iy) {
|
for (int iy=ymin; iy<ymax; iy++) {
|
||||||
for (ix=xmin; ix<xmax; ++ix) {
|
for (int 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);
|
||||||
@ -426,10 +403,8 @@ 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;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -447,7 +422,7 @@ 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()/g;//divide by gain?
|
return stat[iy][ix].getPedestalRMS()/g;//divide by gain?
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
@ -466,11 +441,10 @@ 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 (iy=0; iy<ny; ++iy) {
|
for (int ix=0; ix<nx; ix++) {
|
||||||
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] << " " ;
|
||||||
}
|
}
|
||||||
@ -485,11 +459,10 @@ 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 (iy=0; iy<ny; ++iy) {
|
for (int ix=0; ix<nx; ix++) {
|
||||||
for (ix=0; ix<nx; ++ix) {
|
|
||||||
ped[iy*nx+ix]=stat[iy][ix].getPedestalRMS();
|
ped[iy*nx+ix]=stat[iy][ix].getPedestalRMS();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -528,8 +501,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 (iy=ymin; iy<ymax; ++iy) {
|
for (int iy=ymin; iy<ymax; iy++) {
|
||||||
for (ix=xmin; ix<xmax; ++ix) {
|
for (int 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;
|
||||||
@ -558,8 +531,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 (iy=ymin; iy<ymax; ++iy) {
|
for (int iy=ymin; iy<ymax; iy++) {
|
||||||
for (ix=xmin; ix<xmax; ++ix) {
|
for (int ix=xmin; ix<xmax; ix++) {
|
||||||
stat[iy][ix].setPedestalRMS(rms[iy*nx+ix]);
|
stat[iy][ix].setPedestalRMS(rms[iy*nx+ix]);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -599,8 +572,8 @@ template <class dataType> class analogDetector {
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
gm=new float[nx*ny];
|
gm=new float[nx*ny];
|
||||||
for (iy=0; iy<ny; ++iy) {
|
for (int iy=0; iy<ny; iy++) {
|
||||||
for (ix=0; ix<nx; ++ix) {
|
for (int 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]);
|
||||||
@ -647,8 +620,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 (iy=0; iy<ny; ++iy) {
|
for (int iy=0; iy<ny; iy++) {
|
||||||
for (ix=0; ix<nx; ++ix) {
|
for (int 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 */
|
||||||
@ -694,15 +667,15 @@ template <class dataType> class analogDetector {
|
|||||||
|
|
||||||
|
|
||||||
if (gm) {
|
if (gm) {
|
||||||
for (iy=0; iy<nny; ++iy) {
|
for (int iy=0; iy<nny; iy++) {
|
||||||
for (ix=0; ix<nnx; ++ix) {
|
for (int 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 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -719,15 +692,15 @@ template <class dataType> class analogDetector {
|
|||||||
|
|
||||||
|
|
||||||
if (gm) {
|
if (gm) {
|
||||||
for (iy=0; iy<nny; ++iy) {
|
for (int iy=0; iy<nny; iy++) {
|
||||||
for (ix=0; ix<nnx; ++ix) {
|
for (int 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 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -745,8 +718,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 (iy=0; iy<ny; ++iy) {
|
for (int iy=0; iy<ny; iy++) {
|
||||||
for (ix=0; ix<nx; ++ix) {
|
for (int ix=0; ix<nx; ix++) {
|
||||||
gm[iy*nx+ix]=stat[iy][ix].getPedestalRMS();
|
gm[iy*nx+ix]=stat[iy][ix].getPedestalRMS();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -767,8 +740,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 (iy=0; iy<nny; ++iy) {
|
for (int iy=0; iy<nny; iy++) {
|
||||||
for (ix=0; ix<nnx; ++ix) {
|
for (int ix=0; ix<nnx; ix++) {
|
||||||
stat[iy][ix].setPedestalRMS(gm[iy*nx+ix]);
|
stat[iy][ix].setPedestalRMS(gm[iy*nx+ix]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -804,13 +777,11 @@ template <class dataType> class analogDetector {
|
|||||||
|
|
||||||
//cout << xmin << " " << xmax << endl;
|
//cout << xmin << " " << xmax << endl;
|
||||||
// cout << ymin << " " << ymax << endl;
|
// cout << ymin << " " << ymax << endl;
|
||||||
for (iy=ymin; iy<ymax; ++iy) {
|
for (int iy=ymin; iy<ymax; iy++) {
|
||||||
for (ix=xmin; ix<xmax; ++ix) {
|
for (int 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
|
||||||
@ -934,8 +905,8 @@ template <class dataType> class analogDetector {
|
|||||||
|
|
||||||
//calcGhost(data);
|
//calcGhost(data);
|
||||||
|
|
||||||
for (iy=ymin; iy<ymax; ++iy) {
|
for (int iy=ymin; iy<ymax; iy++) {
|
||||||
for (ix=xmin; ix<xmax; ++ix) {
|
for (int 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);
|
||||||
}
|
}
|
||||||
@ -981,8 +952,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; i++ix)
|
for (int iix=-4; iix<5; iix++)
|
||||||
for (int iiy=-4; iiy<5; i++iy) {
|
for (int iiy=-4; iiy<5; iiy++) {
|
||||||
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
|
||||||
@ -1076,8 +1047,8 @@ template <class dataType> class analogDetector {
|
|||||||
|
|
||||||
//calcGhost(data);
|
//calcGhost(data);
|
||||||
addToCommonMode(data);
|
addToCommonMode(data);
|
||||||
for (iy=ymin; iy<ymax; ++iy) {
|
for (int iy=ymin; iy<ymax; iy++) {
|
||||||
for (ix=xmin; ix<xmax; ++ix) {
|
for (int 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);
|
||||||
}
|
}
|
||||||
@ -1091,8 +1062,8 @@ template <class dataType> class analogDetector {
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
virtual void clearImage(){
|
virtual void clearImage(){
|
||||||
for (iy=0; iy<ny; ++iy) {
|
for (int iy=0; iy<ny; iy++) {
|
||||||
for (ix=0; ix<nx; ++ix) {
|
for (int ix=0; ix<nx; ix++) {
|
||||||
image[iy*nx+ix]=0;
|
image[iy*nx+ix]=0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1122,8 +1093,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();
|
||||||
};
|
};
|
||||||
@ -1158,8 +1129,8 @@ template <class dataType> class analogDetector {
|
|||||||
newFrame(data);
|
newFrame(data);
|
||||||
//calcGhost(data);
|
//calcGhost(data);
|
||||||
addToCommonMode(data);
|
addToCommonMode(data);
|
||||||
for (iy=ymi; iy<yma; ++iy)
|
for (int iy=ymi; iy<yma; iy++)
|
||||||
for (ix=xmi; ix<xma; ++ix)
|
for (int 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);
|
||||||
@ -1262,8 +1233,6 @@ 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 */
|
||||||
@ -1281,7 +1250,6 @@ 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
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
#ifndef DESERIALIZER_H
|
#ifndef DESERIALIZER_H
|
||||||
#define DESERIALIZER_H
|
#define DESERIALIZER_H
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "slsDetectorData.h"
|
|
||||||
|
|
||||||
class deserializer : public slsDetectorData<int> {
|
class deserializer : public slsDetectorData<int> {
|
||||||
|
|
||||||
@ -53,13 +52,7 @@ class deserializer : public slsDetectorData<int> {
|
|||||||
static int* deserializeAll(char *ptr, std::vector <int> dbl, int dr=24, int nch=64*3, int off=5) {
|
static int* deserializeAll(char *ptr, std::vector <int> dbl, int dr=24, int nch=64*3, int off=5) {
|
||||||
// off=0;
|
// off=0;
|
||||||
//int iarg;
|
//int iarg;
|
||||||
|
int64_t word, *wp;
|
||||||
|
|
||||||
cout <<"** deserializer: " << endl;
|
|
||||||
cout << "** Number of chans:\t" << nch << endl;
|
|
||||||
cout << "** Serial Offset:\t" << off << endl;
|
|
||||||
cout << "** Dynamic range:\t" << dr << endl;
|
|
||||||
int64_t word, *wp, ww,one=1, bit ;
|
|
||||||
int* val=new int[nch];
|
int* val=new int[nch];
|
||||||
int ioff=0;
|
int ioff=0;
|
||||||
int idr=0;
|
int idr=0;
|
||||||
@ -74,61 +67,38 @@ class deserializer : public slsDetectorData<int> {
|
|||||||
}
|
}
|
||||||
wp=(int64_t*)ptr;
|
wp=(int64_t*)ptr;
|
||||||
|
|
||||||
int nw=nch/nb;
|
for (iw=0; iw<nch/nb; iw) {
|
||||||
|
|
||||||
cout << "** Number of bits:\t" << nb << endl;
|
|
||||||
cout << "** Samples:\t" << nw << endl;
|
|
||||||
|
|
||||||
for (ib=0; ib<nb; ib++) {
|
|
||||||
cout << dbl[ib] << " " ;
|
|
||||||
}
|
|
||||||
cout << endl;
|
|
||||||
|
|
||||||
for (ib=0; ib<nch; ib++) {
|
|
||||||
val[ib]=0;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (iw=0; iw<nw; iw) {
|
|
||||||
word=*wp;;
|
word=*wp;;
|
||||||
if (ioff<off) {
|
if (ioff<off) {
|
||||||
ioff++;
|
ioff++;
|
||||||
// cout <<"*";
|
// cout <<"*";
|
||||||
} else {
|
} else {
|
||||||
//if (idr<16) {
|
//if (idr<16) {
|
||||||
//ib=0;
|
ib=0;
|
||||||
// cout << hex << "*************" << word << endl;
|
for (const auto &bit : dbl) {
|
||||||
for (ib=0; ib<nb; ib++) {
|
ich=iw+nch/nb*(ib);
|
||||||
// for (const auto &bit : dbl) {
|
if (word&(1<<bit) && ich<nch) {
|
||||||
ich=iw+nch*ib/nb;
|
|
||||||
/* if (ich>1060) */
|
|
||||||
/* cout << iw << " " << idr << " " << ib << " " << bit << " " << ich << " " << val[ich] << " ** " ; */
|
|
||||||
bit=dbl[ib];
|
|
||||||
ww=one<<bit;
|
|
||||||
if (word&(ww) && ich<nch) {
|
|
||||||
//cout << "+" ;
|
//cout << "+" ;
|
||||||
val[ich]|=(1<<idr);
|
val[ich]|=(1<<idr);
|
||||||
}
|
} //else {
|
||||||
/* if (ich>1060) */
|
|
||||||
/* cout << val[ich] << " " << hex << word << " " << ww << " " << (word&(ww)) << dec <<endl; */
|
|
||||||
/* //else { */
|
|
||||||
//cout << "-" ;
|
//cout << "-" ;
|
||||||
//}
|
//}
|
||||||
//ib++;
|
ib++;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
idr++;
|
idr++;
|
||||||
}
|
|
||||||
|
|
||||||
if (idr==dr) {
|
if (idr==dr) {
|
||||||
idr=0;
|
idr=0;
|
||||||
// cout << dec << " " << iw << " " << val[iw] << " " << val[iw+nch/2] << endl;
|
// cout << dec << " " << iw << " " << val[iw] << " " << val[iw+nch/2] << endl;
|
||||||
// cout <<dec << iw<<endl;
|
cout <<dec << iw<<endl;
|
||||||
iw++;
|
iw++;
|
||||||
}//end if()
|
}//end if()
|
||||||
|
|
||||||
//end else()
|
//end else()
|
||||||
wp+=1;
|
wp+=1;
|
||||||
// ii++;
|
ii++;
|
||||||
}//end for
|
}//end for
|
||||||
|
|
||||||
|
|
||||||
@ -147,7 +117,7 @@ class deserializer : public slsDetectorData<int> {
|
|||||||
int ii=0;
|
int ii=0;
|
||||||
int ich;
|
int ich;
|
||||||
int nb=dbl.size();
|
int nb=dbl.size();
|
||||||
int bit;
|
|
||||||
char *dval;
|
char *dval;
|
||||||
|
|
||||||
idr=0;
|
idr=0;
|
||||||
@ -158,12 +128,7 @@ class deserializer : public slsDetectorData<int> {
|
|||||||
|
|
||||||
ib=0;
|
ib=0;
|
||||||
ich=0;
|
ich=0;
|
||||||
for (ib=0; ib<nb; ib++) {
|
for (const auto &bit : dbl) {
|
||||||
// for (const auto &bit : dbl) {
|
|
||||||
|
|
||||||
/* if (ich>1060) */
|
|
||||||
/* cout << iw << " " << idr << " " << ib << " " << bit << " " << ich << " " << val[ich] << " ** " ; */
|
|
||||||
bit=dbl[ib];
|
|
||||||
//ioff=off;
|
//ioff=off;
|
||||||
idr=0;
|
idr=0;
|
||||||
for (iw=0; iw<(nch*dr/nb)/8; iw++) {
|
for (iw=0; iw<(nch*dr/nb)/8; iw++) {
|
||||||
@ -176,7 +141,7 @@ class deserializer : public slsDetectorData<int> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
ii++;
|
ii++;
|
||||||
// ib++;
|
ib++;
|
||||||
}//end for
|
}//end for
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,125 +0,0 @@
|
|||||||
#ifndef IMAGEZMQ16BIT_H
|
|
||||||
#define IMAGEZMQ16BIT_H
|
|
||||||
#include "slsDetectorData.h"
|
|
||||||
|
|
||||||
|
|
||||||
class imageZmq16bit : public slsDetectorData<uint16_t> {
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
// int iframe;
|
|
||||||
public:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
Implements the slsReceiverData structure for the moench02 prototype read out by a module i.e. using the slsReceiver
|
|
||||||
(160x160 pixels, 40 packets 1286 large etc.)
|
|
||||||
\param c crosstalk parameter for the output buffer
|
|
||||||
|
|
||||||
*/
|
|
||||||
// moench03T1ZmqDataNew(int ns=5000): slsDetectorData<uint16_t>(400, 400, ns*32*2+sizeof(int)), nSamples(ns), offset(sizeof(int)), xtalk(0.00021) {
|
|
||||||
imageZmq16bit(int nnx=400, int nny=400): slsDetectorData<uint16_t>(nnx, nny, 2*nnx*nny) {
|
|
||||||
cout << "* " << nx << " " << ny << endl;
|
|
||||||
int is=0;
|
|
||||||
for (int row=0; row<ny; row++){
|
|
||||||
for(int col=0;col<nx;col++){
|
|
||||||
dataMap[row][col]=is*2;
|
|
||||||
is++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
virtual double getValue(char *data, int ix, int iy=0) {
|
|
||||||
|
|
||||||
cout << ix << " " << ix << dataMap[iy][ix] << 2*nx*ny << " "<< endl;
|
|
||||||
uint16_t val=getChannel(data, ix, iy)&0x3fff;
|
|
||||||
return val;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
int getFrameNumber(char *buff){return *((int*)buff);};//*((int*)(buff+5))&0xffffff;};
|
|
||||||
|
|
||||||
|
|
||||||
int getPacketNumber(char *buff){return 0;}//((*(((int*)(buff+4))))&0xff)+1;};
|
|
||||||
|
|
||||||
virtual char *readNextFrame(ifstream &filebin) {
|
|
||||||
int ff=-1, np=-1;
|
|
||||||
return readNextFrame(filebin, ff, np);
|
|
||||||
};
|
|
||||||
|
|
||||||
virtual char *readNextFrame(ifstream &filebin, int &ff) {
|
|
||||||
int np=-1;
|
|
||||||
return readNextFrame(filebin, ff, np);
|
|
||||||
};
|
|
||||||
|
|
||||||
virtual char *readNextFrame(ifstream &filebin, int& ff, int &np) {
|
|
||||||
char *data=new char[2*nx*ny];
|
|
||||||
char *d=readNextFrame(filebin, ff, np, data);
|
|
||||||
if (d==NULL) {delete [] data; data=NULL;}
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
virtual char *readNextFrame(ifstream &filebin, int& ff, int &np, char *data) {
|
|
||||||
//char *retval=0;
|
|
||||||
// int nd;
|
|
||||||
//int fnum = -1;
|
|
||||||
np=0;
|
|
||||||
// int pn;
|
|
||||||
|
|
||||||
|
|
||||||
// if (ff>=0)
|
|
||||||
// fnum=ff;
|
|
||||||
|
|
||||||
if (filebin.is_open()) {
|
|
||||||
if (filebin.read(data, 2*nx*ny) ){
|
|
||||||
// iframe++;
|
|
||||||
//ff=iframe;
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
virtual char *findNextFrame(char *data, int &ndata, int dsize){
|
|
||||||
if (dsize<2*nx*ny) ndata=dsize;
|
|
||||||
else ndata=2*nx*ny;
|
|
||||||
return data;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// virtual int setFrameNumber(int ff){iframe=ff};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int getPacketNumber(int x, int y) {return 0;};
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,125 +0,0 @@
|
|||||||
#ifndef IMAGEZMQ32BIT_H
|
|
||||||
#define IMAGEZMQ32BIT_H
|
|
||||||
#include "slsDetectorData.h"
|
|
||||||
|
|
||||||
|
|
||||||
class imageZmq32bit : public slsDetectorData<uint16_t> {
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
// int iframe;
|
|
||||||
public:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
Implements the slsReceiverData structure for the moench02 prototype read out by a module i.e. using the slsReceiver
|
|
||||||
(160x160 pixels, 40 packets 1286 large etc.)
|
|
||||||
\param c crosstalk parameter for the output buffer
|
|
||||||
|
|
||||||
*/
|
|
||||||
// moench03T1ZmqDataNew(int ns=5000): slsDetectorData<uint16_t>(400, 400, ns*32*2+sizeof(int)), nSamples(ns), offset(sizeof(int)), xtalk(0.00021) {
|
|
||||||
imageZmq32bit(int nnx=400, int nny=400): slsDetectorData<uint16_t>(nnx, nny, sizeof(uint32_t)*nnx*nny) {
|
|
||||||
cout << "* " << nx << " " << ny << endl;
|
|
||||||
int is=0;
|
|
||||||
for (int row=0; row<ny; row++){
|
|
||||||
for(int col=0;col<nx;col++){
|
|
||||||
dataMap[row][col]=is*sizeof(uint32_t);
|
|
||||||
is++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
/* virtual double getValue(char *data, int ix, int iy=0) { */
|
|
||||||
|
|
||||||
/* //cout << ix << " " << ix << dataMap[iy][ix] << 2*nx*ny << " "<< endl; */
|
|
||||||
/* uint16_t val=getChannel(data, ix, iy); */
|
|
||||||
/* return val; */
|
|
||||||
/* }; */
|
|
||||||
|
|
||||||
|
|
||||||
int getFrameNumber(char *buff){return *((int*)buff);};//*((int*)(buff+5))&0xffffff;};
|
|
||||||
|
|
||||||
|
|
||||||
int getPacketNumber(char *buff){return 0;}//((*(((int*)(buff+4))))&0xff)+1;};
|
|
||||||
|
|
||||||
virtual char *readNextFrame(ifstream &filebin) {
|
|
||||||
int ff=-1, np=-1;
|
|
||||||
return readNextFrame(filebin, ff, np);
|
|
||||||
};
|
|
||||||
|
|
||||||
virtual char *readNextFrame(ifstream &filebin, int &ff) {
|
|
||||||
int np=-1;
|
|
||||||
return readNextFrame(filebin, ff, np);
|
|
||||||
};
|
|
||||||
|
|
||||||
virtual char *readNextFrame(ifstream &filebin, int& ff, int &np) {
|
|
||||||
char *data=new char[2*nx*ny];
|
|
||||||
char *d=readNextFrame(filebin, ff, np, data);
|
|
||||||
if (d==NULL) {delete [] data; data=NULL;}
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
virtual char *readNextFrame(ifstream &filebin, int& ff, int &np, char *data) {
|
|
||||||
//char *retval=0;
|
|
||||||
// int nd;
|
|
||||||
//int fnum = -1;
|
|
||||||
np=0;
|
|
||||||
// int pn;
|
|
||||||
|
|
||||||
|
|
||||||
// if (ff>=0)
|
|
||||||
// fnum=ff;
|
|
||||||
|
|
||||||
if (filebin.is_open()) {
|
|
||||||
if (filebin.read(data, 2*nx*ny) ){
|
|
||||||
// iframe++;
|
|
||||||
//ff=iframe;
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
virtual char *findNextFrame(char *data, int &ndata, int dsize){
|
|
||||||
if (dsize<2*nx*ny) ndata=dsize;
|
|
||||||
else ndata=2*nx*ny;
|
|
||||||
return data;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// virtual int setFrameNumber(int ff){iframe=ff};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int getPacketNumber(int x, int y) {return 0;};
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
@ -28,8 +28,7 @@ class moench03T1ZmqDataNew : public slsDetectorData<uint16_t> {
|
|||||||
\param c crosstalk parameter for the output buffer
|
\param c crosstalk parameter for the output buffer
|
||||||
|
|
||||||
*/
|
*/
|
||||||
// moench03T1ZmqDataNew(int ns=5000): slsDetectorData<uint16_t>(400, 400, ns*32*2+sizeof(int)), nSamples(ns), offset(sizeof(int)), xtalk(0.00021) {
|
moench03T1ZmqDataNew(int ns=5000): slsDetectorData<uint16_t>(400, 400, ns*32*2+sizeof(int)), nSamples(ns), offset(sizeof(int)), xtalk(0.00021) {
|
||||||
moench03T1ZmqDataNew(int ns=5000, int oo=0): slsDetectorData<uint16_t>(400, 400, ns*32*2+oo), nSamples(ns), offset(oo), xtalk(0.00021) {
|
|
||||||
|
|
||||||
int nadc=32;
|
int nadc=32;
|
||||||
int sc_width=25;
|
int sc_width=25;
|
||||||
@ -138,7 +137,6 @@ class moench03T1ZmqDataNew : public slsDetectorData<uint16_t> {
|
|||||||
/* vout+=0.0008*val-6224; */
|
/* vout+=0.0008*val-6224; */
|
||||||
/* return vout; //(double)getChannel(data, ix, iy);
|
/* return vout; //(double)getChannel(data, ix, iy);
|
||||||
*/
|
*/
|
||||||
// cout << ix << " "<< iy << " " << dataMap[iy][ix] << endl;
|
|
||||||
return ((double)getChannel(data, ix, iy))+xtalk*getGhost(iy,iy);
|
return ((double)getChannel(data, ix, iy))+xtalk*getGhost(iy,iy);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -44,28 +44,6 @@ 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;
|
||||||
@ -156,7 +134,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,8 +20,6 @@ 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:
|
||||||
|
|
||||||
@ -39,29 +37,35 @@ 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), orderedData(NULL), isOrdered(0) {
|
slsDetectorData(int npx, int npy, int dsize, int **dMap=NULL, dataType **dMask=NULL, int **dROI=NULL): nx(npx), ny(npy), dataSize(dsize) {
|
||||||
|
|
||||||
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];
|
|
||||||
dataMap=new int*[ny];
|
// if (dataMask==NULL) {
|
||||||
dataMask=new dataType*[ny];
|
dataMask=new dataType*[ny];
|
||||||
dataROIMask=new int*[ny];
|
for(int i = 0; i < ny; i++) {
|
||||||
|
dataMask[i] = new dataType[nx];
|
||||||
|
}
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if (dataMap==NULL) {
|
||||||
|
dataMap=new int*[ny];
|
||||||
for(int i = 0; i < ny; i++) {
|
for(int i = 0; i < ny; i++) {
|
||||||
dataMap[i] = new int[nx];
|
dataMap[i] = new int[nx];
|
||||||
orderedData[i]=new dataType[nx];
|
}
|
||||||
dataMask[i] = new dataType[nx];
|
// }
|
||||||
|
// if (dataROIMask==NULL) {
|
||||||
|
dataROIMask=new int*[ny];
|
||||||
|
for(int i = 0; i < ny; i++) {
|
||||||
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<el; ip++){
|
for (int ip=0; ip<dsize/sizeof(dataType); ip++){
|
||||||
xmap[ip]=-1;
|
xmap[ip]=-1;
|
||||||
ymap[ip]=-1;
|
ymap[ip]=-1;
|
||||||
}
|
}
|
||||||
@ -70,24 +74,22 @@ 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);)
|
||||||
@ -203,28 +205,23 @@ 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;
|
|
||||||
int ix,iy;
|
|
||||||
//data=new dataType*[ny];
|
|
||||||
//for(int i = 0; i < ny; i++) {
|
|
||||||
// data[i]=new dataType[nx];
|
|
||||||
//}
|
|
||||||
isOrdered=0;
|
|
||||||
if (dsize<=0 || dsize>dataSize) dsize=dataSize;
|
|
||||||
|
|
||||||
for (int ip=0; ip<(el); ip++) {
|
dataType **data;
|
||||||
|
int ix,iy;
|
||||||
|
data=new dataType*[ny];
|
||||||
|
for(int i = 0; i < ny; i++) {
|
||||||
|
data[i]=new dataType[nx];
|
||||||
|
}
|
||||||
|
if (dsize<=0 || dsize>dataSize) dsize=dataSize;
|
||||||
|
for (int ip=0; ip<(dsize/sizeof(dataType)); 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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
isOrdered=1;
|
return data;
|
||||||
return orderedData;
|
|
||||||
}
|
|
||||||
|
|
||||||
void newFrame(){isOrdered=0;};
|
};
|
||||||
|
|
||||||
virtual double **getImage(char *ptr, int dsize=-1) {
|
virtual double **getImage(char *ptr, int dsize=-1) {
|
||||||
|
|
||||||
@ -234,15 +231,15 @@ virtual dataType **getData(char *ptr, int dsize=-1) {
|
|||||||
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<el; ip++) {
|
for (int ip=0; ip<(dsize/sizeof(dataType)); 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;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -259,10 +256,7 @@ virtual dataType **getData(char *ptr, int dsize=-1) {
|
|||||||
// 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];
|
||||||
if (isOrdered==0)
|
d=*((dataType*)(data+dataMap[iy][ix]));
|
||||||
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), nx(1), ny(1) {
|
ghostSummation(slsDetectorData<dataType> *d, double xt) : xtalk(xt),det(d) {
|
||||||
if (det)
|
if (det)
|
||||||
det->getDetectorSize(nx,ny);
|
det->getDetectorSize(nx,ny);
|
||||||
ghost=new double[nx*ny];
|
ghost=new double[nx*ny];
|
||||||
@ -22,9 +22,6 @@ 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 &nsx, int &nsy) {
|
int getImageSize(int &nnx, int &nny, int &ns) {
|
||||||
if (interp)
|
if (interp)
|
||||||
return interp->getImageSize(nnx, nny, nsx, nsy);
|
return interp->getImageSize(nnx, nny, ns);
|
||||||
else
|
else
|
||||||
return analogDetector<uint16_t>::getImageSize(nnx, nny, nsx, nsy);
|
return analogDetector<uint16_t>::getImageSize(nnx, nny, ns);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -251,7 +251,6 @@ 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 nsy=25, int nb=-1, int nby=-1, double emin=1, double emax=0) : etaInterpolationBase(nx,ny, ns, nsy, nb, nby, emin, emax) {
|
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) {
|
||||||
|
|
||||||
/* 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 (nSubPixelsX>2 || nSubPixelsY>2)
|
if (nSubPixels>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 (nSubPixelsX>2 || nSubPixelsY>2 )
|
if (nSubPixels>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 (nSubPixelsX>2 || nSubPixelsY>2) {
|
if (nSubPixels>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 (nSubPixelsX>2 || nSubPixelsY>2) {
|
if (nSubPixels>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 (nSubPixelsX>2 || nSubPixelsY>2 ) {
|
if (nSubPixels>2) {
|
||||||
|
|
||||||
ex=(etax-etamin)/etastepX;
|
ex=(etax-etamin)/etastep;
|
||||||
ey=(etay-etamin)/etastepY;
|
ey=(etay-etamin)/etastep;
|
||||||
if (ex<0) {
|
if (ex<0) {
|
||||||
cout << "x*"<< ex << endl;
|
cout << "x*"<< ex << endl;
|
||||||
ex=0;
|
ex=0;
|
||||||
}
|
}
|
||||||
if (ex>=nbetaX) {
|
if (ex>=nbeta) {
|
||||||
cout << "x?"<< ex << endl;
|
cout << "x?"<< ex << endl;
|
||||||
ex=nbetaX-1;
|
ex=nbeta-1;
|
||||||
}
|
}
|
||||||
if (ey<0) {
|
if (ey<0) {
|
||||||
cout << "y*"<< ey << " " << nbetaY << endl;
|
cout << "y*"<< ey << endl;
|
||||||
ey=0;
|
ey=0;
|
||||||
}
|
}
|
||||||
if (ey>=nbetaY) {
|
if (ey>=nbeta) {
|
||||||
cout << "y?"<< ey << " " << nbetaY << endl;
|
cout << "y?"<< ey << endl;
|
||||||
ey=nbetaY-1;
|
ey=nbeta-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
xpos_eta=(((double)hhx[(ey*nbetaX+ex)]))+dX ;///((double)nSubPixels);
|
xpos_eta=(((double)hhx[(ey*nbeta+ex)]))+dX ;///((double)nSubPixels);
|
||||||
ypos_eta=(((double)hhy[(ey*nbetaX+ex)]))+dY ;///((double)nSubPixels);
|
ypos_eta=(((double)hhy[(ey*nbeta+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)/etastepX;
|
ex=(etax-etamin)/etastep;
|
||||||
ey=(etay-etamin)/etastepY;
|
ey=(etay-etamin)/etastep;
|
||||||
if (ey<nbetaY && ex<nbetaX && ex>=0 && ey>=0)
|
if (ey<nbeta && ex<nbeta && ex>=0 && ey>=0)
|
||||||
heta[ey*nbetaX+ex]++;
|
heta[ey*nbeta+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<nSubPixelsX; ipx++)
|
for (ipx=0; ipx<nSubPixels; ipx++)
|
||||||
for (ipy=0; ipy<nSubPixelsY; ipy++)
|
for (ipy=0; ipy<nSubPixels; ipy++)
|
||||||
avg+=flat[ipx+ipy*nSubPixelsX];
|
avg+=flat[ipx+ipy*nSubPixels];
|
||||||
avg/=nSubPixelsY*nSubPixelsX;
|
avg/=nSubPixels*nSubPixels;
|
||||||
|
|
||||||
for (int ibx=0 ; ibx<nSubPixelsX*nPixelsX; ibx++) {
|
for (int ibx=0 ; ibx<nSubPixels*nPixelsX; ibx++) {
|
||||||
ipx=ibx%nSubPixelsX-nSubPixelsX/2;
|
ipx=ibx%nSubPixels-nSubPixels/2;
|
||||||
if (ipx<0) ipx=nSubPixelsX+ipx;
|
if (ipx<0) ipx=nSubPixels+ipx;
|
||||||
for (int iby=0 ; iby<nSubPixelsY*nPixelsY; iby++) {
|
for (int iby=0 ; iby<nSubPixels*nPixelsY; iby++) {
|
||||||
ipy=iby%nSubPixelsY-nSubPixelsY/2;
|
ipy=iby%nSubPixels-nSubPixels/2;
|
||||||
if (ipy<0) ipy=nSubPixelsY+ipy;
|
if (ipy<0) ipy=nSubPixels+ipy;
|
||||||
// cout << ipx << " " << ipy << " " << ibx << " " << iby << endl;
|
// cout << ipx << " " << ipy << " " << ibx << " " << iby << endl;
|
||||||
if (flat[ipx+ipy*nSubPixelsX]>0)
|
if (flat[ipx+ipy*nSubPixels]>0)
|
||||||
hintcorr[ibx+iby*nSubPixelsX*nPixelsX]=hint[ibx+iby*nSubPixelsX*nPixelsX]*(avg/flat[ipx+ipy*nSubPixelsX]);
|
hintcorr[ibx+iby*nSubPixels*nPixelsX]=hint[ibx+iby*nSubPixels*nPixelsX]*(avg/flat[ipx+ipy*nSubPixels]);
|
||||||
else
|
else
|
||||||
hintcorr[ibx+iby*nSubPixelsX*nPixelsX]=hint[ibx+iby*nSubPixelsX*nPixelsX];
|
hintcorr[ibx+iby*nSubPixels*nPixelsX]=hint[ibx+iby*nSubPixels*nPixelsX];
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -13,12 +13,35 @@
|
|||||||
class eta3InterpolationBase : public virtual etaInterpolationBase {
|
class eta3InterpolationBase : public virtual etaInterpolationBase {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
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) {
|
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) {
|
||||||
// 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;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -65,7 +88,7 @@ class eta3InterpolationBase : public virtual etaInterpolationBase {
|
|||||||
|
|
||||||
|
|
||||||
double etax, etay;
|
double etax, etay;
|
||||||
if (nSubPixelsX>2 || nSubPixelsY>2 ) {
|
if (nSubPixels>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);
|
||||||
@ -78,7 +101,7 @@ class eta3InterpolationBase : public virtual etaInterpolationBase {
|
|||||||
|
|
||||||
|
|
||||||
double etax, etay;
|
double etax, etay;
|
||||||
if (nSubPixelsX>2 || nSubPixelsY>2 ) {
|
if (nSubPixels>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);
|
||||||
@ -94,38 +117,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 (nSubPixelsX>2 || nSubPixelsY>2 ) {
|
if (nSubPixels>2) {
|
||||||
|
|
||||||
#ifdef MYROOT1
|
#ifdef MYROOT1
|
||||||
xpos_eta=(hhx->GetBinContent(hhx->GetXaxis()->FindBin(etax),hhy->GetYaxis()->FindBin(etay)))/((double)nSubPixelsX);
|
xpos_eta=(hhx->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);
|
ypos_eta=(hhy->GetBinContent(hhx->GetXaxis()->FindBin(etax),hhy->GetYaxis()->FindBin(etay)))/((double)nSubPixels);
|
||||||
#endif
|
#endif
|
||||||
#ifndef MYROOT1
|
#ifndef MYROOT1
|
||||||
ex=(etax-etamin)/etastepX;
|
ex=(etax-etamin)/etastep;
|
||||||
ey=(etay-etamin)/etastepY;
|
ey=(etay-etamin)/etastep;
|
||||||
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>=nbetaX) {
|
if (ex>=nbeta) {
|
||||||
/* cout << etax << " " << etamin << " "; */
|
/* cout << etax << " " << etamin << " "; */
|
||||||
/* cout << "3x?"<< ex << endl; */
|
/* cout << "3x?"<< ex << endl; */
|
||||||
ex=nbetaX-1;
|
ex=nbeta-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>=nbetaY) {
|
if (ey>=nbeta) {
|
||||||
/* cout << etay << " " << etamin << " "; */
|
/* cout << etay << " " << etamin << " "; */
|
||||||
/* cout << "3y?"<< ey << endl; */
|
/* cout << "3y?"<< ey << endl; */
|
||||||
ey=nbetaY-1;
|
ey=nbeta-1;
|
||||||
|
|
||||||
}
|
}
|
||||||
xpos_eta=(((double)hhx[(ey*nbetaX+ex)]));///((double)nSubPixels);
|
xpos_eta=(((double)hhx[(ey*nbeta+ex)]));///((double)nSubPixels);
|
||||||
ypos_eta=(((double)hhy[(ey*nbetaX+ex)]));///((double)nSubPixels);
|
ypos_eta=(((double)hhy[(ey*nbeta+ex)]));///((double)nSubPixels);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -242,10 +265,10 @@ class eta3InterpolationBase : public virtual etaInterpolationBase {
|
|||||||
#endif
|
#endif
|
||||||
#ifndef MYROOT1
|
#ifndef MYROOT1
|
||||||
int ex,ey;
|
int ex,ey;
|
||||||
ex=(etax-etamin)/etastepX;
|
ex=(etax-etamin)/etastep;
|
||||||
ey=(etay-etamin)/etastepY;
|
ey=(etay-etamin)/etastep;
|
||||||
if (ey<nbetaY && ex<nbetaX && ex>=0 && ey>=0)
|
if (ey<nbeta && ex<nbeta && ex>=0 && ey>=0)
|
||||||
heta[ey*nbetaX+ex]++;
|
heta[ey*nbeta+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,51 +15,44 @@ class etaInterpolationBase : public slsInterpolation {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
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) {
|
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) {
|
||||||
// cout << "eb " << nb << " " << emin << " " << emax << endl;
|
// cout << "eb " << nb << " " << emin << " " << emax << endl;
|
||||||
// cout << nb << " " << etamin << " " << etamax << endl;
|
// cout << nb << " " << etamin << " " << etamax << endl;
|
||||||
if (nbetaX<=0) {
|
if (nbeta<=0) {
|
||||||
//cout << "aaa:" <<endl;
|
//cout << "aaa:" <<endl;
|
||||||
nbetaX=nSubPixelsX*10;
|
nbeta=nSubPixels*10;
|
||||||
}
|
|
||||||
if (nbetaY<=0) {
|
|
||||||
//cout << "aaa:" <<endl;
|
|
||||||
nbetaY=nSubPixelsY*10;
|
|
||||||
}
|
}
|
||||||
if (etamin>=etamax) {
|
if (etamin>=etamax) {
|
||||||
etamin=-1;
|
etamin=-1;
|
||||||
etamax=2;
|
etamax=2;
|
||||||
}
|
}
|
||||||
etastepX=(etamax-etamin)/nbetaX;
|
etastep=(etamax-etamin)/nbeta;
|
||||||
etastepY=(etamax-etamin)/nbetaY;
|
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];
|
|
||||||
rangeMin=etamin;
|
rangeMin=etamin;
|
||||||
rangeMax=etamax;
|
rangeMax=etamax;
|
||||||
flat= new double[nSubPixelsX*nSubPixelsY];
|
flat= new double[nSubPixels*nSubPixels];
|
||||||
hintcorr=new int [nSubPixelsX*nSubPixelsY*nPixelsX*nPixelsY];
|
hintcorr=new int [nSubPixels*nSubPixels*nPixelsX*nPixelsY];
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
etaInterpolationBase(etaInterpolationBase *orig): slsInterpolation(orig){
|
etaInterpolationBase(etaInterpolationBase *orig): slsInterpolation(orig){
|
||||||
nbetaX=orig->nbetaX;
|
nbeta=orig->nbeta;
|
||||||
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;
|
||||||
|
|
||||||
|
|
||||||
etastepX=(etamax-etamin)/nbetaX;
|
etastep=(etamax-etamin)/nbeta;
|
||||||
etastepY=(etamax-etamin)/nbetaY;
|
heta=new int[nbeta*nbeta];
|
||||||
heta=new int[nbetaX*nbetaY];
|
memcpy(heta,orig->heta,nbeta*nbeta*sizeof(int));
|
||||||
memcpy(heta,orig->heta,nbetaX*nbetaY*sizeof(int));
|
hhx=new float[nbeta*nbeta];
|
||||||
hhx=new float[nbetaX*nbetaY];
|
memcpy(hhx,orig->hhx,nbeta*nbeta*sizeof(float));
|
||||||
memcpy(hhx,orig->hhx,nbetaX*nbetaY*sizeof(float));
|
hhy=new float[nbeta*nbeta];
|
||||||
hhy=new float[nbetaX*nbetaY];
|
memcpy(hhy,orig->hhy,nbeta*nbeta*sizeof(float));
|
||||||
memcpy(hhy,orig->hhy,nbetaX*nbetaY*sizeof(float));
|
hintcorr=new int [nSubPixels*nSubPixels*nPixelsX*nPixelsY];
|
||||||
hintcorr=new int [nSubPixelsX*nSubPixelsY*nPixelsX*nPixelsY];
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -68,7 +61,7 @@ class etaInterpolationBase : public slsInterpolation {
|
|||||||
|
|
||||||
|
|
||||||
virtual void resetFlatField() {
|
virtual void resetFlatField() {
|
||||||
for (int ibx=0; ibx<nbetaX*nbetaY; ibx++) {
|
for (int ibx=0; ibx<nbeta*nbeta; ibx++) {
|
||||||
heta[ibx]=0;
|
heta[ibx]=0;
|
||||||
hhx[ibx]=0;
|
hhx[ibx]=0;
|
||||||
hhy[ibx]=0;
|
hhy[ibx]=0;
|
||||||
@ -77,16 +70,13 @@ class etaInterpolationBase : public slsInterpolation {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
int *setEta(int *h, int nb=-1, int nby=-1, double emin=1, double emax=0)
|
int *setEta(int *h, int nb=-1, double emin=1, double emax=0)
|
||||||
{
|
{
|
||||||
if (h) {
|
if (h) {
|
||||||
if (heta) delete [] heta;
|
if (heta) delete [] heta;
|
||||||
heta=h;
|
heta=h;
|
||||||
nbetaX=nb;
|
nbeta=nb;
|
||||||
nbetaY=nby;
|
if (nb<=0) nbeta=nSubPixels*10;
|
||||||
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) {
|
||||||
@ -95,24 +85,22 @@ class etaInterpolationBase : public slsInterpolation {
|
|||||||
}
|
}
|
||||||
rangeMin=etamin;
|
rangeMin=etamin;
|
||||||
rangeMax=etamax;
|
rangeMax=etamax;
|
||||||
etastepX=(etamax-etamin)/nbetaX;
|
etastep=(etamax-etamin)/nbeta;
|
||||||
etastepY=(etamax-etamin)/nbetaY;
|
|
||||||
}
|
}
|
||||||
return heta;
|
return heta;
|
||||||
};
|
};
|
||||||
|
|
||||||
int *setFlatField(int *h, int nb=-1, int nby=-1, double emin=1, double emax=0)
|
int *setFlatField(int *h, int nb=-1, double emin=1, double emax=0)
|
||||||
{
|
{
|
||||||
return setEta(h, nb, nby, emin, emax);
|
return setEta(h, nb, emin, emax);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int *getFlatField(){return setEta(NULL);};
|
int *getFlatField(){return setEta(NULL);};
|
||||||
|
|
||||||
int *getFlatField(int &nb, int &nby, double &emin, double &emax){
|
int *getFlatField(int &nb, double &emin, double &emax){
|
||||||
nb=nbetaX;
|
nb=nbeta;
|
||||||
nby=nbetaY;
|
|
||||||
emin=etamin;
|
emin=etamin;
|
||||||
emax=etamax;
|
emax=etamax;
|
||||||
return getFlatField();
|
return getFlatField();
|
||||||
@ -121,13 +109,13 @@ class etaInterpolationBase : public slsInterpolation {
|
|||||||
|
|
||||||
void *writeFlatField(const char * imgname) {
|
void *writeFlatField(const char * imgname) {
|
||||||
float *gm=NULL;
|
float *gm=NULL;
|
||||||
gm=new float[nbetaX*nbetaY];
|
gm=new float[nbeta*nbeta];
|
||||||
for (int ix=0; ix<nbetaX; ix++) {
|
for (int ix=0; ix<nbeta; ix++) {
|
||||||
for (int iy=0; iy<nbetaY; iy++) {
|
for (int iy=0; iy<nbeta; iy++) {
|
||||||
gm[iy*nbetaX+ix]=heta[iy*nbetaX+ix];
|
gm[iy*nbeta+ix]=heta[iy*nbeta+ix];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
WriteToTiff(gm, imgname, nbetaX, nbetaY);
|
WriteToTiff(gm, imgname, nbeta, nbeta);
|
||||||
delete [] gm;
|
delete [] gm;
|
||||||
return NULL;
|
return NULL;
|
||||||
};
|
};
|
||||||
@ -141,18 +129,16 @@ class etaInterpolationBase : public slsInterpolation {
|
|||||||
etamax=2;
|
etamax=2;
|
||||||
}
|
}
|
||||||
|
|
||||||
etastepX=(etamax-etamin)/nbetaX;
|
etastep=(etamax-etamin)/nbeta;
|
||||||
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;
|
||||||
/* } */
|
}
|
||||||
nbetaX=nnx;
|
nbeta=nnx;
|
||||||
nbetaY=nny;
|
|
||||||
if (gm) {
|
if (gm) {
|
||||||
if (heta) {
|
if (heta) {
|
||||||
delete [] heta;
|
delete [] heta;
|
||||||
@ -160,13 +146,13 @@ class etaInterpolationBase : public slsInterpolation {
|
|||||||
delete [] hhy;
|
delete [] hhy;
|
||||||
}
|
}
|
||||||
|
|
||||||
heta=new int[nbetaX*nbetaY];
|
heta=new int[nbeta*nbeta];
|
||||||
hhx=new float[nbetaX*nbetaY];
|
hhx=new float[nbeta*nbeta];
|
||||||
hhy=new float[nbetaX*nbetaY];
|
hhy=new float[nbeta*nbeta];
|
||||||
|
|
||||||
for (int ix=0; ix<nbetaX; ix++) {
|
for (int ix=0; ix<nbeta; ix++) {
|
||||||
for (int iy=0; iy<nbetaY; iy++) {
|
for (int iy=0; iy<nbeta; iy++) {
|
||||||
heta[iy*nbetaX+ix]=gm[iy*nbetaX+ix];
|
heta[iy*nbeta+ix]=gm[iy*nbeta+ix];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
delete [] gm;
|
delete [] gm;
|
||||||
@ -192,10 +178,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)/etastepX;
|
ex=(etax-etamin)/etastep;
|
||||||
ey=(etay-etamin)/etastepY;
|
ey=(etay-etamin)/etastep;
|
||||||
if (ey<nbetaY && ex<nbetaX && ex>=0 && ey>=0)
|
if (ey<nbeta && ex<nbeta && ex>=0 && ey>=0)
|
||||||
heta[ey*nbetaX+ex]++;
|
heta[ey*nbeta+ex]++;
|
||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -209,80 +195,80 @@ float *gethhx()
|
|||||||
|
|
||||||
float tot_eta=0;
|
float tot_eta=0;
|
||||||
|
|
||||||
float *etah=new float[nbetaX*nbetaY];
|
float *etah=new float[nbeta*nbeta];
|
||||||
// int etabins=nbeta;
|
int etabins=nbeta;
|
||||||
int ibb=0;
|
int ibb=0;
|
||||||
|
|
||||||
for (int ii=0; ii<nbetaX*nbetaY; ii++) {
|
for (int ii=0; ii<etabins*etabins; 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, nbetaX, nbetaY);
|
WriteToTiff(etah, tit, etabins, etabins);
|
||||||
|
|
||||||
|
|
||||||
for (int ii=0; ii<nbetaX*nbetaY; ii++) {
|
for (int ii=0; ii<etabins*etabins; ii++) {
|
||||||
ibb=(hhx[ii]*nSubPixelsX);
|
ibb=(hhx[ii]*nSubPixels);
|
||||||
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, nbetaX, nbetaY);
|
WriteToTiff(etah, tit, etabins, etabins);
|
||||||
|
|
||||||
for (int ii=0; ii<nbetaX*nbetaY; ii++) {
|
for (int ii=0; ii<etabins*etabins; ii++) {
|
||||||
ibb=hhy[ii]*nSubPixelsY;
|
ibb=hhy[ii]*nSubPixels;
|
||||||
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, nbetaX, nbetaY);
|
WriteToTiff(etah, tit, etabins, etabins);
|
||||||
|
|
||||||
|
|
||||||
float *ftest=new float[nSubPixelsX*nSubPixelsY];
|
float *ftest=new float[nSubPixels*nSubPixels];
|
||||||
|
|
||||||
for (int ib=0; ib<nSubPixelsX*nSubPixelsY; ib++) ftest[ib]=0;
|
for (int ib=0; ib<nSubPixels*nSubPixels; ib++) ftest[ib]=0;
|
||||||
|
|
||||||
|
|
||||||
//int ibx=0, iby=0;
|
//int ibx=0, iby=0;
|
||||||
|
|
||||||
for (int ii=0; ii<nbetaX*nbetaY; ii++) {
|
for (int ii=0; ii<nbeta*nbeta; ii++) {
|
||||||
|
|
||||||
ibx=nSubPixelsX*hhx[ii];
|
ibx=nSubPixels*hhx[ii];
|
||||||
iby=nSubPixelsY*hhy[ii];
|
iby=nSubPixels*hhy[ii];
|
||||||
if (ibx<0) ibx=0;
|
if (ibx<0) ibx=0;
|
||||||
if (iby<0) iby=0;
|
if (iby<0) iby=0;
|
||||||
if (ibx>=nSubPixelsX) ibx=nSubPixelsX-1;
|
if (ibx>=nSubPixels) ibx=nSubPixels-1;
|
||||||
if (iby>=nSubPixelsY) iby=nSubPixelsY-1;
|
if (iby>=nSubPixels) iby=nSubPixels-1;
|
||||||
|
|
||||||
|
|
||||||
if (ibx>=0 && ibx<nSubPixelsX && iby>=0 && iby<nSubPixelsY) {
|
if (ibx>=0 && ibx<nSubPixels && iby>=0 && iby<nSubPixels) {
|
||||||
//
|
//
|
||||||
// if (ibx>0 && iby>0) cout << ibx << " " << iby << " " << ii << endl;
|
// if (ibx>0 && iby>0) cout << ibx << " " << iby << " " << ii << endl;
|
||||||
ftest[ibx+iby*nSubPixelsX]+=heta[ii];
|
ftest[ibx+iby*nSubPixels]+=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, nSubPixelsX, nSubPixelsY);
|
WriteToTiff(ftest, tit, nSubPixels, nSubPixels);
|
||||||
|
|
||||||
//int ibx=0, iby=0;
|
//int ibx=0, iby=0;
|
||||||
tot_eta/=nSubPixelsX*nSubPixelsY;
|
tot_eta/=nSubPixels*nSubPixels;
|
||||||
int nbad=0;
|
int nbad=0;
|
||||||
for (int ii=0; ii<nbetaX*nbetaY; ii++) {
|
for (int ii=0; ii<etabins*etabins; ii++) {
|
||||||
ibx=nSubPixelsX*hhx[ii];
|
ibx=nSubPixels*hhx[ii];
|
||||||
iby=nSubPixelsY*hhy[ii];
|
iby=nSubPixels*hhy[ii];
|
||||||
if (ftest[ibx+iby*nSubPixelsX]<tot_eta*0.5) {
|
if (ftest[ibx+iby*nSubPixels]<tot_eta*0.5) {
|
||||||
etah[ii]=1;
|
etah[ii]=1;
|
||||||
nbad++;
|
nbad++;
|
||||||
} else if(ftest[ibx+iby*nSubPixelsX]>tot_eta*2.){
|
} else if(ftest[ibx+iby*nSubPixels]>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, nbetaX, nbetaY);
|
WriteToTiff(etah, tit, etabins, etabins);
|
||||||
// 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;
|
||||||
|
|
||||||
@ -300,44 +286,46 @@ 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[nSubPixelsX], p_tot_y[nSubPixelsY], p_tot[nSubPixelsX*nSubPixelsY];
|
double p_tot_x[nSubPixels], p_tot_y[nSubPixels], p_tot[nSubPixels*nSubPixels];
|
||||||
double maxdiff=0, mindiff=avg*nSubPixelsX*nSubPixelsY;
|
double maxdiff=0, mindiff=avg*nSubPixels*nSubPixels;
|
||||||
|
|
||||||
int ipx, ipy;
|
int ipx, ipy;
|
||||||
for (ipy=0; ipy<nSubPixelsY; ipy++) {
|
for (ipy=0; ipy<nSubPixels; ipy++) {
|
||||||
for (ipx=0; ipx<nSubPixelsX; ipx++) {
|
for (ipx=0; ipx<nSubPixels; ipx++) {
|
||||||
p_tot[ipx+ipy*nSubPixelsX]=0;
|
p_tot[ipx+ipy*nSubPixels]=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<nbetaX; ibx++) {
|
for (int ibx=0; ibx<nbeta; ibx++) {
|
||||||
for (int iby=0; iby<nbetaY; iby++) {
|
for (int iby=0; iby<nbeta; iby++) {
|
||||||
ipx=hx[ibx+iby*nbetaX]*nSubPixelsX;
|
ipx=hx[ibx+iby*nbeta]*nSubPixels;
|
||||||
if (ipx<0) ipx=0;
|
if (ipx<0) ipx=0;
|
||||||
if (ipx>=nSubPixelsX) ipx=nSubPixelsX-1;
|
if (ipx>=nSubPixels) ipx=nSubPixels-1;
|
||||||
|
|
||||||
ipy=hy[ibx+iby*nbetaX]*nSubPixelsY;
|
ipy=hy[ibx+iby*nbeta]*nSubPixels;
|
||||||
if (ipy<0) ipy=0;
|
if (ipy<0) ipy=0;
|
||||||
if (ipy>=nSubPixelsY) ipy=nSubPixelsY-1;
|
if (ipy>=nSubPixels) ipy=nSubPixels-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<nSubPixelsY; ipy++) {
|
for (ipy=0; ipy<nSubPixels; 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<nSubPixelsX; ipx++) {
|
for (ipx=0; ipx<nSubPixels; ipx++) {
|
||||||
|
|
||||||
// flat_x[ipx]=p_tot_x[ipx];///avg/nSubPixels;
|
// flat_x[ipx]=p_tot_x[ipx];///avg/nSubPixels;
|
||||||
flat[ipx+nSubPixelsX*ipy]=p_tot[ipx+nSubPixelsX*ipy];///avg;
|
flat[ipx+nSubPixels*ipy]=p_tot[ipx+nSubPixels*ipy];///avg;
|
||||||
d=p_tot[ipx+nSubPixelsX*ipy]-avg;
|
d=p_tot[ipx+nSubPixels*ipy]-avg;
|
||||||
if (d<0) d*=-1.;
|
if (d<0) d*=-1.;
|
||||||
if (d>5*sqrt(avg) )
|
if (d>5*sqrt(avg) )
|
||||||
nbad++;
|
nbad++;
|
||||||
@ -366,8 +354,8 @@ float *gethhx()
|
|||||||
float *hhx;
|
float *hhx;
|
||||||
float *hhy;
|
float *hhy;
|
||||||
int *heta;
|
int *heta;
|
||||||
int nbetaX, nbetaY;
|
int nbeta;
|
||||||
double etamin, etamax, etastepX, etastepY;
|
double etamin, etamax, etastep;
|
||||||
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 nsy=25, int nb=-1, int nby=-1, double emin=1, double emax=0) : etaInterpolationBase(nx,ny, ns, nsy, nb, nby, emin, emax){
|
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){
|
||||||
// cout << "epxy " << nb << " " << emin << " " << emax << endl; cout << nbeta << " " << etamin << " " << etamax << endl;
|
// cout << "epxy " << nb << " " << emin << " " << emax << endl; cout << nbeta << " " << etamin << " " << etamax << endl;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -24,6 +24,14 @@ 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*///
|
||||||
@ -32,128 +40,106 @@ 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<nbetaX*nbetaY; ip++)
|
for (int ip=0; ip<nbeta*nbeta; 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[nbetaX]; //profile x
|
double hx[nbeta]; //profile x
|
||||||
double hy[nbetaY]; //profile y
|
double hy[nbeta]; //profile y
|
||||||
double hix[nbetaX]; //integral of projection x
|
double hix[nbeta]; //integral of projection x
|
||||||
double hiy[nbetaY]; //integral of projection y
|
double hiy[nbeta]; //integral of projection y
|
||||||
// int ii=0;
|
// int ii=0;
|
||||||
double etax, etay;
|
double etax;//, etay;
|
||||||
for (int ib=0; ib<nbetaX; ib++) {
|
for (int ib=0; ib<nbeta; ib++) {
|
||||||
|
|
||||||
|
tot_eta_x=0;
|
||||||
|
tot_eta_y=0;
|
||||||
|
|
||||||
//tot_eta_y=0;
|
for (int iby=0; iby<nbeta; iby++) {
|
||||||
|
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 (etay>=0 && etay<=1)
|
if (etax>=0 && etax<=1)
|
||||||
hy[iby]=heta[ib+iby*nbetaX];
|
hy[iby]=heta[ib+iby*nbeta];
|
||||||
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<nbetaY; iby++) {
|
for (int iby=1; iby<nbeta; iby++) {
|
||||||
|
hix[iby]=hix[iby-1]+hx[iby];
|
||||||
hiy[iby]=hiy[iby-1]+hy[iby];
|
hiy[iby]=hiy[iby-1]+hy[iby];
|
||||||
}
|
}
|
||||||
|
|
||||||
tot_eta_y=hiy[nbetaY-1]+1;
|
// ii=0;
|
||||||
|
tot_eta_x=hix[nbeta-1]+1;
|
||||||
|
tot_eta_y=hiy[nbeta-1]+1;
|
||||||
|
|
||||||
for (int iby=0; iby<nbetaY; iby++) {
|
for (int ibx=0; ibx<nbeta; ibx++) {
|
||||||
|
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+iby*nbetaX]=-1;
|
hhy[ib+ibx*nbeta]=-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+iby*nbetaX]=hiy[iby]/tot_eta_y;
|
hhy[ib+ibx*nbeta]=hiy[ibx]/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*nbetaY+nbetaY/2]<0) iby++;
|
while (hhx[iby*nbeta+nbeta/2]<0) iby++;
|
||||||
for (ib=0; ib<iby;ib++) {
|
for (ib=0; ib<iby;ib++) {
|
||||||
for (ibx=0; ibx<nbetaX;ibx++)
|
for (ibx=0; ibx<nbeta;ibx++)
|
||||||
hhx[ibx+nbetaX*ib]=hhx[ibx+nbetaX*iby];
|
hhx[ibx+nbeta*ib]=hhx[ibx+nbeta*iby];
|
||||||
}
|
}
|
||||||
iby=nbetaY-1;
|
iby=nbeta-1;
|
||||||
|
|
||||||
while (hhx[iby*nbetaY+nbetaY/2]<0) iby--;
|
while (hhx[iby*nbeta+nbeta/2]<0) iby--;
|
||||||
for (ib=iby+1; ib<nbetaY;ib++) {
|
for (ib=iby+1; ib<nbeta;ib++) {
|
||||||
for (ibx=0; ibx<nbetaX;ibx++)
|
for (ibx=0; ibx<nbeta;ibx++)
|
||||||
hhx[ibx+nbetaX*ib]=hhx[ibx+nbetaX*iby];
|
hhx[ibx+nbeta*ib]=hhx[ibx+nbeta*iby];
|
||||||
}
|
}
|
||||||
|
|
||||||
iby=0;
|
iby=0;
|
||||||
while (hhy[nbetaX/2*nbetaX+iby]<0) iby++;
|
while (hhy[nbeta/2*nbeta+iby]<0) iby++;
|
||||||
for (ib=0; ib<iby;ib++) {
|
for (ib=0; ib<iby;ib++) {
|
||||||
for (ibx=0; ibx<nbetaY;ibx++)
|
for (ibx=0; ibx<nbeta;ibx++)
|
||||||
hhy[ib+nbetaX*ibx]=hhy[iby+nbetaX*ibx];
|
hhy[ib+nbeta*ibx]=hhy[iby+nbeta*ibx];
|
||||||
}
|
}
|
||||||
iby=nbetaX-1;
|
iby=nbeta-1;
|
||||||
|
|
||||||
while (hhy[nbetaX/2*nbetaX+iby]<0) iby--;
|
while (hhy[nbeta/2*nbeta+iby]<0) iby--;
|
||||||
for (ib=iby+1; ib<nbetaX;ib++) {
|
for (ib=iby+1; ib<nbeta;ib++) {
|
||||||
for (ibx=0; ibx<nbetaY;ibx++)
|
for (ibx=0; ibx<nbeta;ibx++)
|
||||||
hhy[ib+nbetaX*ibx]=hhy[iby+nbetaX*ibx];
|
hhy[ib+nbeta*ibx]=hhy[iby+nbeta*ibx];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -170,16 +156,9 @@ 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 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){
|
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){
|
||||||
// cout << "e2pxy " << nb << " " << emin << " " << emax << endl;
|
// cout << "e2pxy " << nb << " " << emin << " " << emax << endl;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -193,8 +172,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 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){
|
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){
|
||||||
// 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,21 +29,19 @@ class slsInterpolation
|
|||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
slsInterpolation(int nx=400, int ny=400, int ns=25, int nsy=-1) :nPixelsX(nx), nPixelsY(ny), nSubPixelsX(ns), nSubPixelsY(nsy),id(0) {
|
slsInterpolation(int nx=400, int ny=400, int ns=25) :nPixelsX(nx), nPixelsY(ny), nSubPixels(ns), id(0) {
|
||||||
|
|
||||||
if (nSubPixelsY<=0) nSubPixelsY=nSubPixelsX;
|
hint=new int[ns*nx*ns*ny];
|
||||||
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;
|
||||||
nSubPixelsX=orig->nSubPixelsX;
|
nSubPixels=orig->nSubPixels;
|
||||||
nSubPixelsY=orig->nSubPixelsY;
|
|
||||||
|
|
||||||
hint=new int[nSubPixelsX*nPixelsX*nSubPixelsY*nPixelsY];
|
hint=new int[nSubPixels*nPixelsX*nSubPixels*nPixelsY];
|
||||||
memcpy(hint, orig->hint,nSubPixelsX*nPixelsX*nSubPixelsY*nPixelsY*sizeof(int));
|
memcpy(hint, orig->hint,nSubPixels*nPixelsX*nSubPixels*nPixelsY*sizeof(int));
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -53,37 +51,23 @@ class slsInterpolation
|
|||||||
return new slsInterpolation(this);
|
return new slsInterpolation(this);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
int getNSubPixelsX() {return nSubPixelsX;};
|
int getNSubPixels() {return nSubPixels;};
|
||||||
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;
|
||||||
nSubPixelsX=ns;
|
nSubPixels=ns;
|
||||||
if (nsy>0) nSubPixelsY=nsy;
|
hint=new int[nSubPixels*nPixelsX*nSubPixels*nPixelsY];
|
||||||
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;
|
||||||
int getImageSize(int &nnx, int &nny, int &nsx, int &nsy) {
|
ns=nSubPixels;
|
||||||
nnx=nSubPixelsX*nPixelsX;
|
return nSubPixels*nSubPixels*nPixelsX*nPixelsY;
|
||||||
nny=nSubPixelsY*nPixelsY;
|
|
||||||
nsx=nSubPixelsX;
|
|
||||||
nsy=nSubPixelsY;
|
|
||||||
return nSubPixelsX*nSubPixelsY*nPixelsX*nPixelsY;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
int getImageSize() {
|
|
||||||
return nSubPixelsX*nSubPixelsY*nPixelsX*nPixelsY;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -108,14 +92,14 @@ class slsInterpolation
|
|||||||
//cout << "!" <<endl;
|
//cout << "!" <<endl;
|
||||||
float *gm=NULL;
|
float *gm=NULL;
|
||||||
int *dummy=getInterpolatedImage();
|
int *dummy=getInterpolatedImage();
|
||||||
gm=new float[ nSubPixelsX* nSubPixelsY* nPixelsX*nPixelsY];
|
gm=new float[ nSubPixels* nSubPixels* nPixelsX*nPixelsY];
|
||||||
if (gm) {
|
if (gm) {
|
||||||
for (int ix=0; ix<nPixelsX*nSubPixelsX; ix++) {
|
for (int ix=0; ix<nPixelsX*nSubPixels; ix++) {
|
||||||
for (int iy=0; iy<nPixelsY*nSubPixelsY; iy++) {
|
for (int iy=0; iy<nPixelsY*nSubPixels; iy++) {
|
||||||
gm[iy*nPixelsX*nSubPixelsX+ix]=dummy[iy*nPixelsX*nSubPixelsX+ix];
|
gm[iy*nPixelsX*nSubPixels+ix]=dummy[iy*nPixelsX*nSubPixels+ix];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
WriteToTiff(gm, imgname,nSubPixelsY* nPixelsX ,nSubPixelsY* nPixelsY);
|
WriteToTiff(gm, imgname,nSubPixels* nPixelsX ,nSubPixels* 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;
|
||||||
@ -136,9 +120,9 @@ class slsInterpolation
|
|||||||
virtual void clearInterpolatedImage() {
|
virtual void clearInterpolatedImage() {
|
||||||
|
|
||||||
|
|
||||||
for (int ix=0; ix<nPixelsX*nSubPixelsX; ix++) {
|
for (int ix=0; ix<nPixelsX*nSubPixels; ix++) {
|
||||||
for (int iy=0; iy<nPixelsY*nSubPixelsY; iy++) {
|
for (int iy=0; iy<nPixelsY*nSubPixels; iy++) {
|
||||||
hint[iy*nPixelsX*nSubPixelsX+ix]=0;
|
hint[iy*nPixelsX*nSubPixels+ix]=0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -149,11 +133,11 @@ class slsInterpolation
|
|||||||
|
|
||||||
|
|
||||||
virtual int *addToImage(double int_x, double int_y){
|
virtual int *addToImage(double int_x, double int_y){
|
||||||
int iy=((double)nSubPixelsY)*int_y;
|
int iy=((double)nSubPixels)*int_y;
|
||||||
int ix=((double)nSubPixelsX)*int_x;
|
int ix=((double)nSubPixels)*int_x;
|
||||||
if (ix>=0 && ix<(nPixelsX*nSubPixelsX) && iy<(nSubPixelsY*nPixelsY) && iy>=0 ){
|
if (ix>=0 && ix<(nPixelsX*nSubPixels) && iy<(nSubPixels*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*nSubPixelsX))+=1;
|
(*(hint+ix+iy*nPixelsX*nSubPixels))+=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;
|
||||||
@ -196,12 +180,11 @@ 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];
|
||||||
@ -221,95 +204,34 @@ class slsInterpolation
|
|||||||
|
|
||||||
|
|
||||||
if(sumTL >= totquad){
|
if(sumTL >= totquad){
|
||||||
/* #ifdef WRITE_QUAD */
|
/* sDum[0][0] = cluster[1][0]; sDum[1][0] = cluster[2][0]; */
|
||||||
/* /\* sDum[0][0] = cluster[1][0]; sDum[1][0] = cluster[2][0]; *\/ */
|
/* sDum[0][1] = cluster[1][1]; sDum[1][1] = cluster[2][1]; */
|
||||||
/* /\* 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++) {
|
||||||
@ -573,7 +495,7 @@ class slsInterpolation
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
int nPixelsX, nPixelsY;
|
int nPixelsX, nPixelsY;
|
||||||
int nSubPixelsX, nSubPixelsY;
|
int nSubPixels;
|
||||||
int id;
|
int id;
|
||||||
int *hint;
|
int *hint;
|
||||||
};
|
};
|
||||||
|
@ -1,22 +1,15 @@
|
|||||||
|
|
||||||
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/
|
||||||
LDFLAG= -L/usr/lib64/ -lpthread -lm -lstdc++ -lzmq -pthread -lrt -ltiff -O3 -std=c++11 -Wall -L../../build/bin/ -lSlsSupport
|
LDFLAG= -L/usr/lib64/ -lpthread -lm -lstdc++ -lzmq -pthread -lrt -ltiff -O3 -g -std=c++11 -Wall
|
||||||
#-L../../bin -lhdf5 -L.
|
#-L../../bin -lhdf5 -L.
|
||||||
|
|
||||||
#DESTDIR?=../bin
|
#DESTDIR?=../bin
|
||||||
|
|
||||||
all: moenchZmqProcess moenchZmq04Process
|
all: moenchZmqProcess
|
||||||
#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
|
||||||
|
|
||||||
moenchZmq04Process: moenchZmqProcess.cpp clean
|
|
||||||
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,8 +16,7 @@
|
|||||||
|
|
||||||
//#include "etaInterpolationPosXY.h"
|
//#include "etaInterpolationPosXY.h"
|
||||||
#include "noInterpolation.h"
|
#include "noInterpolation.h"
|
||||||
#include "etaInterpolationPosXY.h"
|
#include "etaInterpolationCleverAdaptiveBins.h"
|
||||||
//#include "etaInterpolationCleverAdaptiveBins.h"
|
|
||||||
//#include "etaInterpolationRandomBins.h"
|
//#include "etaInterpolationRandomBins.h"
|
||||||
using namespace std;
|
using namespace std;
|
||||||
#define NC 400
|
#define NC 400
|
||||||
|
@ -149,7 +149,6 @@ int main(int argc, char *argv[]) {
|
|||||||
if (argc>=9) {
|
if (argc>=9) {
|
||||||
nframes=atoi(argv[8]);
|
nframes=atoi(argv[8]);
|
||||||
}
|
}
|
||||||
|
|
||||||
int xmin=0, xmax=nx, ymin=0, ymax=ny;
|
int xmin=0, xmax=nx, ymin=0, ymax=ny;
|
||||||
if (argc>=13) {
|
if (argc>=13) {
|
||||||
xmin=atoi(argv[9]);
|
xmin=atoi(argv[9]);
|
||||||
@ -186,7 +185,6 @@ int main(int argc, char *argv[]) {
|
|||||||
cout << "pedestal file is " << pedfile << endl;
|
cout << "pedestal file is " << pedfile << endl;
|
||||||
if (thr>0)
|
if (thr>0)
|
||||||
cout << "threshold is " << thr << endl;
|
cout << "threshold is " << thr << endl;
|
||||||
cout << "Nframes is " << nframes << endl;
|
|
||||||
|
|
||||||
uint32 nnx, nny;
|
uint32 nnx, nny;
|
||||||
double *gmap;
|
double *gmap;
|
||||||
|
@ -1,24 +1,13 @@
|
|||||||
//#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>
|
||||||
@ -42,12 +31,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
|
||||||
|
|
||||||
@ -60,11 +49,10 @@ int main(int argc, char *argv[]) {
|
|||||||
*/
|
*/
|
||||||
FILE *of=NULL;
|
FILE *of=NULL;
|
||||||
int fifosize=5000;
|
int fifosize=5000;
|
||||||
int etabins=1000, etabinsy=1000;//nsubpix*2*100;
|
int etabins=1000;//nsubpix*2*100;
|
||||||
double etamin=-1, etamax=2;
|
double etamin=-1, etamax=2;
|
||||||
int nSubPixelsX=2;
|
int nSubPixels=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");
|
||||||
@ -79,20 +67,13 @@ 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 ;
|
||||||
std::chrono::steady_clock::time_point begin,end,finished;
|
time_t begin,end,finished;
|
||||||
//time_t begin,end,finished;
|
|
||||||
int rms=0;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (argc > 4) {
|
if (argc > 4) {
|
||||||
@ -112,14 +93,10 @@ 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)
|
||||||
nSubPixelsX=atoi(argv[6]);
|
nSubPixels=atoi(argv[6]);
|
||||||
nSubPixelsY=nSubPixelsX;
|
cout << "Number of subpixels is: " << nSubPixels << endl;
|
||||||
#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) {
|
||||||
@ -134,17 +111,12 @@ int main(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//slsDetectorData *det=new moench03T1ZmqDataNew();
|
//slsDetectorData *det=new moench03T1ZmqDataNew();
|
||||||
#ifndef MOENCH04
|
|
||||||
moench03T1ZmqDataNew *det=new moench03T1ZmqDataNew();
|
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]);
|
||||||
@ -155,16 +127,10 @@ int main(int argc, char *argv[]) {
|
|||||||
char dummybuff[size];
|
char dummybuff[size];
|
||||||
|
|
||||||
|
|
||||||
moench03CommonMode *cm=NULL;
|
int ncol_cm=CM_ROWS;
|
||||||
moench03GhostSummation *gs=NULL;
|
double xt_ghost=C_GHOST;
|
||||||
#ifdef CORR
|
moench03CommonMode *cm=new moench03CommonMode(ncol_cm);
|
||||||
|
moench03GhostSummation *gs=new moench03GhostSummation(det, xt_ghost);
|
||||||
//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;
|
||||||
@ -192,14 +158,14 @@ 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, 1000, 100, -1, -1, gainmap, gs);
|
singlePhotonDetector *filter=new singlePhotonDetector(det,3, nSigma, 1, cm, 1000, 10, -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, nSubPixelsX,nSubPixelsY, etabins, etabinsy, etamin, etamax);
|
eta2InterpolationPosXY *interp=new eta2InterpolationPosXY(npx, npy, nSubPixels, etabins, etamin, etamax);
|
||||||
|
|
||||||
if (etafname) interp->readFlatField(etafname);
|
if (etafname) interp->readFlatField(etafname);
|
||||||
|
|
||||||
@ -294,17 +260,7 @@ 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;
|
||||||
#ifdef MOENCH_BRANCH
|
//uint32_t subFrameIndex = -1;
|
||||||
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];
|
||||||
@ -314,10 +270,10 @@ int main(int argc, char *argv[]) {
|
|||||||
int iframe=0;
|
int iframe=0;
|
||||||
char ofname[10000];
|
char ofname[10000];
|
||||||
|
|
||||||
string fname;
|
char fname[10000];
|
||||||
// int length;
|
// int length;
|
||||||
int *detimage=NULL;
|
int *detimage;
|
||||||
int nnx, nny,nnsx, nnsy;
|
int nnx, nny,nns;
|
||||||
//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
|
||||||
@ -325,20 +281,19 @@ 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;
|
||||||
string additionalJsonHeader="" ;
|
// int* flippedData = 0;
|
||||||
|
char* additionalJsonHeader = 0;
|
||||||
|
|
||||||
int32_t threshold=0;
|
int32_t threshold=0;
|
||||||
|
|
||||||
@ -356,10 +311,9 @@ int main(int argc, char *argv[]) {
|
|||||||
frameMode fMode=eFrame;
|
frameMode fMode=eFrame;
|
||||||
double *ped;
|
double *ped;
|
||||||
|
|
||||||
filter->getImageSize(nnx, nny,nnsx, nnsy);
|
filter->getImageSize(nnx, nny,nns);
|
||||||
|
|
||||||
|
|
||||||
std::map<std::string, std::string> addJsonHeader;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -369,21 +323,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;
|
||||||
// rapidjson::Document doc;
|
if (!zmqsocket->ReceiveHeader(0, doc, SLS_DETECTOR_JSON_HEADER_VERSION)) {
|
||||||
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
|
||||||
|
|
||||||
@ -394,68 +348,26 @@ 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.c_str(),fileindex);
|
sprintf(ofname,"%s_%ld_ped.tiff",fname,fileindex);
|
||||||
mt->writePedestal(ofname);
|
mt->writePedestal(ofname);
|
||||||
cout << "Writing pedestal to " << ofname << endl;
|
cout << "Writing pedestal to " << ofname << endl;
|
||||||
if (rms){
|
|
||||||
sprintf(ofname,"%s_%ld_var.tiff",fname.c_str(),fileindex);
|
|
||||||
mt->writePedestalRMS(ofname);
|
|
||||||
|
|
||||||
}
|
|
||||||
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.c_str(),fileindex);
|
sprintf(ofname,"%s_%ld_eta.tiff",fname,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 {
|
||||||
if (subframes>0 ) {
|
sprintf(ofname,"%s_%ld.tiff",fname,fileindex);
|
||||||
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;
|
||||||
@ -464,13 +376,11 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
if (fMode==ePedestal) {
|
if (fMode==ePedestal) {
|
||||||
cprintf(MAGENTA,"Get pedestal!\n");
|
cprintf(MAGENTA,"Get pedestal!\n");
|
||||||
nnsx=1;
|
nns=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*nnsx*nnsy];
|
dout= new int32_t[nnx*nny*nns*nns];
|
||||||
// cout << "get pedestal " << endl;
|
// cout << "get pedestal " << endl;
|
||||||
ped=mt->getPedestal();
|
ped=mt->getPedestal();
|
||||||
// cout << "got pedestal " << endl;
|
// cout << "got pedestal " << endl;
|
||||||
@ -496,19 +406,15 @@ int main(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
else {
|
else {
|
||||||
detimage=mt->getImage(nnx,nny,nnsx, nnsy);
|
detimage=mt->getImage(nnx,nny,nns);
|
||||||
cprintf(MAGENTA,"Get image!\n");
|
cprintf(MAGENTA,"Get image!\n");
|
||||||
cout << nnx << " " << nny << " " << nnsx << " " << nnsy << endl;
|
cout << nnx << " " << nny << " " << nns << 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++) {
|
||||||
@ -520,49 +426,71 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
dout[ix]=detimage[ix]*subnorm;
|
dout[ix]=detimage[ix];
|
||||||
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) {
|
|
||||||
|
|
||||||
// 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);
|
//// int SendHeaderData ( int index, bool dummy, uint32_t jsonversion, uint32_t dynamicrange = 0, uint64_t fileIndex = 0,
|
||||||
|
// 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, 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, additionalJsonHeader);
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef DEVELOPER
|
||||||
|
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
|
||||||
|
#ifdef MOENCH_BRANCH
|
||||||
|
/*
|
||||||
|
int SendHeaderData ( int index, bool dummy, uint32_t jsonversion, uint32_t dynamicrange = 0, uint64_t fileIndex = 0,
|
||||||
|
uint32_t npixelsx = 0, uint32_t npixelsy = 0, uint32_t imageSize = 0,
|
||||||
|
uint64_t acqIndex = 0, uint64_t fIndex = 0, 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* flippedData = 0,
|
||||||
|
char* additionalJsonHeader = 0) {
|
||||||
|
int ZmqSocket::SendHeaderData(int 0, bool false, uint32_t SLS_DETECTOR_JSON_HEADER_VERSION , uint32_t dr, uint64_t fileindex, uint32_t 0, uint32_t 0, uint32_t, uint64_t, uint64_t, char*, uint64_t, uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t, int*, char*)
|
||||||
|
|
||||||
|
*/
|
||||||
|
//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,additionalJsonHeader);
|
||||||
|
zmqsocket2->SendHeaderData (0, false, SLS_DETECTOR_JSON_HEADER_VERSION, dr, fileindex, nnx, nny, nnx*nny*dr/8,acqIndex, frameIndex, fname, acqIndex, subFrameIndex, packetNumber,bunchId, timestamp, modId, xCoord, yCoord, zCoord,debug, roundRNumber, detType, version, flippedData, additionalJsonHeader);
|
||||||
|
|
||||||
|
/* old
|
||||||
|
zmqsocket2->SendHeaderData (0, false, SLS_DETECTOR_JSON_HEADER_VERSION, dr, fileindex, nnx, nny, nnx*nny*dr/8,acqIndex, frameIndex, fname, acqIndex, subFrameIndex, packetNumber,bunchId, timestamp, modId, xCoord, yCoord, zCoord,debug, roundRNumber, detType, version, flippedData, additionalJsonHeader);
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
|
||||||
|
|
||||||
|
new
|
||||||
|
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,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");
|
||||||
}
|
|
||||||
outHeader.data=false;
|
zmqsocket2->SendHeaderData(0, true, SLS_DETECTOR_JSON_HEADER_VERSION);
|
||||||
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;
|
||||||
@ -574,103 +502,49 @@ 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();
|
||||||
|
|
||||||
//time(&finished);
|
cout << "Measurement lasted " << difftime(end,begin) << endl;
|
||||||
//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) {
|
||||||
begin = std::chrono::steady_clock::now();
|
time(&begin);
|
||||||
|
// t0 = high_resolution_clock::now();
|
||||||
|
//cout <<"new frame" << endl;
|
||||||
|
|
||||||
size = zHeader.imageSize;//doc["size"].GetUint();
|
// acqIndex, frameIndex, subframeIndex, filename, fileindex
|
||||||
|
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"
|
||||||
@ -700,19 +574,15 @@ document["completeImage"].GetUint(); zHeader.completeImage
|
|||||||
// 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;
|
||||||
rms=0;
|
|
||||||
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 (addJsonHeader.find("frameMode")!= addJsonHeader.end()) {
|
if (doc["frameMode"].IsString()) {
|
||||||
// if (doc["frameMode"].IsString()) {
|
frameMode_s=doc["frameMode"].GetString();
|
||||||
frameMode_s=addJsonHeader.at("frameMode");//doc["frameMode"].GetString();
|
|
||||||
if (frameMode_s == "pedestal"){
|
if (frameMode_s == "pedestal"){
|
||||||
fMode=ePedestal;
|
fMode=ePedestal;
|
||||||
//isPedestal=1;
|
//isPedestal=1;
|
||||||
@ -721,12 +591,6 @@ document["completeImage"].GetUint(); zHeader.completeImage
|
|||||||
// cprintf(MAGENTA, "Resetting pedestal\n");
|
// cprintf(MAGENTA, "Resetting pedestal\n");
|
||||||
fMode=ePedestal;
|
fMode=ePedestal;
|
||||||
//isPedestal=1;
|
//isPedestal=1;
|
||||||
} else if (frameMode_s == "variance"){
|
|
||||||
mt->newDataSet(); //resets pedestal
|
|
||||||
// cprintf(MAGENTA, "Resetting pedestal\n");
|
|
||||||
fMode=ePedestal;
|
|
||||||
//isPedestal=1;
|
|
||||||
rms=1;
|
|
||||||
}
|
}
|
||||||
#ifdef INTERP
|
#ifdef INTERP
|
||||||
else if (frameMode_s == "flatfield") {
|
else if (frameMode_s == "flatfield") {
|
||||||
@ -738,7 +602,7 @@ document["completeImage"].GetUint(); zHeader.completeImage
|
|||||||
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;
|
||||||
@ -746,23 +610,19 @@ document["completeImage"].GetUint(); zHeader.completeImage
|
|||||||
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());
|
||||||
mt->setFrameMode(fMode);
|
mt->setFrameMode(fMode);
|
||||||
|
|
||||||
// threshold=0;
|
// threshold=0;
|
||||||
cprintf(MAGENTA, "Threshold: ");
|
cprintf(MAGENTA, "Threshold: ");
|
||||||
if (addJsonHeader.find("threshold")!= addJsonHeader.end()) {
|
if (doc.HasMember("threshold")) {
|
||||||
istringstream(addJsonHeader.at("threshold")) >>threshold;
|
if (doc["threshold"].IsInt()) {
|
||||||
// threshold=atoi(addJsonHeader.at("threshold").c_str());//doc["frameMode"].GetString();
|
threshold=doc["threshold"].GetInt();
|
||||||
}
|
|
||||||
//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;
|
||||||
@ -770,47 +630,40 @@ document["completeImage"].GetUint(); zHeader.completeImage
|
|||||||
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 (addJsonHeader.find("roi")!= addJsonHeader.end()) {
|
if (doc["roi"].Size() > 1 )
|
||||||
istringstream(addJsonHeader.at("roi")) >> xmin >> xmax >> ymin >> ymax ;
|
if (doc["roi"][1].IsInt())
|
||||||
// if (doc.HasMember("roi")) {
|
xmax=doc["roi"][1].GetInt();
|
||||||
//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 (doc["roi"].Size() > 2 )
|
||||||
// if (doc["roi"][1].IsInt())
|
if (doc["roi"][2].IsInt())
|
||||||
// xmax=doc["roi"][1].GetInt();
|
ymin=doc["roi"][2].GetInt();
|
||||||
|
|
||||||
// if (doc["roi"].Size() > 2 )
|
if (doc["roi"].Size() > 3 )
|
||||||
// if (doc["roi"][2].IsInt())
|
if (doc["roi"][3].IsInt())
|
||||||
// ymin=doc["roi"][2].GetInt();
|
ymax=doc["roi"][3].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()) {
|
|
||||||
istringstream(addJsonHeader.at("dynamicRange")) >> dr ;
|
if (doc.HasMember("dynamicRange")) {
|
||||||
|
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 (addJsonHeader.find("detectorMode")!= addJsonHeader.end()) {;
|
if (doc.HasMember("detectorMode")) {
|
||||||
//if (doc.HasMember("detectorMode")) {
|
if (doc["detectorMode"].IsString()) {
|
||||||
//if (doc["detectorMode"].IsString()) {
|
detectorMode_s=doc["detectorMode"].GetString();
|
||||||
detectorMode_s=addJsonHeader.at("detectorMode");//=doc["detectorMode"].GetString();
|
|
||||||
#ifdef INTERP
|
#ifdef INTERP
|
||||||
if (detectorMode_s == "interpolating"){
|
if (detectorMode_s == "interpolating"){
|
||||||
dMode=eInterpolating;
|
dMode=eInterpolating;
|
||||||
@ -828,7 +681,7 @@ document["completeImage"].GetUint(); zHeader.completeImage
|
|||||||
mt->setInterpolation(NULL);
|
mt->setInterpolation(NULL);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -876,21 +729,6 @@ document["completeImage"].GetUint(); zHeader.completeImage
|
|||||||
// 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();*/
|
||||||
@ -916,98 +754,33 @@ document["completeImage"].GetUint(); zHeader.completeImage
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 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=zHeader.packetNumber; //doc["packetNumber"].GetUint();
|
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);
|
||||||
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, int &nsy) {return det->getImageSize(nnx, nny, ns, nsy);};
|
virtual int getImageSize(int &nnx, int &nny, int &ns) {return det->getImageSize(nnx, nny, ns);};
|
||||||
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() {if (fifoData->isEmpty() && busy==0) return 0; else return 1;}
|
virtual int isBusy() {return busy;}
|
||||||
|
|
||||||
//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, int nsy) {
|
virtual int setNSubPixels(int ns) {
|
||||||
slsInterpolation *interp=(det)->getInterpolation();
|
slsInterpolation *interp=(det)->getInterpolation();
|
||||||
if (interp) interp->setNSubPixels(ns, nsy);
|
if (interp) return interp->setNSubPixels(ns);
|
||||||
return 1;};
|
else 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,7 +259,6 @@ 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;
|
||||||
@ -314,13 +313,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, int &nsy) {
|
virtual int *getImage(int &nnx, int &nny, int &ns) {
|
||||||
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, nsy);
|
int nn=dets[0]->getImageSize(nnx, nny,ns);
|
||||||
if (image) {
|
if (image) {
|
||||||
delete [] image;
|
delete image;
|
||||||
image=NULL;
|
image=NULL;
|
||||||
}
|
}
|
||||||
image=new int[nn];
|
image=new int[nn];
|
||||||
@ -363,10 +362,10 @@ public:
|
|||||||
/* dets[ii]->writeImage(tit); */
|
/* dets[ii]->writeImage(tit); */
|
||||||
/* } */
|
/* } */
|
||||||
/* #endif */
|
/* #endif */
|
||||||
int nnx, nny, ns, nsy;
|
int nnx, nny, ns;
|
||||||
getImage(nnx, nny, ns,nsy);
|
getImage(nnx, nny, ns);
|
||||||
//int nnx, nny, ns;
|
//int nnx, nny, ns;
|
||||||
int nn=dets[0]->getImageSize(nnx, nny, ns, nsy);
|
int nn=dets[0]->getImageSize(nnx, nny, ns);
|
||||||
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++) {
|
||||||
@ -463,50 +462,6 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
virtual double *getPedestalRMS(){
|
|
||||||
int nx, ny;
|
|
||||||
dets[0]->getDetectorSize(nx,ny);
|
|
||||||
// if (ped) delete [] ped;
|
|
||||||
double *rms=new double[nx*ny];
|
|
||||||
double *p0=new double[nx*ny];
|
|
||||||
|
|
||||||
for (int i=0; i<nThreads; i++) {
|
|
||||||
//inte=(slsInterpolation*)dets[i]->getInterpolation(nb,emi,ema);
|
|
||||||
// cout << i << endl;
|
|
||||||
p0=dets[i]->getPedestalRMS(p0);
|
|
||||||
if (p0) {
|
|
||||||
if (i==0) {
|
|
||||||
|
|
||||||
for (int ib=0; ib<nx*ny; ib++) {
|
|
||||||
rms[ib]=p0[ib]*p0[ib]/((double)nThreads);
|
|
||||||
// cout << p0[ib] << " ";
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (int ib=0; ib<nx*ny; ib++) {
|
|
||||||
rms[ib]+=p0[ib]*p0[ib]/((double)nThreads);
|
|
||||||
// cout << p0[ib] << " ";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
delete [] p0;
|
|
||||||
|
|
||||||
/* for (int ib=0; ib<nx*ny; ib++) { */
|
|
||||||
/* if (rms[ib]>0) */
|
|
||||||
/* rms[ib]=sqrt(ped[ib]); */
|
|
||||||
/* else */
|
|
||||||
/* rms[ib]=0; */
|
|
||||||
/* } */
|
|
||||||
|
|
||||||
|
|
||||||
return rms;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
virtual double *setPedestal(double *h=NULL){
|
virtual double *setPedestal(double *h=NULL){
|
||||||
//int nb=0;
|
//int nb=0;
|
||||||
|
|
||||||
@ -543,27 +498,6 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
virtual void *writePedestalRMS(const char * imgname){
|
|
||||||
|
|
||||||
int nx, ny;
|
|
||||||
dets[0]->getDetectorSize(nx,ny);
|
|
||||||
|
|
||||||
double *rms=getPedestalRMS();
|
|
||||||
float *gm=new float[nx*ny];
|
|
||||||
if (gm) {
|
|
||||||
for (int ix=0; ix<nx*ny; ix++) {
|
|
||||||
gm[ix]=rms[ix];
|
|
||||||
}
|
|
||||||
WriteToTiff(gm,imgname ,nx, ny);
|
|
||||||
delete [] gm;
|
|
||||||
delete [] rms;
|
|
||||||
} else cout << "Could not allocate float image " << endl;
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
virtual void *readPedestal(const char * imgname, int nb=-1, double emin=1, double emax=0){
|
virtual void *readPedestal(const char * imgname, int nb=-1, double emin=1, double emax=0){
|
||||||
|
|
||||||
int nx, ny;
|
int nx, ny;
|
||||||
|
@ -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 &nsx, int &nsy) {
|
virtual int *getImage(int &nnx, int &nny, int &ns) {
|
||||||
if (getInterpolation()==NULL) return multiThreadedAnalogDetector::getImage(nnx,nny,nsx, nsy);
|
if (getInterpolation()==NULL) return multiThreadedAnalogDetector::getImage(nnx,nny,ns);
|
||||||
//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,nsx, nsy);
|
int nn=dets[0]->getImageSize(nnx, nny,ns);
|
||||||
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,13 +51,14 @@ 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), c2(1),c3(1), 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), clusters(NULL), quad(UNDEFINED_QUADRANT), tot(0), quadTot(0) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -65,18 +66,13 @@ 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];
|
||||||
|
|
||||||
@ -104,10 +100,8 @@ 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;
|
||||||
@ -117,10 +111,6 @@ 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;
|
||||||
@ -134,8 +124,6 @@ public analogDetector<uint16_t> {
|
|||||||
gmap=orig->gmap;
|
gmap=orig->gmap;
|
||||||
nphTot=0;
|
nphTot=0;
|
||||||
nphFrame=0;
|
nphFrame=0;
|
||||||
nphTot=0;
|
|
||||||
nphFrame=0;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -208,6 +196,7 @@ 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;
|
||||||
|
|
||||||
@ -229,8 +218,8 @@ public analogDetector<uint16_t> {
|
|||||||
cout << "add to common mode?"<< endl;
|
cout << "add to common mode?"<< endl;
|
||||||
addToCommonMode(data);
|
addToCommonMode(data);
|
||||||
}
|
}
|
||||||
for (iy=ymin; iy<ymax; ++iy) {
|
for (int iy=ymin; iy<ymax; iy++) {
|
||||||
for (ix=xmin; ix<xmax; ++ix) {
|
for (int 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);
|
||||||
|
|
||||||
@ -247,8 +236,8 @@ public analogDetector<uint16_t> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (iy=ymin; iy<ymax; ++iy) {
|
for (int iy=ymin; iy<ymax; iy++) {
|
||||||
for (ix=xmin; ix<xmax; ++ix) {
|
for (int ix=xmin; ix<xmax; ix++) {
|
||||||
|
|
||||||
if (det->isGood(ix,iy)) {
|
if (det->isGood(ix,iy)) {
|
||||||
eventMask[iy][ix]=PEDESTAL;
|
eventMask[iy][ix]=PEDESTAL;
|
||||||
@ -357,20 +346,15 @@ int *getClusters(char *data, int *ph=NULL) {
|
|||||||
|
|
||||||
|
|
||||||
int nph=0;
|
int nph=0;
|
||||||
// const int cy=(clusterSizeY+1)/2;
|
double val[ny][nx];
|
||||||
//const int cs=(clusterSize+1)/2;
|
int cy=(clusterSizeY+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;
|
||||||
int ir, ic;
|
if (cmSub) cm=1;
|
||||||
// double quadTot;
|
|
||||||
//quadrant quad;
|
|
||||||
double rms;
|
|
||||||
//if (cmSub) cm=1;
|
|
||||||
double val[ny][nx];
|
|
||||||
if (ph==NULL)
|
if (ph==NULL)
|
||||||
ph=image;
|
ph=image;
|
||||||
|
|
||||||
@ -382,15 +366,13 @@ int *getClusters(char *data, int *ph=NULL) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (cmSub) {
|
if (cm)
|
||||||
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;
|
||||||
@ -402,19 +384,20 @@ int *getClusters(char *data, int *ph=NULL) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
//eventMask[iy][ix]
|
eventMask[iy][ix]=PEDESTAL;
|
||||||
ee=PEDESTAL;
|
|
||||||
|
|
||||||
|
|
||||||
rms=getPedestalRMS(ix,iy);
|
(clusters+nph)->rms=getPedestalRMS(ix,iy);
|
||||||
// cluster=clusters+nph;
|
// cluster=clusters+nph;
|
||||||
|
|
||||||
// cout << ix << " " << iy << endl;
|
|
||||||
for (ir=-(clusterSizeY/2); ir<(clusterSizeY/2)+1; ir++) {
|
for (int ir=-(clusterSizeY/2); ir<(clusterSizeY/2)+1; ir++) {
|
||||||
for (ic=-(clusterSize/2); ic<(clusterSize/2)+1; ic++) {
|
for (int 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)
|
||||||
@ -429,68 +412,44 @@ 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 (ix==50 && iy==50) */
|
if (eventMask[iy][ix]==PHOTON && val[iy][ix]<max)
|
||||||
/* 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 (max>nSigma*rms){
|
if (bl>=br && bl>=tl && bl>=tr) {
|
||||||
// cout << "ph1 " << max << " " << nSigma*rms << endl;
|
(clusters+nph)->quad=BOTTOM_LEFT;
|
||||||
ee=PHOTON;
|
(clusters+nph)->quadTot=bl;
|
||||||
if (val[iy][ix]<max)
|
} else if (br>=bl && br>=tl && br>=tr) {
|
||||||
continue;
|
(clusters+nph)->quad=BOTTOM_RIGHT;
|
||||||
}
|
(clusters+nph)->quadTot=br;
|
||||||
else if (tot>c3*nSigma*rms) {
|
} else if (tl>=br && tl>=bl && tl>=tr) {
|
||||||
// cout << "ph3 " << tot << " " << c3*nSigma*rms << endl;
|
(clusters+nph)->quad=TOP_LEFT;
|
||||||
ee=PHOTON;
|
(clusters+nph)->quadTot=tl;
|
||||||
}
|
} else if (tr>=bl && tr>=tl && tr>=br) {
|
||||||
#ifndef WRITE_QUAD
|
(clusters+nph)->quad=TOP_RIGHT;
|
||||||
else {
|
(clusters+nph)->quadTot=tr;
|
||||||
#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 (quadTot>c2*nSigma*rms) {
|
if (max>nSigma*(clusters+nph)->rms || tot>sqrt(clusterSizeY*clusterSize)*nSigma*(clusters+nph)->rms || ((clusters+nph)->quadTot)>sqrt(cy*cs)*nSigma*(clusters+nph)->rms) {
|
||||||
// cout << "ph2 " << quadTot << " " << c2*nSigma*rms << endl;
|
if (val[iy][ix]>=max) {
|
||||||
ee=PHOTON;
|
eventMask[iy][ix]=PHOTON_MAX;
|
||||||
}
|
|
||||||
|
|
||||||
#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 (ir=-(clusterSizeY/2); ir<(clusterSizeY/2)+1; ir++) {
|
for (int ir=-(clusterSizeY/2); ir<(clusterSizeY/2)+1; ir++) {
|
||||||
for (ic=-(clusterSize/2); ic<(clusterSize/2)+1; ic++) {
|
for (int 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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -503,19 +462,19 @@ int *getClusters(char *data, int *ph=NULL) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} else if (ee==PEDESTAL) {
|
} else {
|
||||||
addToPedestal(data,ix,iy,cm);
|
|
||||||
} /*else {
|
|
||||||
eventMask[iy][ix]=PHOTON;
|
eventMask[iy][ix]=PHOTON;
|
||||||
}*/
|
}
|
||||||
//eventMask[iy][ix]=ee;
|
} else if (eventMask[iy][ix]==PEDESTAL) {
|
||||||
|
addToPedestal(data,ix,iy,cm);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nphFrame=nph;
|
nphFrame=nph;
|
||||||
nphTot+=nph;
|
nphTot+=nph;
|
||||||
//cout << nphFrame << endl;
|
//cout << nphFrame << endl;
|
||||||
//cout <<id << " **********************************"<< iframe << " " << det->getFrameNumber(data) << " " << nphFrame << endl;
|
// cout <<"**********************************"<< det->getFrameNumber(data) << " " << nphFrame << endl;
|
||||||
writeClusters(det->getFrameNumber(data));
|
writeClusters(det->getFrameNumber(data));
|
||||||
return image;
|
return image;
|
||||||
|
|
||||||
@ -602,20 +561,13 @@ 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++)
|
||||||
@ -671,7 +623,6 @@ 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 */
|
||||||
@ -680,7 +631,6 @@ 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,14 +36,16 @@ 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); // if (fwrite((void*)this, 1, sizeof(int)+2*sizeof(int16_t), myFile))
|
//fwrite((void*)this, 1, 3*sizeof(int)+4*sizeof(double)+sizeof(quad), 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, sizeof(int16_t), 2, myFile))
|
if (fwrite((void*)&x, 2, sizeof(int16_t), myFile))
|
||||||
return fwrite((void*)data, sizeof(int), dx*dy, myFile);
|
return fwrite((void*)data, 1, dx*dy*sizeof(int), myFile);
|
||||||
#endif
|
#endif
|
||||||
#ifdef WRITE_QUAD
|
#ifdef WRITE_QUAD
|
||||||
// printf("quad ");
|
// printf("quad ");
|
||||||
@ -89,8 +91,8 @@ class single_photon_hit {
|
|||||||
default:
|
default:
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
if (fwrite((void*)&x, sizeof(int16_t), 2, myFile))
|
if (fwrite((void*)&x, 2, sizeof(int16_t), myFile))
|
||||||
return fwrite((void*)qq, sizeof(int), 4, myFile);
|
return fwrite((void*)qq, 1, 4*sizeof(int), myFile);
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
@ -102,19 +104,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, sizeof(int16_t),2, myFile))
|
if (fread((void*)&x, 2, sizeof(int16_t), myFile))
|
||||||
return fread((void*)data, sizeof(int), dx*dy,myFile);
|
return fread((void*)data, 1, dx*dy*sizeof(int), 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, sizeof(int16_t), 2, myFile))
|
if (fread((void*)&x, 2, sizeof(int16_t), myFile))
|
||||||
if (fread((void*)qq, sizeof(int), 4, myFile)) {
|
if (fread((void*)qq, 1, 4*sizeof(int), myFile)) {
|
||||||
|
|
||||||
quad=TOP_RIGHT;
|
quad=TOP_RIGHT;
|
||||||
/* int mm=qq[0]; */
|
/* int mm=qq[0]; */
|
||||||
@ -214,6 +216,7 @@ 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");
|
||||||
}
|
}
|
||||||
@ -243,6 +246,8 @@ 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 */
|
||||||
@ -250,8 +255,6 @@ 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 */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -4,10 +4,10 @@ find_package(PNG REQUIRED)
|
|||||||
find_package(ZLIB REQUIRED)
|
find_package(ZLIB REQUIRED)
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
slsDetectorPlotting/src/SlsQt1DPlot.cpp
|
slsDetectorPlotting/src/SlsQt1DPlot.cxx
|
||||||
slsDetectorPlotting/src/SlsQt1DZoomer.cpp
|
slsDetectorPlotting/src/SlsQt1DZoomer.cxx
|
||||||
slsDetectorPlotting/src/SlsQt2DHist.cpp
|
slsDetectorPlotting/src/SlsQt2DHist.cxx
|
||||||
slsDetectorPlotting/src/SlsQt2DPlot.cpp
|
slsDetectorPlotting/src/SlsQt2DPlot.cxx
|
||||||
src/qDetectorMain.cpp
|
src/qDetectorMain.cpp
|
||||||
src/qDrawPlot.cpp
|
src/qDrawPlot.cpp
|
||||||
src/qCloneWidget.cpp
|
src/qCloneWidget.cpp
|
||||||
@ -88,7 +88,6 @@ 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}
|
||||||
@ -104,10 +103,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}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>376</width>
|
<width>500</width>
|
||||||
<height>425</height>
|
<height>350</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
@ -55,149 +55,6 @@
|
|||||||
</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">
|
||||||
@ -383,8 +240,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>376</width>
|
<width>500</width>
|
||||||
<height>27</height>
|
<height>28</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QMenu" name="menuSave">
|
<widget class="QMenu" name="menuSave">
|
||||||
|
@ -145,10 +145,6 @@
|
|||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>SLS Detector GUI</string>
|
<string>SLS Detector GUI</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowIcon">
|
|
||||||
<iconset resource="../include/icons.qrc">
|
|
||||||
<normaloff>:/icons/images/mountain.png</normaloff>:/icons/images/mountain.png</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="inputMethodHints">
|
<property name="inputMethodHints">
|
||||||
<set>Qt::ImhNone</set>
|
<set>Qt::ImhNone</set>
|
||||||
</property>
|
</property>
|
||||||
@ -375,6 +371,101 @@ p, li { white-space: pre-wrap; }
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
|
<action name="actionOpenSetup">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Load &Setup</string>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font/>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionSaveSetup">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Save &Setup</string>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font/>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionMeasurementWizard">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Measurement Wizard</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionOpenConfiguration">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Load &Configuration</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionSaveConfiguration">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Save &Configuration</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionEnergyCalibration">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Energy Calibration</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionAngularCalibration">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Angular Calibration</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionDebug">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>&Debug</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionBeamline">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>&Beamline</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionExpert">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>&Expert</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionConfiguration">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>&Configuration</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionVersion">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Version</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionAbout">
|
||||||
|
<property name="text">
|
||||||
|
<string>&About</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
<action name="actionLoadConfiguration">
|
<action name="actionLoadConfiguration">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Load Configuration</string>
|
<string>Load Configuration</string>
|
||||||
@ -385,11 +476,6 @@ p, li { white-space: pre-wrap; }
|
|||||||
<string>Load Trimbits</string>
|
<string>Load Trimbits</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionLoadParameters">
|
|
||||||
<property name="text">
|
|
||||||
<string>Load Parameters</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="actionDebug">
|
<action name="actionDebug">
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
@ -414,14 +500,12 @@ p, li { white-space: pre-wrap; }
|
|||||||
<string>Dockable Windows</string>
|
<string>Dockable Windows</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionAbout">
|
<action name="actionLoadParameters">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&About</string>
|
<string>Load Parameters</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources/>
|
||||||
<include location="../include/icons.qrc"/>
|
|
||||||
</resources>
|
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
@ -19,8 +19,47 @@
|
|||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Form</string>
|
<string>Form</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="layout">
|
||||||
<item row="2" column="0" colspan="4">
|
<property name="margin">
|
||||||
|
<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">
|
||||||
@ -47,6 +86,73 @@
|
|||||||
<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">
|
||||||
@ -75,8 +181,8 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="0" column="7">
|
||||||
<widget class="QLabel" name="lblMinDisp">
|
<widget class="QLabel" name="lblSumDisp">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
@ -88,19 +194,6 @@
|
|||||||
</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">
|
||||||
@ -129,32 +222,6 @@
|
|||||||
</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">
|
||||||
@ -168,213 +235,9 @@
|
|||||||
</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,6 +1066,239 @@
|
|||||||
<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">
|
||||||
@ -1192,98 +1425,6 @@ 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">
|
||||||
@ -1349,428 +1490,6 @@ 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>
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -822,7 +822,7 @@ Displays minimum, maximum and sum of values for each plot.
|
|||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QStackedWidget" name="stackedWidget1D">
|
<widget class="QStackedWidget" name="stackedWidget1D">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>5</number>
|
<number>3</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="pageSuperImpose">
|
<widget class="QWidget" name="pageSuperImpose">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
@ -1360,27 +1360,6 @@ Displays minimum, maximum and sum of values for each plot.
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="chkGainPlot1D">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string><nobr>
|
|
||||||
Displays minimum, maximum and sum of values for each plot.
|
|
||||||
<nobr></string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Gain Plot</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
@ -2368,6 +2347,7 @@ Displays minimum, maximum and sum of values for each plot.
|
|||||||
<zorder>box1D</zorder>
|
<zorder>box1D</zorder>
|
||||||
<zorder>boxFrequency</zorder>
|
<zorder>boxFrequency</zorder>
|
||||||
<zorder>box2D</zorder>
|
<zorder>box2D</zorder>
|
||||||
|
<zorder>horizontalSpacer_6</zorder>
|
||||||
<zorder>boxPlotAxis</zorder>
|
<zorder>boxPlotAxis</zorder>
|
||||||
<zorder>boxSave</zorder>
|
<zorder>boxSave</zorder>
|
||||||
</widget>
|
</widget>
|
||||||
|
@ -214,46 +214,6 @@
|
|||||||
<string>Very Low Gain</string>
|
<string>Very Low Gain</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>G1_HG</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>G1_LG</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>G2_HC_HG</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>G2_HC_LG</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>G2_LC_HG</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>G2_LC_LG</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>G4_HG</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>G4_LG</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Undefined</string>
|
<string>Undefined</string>
|
||||||
|
19
slsDetectorGui/include/qCloneWidget.h
Normal file → Executable file
19
slsDetectorGui/include/qCloneWidget.h
Normal file → Executable file
@ -1,21 +1,25 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "ui_form_cloneplot.h"
|
#include "ui_form_cloneplot.h"
|
||||||
#include <QMainWindow>
|
|
||||||
#include <QString>
|
|
||||||
|
|
||||||
class SlsQtH1D;
|
class SlsQtH1D;
|
||||||
class SlsQt1DPlot;
|
class SlsQt1DPlot;
|
||||||
class SlsQt2DPlot;
|
class SlsQt2DPlot;
|
||||||
|
|
||||||
|
#include <QMainWindow>
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
class qCloneWidget : public QMainWindow, private Ui::ClonePlotObject {
|
class qCloneWidget : public QMainWindow, private Ui::ClonePlotObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
qCloneWidget(QWidget *parent, SlsQt1DPlot *p1, SlsQt2DPlot *p2,
|
qCloneWidget(QWidget *parent, SlsQt1DPlot *p1, SlsQt2DPlot *p2, SlsQt2DPlot *gp,
|
||||||
SlsQt1DPlot *gp1, SlsQt2DPlot *gp, QString title,
|
QString title, QString filePath, QString fileName,
|
||||||
QString filePath, QString fileName, int64_t aIndex,
|
int64_t aIndex, bool displayStats, QString min, QString max,
|
||||||
bool displayStats, QString min, QString max, QString sum,
|
QString sum);
|
||||||
bool completeImage);
|
|
||||||
|
|
||||||
~qCloneWidget();
|
~qCloneWidget();
|
||||||
|
|
||||||
@ -33,7 +37,6 @@ class qCloneWidget : public QMainWindow, private Ui::ClonePlotObject {
|
|||||||
int id;
|
int id;
|
||||||
SlsQt1DPlot *plot1d{nullptr};
|
SlsQt1DPlot *plot1d{nullptr};
|
||||||
SlsQt2DPlot *plot2d{nullptr};
|
SlsQt2DPlot *plot2d{nullptr};
|
||||||
SlsQt1DPlot *gainplot1d{nullptr};
|
|
||||||
SlsQt2DPlot *gainplot2d{nullptr};
|
SlsQt2DPlot *gainplot2d{nullptr};
|
||||||
QString filePath{"/"};
|
QString filePath{"/"};
|
||||||
QString fileName{"run"};
|
QString fileName{"run"};
|
||||||
|
9
slsDetectorGui/include/qDacWidget.h
Normal file → Executable file
9
slsDetectorGui/include/qDacWidget.h
Normal file → Executable file
@ -1,15 +1,17 @@
|
|||||||
#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 {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
qDacWidget(QWidget *parent, sls::Detector *detector, bool d, std::string n,
|
qDacWidget(QWidget *parent, sls::Detector* detector, bool d, std::string n, slsDetectorDefs::dacIndex i);
|
||||||
slsDetectorDefs::dacIndex i);
|
|
||||||
~qDacWidget();
|
~qDacWidget();
|
||||||
void SetDetectorIndex(int id);
|
void SetDetectorIndex(int id);
|
||||||
|
|
||||||
@ -28,3 +30,4 @@ class qDacWidget : public QWidget, private Ui::WidgetDacObject {
|
|||||||
slsDetectorDefs::dacIndex index;
|
slsDetectorDefs::dacIndex index;
|
||||||
int detectorIndex{-1};
|
int detectorIndex{-1};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
72
slsDetectorGui/include/qDefs.h
Normal file → Executable file
72
slsDetectorGui/include/qDefs.h
Normal file → Executable file
@ -1,34 +1,26 @@
|
|||||||
#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 <cstdint>
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
|
#include <stdint.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <chrono>
|
||||||
using std::chrono::duration;
|
using std::chrono::duration;
|
||||||
using std::chrono::duration_cast;
|
using std::chrono::duration_cast;
|
||||||
using std::chrono::hours;
|
using std::chrono::nanoseconds;
|
||||||
using std::chrono::microseconds;
|
using std::chrono::microseconds;
|
||||||
using std::chrono::milliseconds;
|
using std::chrono::milliseconds;
|
||||||
using std::chrono::minutes;
|
|
||||||
using std::chrono::nanoseconds;
|
|
||||||
using std::chrono::seconds;
|
using std::chrono::seconds;
|
||||||
|
using std::chrono::minutes;
|
||||||
|
using std::chrono::hours;
|
||||||
|
|
||||||
#define CATCH_DISPLAY(m, s) \
|
#define CATCH_DISPLAY(m, s) catch(...) { qDefs::DisplayExceptions(m, s); }
|
||||||
catch (...) { \
|
#define CATCH_HANDLE(...) catch(...) { qDefs::HandleExceptions(__VA_ARGS__); }
|
||||||
qDefs::DisplayExceptions(m, s); \
|
|
||||||
}
|
|
||||||
#define CATCH_HANDLE(...) \
|
|
||||||
catch (...) { \
|
|
||||||
qDefs::HandleExceptions(__VA_ARGS__); \
|
|
||||||
}
|
|
||||||
|
|
||||||
class qDefs : public QWidget {
|
class qDefs : public QWidget {
|
||||||
public:
|
public:
|
||||||
@ -39,7 +31,6 @@ class qDefs : public QWidget {
|
|||||||
|
|
||||||
static const int Q_FONT_SIZE=9;
|
static const int Q_FONT_SIZE=9;
|
||||||
static const int DATA_GAIN_PLOT_RATIO=5;
|
static const int DATA_GAIN_PLOT_RATIO=5;
|
||||||
static const int MIN_HEIGHT_GAIN_PLOT_1D = 75;
|
|
||||||
|
|
||||||
static void DisplayExceptions(std::string emsg, std::string src) {
|
static void DisplayExceptions(std::string emsg, std::string src) {
|
||||||
try {
|
try {
|
||||||
@ -55,8 +46,8 @@ class qDefs : public QWidget {
|
|||||||
|
|
||||||
template <class CT> struct NonDeduced { using type = CT; };
|
template <class CT> struct NonDeduced { using type = CT; };
|
||||||
template <class S, typename RT, typename... CT>
|
template <class S, typename RT, typename... CT>
|
||||||
static void HandleExceptions(const std::string emsg, const std::string src,
|
static void HandleExceptions(const std::string emsg, const std::string src, S* s,
|
||||||
S *s, RT (S::*somefunc)(CT...),
|
RT (S::*somefunc)(CT...),
|
||||||
typename NonDeduced<CT>::type... Args) {
|
typename NonDeduced<CT>::type... Args) {
|
||||||
try {
|
try {
|
||||||
throw;
|
throw;
|
||||||
@ -82,20 +73,13 @@ class qDefs : public QWidget {
|
|||||||
|
|
||||||
static const char* getQFunctionNameFromEnum(enum qFuncNames func) {
|
static const char* getQFunctionNameFromEnum(enum qFuncNames func) {
|
||||||
switch (func) {
|
switch (func) {
|
||||||
case QF_GET_DETECTOR_STATUS:
|
case QF_GET_DETECTOR_STATUS: return "QF_GET_DETECTOR_STATUS";
|
||||||
return "QF_GET_DETECTOR_STATUS";
|
case QF_START_ACQUISITION: return "QF_START_ACQUISITION";
|
||||||
case QF_START_ACQUISITION:
|
case QF_STOP_ACQUISITION: return "QF_STOP_ACQUISITION";
|
||||||
return "QF_START_ACQUISITION";
|
case QF_START_AND_READ_ALL: return "QF_START_AND_READ_ALL";
|
||||||
case QF_STOP_ACQUISITION:
|
case QF_EXIT_SERVER: return "QF_EXIT_SERVER";
|
||||||
return "QF_STOP_ACQUISITION";
|
case QF_NUM_FUNCTIONS: return "QF_NUM_FUNCTIONS";
|
||||||
case QF_START_AND_READ_ALL:
|
default: return "Unknown Function";
|
||||||
return "QF_START_AND_READ_ALL";
|
|
||||||
case QF_EXIT_SERVER:
|
|
||||||
return "QF_EXIT_SERVER";
|
|
||||||
case QF_NUM_FUNCTIONS:
|
|
||||||
return "QF_NUM_FUNCTIONS";
|
|
||||||
default:
|
|
||||||
return "Unknown Function";
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -126,16 +110,11 @@ class qDefs : public QWidget {
|
|||||||
|
|
||||||
static std::string getRangeAsString(enum range r) {
|
static std::string getRangeAsString(enum range r) {
|
||||||
switch (r) {
|
switch (r) {
|
||||||
case XMIN:
|
case XMIN: return "XMIN";
|
||||||
return "XMIN";
|
case XMAX: return "XMAX";
|
||||||
case XMAX:
|
case YMIN: return "YMIN";
|
||||||
return "XMAX";
|
case YMAX: return "YMAX";
|
||||||
case YMIN:
|
default: return "Unknown";
|
||||||
return "YMIN";
|
|
||||||
case YMAX:
|
|
||||||
return "YMAX";
|
|
||||||
default:
|
|
||||||
return "Unknown";
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -210,8 +189,7 @@ class qDefs : public QWidget {
|
|||||||
MINUTES);
|
MINUTES);
|
||||||
}
|
}
|
||||||
return std::make_pair(
|
return std::make_pair(
|
||||||
duration_cast<duration<double, std::ratio<3600>>>(tns).count(),
|
duration_cast<duration<double, std::ratio<3600>>>(tns).count(), HOURS);
|
||||||
HOURS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** returns the value in ns */
|
/** returns the value in ns */
|
||||||
@ -320,9 +298,7 @@ class qDefs : public QWidget {
|
|||||||
static int ExceptionMessage(std::string message,
|
static int ExceptionMessage(std::string message,
|
||||||
std::string exceptionMessage,
|
std::string exceptionMessage,
|
||||||
std::string source) {
|
std::string source) {
|
||||||
return Message(qDefs::WARNING,
|
return Message(qDefs::WARNING, message + std::string("\nCaught exception:\n") + exceptionMessage, source);
|
||||||
message + std::string("\nCaught exception:\n") +
|
|
||||||
exceptionMessage,
|
|
||||||
source);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
45
slsDetectorGui/include/qDetectorMain.h
Normal file → Executable file
45
slsDetectorGui/include/qDetectorMain.h
Normal file → Executable file
@ -1,9 +1,8 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Detector.h"
|
|
||||||
#include "qDefs.h"
|
|
||||||
#include "ui_form_detectormain.h"
|
|
||||||
#include <QTabWidget>
|
|
||||||
|
|
||||||
|
#include "ui_form_detectormain.h"
|
||||||
|
|
||||||
|
#include "qDefs.h"
|
||||||
class qDrawPlot;
|
class qDrawPlot;
|
||||||
class qTabMeasurement;
|
class qTabMeasurement;
|
||||||
class qTabDataOutput;
|
class qTabDataOutput;
|
||||||
@ -13,15 +12,17 @@ class qTabSettings;
|
|||||||
class qTabDebugging;
|
class qTabDebugging;
|
||||||
class qTabDeveloper;
|
class qTabDeveloper;
|
||||||
class qTabMessages;
|
class qTabMessages;
|
||||||
class QScrollArea;
|
|
||||||
|
#include "Detector.h"
|
||||||
|
|
||||||
|
#include <QTabWidget>
|
||||||
class QResizeEvent;
|
class QResizeEvent;
|
||||||
|
|
||||||
/** To Over-ride the QTabWidget class to get the tabBar protected
|
/** To Over-ride the QTabWidget class to get the tabBar */
|
||||||
* methodTabWidget */
|
|
||||||
class MyTabWidget : public QTabWidget {
|
class MyTabWidget : public QTabWidget {
|
||||||
public:
|
public:
|
||||||
MyTabWidget(QWidget *parent = 0) { setParent(parent); }
|
MyTabWidget(QWidget *parent = 0) { setParent(parent); }
|
||||||
/** Overridden protected method from QTabWidget */
|
/** Overridden method from QTabWidget */
|
||||||
QTabBar *tabBar() { return QTabWidget::tabBar(); }
|
QTabBar *tabBar() { return QTabWidget::tabBar(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -29,7 +30,8 @@ class qDetectorMain : public QMainWindow, private Ui::DetectorMainObject {
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
qDetectorMain(int multiId, const std::string &fname, bool isDevel);
|
qDetectorMain(int argc, char **argv, QApplication *app,
|
||||||
|
QWidget *parent = 0);
|
||||||
~qDetectorMain();
|
~qDetectorMain();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
@ -51,9 +53,9 @@ class qDetectorMain : public QMainWindow, private Ui::DetectorMainObject {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void SetUpWidgetWindow();
|
void SetUpWidgetWindow();
|
||||||
void SetUpDetector(const std::string &config_file, int multiID);
|
void SetUpDetector(const std::string fName, int multiID);
|
||||||
void Initialization();
|
void Initialization();
|
||||||
void LoadConfigFile(const std::string &config_file);
|
void LoadConfigFile(const std::string fName);
|
||||||
|
|
||||||
/** enumeration of the tabs */
|
/** enumeration of the tabs */
|
||||||
enum {
|
enum {
|
||||||
@ -69,17 +71,16 @@ class qDetectorMain : public QMainWindow, private Ui::DetectorMainObject {
|
|||||||
};
|
};
|
||||||
slsDetectorDefs::detectorType detType;
|
slsDetectorDefs::detectorType detType;
|
||||||
std::unique_ptr<sls::Detector> det;
|
std::unique_ptr<sls::Detector> det;
|
||||||
qDrawPlot *plot;
|
std::unique_ptr<qDrawPlot> plot;
|
||||||
MyTabWidget *tabs;
|
std::unique_ptr<MyTabWidget> tabs;
|
||||||
std::unique_ptr<QScrollArea> scroll[NumberOfTabs];
|
std::unique_ptr<qTabMeasurement> tabMeasurement;
|
||||||
qTabMeasurement *tabMeasurement;
|
std::unique_ptr<qTabDataOutput> tabDataOutput;
|
||||||
qTabDataOutput *tabDataOutput;
|
std::unique_ptr<qTabPlot> tabPlot;
|
||||||
qTabPlot *tabPlot;
|
std::unique_ptr<qTabSettings> tabSettings;
|
||||||
qTabSettings *tabSettings;
|
std::unique_ptr<qTabAdvanced> tabAdvanced;
|
||||||
qTabAdvanced *tabAdvanced;
|
std::unique_ptr<qTabDebugging> tabDebugging;
|
||||||
qTabDebugging *tabDebugging;
|
std::unique_ptr<qTabDeveloper> tabDeveloper;
|
||||||
qTabDeveloper *tabDeveloper;
|
std::unique_ptr<qTabMessages> tabMessages;
|
||||||
qTabMessages *tabMessages;
|
|
||||||
int isDeveloper;
|
int isDeveloper;
|
||||||
int heightPlotWindow;
|
int heightPlotWindow;
|
||||||
int heightCentralWidget;
|
int heightCentralWidget;
|
||||||
|
39
slsDetectorGui/include/qDrawPlot.h
Normal file → Executable file
39
slsDetectorGui/include/qDrawPlot.h
Normal file → Executable file
@ -1,15 +1,20 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Detector.h"
|
|
||||||
#include "qDefs.h"
|
|
||||||
#include "ui_form_plot.h"
|
|
||||||
#include <mutex>
|
|
||||||
|
|
||||||
|
#include "ui_form_plot.h"
|
||||||
|
|
||||||
|
#include "qDefs.h"
|
||||||
class SlsQt1DPlot;
|
class SlsQt1DPlot;
|
||||||
class SlsQtH1D;
|
class SlsQtH1D;
|
||||||
class SlsQt2DPlot;
|
class SlsQt2DPlot;
|
||||||
class qCloneWidget;
|
class qCloneWidget;
|
||||||
|
|
||||||
class detectorData;
|
class detectorData;
|
||||||
|
#include "Detector.h"
|
||||||
|
|
||||||
class QResizeEvent;
|
class QResizeEvent;
|
||||||
|
#include <QFutureWatcher>
|
||||||
|
|
||||||
|
#include <mutex>
|
||||||
|
|
||||||
class qDrawPlot : public QWidget, private Ui::PlotObject {
|
class qDrawPlot : public QWidget, private Ui::PlotObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -59,8 +64,10 @@ class qDrawPlot : public QWidget, private Ui::PlotObject {
|
|||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void SetSaveFileName(QString val);
|
void SetSaveFileName(QString val);
|
||||||
|
void AcquireFinished();
|
||||||
void UpdatePlot();
|
void UpdatePlot();
|
||||||
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void AcquireFinishedSignal();
|
void AcquireFinishedSignal();
|
||||||
void AbortSignal();
|
void AbortSignal();
|
||||||
@ -72,17 +79,12 @@ 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, int detectorStatus, void *this_pointer);
|
||||||
static void GetAcquisitionFinishedCallBack(double currentProgress,
|
static void GetDataCallBack(detectorData *data, uint64_t frameIndex, uint32_t subFrameIndex, void *this_pointer);
|
||||||
int detectorStatus,
|
std::string AcquireThread();
|
||||||
void *this_pointer);
|
|
||||||
static void GetDataCallBack(detectorData *data, uint64_t frameIndex,
|
|
||||||
uint32_t subFrameIndex, void *this_pointer);
|
|
||||||
void AcquisitionFinished(double currentProgress, int detectorStatus);
|
void AcquisitionFinished(double currentProgress, int detectorStatus);
|
||||||
void GetData(detectorData *data, uint64_t frameIndex,
|
void GetData(detectorData *data, uint64_t frameIndex, uint32_t subFrameIndex);
|
||||||
uint32_t subFrameIndex);
|
void toDoublePixelData(double *dest, char *source, int size, int databytes, int dr, double *gaindest = NULL);
|
||||||
void toDoublePixelData(double *dest, char *source, int size, int databytes,
|
|
||||||
int dr, double *gaindest = NULL);
|
|
||||||
void Get1dData(double* rawData);
|
void Get1dData(double* rawData);
|
||||||
void Get2dData(double* rawData);
|
void Get2dData(double* rawData);
|
||||||
void Update1dPlot();
|
void Update1dPlot();
|
||||||
@ -96,10 +98,9 @@ class qDrawPlot : public QWidget, private Ui::PlotObject {
|
|||||||
|
|
||||||
SlsQt1DPlot *plot1d{nullptr};
|
SlsQt1DPlot *plot1d{nullptr};
|
||||||
QVector<SlsQtH1D *> hists1d;
|
QVector<SlsQtH1D *> hists1d;
|
||||||
SlsQt1DPlot *gainplot1d{nullptr};
|
|
||||||
SlsQtH1D *gainhist1d{nullptr};
|
|
||||||
SlsQt2DPlot *plot2d{nullptr};
|
SlsQt2DPlot *plot2d{nullptr};
|
||||||
SlsQt2DPlot *gainplot2d{nullptr};
|
SlsQt2DPlot *gainplot2d{nullptr};
|
||||||
|
QFutureWatcher<std::string> *acqResultWatcher;
|
||||||
|
|
||||||
bool is1d{true};
|
bool is1d{true};
|
||||||
bool isRunning{false};
|
bool isRunning{false};
|
||||||
@ -113,7 +114,6 @@ 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};
|
||||||
@ -124,7 +124,6 @@ class qDrawPlot : public QWidget, private Ui::PlotObject {
|
|||||||
int nHists{1};
|
int nHists{1};
|
||||||
double *datax1d{nullptr};
|
double *datax1d{nullptr};
|
||||||
std::vector<double *> datay1d;
|
std::vector<double *> datay1d;
|
||||||
double *gainDatay1d{nullptr};
|
|
||||||
double *data2d{nullptr};
|
double *data2d{nullptr};
|
||||||
double *gainData{nullptr};
|
double *gainData{nullptr};
|
||||||
|
|
||||||
@ -159,7 +158,7 @@ class qDrawPlot : public QWidget, private Ui::PlotObject {
|
|||||||
|
|
||||||
unsigned int nPixelsX{0};
|
unsigned int nPixelsX{0};
|
||||||
unsigned int nPixelsY{0};
|
unsigned int nPixelsY{0};
|
||||||
|
const static int npixelsx_jctb = 400;
|
||||||
|
int npixelsy_jctb{0};
|
||||||
uint32_t pixelMask{0};
|
uint32_t pixelMask{0};
|
||||||
uint32_t gainMask{0};
|
|
||||||
int gainOffset{0};
|
|
||||||
};
|
};
|
||||||
|
11
slsDetectorGui/include/qTabAdvanced.h
Normal file → Executable file
11
slsDetectorGui/include/qTabAdvanced.h
Normal file → Executable file
@ -1,9 +1,11 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Detector.h"
|
|
||||||
#include "ui_form_tab_advanced.h"
|
#include "ui_form_tab_advanced.h"
|
||||||
|
|
||||||
class qDrawPlot;
|
class qDrawPlot;
|
||||||
|
|
||||||
|
#include "Detector.h"
|
||||||
|
|
||||||
class qTabAdvanced:public QWidget, private Ui::TabAdvancedObject{
|
class qTabAdvanced:public QWidget, private Ui::TabAdvancedObject{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@ -36,9 +38,6 @@ 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();
|
||||||
@ -62,9 +61,9 @@ 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;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
10
slsDetectorGui/include/qTabDataOutput.h
Normal file → Executable file
10
slsDetectorGui/include/qTabDataOutput.h
Normal file → Executable file
@ -1,7 +1,9 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Detector.h"
|
|
||||||
#include "ui_form_tab_dataoutput.h"
|
#include "ui_form_tab_dataoutput.h"
|
||||||
|
|
||||||
|
#include "Detector.h"
|
||||||
|
|
||||||
class qTabDataOutput:public QWidget, private Ui::TabDataOutputObject{
|
class qTabDataOutput:public QWidget, private Ui::TabDataOutputObject{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@ -40,5 +42,9 @@ class qTabDataOutput : public QWidget, private Ui::TabDataOutputObject {
|
|||||||
// Button group for radiobuttons for rate
|
// Button group for radiobuttons for rate
|
||||||
QButtonGroup *btnGroupRate;
|
QButtonGroup *btnGroupRate;
|
||||||
// enum for the Eiger Parallel flag
|
// enum for the Eiger Parallel flag
|
||||||
enum { PARALLEL, NONPARALLEL };
|
enum {
|
||||||
|
PARALLEL,
|
||||||
|
NONPARALLEL
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
5
slsDetectorGui/include/qTabDebugging.h
Normal file → Executable file
5
slsDetectorGui/include/qTabDebugging.h
Normal file → Executable file
@ -1,7 +1,9 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Detector.h"
|
|
||||||
#include "ui_form_tab_debugging.h"
|
#include "ui_form_tab_debugging.h"
|
||||||
|
|
||||||
|
#include "Detector.h"
|
||||||
|
|
||||||
class QTreeWidget;
|
class QTreeWidget;
|
||||||
class QTreeWidgetItem;
|
class QTreeWidgetItem;
|
||||||
|
|
||||||
@ -31,3 +33,4 @@ class qTabDebugging : public QWidget, private Ui::TabDebuggingObject {
|
|||||||
QLabel *lblDetectorFirmware;
|
QLabel *lblDetectorFirmware;
|
||||||
QLabel *lblDetectorSoftware;
|
QLabel *lblDetectorSoftware;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
23
slsDetectorGui/include/qTabDeveloper.h
Normal file → Executable file
23
slsDetectorGui/include/qTabDeveloper.h
Normal file → Executable file
@ -1,10 +1,13 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "ui_form_tab_developer.h"
|
||||||
|
class qDacWidget;
|
||||||
|
|
||||||
#include "Detector.h"
|
#include "Detector.h"
|
||||||
#include "sls_detector_defs.h"
|
#include "sls_detector_defs.h"
|
||||||
#include "ui_form_tab_developer.h"
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
class qDacWidget;
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
class qTabDeveloper:public QWidget, private Ui::TabDeveloperObject {
|
class qTabDeveloper:public QWidget, private Ui::TabDeveloperObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -24,15 +27,23 @@ class qTabDeveloper : public QWidget, private Ui::TabDeveloperObject {
|
|||||||
void Initialization();
|
void Initialization();
|
||||||
void PopulateDetectors();
|
void PopulateDetectors();
|
||||||
void GetHighVoltage();
|
void GetHighVoltage();
|
||||||
slsDetectorDefs::dacIndex getSLSIndex(slsDetectorDefs::detectorType detType,
|
slsDetectorDefs::dacIndex getSLSIndex(slsDetectorDefs::detectorType detType, int index);
|
||||||
int index);
|
|
||||||
|
|
||||||
sls::Detector *det;
|
sls::Detector *det;
|
||||||
std::vector<qDacWidget*> dacWidgets;
|
std::vector<qDacWidget*> dacWidgets;
|
||||||
std::vector<qDacWidget*> adcWidgets;
|
std::vector<qDacWidget*> adcWidgets;
|
||||||
|
|
||||||
enum hvVals { HV_0, HV_90, HV_110, HV_120, HV_150, HV_180, HV_200 };
|
enum hvVals {
|
||||||
|
HV_0,
|
||||||
|
HV_90,
|
||||||
|
HV_110,
|
||||||
|
HV_120,
|
||||||
|
HV_150,
|
||||||
|
HV_180,
|
||||||
|
HV_200
|
||||||
|
};
|
||||||
int hvmin;
|
int hvmin;
|
||||||
static const int HV_MIN = 60;
|
static const int HV_MIN = 60;
|
||||||
static const int HV_MAX = 200;
|
static const int HV_MAX = 200;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
27
slsDetectorGui/include/qTabMeasurement.h
Normal file → Executable file
27
slsDetectorGui/include/qTabMeasurement.h
Normal file → Executable file
@ -1,8 +1,11 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Detector.h"
|
|
||||||
#include "ui_form_tab_measurement.h"
|
#include "ui_form_tab_measurement.h"
|
||||||
|
|
||||||
class qDrawPlot;
|
class qDrawPlot;
|
||||||
|
|
||||||
|
#include "Detector.h"
|
||||||
|
|
||||||
class QStandardItemModel;
|
class QStandardItemModel;
|
||||||
|
|
||||||
class qTabMeasurement:public QWidget, private Ui::TabMeasurementObject{
|
class qTabMeasurement:public QWidget, private Ui::TabMeasurementObject{
|
||||||
@ -23,13 +26,10 @@ class qTabMeasurement : public QWidget, private Ui::TabMeasurementObject {
|
|||||||
void SetNumMeasurements(int val);
|
void SetNumMeasurements(int val);
|
||||||
void SetNumFrames(int val);
|
void SetNumFrames(int val);
|
||||||
void SetNumTriggers(int val);
|
void SetNumTriggers(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();
|
||||||
void SetBurstPeriod();
|
|
||||||
void SetFileWrite(bool val);
|
void SetFileWrite(bool val);
|
||||||
void SetFileName();
|
void SetFileName();
|
||||||
void SetRunIndex(int val);
|
void SetRunIndex(int val);
|
||||||
@ -41,26 +41,17 @@ class qTabMeasurement : public QWidget, private Ui::TabMeasurementObject {
|
|||||||
private:
|
private:
|
||||||
void SetupWidgetWindow();
|
void SetupWidgetWindow();
|
||||||
void Initialization();
|
void Initialization();
|
||||||
/** default, show trigger and delay,
|
|
||||||
* otherwise for gotthard2 in auto timing mode and burst mode,
|
|
||||||
* show bursts and burst period
|
|
||||||
*/
|
|
||||||
void ShowTriggerDelay();
|
|
||||||
void ShowGates();
|
|
||||||
void SetupTimingMode();
|
void SetupTimingMode();
|
||||||
void EnableWidgetsforTimingMode();
|
void EnableWidgetsforTimingMode();
|
||||||
|
|
||||||
void GetTimingMode();
|
void GetTimingMode();
|
||||||
void GetNumFrames();
|
void GetNumFrames();
|
||||||
void GetNumTriggers();
|
void GetNumTriggers();
|
||||||
void GetNumBursts();
|
|
||||||
void GetNumSamples();
|
void GetNumSamples();
|
||||||
void GetNumGates();
|
|
||||||
void GetExposureTime();
|
void GetExposureTime();
|
||||||
void GetAcquisitionPeriod();
|
void GetAcquisitionPeriod();
|
||||||
void CheckAcqPeriodGreaterThanExp();
|
void CheckAcqPeriodGreaterThanExp();
|
||||||
void GetDelay();
|
void GetDelay();
|
||||||
void GetBurstPeriod();
|
|
||||||
void GetFileWrite();
|
void GetFileWrite();
|
||||||
void GetFileName();
|
void GetFileName();
|
||||||
void GetRunIndex();
|
void GetRunIndex();
|
||||||
@ -74,12 +65,17 @@ class qTabMeasurement : public QWidget, private Ui::TabMeasurementObject {
|
|||||||
signals:
|
signals:
|
||||||
void EnableTabsSignal(bool);
|
void EnableTabsSignal(bool);
|
||||||
void FileNameChangedSignal(QString);
|
void FileNameChangedSignal(QString);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
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, TRIGGER_GATED, NUMTIMINGMODES };
|
enum{
|
||||||
|
AUTO,
|
||||||
|
TRIGGER,
|
||||||
|
GATED,
|
||||||
|
BURST_TRIGGER,
|
||||||
|
NUMTIMINGMODES
|
||||||
|
};
|
||||||
QTimer *progressTimer;
|
QTimer *progressTimer;
|
||||||
//tool tip variables
|
//tool tip variables
|
||||||
QString acqPeriodTip;
|
QString acqPeriodTip;
|
||||||
@ -87,7 +83,6 @@ 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};
|
||||||
|
2
slsDetectorGui/include/qTabMessages.h
Normal file → Executable file
2
slsDetectorGui/include/qTabMessages.h
Normal file → Executable file
@ -1,4 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "ui_form_tab_messages.h"
|
#include "ui_form_tab_messages.h"
|
||||||
|
|
||||||
class QProcess;
|
class QProcess;
|
||||||
@ -32,3 +33,4 @@ class qTabMessages : public QWidget, private Ui::TabMessagesObject {
|
|||||||
QProcess* process;
|
QProcess* process;
|
||||||
QStringList lastCommand;
|
QStringList lastCommand;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
7
slsDetectorGui/include/qTabPlot.h
Normal file → Executable file
7
slsDetectorGui/include/qTabPlot.h
Normal file → Executable file
@ -1,8 +1,11 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Detector.h"
|
|
||||||
#include "ui_form_tab_plot.h"
|
#include "ui_form_tab_plot.h"
|
||||||
|
|
||||||
class qDrawPlot;
|
class qDrawPlot;
|
||||||
|
|
||||||
|
#include "Detector.h"
|
||||||
|
|
||||||
class QButtonGroup;
|
class QButtonGroup;
|
||||||
|
|
||||||
class qTabPlot:public QWidget, private Ui::TabPlotObject{
|
class qTabPlot:public QWidget, private Ui::TabPlotObject{
|
||||||
@ -56,3 +59,5 @@ class qTabPlot : public QWidget, private Ui::TabPlotObject {
|
|||||||
static QString defaultImageYAxisTitle;
|
static QString defaultImageYAxisTitle;
|
||||||
static QString defaultImageZAxisTitle;
|
static QString defaultImageZAxisTitle;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
19
slsDetectorGui/include/qTabSettings.h
Normal file → Executable file
19
slsDetectorGui/include/qTabSettings.h
Normal file → Executable file
@ -1,7 +1,9 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Detector.h"
|
|
||||||
#include "ui_form_tab_settings.h"
|
#include "ui_form_tab_settings.h"
|
||||||
|
|
||||||
|
#include "Detector.h"
|
||||||
|
|
||||||
class qTabSettings: public QWidget, private Ui::TabSettingsObject{
|
class qTabSettings: public QWidget, private Ui::TabSettingsObject{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@ -39,17 +41,14 @@ class qTabSettings : public QWidget, private Ui::TabSettingsObject {
|
|||||||
FORCESWITCHG1,
|
FORCESWITCHG1,
|
||||||
FORCESWITCHG2,
|
FORCESWITCHG2,
|
||||||
VERLOWGAIN,
|
VERLOWGAIN,
|
||||||
G1_HIGHGAIN,
|
|
||||||
G1_LOWGAIN,
|
|
||||||
G2_HIGHCAP_HIGHGAIN,
|
|
||||||
G2_HIGHCAP_LOWGAIN,
|
|
||||||
G2_LOWCAP_HIGHGAIN,
|
|
||||||
G2_LOWCAP_LOWGAIN,
|
|
||||||
G4_HIGHGAIN,
|
|
||||||
G4_LOWGAIN,
|
|
||||||
UNDEFINED,
|
UNDEFINED,
|
||||||
UNINITIALIZED,
|
UNINITIALIZED,
|
||||||
NUMSETTINGS
|
NUMSETTINGS
|
||||||
};
|
};
|
||||||
enum { DYNAMICRANGE_32, DYNAMICRANGE_16, DYNAMICRANGE_8, DYNAMICRANGE_4 };
|
enum {
|
||||||
|
DYNAMICRANGE_32,
|
||||||
|
DYNAMICRANGE_16,
|
||||||
|
DYNAMICRANGE_8,
|
||||||
|
DYNAMICRANGE_4
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user