Compare commits

..

1 Commits

Author SHA1 Message Date
4a629b954a version 2019-09-30 16:58:04 +02:00
699 changed files with 73401 additions and 94364 deletions

View File

@ -4,4 +4,3 @@ IndentWidth: 4
UseTab: Never UseTab: Never
ColumnLimit: 80 ColumnLimit: 80
AlignConsecutiveAssignments: false AlignConsecutiveAssignments: false
AlignConsecutiveMacros: true

View File

@ -16,9 +16,7 @@ Checks: '*,
-hicpp-braces-around-statements, -hicpp-braces-around-statements,
-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,
-readability-isolate-declaration'
HeaderFilterRegex: \.h HeaderFilterRegex: \.h
AnalyzeTemporaryDtors: false AnalyzeTemporaryDtors: false

View File

@ -1,42 +0,0 @@
---
name: Bug Report
about: Create a report to help us improve
title: New Bug Report
labels: action - Bug, priority - Unclassified, status - Pending
template: bug_report.md
---
<!-- Preview changes before submitting -->
<!-- Please fill out everything with an *, as this report will be discarded otherwise -->
<!-- This is a comment, the syntax is a bit different from c++ or bash -->
##### *Distribution:
<!-- RHEL7, RHEL6, Fedora, etc -->
##### *Detector type:
<!-- If applicable, Eiger, Jungfrau, Mythen3, Gotthard2, Gotthard, Moench, ChipTestBoard -->
##### *Software Package Version:
<!-- developer, 4.2.0, 4.1.1, etc -->
##### Priority:
<!-- Super Low, Low, Medium, High, Super High -->
##### *Describe the bug
<!-- A clear and concise description of what the bug is -->
##### Expected behavior
<!-- A clear and concise description of what you expected to happen. -->
##### To Reproduce
<!-- Steps to reproduce the behavior: -->
<!-- 1. Go to '...' -->
<!-- 2. Click on '....' -->
<!-- 3. Scroll down to '....' -->
<!-- 4. See error -->
##### Screenshots
<!-- If applicable, add screenshots to help explain your problem. -->
##### Additional context
<!-- Add any other context about the problem here. -->

View File

@ -1,28 +0,0 @@
---
name: Change Request
about: Suggest a change to an existing feature
title: New Change Request
labels: action - Change, priority - Unclassified, status - Pending
template: change_request.md
---
<!-- Preview changes before submitting -->
<!-- Please fill out everything with an *, as this report will be discarded otherwise -->
<!-- This is a comment, the syntax is a bit different from c++ or bash -->
##### *Detector type:
<!-- If applicable, Eiger, Jungfrau, Mythen3, Gotthard2, Gotthard, Moench, ChipTestBoard -->
##### *Software Package Version:
<!-- developer, 4.2.0, 4.1.1, etc -->
##### Priority:
<!-- Super Low, Low, Medium, High, Super High -->
##### *State the change request:
<!-- A clear and concise description of what the change is to an existing feature -->
##### Is your change request related to a problem. Please describe:
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
##### Additional context:
<!-- Add any other context about the feature here -->

View File

@ -1 +0,0 @@
blank_issues_enabled: false

View File

@ -1,34 +0,0 @@
---
name: Feature Request
about: Suggest a feature, documentation or submit a question
title: New Feature Request
labels: action - Enhancement, priority - Unclassified, status - Pending
template: feature_request.md
---
<!-- Preview changes before submitting -->
<!-- Please fill out everything with an *, as this report will be discarded otherwise -->
<!-- This is a comment, the syntax is a bit different from c++ or bash -->
##### *Detector type:
<!-- If applicable, Eiger, Jungfrau, Mythen3, Gotthard2, Gotthard, Moench, ChipTestBoard -->
##### *Software Package Version:
<!-- developer, 4.2.0, 4.1.1, etc -->
##### Priority:
<!-- Super Low, Low, Medium, High, Super High -->
##### *State the feature:
<!-- A clear and concise description of what the feature is -->
##### Is your feature request related to a problem. Please describe:
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
##### Describe the solution you'd like:
<!-- A clear and concise description of what you want to happen -->
##### Describe alternatives you've considered:
<!-- A clear and concise description of any alternative solutions or features you've considered -->
##### Additional context:
<!-- Add any other context about the feature here -->

5
.gitignore vendored
View File

@ -7,16 +7,11 @@ bin/
*.out *.out
*.toc *.toc
*.o *.o
*.so
.* .*
build build
RELEASE.txt RELEASE.txt
Testing/ Testing/
ctbDict.cpp
ctbDict.h
*.pyc *.pyc
*/__pycache__/* */__pycache__/*

View File

@ -4,25 +4,38 @@ language: cpp
os: linux os: linux
dist: bionic env:
matrix:
- CONDA_PY=3.6
- CONDA_PY=3.7
dist: trusty
install: install:
- sudo apt-get update - sudo apt-get update
- ldd --version - ldd --version
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
- bash miniconda.sh -b -p $HOME/miniconda - bash miniconda.sh -b -p $HOME/miniconda
- source "$HOME/miniconda/etc/profile.d/conda.sh" - export PATH="$HOME/miniconda/bin:$PATH"
- rm -f miniconda.sh - rm -f miniconda.sh
- hash -r - hash -r
- conda config --set always_yes yes --set changeps1 no - conda config --set always_yes yes --set changeps1 no
- conda config --add channels conda-forge - conda config --add channels conda-forge
- conda config --add channels slsdetectorgroup - conda config --add channels slsdetectorgroup
- conda update -q conda - conda update conda
- conda info -a - conda update --all
- conda install conda-build=3.17
- conda install anaconda-client
- conda install conda-verify
# Useful for debugging any issues with conda # Useful for debugging any issues with conda
- conda create -q -n testenv conda-build anaconda-client conda-verify - conda info -a
- conda activate testenv
# Replace dep1 dep2 ... with your dependencies
- conda create -q -n test-environment python=$CONDA_PY
- source activate test-environment
- conda-build . - conda-build .
script: script:
@ -31,8 +44,7 @@ script:
deploy: 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/conda-bld/${TRAVIS_OS_NAME}-64 -name "*.tar.bz2" -exec anaconda -t $CONDA_TOKEN upload --force {} \;
on: on:
branch: developer branch: filip1
tags: true

View File

@ -1,8 +1,9 @@
cmake_minimum_required(VERSION 3.12) cmake_minimum_required(VERSION 3.9)
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)
@ -41,40 +42,6 @@ option (SLS_USE_TESTS "TESTS" OFF)
option (SLS_USE_INTEGRATION_TESTS "Integration Tests" OFF) option (SLS_USE_INTEGRATION_TESTS "Integration Tests" OFF)
option(SLS_USE_SANITIZER "Sanitizers for debugging" OFF) option(SLS_USE_SANITIZER "Sanitizers for debugging" OFF)
option(SLS_USE_PYTHON "Python bindings" OFF) option(SLS_USE_PYTHON "Python bindings" OFF)
option(SLS_USE_CTBGUI "ctb GUI" OFF)
option(SLS_BUILD_DOCS "docs" 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)
option(SLS_USE_MOENCH "compile zmq and post processing for Moench" 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_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
# set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
# set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
# else ()
# message(WARNING "GNU gold linker isn't available, using the default system linker.")
# endif ()
# endif ()
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) 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)
@ -98,9 +65,7 @@ target_compile_options(slsProjectWarnings INTERFACE
-Wformat=2 -Wformat=2
-Wredundant-decls -Wredundant-decls
# -Wconversion # -Wconversion
-Wvla
-Wdouble-promotion -Wdouble-promotion
-Werror=return-type
) )
@ -138,16 +103,12 @@ endif()
if(SLS_USE_SANITIZER) if(SLS_USE_SANITIZER)
target_compile_options(slsProjectOptions INTERFACE -fsanitize=address,undefined -fno-omit-frame-pointer) target_compile_options(slsProjectOptions INTERFACE -fsanitize=address,undefined -fno-omit-frame-pointer)
#target_compile_options(slsProjectOptions INTERFACE -fsanitize=address,undefined)
target_link_libraries(slsProjectOptions INTERFACE -fsanitize=address,undefined) target_link_libraries(slsProjectOptions INTERFACE -fsanitize=address,undefined)
# target_compile_options(slsProjectOptions INTERFACE -fsanitize=thread) # target_compile_options(slsProjectOptions INTERFACE -fsanitize=thread)
# 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
@ -163,7 +124,7 @@ install(TARGETS slsProjectOptions slsProjectWarnings rapidjson
) )
set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_INSTALL_RPATH $ORIGIN) set(CMAKE_INSTALL_RPATH "$ORIGIN")
# set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) # set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
@ -192,11 +153,12 @@ if (SLS_USE_RECEIVER)
find_package(HDF5 1.10 COMPONENTS CXX REQUIRED) find_package(HDF5 1.10 COMPONENTS CXX REQUIRED)
endif (SLS_USE_HDF5) endif (SLS_USE_HDF5)
add_subdirectory(slsReceiverSoftware) add_subdirectory(slsReceiverSoftware)
add_subdirectory(manual/manual-api)
endif (SLS_USE_RECEIVER) 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()
@ -211,37 +173,27 @@ if (SLS_USE_INTEGRATION_TESTS)
endif (SLS_USE_INTEGRATION_TESTS) endif (SLS_USE_INTEGRATION_TESTS)
if (SLS_USE_PYTHON) if (SLS_USE_PYTHON)
set(PYBIND11_CPP_STANDARD -std=c++11)
add_subdirectory(libs/pybind11) add_subdirectory(libs/pybind11)
add_subdirectory(python) add_subdirectory(python)
endif(SLS_USE_PYTHON) endif(SLS_USE_PYTHON)
if (SLS_USE_CTBGUI)
add_subdirectory(ctbGui)
endif(SLS_USE_CTBGUI)
configure_file( .clang-tidy configure_file( .clang-tidy
${CMAKE_BINARY_DIR}/.clang-tidy ${CMAKE_BINARY_DIR}/.clang-tidy
) )
if (SLS_BUILD_EXAMPLES)
add_subdirectory(sample)
endif(SLS_BUILD_EXAMPLES)
if(SLS_BUILD_DOCS) add_subdirectory(sample)
add_subdirectory(docs)
endif(SLS_BUILD_DOCS) add_subdirectory(docs)
if(SLS_USE_MOENCH)
add_subdirectory(slsDetectorCalibration/moenchExecutables)
endif(SLS_USE_MOENCH)
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 slsSupportShared slsDetectorShared slsReceiverShared) set(PROJECT_LIBRARIES slsSupportLib slsDetectorShared slsReceiverShared)
# Generate and install package config file and version # Generate and install package config file and version
include(cmake/package_config.cmake) include(cmake/package_config.cmake)
endif() endif()

111
README.md
View File

@ -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
``` ```

View File

@ -1,114 +0,0 @@
SLS Detector Package 5.0.0-rc1 released on 25.09.2020 (Release Candidate 1)
===========================================================================
CONTENTS
--------
1. Firmware Requirements
2. Download, Documentation & Support
1. Firmware Requirements
========================
Eiger
=====
Minimum compatible version : 27
Latest compatible version : 27
Jungfrau
========
Minimum compatible version (PCB v1.0) : 24.07.2020 (v0.8)
Latest compatible version (PCB v1.0) : 24.07.2020 (v0.8)
Minimum compatible version (PCB v2.0) : 21.07.2020 (v2.1)
Latest compatible version (PCB v2.0) : 21.07.2020 (v2.1)
Gotthard
========
Minimum compatible version : 11.01.2013
Latest compatible version : 08.02.2018 (50um and 25um Master)
09.02.2018 (25 um Slave)
Mythen3
=======
Minimum compatible version : 25.09.2020
Latest compatible version : 25.09.2020
Gotthard2
=========
Minimum compatible version : 25.09.2020
Latest compatible version : 25.09.2020
Moench
======
Minimum compatible version : 02.03.2020
Latest compatible version : 02.03.2020
Ctb
===
Minimum compatible version : 27.11.2019
Latest compatible version : 27.11.2019
Detector Upgrade
================
Eiger Remotely via bit files
Jungfrau Remotely using sls_detector_put programfpga <pof>
Gotthard Cannot be upgraded remotely. Requires programming via USB blaster
Mythen3 Remotely using sls_detector_put programfpga <rbf>
Gotthard2 Remotely using sls_detector_put programfpga <rbf>
Moench Remotely using sls_detector_put programfpga <pof>
Ctb Remotely using sls_detector_put programfpga <pof>
Instructions available at
https://slsdetectorgroup.github.io/devdoc/firmware.html
Please refer to the link below for more details on the firmware versions.
https://www.psi.ch/en/detectors/firmware
2. Download, Documentation & Support
====================================
Download
--------
The Source Code (Default C++ API):
https://github.com/slsdetectorgroup/slsDetectorPackage
Documentation
-------------
Installation:
https://slsdetectorgroup.github.io/devdoc/installation.html#
Consuming slsDetectorPackage:
https://slsdetectorgroup.github.io/devdoc/consuming.html
Command Line Documentation:
https://slsdetectorgroup.github.io/devdoc/commandline.html
C++ API Documentation:
https://slsdetectorgroup.github.io/devdoc/detector.html
C++ API Example:
https://slsdetectorgroup.github.io/devdoc/examples.html#
Python API Documentation:
https://slsdetectorgroup.github.io/devdoc/pygettingstarted.html
Python API Example:
https://slsdetectorgroup.github.io/devdoc/pyexamples.html
TroubleShooting:
https://www.psi.ch/en/detectors/troubleshooting
Further Documentation:
https://www.psi.ch/en/detectors/users-support
Support
-------
dhanya.thattil@psi.ch
erik.frojdh@psi.ch
anna.bergamaschi@psi.ch

View File

@ -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()

View File

@ -1,6 +1,6 @@
#Look for an executable called sphinx-build #Look for an executable called sphinx-build
find_program(SPHINX_EXECUTABLE find_program(SPHINX_EXECUTABLE
NAMES sphinx-build sphinx-build-3.6 NAMES sphinx-build
DOC "Path to sphinx-build executable") DOC "Path to sphinx-build executable")
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)

View File

@ -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}
)

View File

@ -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 ()

86
cmk.sh
View File

@ -10,10 +10,6 @@ DEBUG=0
PYTHON=0 PYTHON=0
TESTS=0 TESTS=0
SIMULATOR=0 SIMULATOR=0
CTBGUI=0
MANUALS=0
MANUALS_ONLY_RST=0
MOENCHZMQ=0
CLEAN=0 CLEAN=0
@ -22,7 +18,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] [n] [-h] [z] [-d <HDF5 directory>] [-j] <Number of threads> Usage: $0 [-c] [-b] [-p] [e] [t] [r] [g] [s] [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
@ -33,13 +29,9 @@ Usage: $0 [-c] [-b] [-p] [e] [t] [r] [g] [s] [u] [i] [m] [n] [-h] [z] [-d <HDF5
-r: Build/Rebuilds only receiver -r: Build/Rebuilds only receiver
-g: Build/Rebuilds only gui -g: Build/Rebuilds only gui
-s: Simulator -s: Simulator
-u: Chip Test Gui
-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
-n: Manuals without compiling doxygen (only rst)
-z: Moench zmq processor
Rebuild when you switch to a new build and compile in parallel: Rebuild when you switch to a new build and compile in parallel:
./cmk.sh -bj5 ./cmk.sh -bj5
@ -75,7 +67,7 @@ For rebuilding only certain sections
" ; exit 1; } " ; exit 1; }
while getopts ":bpchd:j:trgeisumnz" opt ; do while getopts ":bpchd:j:trgeis" opt ; do
case $opt in case $opt in
b) b)
echo "Building of CMake files Required" echo "Building of CMake files Required"
@ -130,22 +122,6 @@ while getopts ":bpchd:j:trgeisumnz" opt ; do
echo "Compiling Options: Simulator" echo "Compiling Options: Simulator"
SIMULATOR=1 SIMULATOR=1
;; ;;
m)
echo "Compiling Manuals"
MANUALS=1
;;
n)
echo "Compiling Manuals (Only RST)"
MANUALS_ONLY_RST=1
;;
z)
echo "Compiling Moench Zmq Processor"
MOENCHZMQ=1
;;
u)
echo "Compiling Options: Chip Test Gui"
CTBGUI=1
;;
\?) \?)
echo "Invalid option: -$OPTARG" echo "Invalid option: -$OPTARG"
usage usage
@ -173,7 +149,7 @@ if [ $TEXTCLIENT -eq 0 ] && [ $RECEIVER -eq 0 ] && [ $GUI -eq 0 ]; then
echo "Enabling Compile Option: TextClient, Receiver and GUI" echo "Enabling Compile Option: TextClient, Receiver and GUI"
else else
if [ $TEXTCLIENT -eq 1 ]; then if [ $TEXTCLIENT -eq 1 ]; then
CMAKE_POST+=" -DSLS_USE_TEXTCLIENT=ON -DSLS_USE_RECEIVER=OFF " CMAKE_POST+=" -DSLS_USE_TEXTCLIENT=ON "
echo "Enabling Compile Option: TextClient" echo "Enabling Compile Option: TextClient"
fi fi
if [ $RECEIVER -eq 1 ]; then if [ $RECEIVER -eq 1 ]; then
@ -205,38 +181,21 @@ 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
#Simulator #Simulator
if [ $SIMULATOR -eq 1 ]; then if [ $SIMULATOR -eq 1 ]; then
CMAKE_POST+=" -DSLS_USE_SIMULATOR=ON " CMAKE_POST+=" -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_SIMULATOR=ON "
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
#Moench zmq processor
if [ $MOENCHZMQ -eq 1 ]; then
CMAKE_POST+=" -DSLS_USE_MOENCH=ON "
echo "Moench Zmq Processor Option enabled"
fi
#Chip Test Gui
if [ $CTBGUI -eq 1 ]; then
CMAKE_POST+=" -DSLS_USE_CTBGUI=ON "
echo "CTB Gui Option enabled"
fi
#Tests #Tests
if [ $TESTS -eq 1 ]; then if [ $TESTS -eq 1 ]; then
CMAKE_POST+=" -DSLS_USE_TESTS=ON -DSLS_USE_INTEGRATION_TESTS=ON" CMAKE_POST+=" -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_TESTS=ON -DSLS_USE_INTEGRATION_TESTS=ON"
echo "Tests Option enabled" echo "Tests Option enabled"
fi fi
@ -274,34 +233,11 @@ fi
#make #make
if [ $COMPILERTHREADS -gt 0 ]; then if [ $COMPILERTHREADS -gt 0 ]; then
if [ $MANUALS -eq 0 ] && [ $MANUALS_ONLY_RST -eq 0 ]; then BUILDCOMMAND="make -j$COMPILERTHREADS"
BUILDCOMMAND="make -j$COMPILERTHREADS" echo $BUILDCOMMAND
echo $BUILDCOMMAND eval $BUILDCOMMAND
eval $BUILDCOMMAND
else
if [ $MANUALS -eq 1 ]; then
BUILDCOMMAND="make docs -j$COMPILERTHREADS"
echo $BUILDCOMMAND
eval $BUILDCOMMAND
else
BUILDCOMMAND="make rst -j$COMPILERTHREADS"
echo $BUILDCOMMAND
eval $BUILDCOMMAND
fi
fi
else else
if [ $MANUALS -eq 0 ] && [ $MANUALS_ONLY_RST -eq 0 ]; then make
echo "make"
make
else
if [ $MANUALS -eq 1 ]; then
echo "make docs"
make docs
else
echo "make rst"
make rst
fi
fi
fi fi

View File

@ -1,4 +1,3 @@
mkdir build mkdir build
mkdir install mkdir install
cd build cd build
@ -7,7 +6,7 @@ cmake .. \
-DCMAKE_INSTALL_PREFIX=install \ -DCMAKE_INSTALL_PREFIX=install \
-DSLS_USE_TEXTCLIENT=ON \ -DSLS_USE_TEXTCLIENT=ON \
-DSLS_USE_RECEIVER=ON \ -DSLS_USE_RECEIVER=ON \
-DSLS_USE_GUI=ON \ -DSLS_USE_GUI=OFF \
-DSLS_USE_TESTS=ON \ -DSLS_USE_TESTS=ON \
-DSLS_USE_PYTHON=OFF \ -DSLS_USE_PYTHON=OFF \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \

View File

@ -1,4 +1,14 @@
echo "|<-------- starting python build" # mkdir $PREFIX/lib
# mkdir $PREFIX/include
# #Shared and static libraries
# cp build/bin/_sls_detector* $PREFIX/lib/.
# #Binaries
# cp -r build/bin/sls_detector $PREFIX/lib/.
cd python cd python
${PYTHON} setup.py install ${PYTHON} setup.py install

View File

@ -1,7 +0,0 @@
python:
- 3.6
- 3.7
- 3.8
numpy:
- 1.17

View File

@ -1,9 +0,0 @@
mkdir $PREFIX/lib
mkdir $PREFIX/bin
mkdir $PREFIX/include
cp build/bin/ctbGui $PREFIX/bin/.
cp build/bin/libctbRootLib.so $PREFIX/lib/.

View File

@ -1,3 +1,15 @@
#Copy the GUI
mkdir $PREFIX/lib
mkdir $PREFIX/bin mkdir $PREFIX/bin
mkdir $PREFIX/include
#No libs for gui?
#Binaries
cp build/bin/gui_client $PREFIX/bin/.
cp build/bin/slsDetectorGui $PREFIX/bin/. cp build/bin/slsDetectorGui $PREFIX/bin/.
#Which headers do we need for development??
# cp include/some_lib.h $PREFIX/include/.

View File

@ -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/.

View File

@ -1,14 +1,13 @@
package: package:
name: sls_detector_software name: sls_detector_software
version: {{ environ.get('GIT_DESCRIBE_TAG', '') }} version: "filip1"
source: source:
- path: .. - path: ..
build: build:
number: 0 number: 1
binary_relocation: True
rpaths: rpaths:
- lib/ - lib/
@ -17,9 +16,10 @@ requirements:
- {{ compiler('c') }} - {{ compiler('c') }}
- {{compiler('cxx')}} - {{compiler('cxx')}}
- cmake - cmake
- qwt 6.* # - qwt 6.* #require qt5 investigate befor activating gui
- qt 4.8.* # - qt=4.8.7=7
- zeromq - zeromq=4.2.5=hfc679d8_5
- pyzmq
- xorg-libx11 - xorg-libx11
- xorg-libice - xorg-libice
- xorg-libxext - xorg-libxext
@ -33,12 +33,10 @@ requirements:
- {{ cdt('libselinux') }} # [linux] - {{ cdt('libselinux') }} # [linux]
- {{ cdt('libxdamage') }} # [linux] - {{ cdt('libxdamage') }} # [linux]
- {{ cdt('libxxf86vm') }} # [linux] - {{ cdt('libxxf86vm') }} # [linux]
- expat
host: host:
- libstdcxx-ng - libstdcxx-ng
- libgcc-ng - libgcc-ng
- zeromq
- xorg-libx11 - xorg-libx11
- xorg-libice - xorg-libice
- xorg-libxext - xorg-libxext
@ -46,56 +44,77 @@ requirements:
- xorg-libxau - xorg-libxau
- xorg-libxrender - xorg-libxrender
- xorg-libxfixes - xorg-libxfixes
- expat
run: run:
- zeromq
- libstdcxx-ng - libstdcxx-ng
- libgcc-ng - libgcc-ng
outputs: outputs:
- name: slsdetlib - name: sls_detector_lib
script: copy_lib.sh script: copy_lib.sh
requirements: - name: sls_detector
run:
- libstdcxx-ng
- libgcc-ng
- zeromq
- name: slsdet
script: build_pylib.sh script: build_pylib.sh
requirements: requirements:
build: build:
- python
- {{ compiler('c') }} - {{ compiler('c') }}
- {{compiler('cxx')}} - {{compiler('cxx')}}
- {{ pin_subpackage('slsdetlib', exact=True) }} - python {{ python }}
- setuptools - setuptools
- sls_detector_lib
- pyzmq
- pybind11 2.2
host: host:
- python - python
- pybind11 2.2
run: - pyzmq
- sls_detector_lib
- libstdcxx-ng - libstdcxx-ng
- libgcc-ng - libgcc-ng
run:
- python - python
- numpy - numpy
- {{ pin_subpackage('slsdetlib', exact=True) }} - sls_detector_lib=filip1
- pyzmq
- libstdcxx-ng
- libgcc-ng
test: test:
imports: imports:
- slsdet - sls_detector
- name: slsdetgui # requirements:
script: copy_gui.sh # build:
requirements: # - {{ compiler('c') }}
run: # - {{compiler('cxx')}}
- {{ pin_subpackage('slsdetlib', exact=True) }}
- qwt 6.* # - name: sls_detector_gui
- qt 4.8.* # version: "refactor"
- expat # script: copy_gui.sh
# requirements:
# build:
# - {{ compiler('c') }}
# - {{compiler('cxx')}}
# - cmake
# - qwt 6.*
# - qt=4.8.7=7
# - zeromq=4.2.5=hfc679d8_5
# - pyzmq
# - xorg-libx11
# - xorg-libice
# - xorg-libxext
# - xorg-libsm
# - xorg-libxau
# - xorg-libxrender
# - xorg-libxfixes
# - {{ cdt('mesa-libgl-devel') }} # [linux]
# - {{ cdt('mesa-libegl-devel') }} # [linux]
# - {{ cdt('mesa-dri-drivers') }} # [linux]
# - {{ cdt('libselinux') }} # [linux]
# - {{ cdt('libxdamage') }} # [linux]
# - {{ cdt('libxxf86vm') }} # [linux]
# run:
# - sls_detector_lib=refactor
# - qwt 6.*
# - qt=4.8.7=7

View File

@ -1,87 +0,0 @@
find_package(ROOT CONFIG REQUIRED COMPONENTS Core Gui)
find_package(TIFF REQUIRED)
target_include_directories(ROOT::Core INTERFACE "${ROOT_INCLUDE_DIRS}")
add_library(ROOT::Flags_CXX IMPORTED INTERFACE)
separate_arguments(ROOT_CXX_FLAGS)
target_compile_options(ROOT::Flags_CXX INTERFACE ${ROOT_CXX_FLAGS})
separate_arguments(ROOT_DEFINITIONS)
target_compile_definitions(ROOT::Flags_CXX INTERFACE ${ROOT_DEFINITIONS})
# This fixes a bug in the linker flags
string(REPLACE "-L " "-L" ROOT_EXE_LINKER_FLAGS "${ROOT_EXE_LINKER_FLAGS}")
separate_arguments(ROOT_EXE_LINKER_FLAGS)
# Stuck into using old property method due to separate -L and -l arguments
# (A full path to -l is better!)
set_property(TARGET ROOT::Flags_CXX PROPERTY
INTERFACE_LINK_LIBRARIES ${ROOT_EXE_LINKER_FLAGS})
set_property(TARGET ROOT::Core PROPERTY
INTERFACE_INCLUDE_DIRECTORIES "${ROOT_INCLUDE_DIRS}")
add_executable(ctbGui
ctbGui.cpp
ctbMain.cpp
ctbDacs.cpp
ctbPowers.cpp
ctbSlowAdcs.cpp
ctbSignals.cpp
ctbAdcs.cpp
ctbPattern.cpp
ctbAcquisition.cpp
${CMAKE_SOURCE_DIR}/slsDetectorCalibration/tiffIO.cpp
)
#TODO! Replace with target
target_include_directories(ctbGui PRIVATE
${CMAKE_SOURCE_DIR}/slsDetectorCalibration/dataStructures
${CMAKE_SOURCE_DIR}/slsDetectorCalibration/interpolations
${CMAKE_SOURCE_DIR}/slsDetectorCalibration/
)
# Headders needed for ROOT dictionary generation
set( HEADERS
ctbDefs.h
ctbMain.h
ctbDacs.h
ctbPattern.h
ctbSignals.h
ctbAdcs.h
ctbAcquisition.h
ctbPowers.h
ctbSlowAdcs.h
)
#set(ROOT_INCLUDE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
# ROOT dictionary generation
include("${ROOT_DIR}/RootMacros.cmake")
root_generate_dictionary(ctbDict ${HEADERS} LINKDEF ctbLinkDef.h)
add_library(ctbRootLib SHARED ctbDict.cxx)
target_include_directories(ctbRootLib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(ctbRootLib PUBLIC
ROOT::Core
slsDetectorShared
${ROOT_LIBRARIES}
${ROOT_EXE_LINKER_FLAGS}
)
set_target_properties(
ctbRootLib PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
target_link_libraries(ctbGui PUBLIC
slsDetectorShared
ctbRootLib
${TIFF_LIBRARIES}
)
set_target_properties(ctbGui PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)

View File

@ -1,17 +1,17 @@
INCS=ctbMain.h ctbDacs.h ctbPattern.h ctbSignals.h ctbAdcs.h ctbAcquisition.h ctbPowers.h ctbSlowAdcs.h INCS=ctbMain.h ctbDacs.h ctbPattern.h ctbSignals.h ctbAdcs.h ctbAcquisition.h ctbPowers.h ctbSlowAdcs.h
SRC= $(INCS:.h=.cpp) ctbDict.cpp SRC= $(SRC:.h=.cpp) ctbDict.cpp
LINKDEF=ctbLinkDef.h LINKDEF=ctbLinkDef.h
ZMQLIB=../slsReceiverSoftware/include ZMQLIB=../slsReceiverSoftware/include
LIBRARYCBF=$(CBFLIBDIR)/lib/*.o LIBRARYCBF=$(CBFLIBDIR)/lib/*.o
INCDIR=-I../slsReceiverSoftware/include/ -I../slsDetectorSoftware/include/ -I../slsSupportLib/include/ -I../slsDetectorCalibration -I../slsDetectorCalibration/dataStructures -I$(CBFLIBDIR)/include -I../slsDetectorCalibration/interpolations INCDIR=-I../slsReceiverSoftware/include/ -I../slsDetectorSoftware/include/ -I../slsSupportLib/include/ -I../slsDetectorCalibration -I../slsDetectorCalibration/dataStructures -I$(CBFLIBDIR)/include -I../slsDetectorCalibration/interpolations
LDFLAG=-L../build/bin -lSlsDetector -lSlsSupport -L/usr/lib64/ -lpthread -lm -lstdc++ -lzmq -pthread -lrt -ltiff -L$(ZMQLIB) -L$(CBFLIBDIR)/lib/ -std=c++11 LDFLAG=-L../bin -lSlsDetector -lSlsSupport -L/usr/lib64/ -lpthread -lm -lstdc++ -lzmq -pthread -lrt -ltiff -L$(ZMQLIB) -L$(CBFLIBDIR)/lib/ -std=c++11
# #
MAIN=ctbGui.cpp MAIN=ctbGui.cpp
DESTDIR?=../build/bin DESTDIR?=../bin
OBJS = $(SRC:.cpp=.o) $(MAIN:.cpp=.o) OBJS = $(SRC:.cpp=.o) $(MAIN:.cpp=.o)
@ -30,13 +30,13 @@ ctbDict.cpp: $(INCS) $(LINKDEF)
%.o : %.cpp %.o : %.cpp
echo $@ echo $@
g++ -DMYROOT `root-config --cflags --glibs` -lMinuit -DCTB $(LDFLAG) -o $@ -c $< $(INCDIR) g++ -DMYROOT `source root-config --cflags --glibs` -lMinuit -DCTB $(LDFLAG) -o $@ -c $< $(INCDIR)
#$(CXX) -o $@ -c $< $(INCLUDES) $(DFLAGS) -fPIC $(EPICSFLAGS) -lpthread #$(FLAGS) #$(CXX) -o $@ -c $< $(INCLUDES) $(DFLAGS) -fPIC $(EPICSFLAGS) -lpthread #$(FLAGS)
$(DESTDIR)/ctbGui: $(OBJS) $(LINKDEF) $(DESTDIR)/ctbGui: $(OBJS) $(LINKDEF)
g++ -DMYROOT `root-config --cflags --glibs` -lMinuit -DCTB $(LDFLAG) -o ctbGui $(INCDIR) $(OBJS) ../slsDetectorCalibration/tiffIO.cpp g++ -DMYROOT `source root-config --cflags --glibs` -lMinuit -DCTB $(LDFLAG) -o ctbGui $(INCDIR) $(OBJS) ../slsDetectorCalibration/tiffIO.cpp
mv ctbGui $(DESTDIR) mv ctbGui $(DESTDIR)
clean: clean:

View File

@ -24,15 +24,13 @@
#include <fstream> #include <fstream>
#include "ctbAcquisition.h" #include "ctbAcquisition.h"
#include "ctbDefs.h" #include "multiSlsDetector.h"
#include "Detector.h"
#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"
@ -41,19 +39,15 @@
#include "Mythen3_02_jctbData.h" #include "Mythen3_02_jctbData.h"
#include "adcSar2_jctbData.h" #include "adcSar2_jctbData.h"
#include "moench04CtbZmqData.h" #include "moench04CtbZmqData.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;
ctbAcquisition::ctbAcquisition(TGVerticalFrame *page, sls::Detector *det) : TGGroupFrame(page,"Acquisition",kVerticalFrame), myDet(det), myCanvas(NULL), globalPlot(0), tenG(0), nAnalogSamples(1), nDigitalSamples(1), dataStructure(NULL), photonFinder(NULL), cmSub(0), dBitMask(0xffffffffffffffff), deserializer(0) { ctbAcquisition::ctbAcquisition(TGVerticalFrame *page, multiSlsDetector *det) : TGGroupFrame(page,"Acquisition",kVerticalFrame), myDet(det), myCanvas(NULL), globalPlot(0), nAnalogSamples(1), nDigitalSamples(1), dataStructure(NULL), photonFinder(NULL), cmSub(0), dBitMask(0xffffffffffffffff), deserializer(0) {
adcFit=NULL; adcFit=NULL;
bitPlot=NULL; bitPlot=NULL;
@ -76,11 +70,8 @@ ctbAcquisition::ctbAcquisition(TGVerticalFrame *page, sls::Detector *det) : TGGr
cFileSave->SetTextJustify(kTextRight); cFileSave->SetTextJustify(kTextRight);
cFileSave->Connect("Toggled(Bool_t)","ctbAcquisition",this,"setFsave(Bool_t)"); cFileSave->Connect("Toggled(Bool_t)","ctbAcquisition",this,"setFsave(Bool_t)");
std::string temp = "run";
try { eFname = new TGTextEntry(hframe, (myDet->getFileName()).c_str());
temp = myDet->getFileNamePrefix().tsquash("Different values");
} CATCH_DISPLAY ("Could not get file name prefix.", "ctbAcquisition::ctbAcquisition")
eFname = new TGTextEntry(hframe, temp.c_str());
hframe->AddFrame(eFname,new TGLayoutHints(kLHintsTop | kLHintsExpandX, 5, 5, 5, 5)); hframe->AddFrame(eFname,new TGLayoutHints(kLHintsTop | kLHintsExpandX, 5, 5, 5, 5));
eFname->MapWindow(); eFname->MapWindow();
@ -121,11 +112,7 @@ ctbAcquisition::ctbAcquisition(TGVerticalFrame *page, sls::Detector *det) : TGGr
temp = "/tmp/"; eOutdir = new TGTextEntry(hframe, (myDet->getFilePath()).c_str());
try {
temp = myDet->getFilePath().tsquash("Different values");
} CATCH_DISPLAY ("Could not get file path.", "ctbAcquisition::ctbAcquisition")
eOutdir = new TGTextEntry(hframe, temp.c_str());
hframe->AddFrame(eOutdir,new TGLayoutHints(kLHintsTop | kLHintsExpandX, 5, 5, 5, 5)); hframe->AddFrame(eOutdir,new TGLayoutHints(kLHintsTop | kLHintsExpandX, 5, 5, 5, 5));
eOutdir->MapWindow(); eOutdir->MapWindow();
@ -236,10 +223,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 +262,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 +281,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 +328,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);
@ -659,14 +596,21 @@ hframe=new TGHorizontalFrame(this, 800,50);
acqThread = new TThread("acqThread", acqThread = new TThread("acqThread",
ctbAcquisition::ThreadHandle,(void*)this); ctbAcquisition::ThreadHandle,(void*)this);
// acqThread->Run();
cout <<"Registering progress callback" << endl;
try {
myDet->registerProgressCallback(&progressCallback,(void*)this);
} catch (...) {
cout << "Do nothing for this error" << endl;
}
cout <<"Registering data callback" << endl; cout <<"Registering data callback" << endl;
try { try{
myDet->registerDataCallback(&dataCallback, (void*)this); myDet->registerDataCallback(&dataCallback, (void*)this);
} CATCH_DISPLAY ("Could not get register call back.", "ctbAcquisition::ctbAcquisition") } catch (...) {
try { cout << "Do nothing for this error" << endl;
myDet->setRxZmqDataStream(true); }
} CATCH_DISPLAY ("Could not get set RxZmqDataStream.", "ctbAcquisition::ctbAcquisition")
cout <<"Done" << endl; cout <<"Done" << endl;
// mgAdcs=new TMultiGraph(); // mgAdcs=new TMultiGraph();
@ -719,6 +663,10 @@ hframe=new TGHorizontalFrame(this, 800,50);
countsHisto[i]=h1; countsHisto[i]=h1;
} }
int nx,ny;
int csize=3;
int nsigma=5;
dataStructure=NULL; dataStructure=NULL;
commonMode=NULL; commonMode=NULL;
photonFinder=NULL; photonFinder=NULL;
@ -822,7 +770,7 @@ void ctbAcquisition::canvasClicked() {
void ctbAcquisition::setCanvas(TCanvas* c) { void ctbAcquisition::setCanvas(TCanvas* c) {
myCanvas=c; myCanvas=c;
myCanvas->cd(); myCanvas->cd();
myCanvas->AddExec("dynamic",Form("((ctbAcquisition*)%p)->canvasClicked()",this)); myCanvas->AddExec("dynamic",Form("((ctbAcquisition*)0x%x)->canvasClicked()",this));
// myCanvas->AddExec("ex","canvasClicked()"); // myCanvas->AddExec("ex","canvasClicked()");
} }
void ctbAcquisition::dataCallback(detectorData *data, long unsigned int index, unsigned int dum, void* pArgs) { void ctbAcquisition::dataCallback(detectorData *data, long unsigned int index, unsigned int dum, void* pArgs) {
@ -857,6 +805,8 @@ digital:
sample0 (dbit0 + dbit1 +...) sample0 (dbit0 + dbit1 +...)
sample1 (dbit0 + dbit1 +...)if (cmd == "rx_dbitlist") { sample1 (dbit0 + dbit1 +...)if (cmd == "rx_dbitlist") {
myDet->setReceiverOnline(ONLINE_FLAG, detPos);
if (action == PUT_ACTION) { if (action == PUT_ACTION) {
std::vector <int> dbitlist; std::vector <int> dbitlist;
@ -888,24 +838,25 @@ 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;
//#endif //#endif
int ig=0; int ig=0;
int i, ii, ib; int i, ii, ich=0, ib, vv;
// TList *l= adcStack->GetHists(); // TList *l= adcStack->GetHists();
// TList *l1= countsStack->GetHists(); // TList *l1= countsStack->GetHists();
TH1F *h; TH1F *h;
TH1F *h1; TH1F *h1;
TH1F *hb; TH1F *hb;
int x; int nb, x,y;
double ped=0; double ped=0;
int vv1,vv2;
int dsize=-1; int dsize=-1;
int *val=NULL; int *val=NULL;
int nx=1, ny=1; int nx=1, ny=1, jj;
short unsigned int *va;
if (dataStructure) { if (dataStructure) {
dataStructure->getDetectorSize(nx,ny); dataStructure->getDetectorSize(nx,ny);
cout << "Data structure: " << dataStructure << " size " << nx << " " << ny << endl; cout << "Data structure: " << dataStructure << " size " << nx << " " << ny << endl;
@ -915,18 +866,13 @@ 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;
int nadc; int nadc;
int ndbit; int ndbit;
tenG = 0;
@ -947,18 +893,8 @@ sample1 (dbit0 + dbit1 +...)if (cmd == "rx_dbitlist") {
} }
} else } else
ndbit=dbitlist.size(); ndbit=dbitlist.size();
if (tenG){
if (nDigitalSamples && nAnalogSamples){ dsize=nadc*2*nAnalogSamples+ndbit*(nDigitalSamples-dBitOffset/8)/8;
if (nDigitalSamples>nAnalogSamples)
dsize=nDigitalSamples*(32*2+8);
else
dsize=nAnalogSamples*(32*2+8);
} else
dsize=32*2*nAnalogSamples+8*nDigitalSamples;
} else
dsize=nadc*2*nAnalogSamples+ndbit*(nDigitalSamples-dBitOffset/8)/8;
cout << "dataBytes is " << data->databytes << " expected " << dsize << endl; cout << "dataBytes is " << data->databytes << " expected " << dsize << endl;
@ -969,11 +905,7 @@ sample1 (dbit0 + dbit1 +...)if (cmd == "rx_dbitlist") {
i=0; i=0;
char *d_data; char *d_data= data->data+2*nadc*nAnalogSamples;
if (tenG)
d_data= data->data;
else
d_data = data->data+2*nadc*nAnalogSamples;
char dval; char dval;
@ -984,8 +916,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);
@ -1036,11 +967,7 @@ sample1 (dbit0 + dbit1 +...)if (cmd == "rx_dbitlist") {
ig=ii; ig=ii;
else else
ig=adclist.at(ii); ig=adclist.at(ii);
aval=data->getChannel(i);//*((uint16_t*)(data->cvalues+i*2));//
// if (tenG)
// aval=data->getChannel(i);
// else
aval=data->getChannel(i);//*((uint16_t*)(data->cvalues+i*2));//
if (plotFlag[ig]) { if (plotFlag[ig]) {
@ -1052,11 +979,10 @@ sample1 (dbit0 + dbit1 +...)if (cmd == "rx_dbitlist") {
// cout << data->getChannel(i) << endl; // cout << data->getChannel(i) << endl;
h->SetBinContent(ip+1,aval); h->SetBinContent(ip+1,aval);
h1->Fill(aval); h1->Fill(aval);
} }
i++; i++;
} }
if (tenG) i+=4;
} }
@ -1066,10 +992,8 @@ sample1 (dbit0 + dbit1 +...)if (cmd == "rx_dbitlist") {
if (dbitlist.empty()) { if (dbitlist.empty()) {
for (ip=0; ip<nDigitalSamples; ip++) { for (ip=0; ip<nDigitalSamples; ip++) {
for (ig=0; ig<8; ig++) { for (ig=0; ig<8; ig++) {
if (tenG)
dval=*(d_data+ip*(8+32*2)+32*2+ig); dval=*(d_data+ip*8+ig);
else
dval=*(d_data+ip*8+ig);
for (ib=(ig)*8; ib<(ig+1)*8; ib++) { for (ib=(ig)*8; ib<(ig+1)*8; ib++) {
if (bitPlotFlag[ib]) { if (bitPlotFlag[ib]) {
@ -1086,6 +1010,7 @@ sample1 (dbit0 + dbit1 +...)if (cmd == "rx_dbitlist") {
} else { } else {
ii=0; ii=0;
int iii=0; int iii=0;
int nb=dbitlist.size();
for (const auto &value : dbitlist) { for (const auto &value : dbitlist) {
ib=value; ib=value;
hb=bitHisto[ib]; hb=bitHisto[ib];
@ -1157,19 +1082,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++)
@ -1263,10 +1176,10 @@ void ctbAcquisition::changeDetector(){
photonFinder=NULL; photonFinder=NULL;
dataStructure=NULL; dataStructure=NULL;
commonMode=NULL; commonMode=NULL;
TH2F *h2DMapOld=h2DMapAn;
// TH2F *h2ScanOld=h2Scan; // TH2F *h2ScanOld=h2Scan;
TH1F *h1DMapOld=h1DMap;
int dim=2;
int nx,ny; int nx,ny;
int csize=3; int csize=3;
int nsigma=5; int nsigma=5;
@ -1274,9 +1187,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,66 +1197,10 @@ void ctbAcquisition::changeDetector(){
// commonMode=new moench03CommonMode(); // commonMode=new moench03CommonMode();
break; break;
case MOENCH04: case MOENCH04:
try { dataStructure=new moench04CtbZmqData(nAnalogSamples, nDigitalSamples);
auto retval = myDet->getTenGiga().tsquash("Different values");
if (retval) {
dataStructure=new moench04CtbZmq10GbData(nAnalogSamples, nDigitalSamples);
} else {
dataStructure=new moench04CtbZmqData(nAnalogSamples, nDigitalSamples);
}
} CATCH_DISPLAY ("Could not get ten giga enable.", "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 +1264,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;
@ -1558,7 +1411,7 @@ void ctbAcquisition::setBitGraph(int i ,int en, Pixel_t col) {
float off=0; float off=0;
for (int ii=0; ii<NSIGNALS; ii++) { for (int ii=0; ii<NSIGNALS; ii++) {
if (bitPlotFlag[ii]) {bitOffset[ii]=off; if (bitPlotFlag[ii]) {bitOffset[ii]=off;
off+=static_cast<float>(1.5); off+=1.5;
cout << "bit " << ii << " offset " << bitOffset[ii] << endl; cout << "bit " << ii << " offset " << bitOffset[ii] << endl;
} }
} }
@ -1573,89 +1426,88 @@ void ctbAcquisition::setBitGraph(int i ,int en, Pixel_t col) {
void ctbAcquisition::setOutdir() { void ctbAcquisition::setOutdir() {
try { try {
myDet->setFilePath(eOutdir->GetText()); myDet->setFilePath(eOutdir->GetText());
} CATCH_DISPLAY ("Could not set file path", "ctbAcquisition::setOutdir") } catch (...) {
cout << "Do nothing for this error" << endl;
}
// // cout << "setting dac! "<< id << endl;
// myDet->setDAC(dacsEntry->GetIntNumber(), (slsDetectorDefs::dacIndex)id, dacsUnit->IsOn());
// getValue();
} }
void ctbAcquisition::setFname() { void ctbAcquisition::setFname() {
try { try {
myDet->setFileNamePrefix(eFname->GetText()); myDet->setFileName(eFname->GetText());
} CATCH_DISPLAY ("Could not set file name prefix", "ctbAcquisition::setFname") } catch (...) {
cout << "Do nothing for this error" << endl;
}
// int val=myDet->setDAC(-1, (slsDetectorDefs::dacIndex)id, dacsUnit->IsOn());
// char s[100];
// sprintf(s,"%d",val);
// dacsValue->SetText(s);
// return val;
} }
void ctbAcquisition::setFindex() { void ctbAcquisition::setFindex() {
try { try {
myDet->setAcquisitionIndex(eFindex->GetNumber()); myDet->setFileIndex(eFindex->GetNumber());
} CATCH_DISPLAY ("Could not set acquisition index", "ctbAcquisition::setFindex") } catch (...) {
cout << "Do nothing for this error" << endl;
}
} }
void ctbAcquisition::setFsave(Bool_t b) { void ctbAcquisition::setFsave(Bool_t b) {
try { try {
myDet->setFileWrite(b); myDet->setFileWrite(b);
eFname->SetState(b); } catch (...) {
eOutdir->SetState(b); cout << "Do nothing for this error" << endl;
} CATCH_DISPLAY ("Could not set file write", "ctbAcquisition::setFsave") }
eFname->SetState(b);
eOutdir->SetState(b);
} }
void ctbAcquisition::update() { void ctbAcquisition::update() {
try {
auto retval = myDet->getFileNamePrefix().tsquash("Different values");
eFname->SetText(retval.c_str());
} CATCH_DISPLAY ("Could not get file name prefix", "ctbAcquisition::update")
try {
auto retval = myDet->getAcquisitionIndex().tsquash("Different values");
eFindex->SetNumber(retval);
} CATCH_DISPLAY ("Could not get acquisition index", "ctbAcquisition::update")
try {
auto retval = myDet->getFileWrite().tsquash("Different values");
cFileSave->SetOn(retval);
} CATCH_DISPLAY ("Could not get file write", "ctbAcquisition::update")
eFname->SetText((myDet->getFileName()).c_str());
eOutdir->SetText((myDet->getFilePath()).c_str());
eFindex->SetNumber(myDet->getFileIndex());
cFileSave->SetOn(myDet->getFileWrite());
eFname->SetState(cFileSave->IsOn()); eFname->SetState(cFileSave->IsOn());
eOutdir->SetState(cFileSave->IsOn()); eOutdir->SetState(cFileSave->IsOn());
eFindex->SetState(cFileSave->IsOn()); eFindex->SetState(cFileSave->IsOn());
// eMeasurements->SetNumber(myDet->setTimer(slsDetectorDefs::MEASUREMENTS_NUMBER,-1));
try { setAnalogSamples(myDet->setTimer(slsDetectorDefs::ANALOG_SAMPLES,-1));
auto retval = myDet->getNumberOfAnalogSamples().tsquash("Different values"); setDigitalSamples(myDet->setTimer(slsDetectorDefs::DIGITAL_SAMPLES,-1));
setAnalogSamples(retval); roMode=myDet->setReadOutFlags();
} CATCH_DISPLAY ("Could not get number of analog samples", "ctbAcquisition::update") setReadoutMode(roMode);
//nChannels=myDet->getTotalNumberOfChannels();
try {
auto retval = myDet->getNumberOfDigitalSamples().tsquash("Different values");
setDigitalSamples(retval);
} CATCH_DISPLAY ("Could not get number of digital samples", "ctbAcquisition::update")
try {
roMode = static_cast<int>(myDet->getReadoutMode().tsquash("Different values"));
setReadoutMode(roMode);
} CATCH_DISPLAY ("Could not get readout mode", "ctbAcquisition::update")
updateChans(); updateChans();
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));
// } }
} }
dBitOffset=myDet->getReceiverDbitOffset();
if (myDet->getDetectorType().squash() == slsDetectorDefs::MOENCH) {
dBitOffset = 0;
} else {
try {
dBitOffset = myDet->getRxDbitOffset().tsquash("Different values");
} CATCH_DISPLAY ("Could not get receiver dbit offset", "ctbAcquisition::update")
}
try {
tenG = myDet->getTenGiga().tsquash("Different values");
} CATCH_DISPLAY ("Could not get ten giga enable", "ctbAcquisition::update")
// char aargs[10][100]; // char aargs[10][100];
// char *args[10]; // char *args[10];
@ -1716,8 +1568,10 @@ void ctbAcquisition::loadPattern() {
cout << "Load: " << fname << endl; cout << "Load: " << fname << endl;
try { try {
myDet->loadParameters(fname); myDet->retrieveDetectorSetup(fname);
} CATCH_DISPLAY ("Could not load parameters", "ctbAcquisition::loadPattern") } catch (...) {
cout << "Do nothing for this error" << endl;
}
} }
} }
@ -1728,30 +1582,16 @@ void ctbAcquisition::toggleAcquisition() {
if (acqThread->GetState()==1 || acqThread->GetState()==6) { if (acqThread->GetState()==1 || acqThread->GetState()==6) {
/** update all infos useful for the acquisition! */ /** update all infos useful for the acquisition! */
try { setAnalogSamples(myDet->setTimer(slsDetectorDefs::ANALOG_SAMPLES,-1));
auto retval = myDet->getNumberOfAnalogSamples().tsquash("Different values"); setDigitalSamples(myDet->setTimer(slsDetectorDefs::DIGITAL_SAMPLES,-1));
setAnalogSamples(retval); dBitOffset=myDet->getReceiverDbitOffset();
} CATCH_DISPLAY ("Could not get number of analog samples", "ctbAcquisition::toggleAcquisition") roMode=myDet->setReadOutFlags();
try {
auto retval = myDet->getNumberOfDigitalSamples().tsquash("Different values");
setDigitalSamples(retval);
} CATCH_DISPLAY ("Could not get number of digital samples", "ctbAcquisition::toggleAcquisition")
if (myDet->getDetectorType().squash() == slsDetectorDefs::MOENCH) {
dBitOffset = 0;
} else {
try {
dBitOffset = myDet->getRxDbitOffset().tsquash("Different values");
} CATCH_DISPLAY ("Could not get receiver dbit offset", "ctbAcquisition::toggleAcquisition")
}
try {
roMode = static_cast<int>(myDet->getReadoutMode().tsquash("Different values"));
setReadoutMode(roMode); setReadoutMode(roMode);
} CATCH_DISPLAY ("Could not get readout mode", "ctbAcquisition::toggleAcquisition")
// iScanStep=0;
cout << "Run" << endl; cout << "Run" << endl;
bStatus->SetText("Stop"); bStatus->SetText("Stop");
ip=0; ip=0;
@ -1801,9 +1641,11 @@ void ctbAcquisition::toggleAcquisition() {
} else { } else {
StopFlag=1; StopFlag=1;
try{ try {
myDet->stopDetector(); myDet->stopAcquisition();
} CATCH_DISPLAY ("Could not stop acquisition", "ctbAcquisition::toggleAcquisition") } catch (...) {
cout << "Do nothing for this error" << endl;
}
stop=1; stop=1;
bStatus->SetText("Start"); bStatus->SetText("Start");
// acqThread->Kill(); // acqThread->Kill();
@ -1820,30 +1662,27 @@ void ctbAcquisition::acquisitionFinished() {
void ctbAcquisition::startAcquisition(){ void ctbAcquisition::startAcquisition(){
cout << "Detector started " <<eMeasurements->GetNumber()<< endl; cout << "Detector started " <<eMeasurements->GetNumber()<< endl;
stop=0; stop=0;
try {
tenG = myDet->getTenGiga().tsquash("Different values");
} CATCH_DISPLAY ("Could not get ten giga enable", "ctbAcquisition::startAcquisition")
for (int im=0; im<eMeasurements->GetNumber(); im++) { for (int im=0; im<eMeasurements->GetNumber(); im++) {
try { try {
myDet->acquire(); myDet->acquire();
} CATCH_DISPLAY ("Could not acquire", "ctbAcquisition::startAcquisition") } catch (...) {
cout << "Do nothing for this error" << endl;
}
cout << im << endl; cout << im << endl;
if (stop) if (stop) break;
break;
} }
} }
void* ctbAcquisition::ThreadHandle(void *arg) void* ctbAcquisition::ThreadHandle(void *arg)
{ {
ctbAcquisition *acq = static_cast<ctbAcquisition*>(arg); ctbAcquisition *acq = static_cast<ctbAcquisition*>(arg);
int i=0;
acq->startAcquisition(); acq->startAcquisition();
acq->acquisitionFinished(); acq->acquisitionFinished();
return nullptr;
} }
void ctbAcquisition::progressCallback(double f,void* arg) { void ctbAcquisition::progressCallback(double f,void* arg) {
@ -1876,6 +1715,12 @@ void ctbAcquisition::setPatternCompiler(const char* t) {
} }
void ctbAcquisition::setMeasurements() { void ctbAcquisition::setMeasurements() {
// myDet->setTimer(slsDetectorDefs::MEASUREMENTS_NUMBER,eMeasurements->GetNumber());
} }
void ctbAcquisition::setAnalogSamples(int n) { void ctbAcquisition::setAnalogSamples(int n) {
@ -1930,11 +1775,11 @@ void ctbAcquisition::setDigitalSamples(int n) {
void ctbAcquisition::setReadoutMode(int f) { void ctbAcquisition::setReadoutMode(int f) {
roMode=f; roMode=f;
slsDetectorDefs::readoutMode flag=(slsDetectorDefs::readoutMode)f; slsDetectorDefs::readOutFlags flags=(slsDetectorDefs::readOutFlags)f;
if (flag == slsDetectorDefs::DIGITAL_ONLY) { if (flags&slsDetectorDefs::DIGITAL_ONLY) {
nAnalogSamples=0; nAnalogSamples=0;
adclist.clear(); adclist.clear();
} else if (flag ==slsDetectorDefs::ANALOG_AND_DIGITAL) { } else if (flags&slsDetectorDefs::ANALOG_AND_DIGITAL) {
; ;
} }
else { else {
@ -1980,36 +1825,46 @@ void ctbAcquisition::setDbitEnable(Int_t reg){
void ctbAcquisition::updateChans() { void ctbAcquisition::updateChans() {
// dbit list /** dbitlist updated */
if (myDet->getDetectorType().squash() == slsDetectorDefs::MOENCH) { std::vector <int> dbl;
dbitlist.clear(); try {
} else { dbl = myDet->getReceiverDbitList();
try { } catch (...) {
auto retval = myDet->getRxDbitList().tsquash("Different values"); cout << "Do nothing for this error" << endl;
dbitlist.clear(); }
if (!retval.empty()) { dbitlist.clear();
for (const auto &value : retval) if (dbl.empty())
dbitlist.push_back(value); ;
} else {
} CATCH_DISPLAY ("Could not get receiver dbit list.", "ctbAcquisition::updateChans") for (const auto &value : dbl)
dbitlist.push_back(value);
}
uint32_t reg;
try {
reg=myDet->getADCEnableMask();
} catch (...) {
cout << "Do nothing for this error" << endl;
}
/* adc updated */
adclist.clear();
// // updateChans();
if (reg!=0xffffffff) {
for (int i=0; i<NADCS; i++) {
if (reg&(1<<i))
adclist.push_back(i);
// // else enableFlag[i]=1;
}
} }
// adc mask
try {
auto retval = myDet->getADCEnableMask().tsquash("Different values");
adclist.clear();
if (retval!=0xffffffff) {
for (int i=0; i<NADCS; i++) {
if (retval&(1<<i)) {
adclist.push_back(i);
}
}
}
} CATCH_DISPLAY ("Could not get adc enable mask.", "ctbAcquisition::updateChans")
} }
void ctbAcquisition::resetPedestal() { void ctbAcquisition::resetPedestal() {
if (photonFinder) { if (photonFinder) {
photonFinder->newDataSet(); photonFinder->newDataSet();
@ -2113,22 +1968,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 +1995,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 +2008,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){

View File

@ -23,10 +23,7 @@ class TH1F;
class TGLabel; class TGLabel;
class TGTextButton; class TGTextButton;
namespace sls class multiSlsDetector;
{
class Detector;
};
class detectorData; class detectorData;
template <class dataType> class slsDetectorData; template <class dataType> class slsDetectorData;
@ -42,7 +39,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 +54,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;
@ -118,7 +112,7 @@ class ctbAcquisition : public TGGroupFrame {
// TH1I *plotAdc[NADCS]; // TH1I *plotAdc[NADCS];
sls::Detector* myDet; multiSlsDetector* myDet;
int plotFlag[NADCS]; int plotFlag[NADCS];
int bitPlotFlag[NSIGNALS]; int bitPlotFlag[NSIGNALS];
@ -157,7 +151,6 @@ class ctbAcquisition : public TGGroupFrame {
int globalPlot; int globalPlot;
int adcPlot; int adcPlot;
int dbitPlot; int dbitPlot;
int tenG;
int nAnalogSamples, nDigitalSamples; int nAnalogSamples, nDigitalSamples;
// int iScanStep; // int iScanStep;
@ -175,7 +168,7 @@ class ctbAcquisition : public TGGroupFrame {
int deserializer; int deserializer;
public: public:
ctbAcquisition(TGVerticalFrame*, sls::Detector*); ctbAcquisition(TGVerticalFrame*, multiSlsDetector*);
void setOutdir(); void setOutdir();
void setFname(); void setFname();
void setMeasurements(); void setMeasurements();
@ -234,8 +227,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();

View File

@ -24,14 +24,14 @@
#include <fstream> #include <fstream>
#include "ctbAdcs.h" #include "ctbAdcs.h"
#include "ctbDefs.h" #include "multiSlsDetector.h"
#include "Detector.h" #include "slsDetectorCommand.h"
using namespace std; using namespace std;
ctbAdc::ctbAdc(TGVerticalFrame *page, int i, sls::Detector *det) ctbAdc::ctbAdc(TGVerticalFrame *page, int i, multiSlsDetector *det)
: TGHorizontalFrame(page, 800,800), id(i), myDet(det) { : TGHorizontalFrame(page, 800,800), id(i), myDet(det) {
TGHorizontalFrame *hframe=this; TGHorizontalFrame *hframe=this;
@ -155,7 +155,7 @@ void ctbAdc::setAdcAlias(char *tit, int plot, int color) {
string ctbAdc::getAdcAlias() { string ctbAdc::getAdcAlias() {
char line[1000]; char line[1000];
sprintf(line,"ADC%d %s %d %lx\n",id,sAdcLabel->GetText()->Data(),sAdcPlot->IsOn(),fColorSel->GetColor()); sprintf(line,"ADC%d %s %d %x\n",id,sAdcLabel->GetText()->Data(),sAdcPlot->IsOn(),fColorSel->GetColor());
return string(line); return string(line);
} }
@ -264,7 +264,7 @@ void ctbAdc::setPlot(Bool_t b){
ctbAdcs::ctbAdcs(TGVerticalFrame *page, sls::Detector *det) ctbAdcs::ctbAdcs(TGVerticalFrame *page, multiSlsDetector *det)
: TGGroupFrame(page,"Adcs",kVerticalFrame), myDet(det) { : TGGroupFrame(page,"Adcs",kVerticalFrame), myDet(det) {
@ -272,6 +272,7 @@ ctbAdcs::ctbAdcs(TGVerticalFrame *page, sls::Detector *det)
page->AddFrame(this,new TGLayoutHints( kLHintsTop | kLHintsExpandX , 10,10,10,10)); page->AddFrame(this,new TGLayoutHints( kLHintsTop | kLHintsExpandX , 10,10,10,10));
MapWindow(); MapWindow();
char tit[100];
TGHorizontalFrame* hframe=new TGHorizontalFrame(this, 800,800); TGHorizontalFrame* hframe=new TGHorizontalFrame(this, 800,800);
@ -414,41 +415,108 @@ ctbAdcs::ctbAdcs(TGVerticalFrame *page, sls::Detector *det)
int ctbAdcs::setEnable(int reg) { int ctbAdcs::setEnable(int reg) {
try { // char aargs[10][100];
if (reg > -1) { // char *args[10];
myDet->setADCEnableMask(reg); string retval;
} int retreg;
auto retval = myDet->getADCEnableMask().tsquash("Different values");
eEnableMask->SetHexNumber(retval);
return retval;
} CATCH_DISPLAY ("Could not set/get adc enablemask.", "ctbAdcs::setEnable")
return -1; // for (int i=0; i<10; i++) args[i]=aargs[i];
// sprintf(args[0],"adcenable");
// sprintf(args[1],"%x",reg);
// slsDetectorCommand *cmd=new slsDetectorCommand(myDet);
// if (reg>-1) {
// retval=cmd->executeLine(1,args,slsDetectorDefs::PUT_ACTION);
// }
if (reg>-1) {
try {
myDet->setADCEnableMask(reg);
} catch (...) {
cout << "Do nothing for this error" << endl;
}
}
// retval=cmd->executeLine(1,args,slsDetectorDefs::GET_ACTION);
// cout <<"enable: " << retval << endl;;
// delete cmd;
// sscanf(retval.c_str(),"%x",&retreg);
try {
retreg=myDet->getADCEnableMask();
} catch (...) {
cout << "Do nothing for this error" << endl;
}
eEnableMask->SetHexNumber(retreg);
return retreg;
} }
int ctbAdcs::setInvert(int reg) { int ctbAdcs::setInvert(int reg) {
try { // char aargs[10][100];
if (reg > -1) { // char *args[10];
myDet->setADCInvert(reg); string retval;
} int retreg;
auto retval = myDet->getADCInvert().tsquash("Different values");
eInversionMask->SetHexNumber(retval);
return retval;
} CATCH_DISPLAY ("Could not set/get adc enablemask.", "ctbAdcs::setEnable")
return -1; // for (int i=0; i<10; i++) args[i]=aargs[i];
//sprint// f(args[0],"adcinvert");
// sprintf(args[1],"%x",reg);
// slsDetectorCommand *cmd=new slsDetectorCommand(myDet);
if (reg>-1) {
try {
myDet->setADCInvert(reg);
} catch (...) {
cout << "Do nothing for this error" << endl;
}
//retval=cmd->executeLine(1,args,slsDetectorDefs::PUT_ACTION);
}
try {
retreg=myDet->getADCInvert();
} catch (...) {
cout << "Do nothing for this error" << endl;
}
// retval=cmd->executeLine(1,args,slsDetectorDefs::GET_ACTION);
// cout <<"invert: " << retval << endl;;
// delete cmd;
// sscanf(retval.c_str(),"%x",&retreg);
eInversionMask->SetHexNumber(retreg);
return retreg;
} }
void ctbAdcs::update() { void ctbAdcs::update() {
Int_t invreg; Int_t invreg;//=myDet->readRegister(67);//(120);
Int_t disreg; Int_t disreg;//=myDet->readRegister(120);//(94);
// for (int i=0; i<10; i++)
// args[i]=aargs[i];
// string retval;
// sprintf(args[0],"adcenable");
// slsDetectorCommand *cmd=new slsDetectorCommand(myDet);
// retval=cmd->executeLine(1,args,slsDetectorDefs::GET_ACTION);
// delete cmd;
// // cout << retval << endl;
// sscanf(retval.c_str(),"adcenable %x",&disreg);
// eInversionMask->SetHexNumber(invreg);
// eEnableMask->SetHexNumber(disreg);
disreg=setEnable(); disreg=setEnable();
invreg=setInvert(); invreg=setInvert();
for (int is=0; is<NADCS; is++) { for (int is=0; is<NADCS; is++) {
sAdc[is]->setAdcAlias(NULL,-1,-1); sAdc[is]->setAdcAlias(NULL,-1,-1);
if (invreg & (1<<is) ) if (invreg & (1<<is) )
@ -460,29 +528,42 @@ void ctbAdcs::update() {
sAdc[is]->setEnable(kTRUE); sAdc[is]->setEnable(kTRUE);
else else
sAdc[is]->setEnable(kFALSE); sAdc[is]->setEnable(kFALSE);
} }
Emit("AdcEnable(Int_t)", disreg); Emit("AdcEnable(Int_t)", disreg);
} }
string ctbAdcs::getAdcParameters() { string ctbAdcs::getAdcParameters() {
ostringstream line;
ostringstream line;
line << "reg "<< hex << setInvert() << "# ADC invert reg" << dec << endl; line << "reg "<< hex << setInvert() << "# ADC invert reg" << dec << endl;
line << "reg "<< hex << setEnable() << " # ADC enable reg"<< dec << endl; line << "reg "<< hex << setEnable() << " # ADC enable reg"<< dec << endl;
// line << "reg "<< hex << 67 << " " << myDet->readRegister(67) << "# ADC invert reg" << dec << endl;
// line << "reg "<< hex << 120 << " " << myDet->readRegister(120) << " # ADC enable reg"<< dec << endl;
// // line << "reg "<< hex << 94 << " " << myDet->readRegister(94) << " # ADC enable reg"<< dec << endl;
return line.str(); return line.str();
} }
void ctbAdcs::CheckAll() { void ctbAdcs::CheckAll() {
for (int is=0; is<NADCS; is++){ for (int is=0; is<NADCS; is++){
sAdc[is]->setPlot(kTRUE); sAdc[is]->setPlot(kTRUE);
// sAdc[is]->setEnabled(kTRUE);
} }
} }
void ctbAdcs::RemoveAll() { void ctbAdcs::RemoveAll() {
for (int is=0; is<NADCS; is++) { for (int is=0; is<NADCS; is++) {
// sAdc[is]->setEnabled(kFALSE);
sAdc[is]->setPlot(kFALSE); sAdc[is]->setPlot(kFALSE);
} }
} }
@ -490,32 +571,51 @@ void ctbAdcs::RemoveAll() {
void ctbAdcs::CheckHalf0() { void ctbAdcs::CheckHalf0() {
for (int is=0; is<NADCS/2; is++) { for (int is=0; is<NADCS/2; is++) {
sAdc[is]->setPlot(kTRUE); sAdc[is]->setPlot(kTRUE);
// sAdc[is]->setEnabled(kTRUE)
} }
} }
void ctbAdcs::RemoveHalf0() { void ctbAdcs::RemoveHalf0() {
for (int is=0; is<NADCS/2; is++){ for (int is=0; is<NADCS/2; is++){
// sAdc[is]->setEnabled(kFALSE);
sAdc[is]->setPlot(kFALSE); sAdc[is]->setPlot(kFALSE);
} }
} }
void ctbAdcs::CheckHalf1() { void ctbAdcs::CheckHalf1() {
for (int is=NADCS/2; is<NADCS; is++){ for (int is=NADCS/2; is<NADCS; is++){
sAdc[is]->setPlot(kTRUE); sAdc[is]->setPlot(kTRUE);
// sAdc[is]->setEnabled(kTRUE)
} }
} }
void ctbAdcs::RemoveHalf1() { void ctbAdcs::RemoveHalf1() {
for (int is=NADCS/2; is<NADCS; is++){ for (int is=NADCS/2; is<NADCS; is++){
// sAdc[is]->setEnabled(kFALSE);
sAdc[is]->setPlot(kFALSE); sAdc[is]->setPlot(kFALSE);
} }
} }
// TGraph* ctbAdcs::getGraph(int i) {
// if (i>=0 && i<NADCS)
// return sAdc[i]->getGraph();
// return NULL;
// }
int ctbAdcs::setAdcAlias(string line) { int ctbAdcs::setAdcAlias(string line) {
int is=-1, plot=0, color=-1; int is=-1, plot=0, color=-1;
@ -557,23 +657,33 @@ void ctbAdcs::AdcEnable(Int_t b){
void ctbAdcs::ToggledAdcEnable(Int_t b){ void ctbAdcs::ToggledAdcEnable(Int_t b){
Int_t oreg=setEnable();
Int_t oreg=setEnable();//myDet->readRegister(67);
Int_t m=1<<b; Int_t m=1<<b;
if (sAdc[b]->getEnable()) if (sAdc[b]->getEnable())
oreg|=m; oreg|=m;
else else
oreg&=~m; oreg&=~m;
setEnable(oreg); // cout << dec << sizeof(Long64_t) << " " << mask << " " << hex << m << " ioreg " << oreg << endl;
setEnable(oreg);//)writeRegister(67, oreg);
//oreg=setEnable();//myDet->readRegister(67);
Emit("AdcEnable(Int_t)", oreg); Emit("AdcEnable(Int_t)", oreg);
//cout << "enable!" << endl;
// Emit("ToggledAdcPlot(Int_t)", b);
} }
void ctbAdcs::ToggledAdcInvert(Int_t b){ void ctbAdcs::ToggledAdcInvert(Int_t b){
Int_t oreg=setInvert(); // char val[1000];
Int_t oreg=setInvert();//myDet->readRegister(67);
Int_t m=1<<b; Int_t m=1<<b;
@ -582,7 +692,15 @@ void ctbAdcs::ToggledAdcInvert(Int_t b){
else else
oreg&=~m; oreg&=~m;
setInvert(oreg); // cout << dec << sizeof(Long64_t) << " " << mask << " " << hex << m << " ioreg " << oreg << endl;
setInvert(oreg);//)writeRegister(67, oreg);
// oreg=setInvert();//myDet->readRegister(67);
// cout << dec << sizeof(Long64_t) << " " << mask << " " << hex << m << " ioreg " << oreg << endl;
//sprintf(val,"%X",oreg);
//eInversionMask->SetHexNumber(oreg);
} }
@ -592,23 +710,22 @@ void ctbAdcs::ToggledAdcInvert(Int_t b){
Pixel_t ctbAdcs::getColor(int i){ Pixel_t ctbAdcs::getColor(int i){
if (i>=0 && i<NADCS) if (i>=0 && i<NADCS)
return sAdc[i]->getColor(); return sAdc[i]->getColor();
return static_cast<Pixel_t>(-1);
} }
Bool_t ctbAdcs::getEnabled(int i){ Bool_t ctbAdcs::getEnabled(int i){
if (i>=0 && i<NADCS) if (i>=0 && i<NADCS)
return sAdc[i]->getEnabled(); return sAdc[i]->getEnabled();
return static_cast<Bool_t>(-1);
} }
Bool_t ctbAdcs::getEnable(int i){ Bool_t ctbAdcs::getEnable(int i){
if (i>=0 && i<NADCS) if (i>=0 && i<NADCS)
return sAdc[i]->getEnable(); return sAdc[i]->getEnable();
return static_cast<Bool_t>(-1);
} }
Bool_t ctbAdcs::getPlot(int i){ Bool_t ctbAdcs::getPlot(int i){
if (i>=0 && i<NADCS) if (i>=0 && i<NADCS)
return sAdc[i]->getPlot(); return sAdc[i]->getPlot();
return static_cast<Bool_t>(-1);
} }

View File

@ -28,10 +28,7 @@ class TGTab;
class TGraph; class TGraph;
namespace sls class multiSlsDetector;
{
class Detector;
};
#include <string> #include <string>
using namespace std; using namespace std;
@ -52,10 +49,10 @@ class ctbAdc : public TGHorizontalFrame {
// TGraph *gADC; // TGraph *gADC;
int id; int id;
sls::Detector *myDet; multiSlsDetector *myDet;
public: public:
ctbAdc(TGVerticalFrame *page, int i, sls::Detector *det); ctbAdc(TGVerticalFrame *page, int i, multiSlsDetector *det);
void setAdcAlias(char *tit, int plot, int color); void setAdcAlias(char *tit, int plot, int color);
@ -92,7 +89,7 @@ class ctbAdcs : public TGGroupFrame {
private: private:
ctbAdc *sAdc[NADCS]; ctbAdc *sAdc[NADCS];
sls::Detector *myDet; multiSlsDetector *myDet;
TGTextButton *bCheckAll; TGTextButton *bCheckAll;
@ -118,7 +115,7 @@ private:
public: public:
ctbAdcs(TGVerticalFrame *page, sls::Detector *det); ctbAdcs(TGVerticalFrame *page, multiSlsDetector *det);
int setAdcAlias(string line); int setAdcAlias(string line);
string getAdcAlias(); string getAdcAlias();
string getAdcParameters(); string getAdcParameters();

View File

@ -9,14 +9,17 @@
#include <TGButton.h> #include <TGButton.h>
#include "ctbDacs.h" #include "ctbDacs.h"
#include "ctbDefs.h" #include "multiSlsDetector.h"
#include "Detector.h"
#include "sls_detector_defs.h" #include "sls_detector_defs.h"
using namespace std; using namespace std;
ctbDac::ctbDac(TGGroupFrame *page, int idac, sls::Detector *det) : TGHorizontalFrame(page, 800,50) , id(idac), myDet(det) {
ctbDac::ctbDac(TGGroupFrame *page, int idac, multiSlsDetector *det) : TGHorizontalFrame(page, 800,50) , id(idac), myDet(det) {
TGHorizontalFrame *hframe=this; TGHorizontalFrame *hframe=this;
@ -101,76 +104,80 @@ int ctbDac::setLabel(char *tit, int mv) {
} }
string ctbDac::getLabel() { string ctbDac::getLabel() {
ostringstream line; ostringstream line;
line << dacsLabel->GetText() << " " << dacsUnit->IsOn() << endl; line << dacsLabel->GetText() << " " << dacsUnit->IsOn() << endl;
// line << "DAC" << dec << id << " " << dacsUnit->IsOn() << endl; // line << "DAC" << dec << id << " " << dacsUnit->IsOn() << endl;
return line.str(); return line.str();
} }
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(dacsEntry->GetIntNumber(), (slsDetectorDefs::dacIndex)id, dacsUnit->IsOn()); } catch (...) {
if (myDet->getDetectorType().squash() == slsDetectorDefs::MOENCH) { cout << "Do nothing for this error" << endl;
sid = getMoenchDacId(); }
}
myDet->setDAC(static_cast<slsDetectorDefs::dacIndex>(sid), dacsEntry->GetIntNumber(), dacsUnit->IsOn());
} CATCH_DISPLAY ("Could not set dac " + to_string(id) + ".", "ctbDac::setValue")
getValue(); getValue();
} }
void ctbDac::setOn(Bool_t b) { void ctbDac::setOn(Bool_t b) {
// cout << "setting dac! "<< id << endl; // cout << "setting dac! "<< id << endl;
if ( dacsLabel->IsOn()) { if ( dacsLabel->IsOn()) {
setValue(); setValue();
} else { } else {
try { try {
int sid = id; myDet->setDAC(-100, (slsDetectorDefs::dacIndex)id, 0);
if (myDet->getDetectorType().squash() == slsDetectorDefs::MOENCH) { } catch (...) {
sid = getMoenchDacId(); cout << "Do nothing for this error" << endl;
} }
myDet->setDAC(static_cast<slsDetectorDefs::dacIndex>(sid), -100, false);
} CATCH_DISPLAY ("Could not power off dac " + to_string(id) + ".", "ctbDac::setOn")
} }
getValue(); getValue();
} }
int ctbDac::getValue() { int ctbDac::getValue() {
int val;
try { try {
int sid = id; val=myDet->setDAC(-1,(slsDetectorDefs::dacIndex)id, dacsUnit->IsOn());
if (myDet->getDetectorType().squash() == slsDetectorDefs::MOENCH) { } catch (...) {
sid = getMoenchDacId(); cout << "Do nothing for this error" << endl;
} }
int val = myDet->getDAC(static_cast<slsDetectorDefs::dacIndex>(sid), dacsUnit->IsOn()).tsquash("Different values"); char s[100];
cout << "dac " << id << " " << val << endl; cout << "dac " << id << " " << val << endl;
dacsValue->SetText(to_string(val).c_str()); sprintf(s,"%d",val);
if (val >= 0) { dacsValue->SetText(s);
dacsLabel->SetOn(kTRUE); if (val>=0) {
} else { dacsLabel->SetOn(kTRUE);
dacsLabel->SetOn(kFALSE); } else {
} dacsLabel->SetOn(kFALSE);
return val; }
} CATCH_DISPLAY ("Could not get dac " + to_string(id) + ".", "ctbDac::getValue")
return val;
return -1;
} }
ctbDacs::ctbDacs(TGVerticalFrame *page, sls::Detector *det) : TGGroupFrame(page,"DACs",kVerticalFrame) , myDet(det){
ctbDacs::ctbDacs(TGVerticalFrame *page, multiSlsDetector *det) : TGGroupFrame(page,"DACs",kVerticalFrame) , myDet(det){
SetTitlePos(TGGroupFrame::kLeft); SetTitlePos(TGGroupFrame::kLeft);
page->AddFrame(this,new TGLayoutHints( kLHintsTop | kLHintsExpandX , 10,10,10,10)); page->AddFrame(this,new TGLayoutHints( kLHintsTop | kLHintsExpandX , 10,10,10,10));
@ -185,12 +192,14 @@ ctbDacs::ctbDacs(TGVerticalFrame *page, sls::Detector *det) : TGGroupFrame(pag
} }
dacs[NDACS]=new ctbDac(this, slsDetectorDefs::ADC_VPP, myDet); dacs[NDACS]=new ctbDac(this, slsDetectorDefs::ADC_VPP, myDet);
dacs[NDACS+1]=new ctbDac(this, slsDetectorDefs::HIGH_VOLTAGE, myDet); dacs[NDACS+1]=new ctbDac(this, slsDetectorDefs::HIGH_VOLTAGE, myDet);
dacs[NDACS]->setLabel((char*)"ADC Vpp",2); dacs[NDACS]->setLabel("ADC Vpp",2);
dacs[NDACS+1]->setLabel((char*)"High Voltage",3); dacs[NDACS+1]->setLabel("High Voltage",3);
} }
int ctbDacs::setDacAlias(string line) { int ctbDacs::setDacAlias(string line) {
int is=-1, mv=0; int is=-1, mv=0;
char tit[100]; char tit[100];
int narg=sscanf(line.c_str(),"DAC%d %s %d",&is,tit,&mv); int narg=sscanf(line.c_str(),"DAC%d %s %d",&is,tit,&mv);
@ -208,6 +217,7 @@ string ctbDacs::getDacAlias() {
for (int i=0; i<NDACS; i++) for (int i=0; i<NDACS; i++)
line << dacs[i]->getLabel() << endl; line << dacs[i]->getLabel() << endl;
return line.str(); return line.str();
} }
@ -215,6 +225,8 @@ string ctbDacs::getDacAlias() {
string ctbDacs::getDacParameters() { string ctbDacs::getDacParameters() {
ostringstream line; ostringstream line;
for (int i=0; i<NDACS; i++) { for (int i=0; i<NDACS; i++) {
@ -222,12 +234,18 @@ string ctbDacs::getDacParameters() {
line << "dac:" << i << " " << dacs[i]->getValue() << endl; line << "dac:" << i << " " << dacs[i]->getValue() << endl;
} }
return line.str(); return line.str();
} }
void ctbDacs::update() { void ctbDacs::update() {
for (int idac=0; idac<NDACS+1; idac++) { for (int idac=0; idac<NDACS+1; idac++) {
dacs[idac]->getValue(); dacs[idac]->getValue();
} }
} }

View File

@ -15,10 +15,7 @@ class TGNumberEntry;
class TGCheckButton; class TGCheckButton;
namespace sls class multiSlsDetector;
{
class Detector;
};
#include <string> #include <string>
using namespace std; using namespace std;
@ -35,9 +32,9 @@ class ctbDac : public TGHorizontalFrame {
TGLabel *dacsValue; TGLabel *dacsValue;
int id; int id;
sls::Detector* myDet; multiSlsDetector* myDet;
public: public:
ctbDac(TGGroupFrame*, int , sls::Detector*); ctbDac(TGGroupFrame*, int , multiSlsDetector*);
void setValue(); void setValue();
void setValue(Long_t); void setValue(Long_t);
int getValue(); int getValue();
@ -45,7 +42,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,12 +51,14 @@ int getMoenchDacId();
class ctbDacs : public TGGroupFrame { class ctbDacs : public TGGroupFrame {
private: private:
ctbDac *dacs[NDACS+2]; ctbDac *dacs[NDACS+2];
sls::Detector* myDet; multiSlsDetector* myDet;
public: public:
ctbDacs(TGVerticalFrame *page, sls::Detector*); ctbDacs(TGVerticalFrame *page, multiSlsDetector*);
int setDacAlias(string line); int setDacAlias(string line);
// int setDacAlias(string line); // int setDacAlias(string line);

View File

@ -1,84 +0,0 @@
#pragma once
#include <string>
#include <stdexcept>
#include <chrono>
//#include "sls_detector_exceptions.h"
//#include "ansi.h"
#define RED "\x1b[31m"
#define RESET "\x1b[0m"
#define BOLD "\x1b[1m"
#define cprintf(code, format, ...) printf(code format RESET, ##__VA_ARGS__)
#define CATCH_DISPLAY(m, s) catch(...) { ctbDefs::DisplayExceptions(m, s); }
#define CATCH_HANDLE(...) catch(...) { ctbDefs::HandleExceptions(__VA_ARGS__); }
class ctbDefs {
public:
/**
* Empty Constructor
*/
ctbDefs(){};
// convert double seconds to chrono ns
static std::chrono::nanoseconds ConvertDoubleStoChronoNS(double timeS) {
using std::chrono::duration;
using std::chrono::duration_cast;
using std::chrono::nanoseconds;
return duration_cast<nanoseconds>(duration<double>(timeS));
}
// convert chrono ns to doubel s
static double ConvertChronoNStoDoubleS(std::chrono::nanoseconds timeNs) {
using std::chrono::duration;
using std::chrono::duration_cast;
return duration_cast<duration<double>>(timeNs).count();
}
static void DisplayExceptions(std::string emsg, std::string src) {
try {
throw;
} /* catch (const sls::SocketError &e) {
throw;
} catch (const sls::SharedMemoryError &e) {
throw;
} */catch (const std::exception &e) {
ExceptionMessage(emsg, e.what(), src);
}
};
template <class CT> struct NonDeduced { using type = CT; };
template <class S, typename RT, typename... CT>
static void HandleExceptions(const std::string emsg, const std::string src, S* s,
RT (S::*somefunc)(CT...),
typename NonDeduced<CT>::type... Args) {
try {
throw;
} /*catch (const sls::SocketError &e) {
throw;
} catch (const sls::SharedMemoryError &e) {
throw;
} */catch (const std::exception &e) {
ExceptionMessage(emsg, e.what(), src);
(s->*somefunc)(Args...);
}
};
static void ExceptionMessage(std::string message,
std::string exceptionMessage,
std::string source) {
// because sls_detector_exceptions cannot be included
if (exceptionMessage.find("hared memory") != std::string::npos) {
throw;
}
if (exceptionMessage.find("annot connect") != std::string::npos) {
throw;
}
cprintf(RED, "Warning (%s): %s [Caught Exception: %s]\n", source.c_str(), message.c_str(), exceptionMessage.c_str());
//return Message(qDefs::WARNING, message + std::string("\nCaught exception:\n") + exceptionMessage, source);
};
};

View File

@ -9,11 +9,11 @@
#include <fstream> #include <fstream>
#include <string> #include <string>
#include "Detector.h"
#include "multiSlsDetector.h"
#include "sls_detector_defs.h" #include "sls_detector_defs.h"
//#include "sls_receiver_defs.h" //#include "sls_receiver_defs.h"
#include "ctbMain.h" #include "ctbMain.h"
#include "ctbDefs.h"
using namespace std; using namespace std;
@ -45,9 +45,9 @@ int main(int argc, char **argv) {
} else if (strcmp(argv[ia],"-par")==0) { } else if (strcmp(argv[ia],"-par")==0) {
if (ia+1<argc) { if (ia+1<argc) {
pfname=argv[ia+1]; pfname=argv[ia+1];
ia++; ia++;
pf=1; pf=1;
} }
@ -61,27 +61,31 @@ int main(int argc, char **argv) {
cout << " *** " << endl; cout << " *** " << endl;
sls::Detector *myDet = nullptr;
try {
/****** Create detector ****************/
myDet=new sls::Detector(id);
cout << "Created multi detector id " << id << endl;
if (cf) { /****** Create detector ****************/
myDet->loadConfig(cfname); multiSlsDetector *myDet=new multiSlsDetector(id);
cout << "Config file loaded successfully" << endl; // myDet->setOnline(slsDetectorDefs::ONLINE_FLAG);
} else {
cout << "No config file specified" << endl; //cout << id << " " << myDet << " " << myDet->setOnline() << endl;
} if (cf) {
cout << "hostname " << myDet->getHostname() << endl; myDet->readConfigurationFile(cfname);
} else
cout << "No config file specified" << endl;
cout << "aa" << endl;
cout << "Created multi detector id " << id << " hostname " << myDet->getHostname() << endl;
cout << "bb" << endl;
if (pf) {
myDet->retrieveDetectorSetup(pfname);
} else
cout << "No parameter file specified" << endl;
if (pf) {
myDet->loadParameters(pfname);
cout << "Loaded parameter file successfully" << endl;
} else{
cout << "No parameter file specified" << endl;
}
} CATCH_DISPLAY ("Could not create detector/ load config/parameters.", "ctbGui::main")
/***********Create GUI stuff *******************/ /***********Create GUI stuff *******************/
TApplication theApp("App",&argc,argv); TApplication theApp("App",&argc,argv);
@ -137,7 +141,7 @@ int main(int argc, char **argv) {
gROOT->ForceStyle(); gROOT->ForceStyle();
ctbMain *mf=new ctbMain(gClient->GetRoot(), myDet); ctbMain *mf=new ctbMain(gClient->GetRoot(),myDet);
cout << " *** " << argc << endl; cout << " *** " << argc << endl;
for (int ia=0; ia<argc; ia++) for (int ia=0; ia<argc; ia++)

View File

@ -29,13 +29,15 @@
#include <stdio.h> #include <stdio.h>
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
#include <string> #include <string>
#include "Detector.h" #include "multiSlsDetector.h"
#include "ctbDefs.h"
#include "ctbMain.h" #include "ctbMain.h"
#include "ctbDacs.h" #include "ctbDacs.h"
#include "ctbSlowAdcs.h" #include "ctbSlowAdcs.h"
@ -50,7 +52,7 @@ using namespace std;
ctbMain::ctbMain(const TGWindow *p, sls::Detector *det) ctbMain::ctbMain(const TGWindow *p, multiSlsDetector *det)
: TGMainFrame(p,800,800), pwrs(NULL), senses(NULL) { : TGMainFrame(p,800,800), pwrs(NULL), senses(NULL) {
myDet=det; myDet=det;
@ -145,7 +147,7 @@ ctbMain::ctbMain(const TGWindow *p, sls::Detector *det)
tf = mtab->AddTab("Power Supplies"); tf = mtab->AddTab("Power Supplies");
page=new TGVerticalFrame(tf, 1500,1200); page=new TGVerticalFrame(tf, 1500,1200);
tf->AddFrame(page, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10,10,10,1)); tf->AddFrame(page, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10,10,10,1));
pwrs=new ctbPowers(page, myDet); pwrs=new ctbPowers(page, myDet);
i_pwrs=i_page++; i_pwrs=i_page++;
@ -153,7 +155,7 @@ ctbMain::ctbMain(const TGWindow *p, sls::Detector *det)
tf = mtab->AddTab("Sense"); tf = mtab->AddTab("Sense");
page=new TGVerticalFrame(tf, 1500,1200); page=new TGVerticalFrame(tf, 1500,1200);
tf->AddFrame(page, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10,10,10,1)); tf->AddFrame(page, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10,10,10,1));
senses=new ctbSlowAdcs(page, myDet); senses=new ctbSlowAdcs(page, myDet);
i_senses=i_page++; i_senses=i_page++;
@ -259,10 +261,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());
@ -304,7 +304,7 @@ void ctbMain::HandleMenu(Int_t id)
fi.fIniDir = StrDup(dir); fi.fIniDir = StrDup(dir);
printf("fIniDir = %s\n", fi.fIniDir); printf("fIniDir = %s\n", fi.fIniDir);
new TGFileDialog(gClient->GetRoot(), this, kFDOpen, &fi); new TGFileDialog(gClient->GetRoot(), this, kFDOpen, &fi);
printf("Open file: %s (dir: %s)\n", fi.fFilename, fi.fIniDir); printf("Open file: %s (dir: %s)\n", fi.fFilename);
// dir = fi.fIniDir; // dir = fi.fIniDir;
if (fi.fFilename) if (fi.fFilename)
loadAlias(fi.fFilename); loadAlias(fi.fFilename);
@ -320,12 +320,13 @@ void ctbMain::HandleMenu(Int_t id)
fi.fIniDir = StrDup(dir); fi.fIniDir = StrDup(dir);
printf("fIniDir = %s\n", fi.fIniDir); printf("fIniDir = %s\n", fi.fIniDir);
new TGFileDialog(gClient->GetRoot(), this, kFDSave, &fi); new TGFileDialog(gClient->GetRoot(), this, kFDSave, &fi);
printf("Save file: %s (dir: %s)\n", fi.fFilename, fi.fIniDir); printf("Save file: %s (dir: %s)\n", fi.fFilename);
// dir = fi.fIniDir; // dir = fi.fIniDir;
if (fi.fFilename) if (fi.fFilename)
saveAlias(fi.fFilename); saveAlias(fi.fFilename);
} }
break; break;
case 2: //fMenuFile->AddEntry("Open Parameters", im++); case 2: //fMenuFile->AddEntry("Open Parameters", im++);
cout << "Open Parameters" << endl; cout << "Open Parameters" << endl;
{ {
@ -342,7 +343,23 @@ void ctbMain::HandleMenu(Int_t id)
} }
break; break;
case 3: // fMenuFile->AddEntry("Open Configuration", im++); case 3: //fMenuFile->AddEntry("Save Parameters", im++);
cout << "Save Parameters" << endl;
{
static TString dir(".");
TGFileInfo fi;
//fi.fFileTypes = filetypes;
fi.fIniDir = StrDup(dir);
printf("fIniDir = %s\n", fi.fIniDir);
new TGFileDialog(gClient->GetRoot(), this, kFDSave, &fi);
printf("Open file: %s (dir: %s)\n", fi.fFilename, fi.fIniDir);
// dir = fi.fIniDir;
if (fi.fFilename)
saveParameters(fi.fFilename);
}
break;
case 4: // fMenuFile->AddEntry("Open Configuration", im++);
cout << "Open configuration" << endl; cout << "Open configuration" << endl;
{ {
static TString dir("."); static TString dir(".");
@ -358,7 +375,23 @@ void ctbMain::HandleMenu(Int_t id)
} }
break; break;
case 4: //fMenuFile->AddEntry("Open Pattern", im++); case 5: // fMenuFile->AddEntry("Save Configuration", im++);
cout << "Save configuration" << endl;
{
static TString dir(".");
TGFileInfo fi;
//fi.fFileTypes = filetypes;
fi.fIniDir = StrDup(dir);
printf("fIniDir = %s\n", fi.fIniDir);
new TGFileDialog(gClient->GetRoot(), this, kFDSave, &fi);
printf("Open file: %s (dir: %s)\n", fi.fFilename, fi.fIniDir);
// dir = fi.fIniDir;
if (fi.fFilename)
saveConfiguration(fi.fFilename);
}
break;
case 6: //fMenuFile->AddEntry("Open Pattern", im++);
cout << "Open pattern" << endl; cout << "Open pattern" << endl;
{ {
static TString dir("."); static TString dir(".");
@ -374,7 +407,7 @@ void ctbMain::HandleMenu(Int_t id)
} }
break; break;
case 5: //fMenuFile->AddEntry("Save Pattern", im++); case 7: //fMenuFile->AddEntry("Save Pattern", im++);
cout << "Save pattern" << endl; cout << "Save pattern" << endl;
{ {
static TString dir("."); static TString dir(".");
@ -386,11 +419,11 @@ void ctbMain::HandleMenu(Int_t id)
printf("Open file: %s (dir: %s)\n", fi.fFilename, fi.fIniDir); printf("Open file: %s (dir: %s)\n", fi.fFilename, fi.fIniDir);
// dir = fi.fIniDir; // dir = fi.fIniDir;
if (fi.fFilename) if (fi.fFilename)
savePattern(fi.fFilename); saveParameters(fi.fFilename);
} }
break; break;
case 6: // fMenuFile->AddEntry("Exit", im++); case 8: // fMenuFile->AddEntry("Exit", im++);
CloseWindow(); CloseWindow();
default: default:
@ -406,7 +439,7 @@ int ctbMain::setADCPlot(Int_t i) {
// cout << "ADC " << i << " plot or color toggled" << endl; // cout << "ADC " << i << " plot or color toggled" << endl;
// acq->setGraph(i,adcs->getGraph(i)); // acq->setGraph(i,adcs->getGraph(i));
acq->setGraph(i,adcs->getEnabled(i),adcs->getColor(i)); acq->setGraph(i,adcs->getEnabled(i),adcs->getColor(i));
return -1;
} }
@ -415,31 +448,120 @@ int ctbMain::setSignalPlot(Int_t i) {
// cout << "ADC " << i << " plot or color toggled" << endl; // cout << "ADC " << i << " plot or color toggled" << endl;
// acq->setGraph(i,adcs->getGraph(i)); // acq->setGraph(i,adcs->getGraph(i));
acq->setBitGraph(i,sig->getPlot(i),sig->getColor(i)); acq->setBitGraph(i,sig->getPlot(i),sig->getColor(i));
return -1;
} }
void ctbMain::loadConfiguration(string fname) { int ctbMain::loadConfiguration(string fname) {
try{
myDet->loadConfig(fname); myDet->readConfigurationFile(fname);
} CATCH_DISPLAY ("Could not load config.", "ctbMain::loadConfiguration")
// string line;
// int i;
// ifstream myfile (fname.c_str());
// if (myfile.is_open())
// {
// while ( getline (myfile,line) )
// {
// }
// myfile.close();
// }
// else cout << "Unable to open file";
return 0;
} }
void ctbMain::loadParameters(string fname) {
try{
myDet->loadParameters(fname);
} CATCH_DISPLAY ("Could not load parameters.", "ctbMain::loadParameters")
int ctbMain::saveConfiguration(string fname) {
myDet->writeConfigurationFile(fname);
// string line;
// int i;
// ofstream myfile (fname.c_str());
// if (myfile.is_open())
// {
// myfile.close();
// }
// else cout << "Unable to open file";
return 0;
} }
void ctbMain::savePattern(string fname) {
try{
myDet->savePattern(fname);
} CATCH_DISPLAY ("Could not save pattern.", "ctbMain::savePattern")
int ctbMain::loadParameters(string fname) {
myDet->retrieveDetectorSetup(fname);
// string line;
// int i;
// ifstream myfile (fname.c_str());
// if (myfile.is_open())
// {
// while ( getline (myfile,line) )
// {
// }
// myfile.close();
// }
// else cout << "Unable to open file";
return 0;
} }
int ctbMain::saveParameters(string fname) {
string line;
int i;
myDet->dumpDetectorSetup(fname);
// ofstream myfile (fname.c_str());
// if (myfile.is_open())
// {
// myfile << dacs->getDacParameters();
// myfile << sig->getSignalParameters();
// myfile << adcs->getAdcParameters();
// myfile.close();
// }
// else cout << "Unable to open file";
return 0;
}
int ctbMain::loadAlias(string fname) { int ctbMain::loadAlias(string fname) {
@ -467,7 +589,7 @@ int ctbMain::loadAlias(string fname) {
else if (sscanf(line.c_str(),"PAT%s",aaaa)>0) { else if (sscanf(line.c_str(),"PAT%s",aaaa)>0) {
pat->setPatternAlias(line); pat->setPatternAlias(line);
// cout << "---------" << line<< endl; // cout << "---------" << line<< endl;
} else if (sscanf(line.c_str(),"V%s",aaaa)>0) { } else if (sscanf(line.c_str(),"V%s",&i)>0) {
if (pwrs) pwrs->setPwrAlias(line); if (pwrs) pwrs->setPwrAlias(line);
// cout << "+++++++++" << line<< endl; // cout << "+++++++++" << line<< endl;
} else if (sscanf(line.c_str(),"SENSE%d",&i)>0) { } else if (sscanf(line.c_str(),"SENSE%d",&i)>0) {
@ -493,6 +615,7 @@ int ctbMain::saveAlias(string fname) {
string line; string line;
int i;
ofstream myfile (fname.c_str()); ofstream myfile (fname.c_str());
if (myfile.is_open()) if (myfile.is_open())
{ {

View File

@ -33,10 +33,7 @@ class ctbPowers;
class ctbSignals; class ctbSignals;
namespace sls class multiSlsDetector;
{
class Detector;
};
class ctbPattern; class ctbPattern;
class ctbAdcs; class ctbAdcs;
@ -50,7 +47,7 @@ class ctbMain : public TGMainFrame {
private: private:
sls::Detector *myDet; multiSlsDetector *myDet;
@ -99,14 +96,15 @@ private:
public: public:
ctbMain(const TGWindow *p, sls::Detector *det); ctbMain(const TGWindow *p, multiSlsDetector *det);
int loadAlias(string fname); int loadAlias(string fname);
int saveAlias(string fname); int saveAlias(string fname);
void loadParameters(string fname); int loadParameters(string fname);
void savePattern(string fname); int saveParameters(string fname);
void loadConfiguration(string fname); int loadConfiguration(string fname);
int saveConfiguration(string fname);
void tabSelected(Int_t); void tabSelected(Int_t);
int setADCPlot(Int_t); int setADCPlot(Int_t);
int setSignalPlot(Int_t); int setSignalPlot(Int_t);

View File

@ -24,16 +24,15 @@
#include <fstream> #include <fstream>
#include "ctbPattern.h" #include "ctbPattern.h"
#include "ctbDefs.h" #include "multiSlsDetector.h"
#include "Detector.h"
#include <chrono>
using namespace std; using namespace std;
ctbLoop::ctbLoop(TGGroupFrame *page, int i, sls::Detector *det) : TGHorizontalFrame(page, 800,800), id(i), myDet(det) { ctbLoop::ctbLoop(TGGroupFrame *page, int i, multiSlsDetector *det) : TGHorizontalFrame(page, 800,800), id(i), myDet(det) {
TGHorizontalFrame *hframe=this; TGHorizontalFrame *hframe=this;
@ -117,29 +116,47 @@ ctbLoop::ctbLoop(TGGroupFrame *page, int i, sls::Detector *det) : TGHorizontalFr
} }
void ctbLoop::setNLoops() { void ctbLoop::setNLoops() {
try{
myDet->setPatternLoopCycles(id, eLoopNumber->GetNumber()); int start, stop, n;
} CATCH_DISPLAY ("Could not set number of pattern loops for level " + to_string(id) + ".", "ctbLoop::setNLoops")
start=-1;
stop=-1;
n=eLoopNumber->GetNumber();
try{
myDet->setPatternLoops(id,start, stop,n);
} catch (...) {
cout << "Do nothing for this error" << endl;
}
} }
void ctbLoop::update() { void ctbLoop::update() {
try{
auto loop = myDet->getPatternLoopCycles(id).tsquash("Different values"); int start, stop, n;
eLoopNumber->SetNumber(loop);
auto loopaddr = myDet->getPatternLoopAddresses(id).tsquash("Different values"); std::array<int, 3> loop;
eLoopStartAddr->SetHexNumber(loopaddr[0]);
eLoopStopAddr->SetHexNumber(loopaddr[1]); try {
loop=myDet->getPatternLoops(id);
} catch (...) {
cout << "Do nothing for this error" << endl;
}
} CATCH_DISPLAY ("Could not get pattern loops for level " + to_string(id) + ".", "ctbLoop::update") eLoopStartAddr->SetHexNumber(loop[0]);
eLoopStopAddr->SetHexNumber(loop[1]);
eLoopNumber->SetNumber(loop[2]);
} }
ctbWait::ctbWait(TGGroupFrame *page, int i, sls::Detector *det) : TGHorizontalFrame(page, 800,800), id(i), myDet(det) { ctbWait::ctbWait(TGGroupFrame *page, int i, multiSlsDetector *det) : TGHorizontalFrame(page, 800,800), id(i), myDet(det) {
char tit[100]; char tit[100];
TGHorizontalFrame *hframe=this; TGHorizontalFrame *hframe=this;
@ -194,25 +211,41 @@ ctbWait::ctbWait(TGGroupFrame *page, int i, sls::Detector *det) : TGHorizontalFr
void ctbWait::setWaitTime() { void ctbWait::setWaitTime() {
Long64_t t=eWaitTime->GetNumber();
try{ try{
t=myDet->setPatternWaitTime(id,t);
} catch (...) {
myDet->setPatternWaitTime(id, eWaitTime->GetNumber()); cout << "Do nothing for this error" << endl;
}
} CATCH_DISPLAY ("Could not set pattern wait time for level " + to_string(id) + ".", "ctbWait::setWaitTime")
} }
void ctbWait::update() { void ctbWait::update() {
int start, stop, n, addr;
Long64_t t=-1;
try{ try{
auto time = myDet->getPatternWaitTime(id).tsquash("Different values"); t=myDet->setPatternWaitTime(id,t);
auto addr = myDet->getPatternWaitAddr(id).tsquash("Different values"); } catch (...) {
cout << "Do nothing for this error" << endl;
}
try{
addr=myDet->setPatternWaitAddr(id,-1);
} catch (...) {
cout << "Do nothing for this error" << endl;
}
eWaitAddr->SetHexNumber(addr); eWaitAddr->SetHexNumber(addr);
eWaitTime->SetNumber(time); eWaitTime->SetNumber(t);
} CATCH_DISPLAY ("Could not get pattern loops for level " + to_string(id) + ".", "ctbWait::update")
} }
@ -223,7 +256,7 @@ void ctbWait::update() {
ctbPattern::ctbPattern(TGVerticalFrame *page, sls::Detector *det) ctbPattern::ctbPattern(TGVerticalFrame *page, multiSlsDetector *det)
: TGGroupFrame(page,"Pattern",kVerticalFrame), myDet(det) { : TGGroupFrame(page,"Pattern",kVerticalFrame), myDet(det) {
@ -457,7 +490,7 @@ ctbPattern::ctbPattern(TGVerticalFrame *page, sls::Detector *det)
hframe->MapWindow(); hframe->MapWindow();
sprintf(tit, "Number of triggers: "); sprintf(tit, "Number of cycles: ");
label= new TGLabel(hframe, tit); label= new TGLabel(hframe, tit);
hframe->AddFrame(label,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 1, 1, 1, 1)); hframe->AddFrame(label,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 1, 1, 1, 1));
@ -467,14 +500,14 @@ ctbPattern::ctbPattern(TGVerticalFrame *page, sls::Detector *det)
eTriggers = new TGNumberEntry(hframe, 0, 9,999, TGNumberFormat::kNESInteger, eCycles = new TGNumberEntry(hframe, 0, 9,999, TGNumberFormat::kNESInteger,
TGNumberFormat::kNEANonNegative, TGNumberFormat::kNEANonNegative,
TGNumberFormat::kNELNoLimits); TGNumberFormat::kNELNoLimits);
hframe->AddFrame( eTriggers,new TGLayoutHints(kLHintsTop | kLHintsExpandX, 1, 1, 1, 1)); hframe->AddFrame( eCycles,new TGLayoutHints(kLHintsTop | kLHintsExpandX, 1, 1, 1, 1));
eTriggers->MapWindow(); eCycles->MapWindow();
eTriggers->Resize(150,30); eCycles->Resize(150,30);
e= eTriggers->TGNumberEntry::GetNumberEntry(); e= eCycles->TGNumberEntry::GetNumberEntry();
e->Connect("ReturnPressed()","ctbPattern",this,"setTriggers()"); e->Connect("ReturnPressed()","ctbPattern",this,"setCycles()");
// sprintf(tit, "Number of measurements: "); // sprintf(tit, "Number of measurements: ");
@ -776,64 +809,134 @@ ctbPattern::ctbPattern(TGVerticalFrame *page, sls::Detector *det)
} }
void ctbPattern::update() { void ctbPattern::update() {
try{
auto retval = myDet->getRUNClock().tsquash("Different values");
eRunClkFreq->SetNumber(retval);
} CATCH_DISPLAY ("Could not get run clock.", "ctbPattern::update")
try{ int start, stop, n, addr;
auto retval = myDet->getADCClock().tsquash("Different values");
eAdcClkFreq->SetNumber(retval);
} CATCH_DISPLAY ("Could not get adc clock.", "ctbPattern::update")
try{ Long_t t;
auto retval = myDet->getADCPhase().tsquash("Different values");
eAdcClkPhase->SetNumber(retval);
} CATCH_DISPLAY ("Could not get adc phase shift.", "ctbPattern::update")
try{
auto retval = myDet->getADCPipeline().tsquash("Different values");
eAdcPipeline->SetNumber(retval);
} CATCH_DISPLAY ("Could not get adc pipeline.", "ctbPattern::update")
try{ try {
auto retval = myDet->getDBITClock().tsquash("Different values"); n=myDet->setSpeed(slsDetectorDefs::CLOCK_DIVIDER,-1,0);
eDBitClkFreq->SetNumber(retval); } catch (...) {
} CATCH_DISPLAY ("Could not get dbit clock.", "ctbPattern::update")
try{ cout << "Do nothing for this error" << endl;
auto retval = myDet->getDBITPhase().tsquash("Different values"); }
eDBitClkPhase->SetNumber(retval);
} CATCH_DISPLAY ("Could not get dbit phase shift.", "ctbPattern::update")
try{ eRunClkFreq->SetNumber(n);
auto retval = myDet->getDBITPipeline().tsquash("Different values");
eDBitPipeline->SetNumber(retval);
} CATCH_DISPLAY ("Could not get dbit pipeline.", "ctbPattern::update")
try{ try {
auto retval = myDet->getNumberOfFrames().tsquash("Different values"); n=myDet->setSpeed(slsDetectorDefs::ADC_CLOCK,-1,0);
eFrames->SetNumber(retval); } catch (...) {
} CATCH_DISPLAY ("Could not get number of frames.", "ctbPattern::update")
try{ cout << "Do nothing for this error" << endl;
auto timeNs = myDet->getPeriod().tsquash("Different values"); }
ePeriod->SetNumber(ctbDefs::ConvertChronoNStoDoubleS(timeNs));
} CATCH_DISPLAY ("Could not get period.", "ctbPattern::update")
try{ eAdcClkFreq->SetNumber(n);
auto retval = myDet->getNumberOfTriggers().tsquash("Different values");
eTriggers->SetNumber(retval);
} CATCH_DISPLAY ("Could not get number of triggers.", "ctbPattern::update")
try{ try {
auto retval = myDet->getPatternLoopAddresses(-1).tsquash("Different values"); n=myDet->setSpeed(slsDetectorDefs::ADC_PHASE,-1,0);
eStartAddr->SetHexNumber(retval[0]); } catch (...) {
eStopAddr->SetHexNumber(retval[1]);
} CATCH_DISPLAY ("Could not get dbit phase shift.", "ctbPattern::update") cout << "Do nothing for this error" << endl;
}
eAdcClkPhase->SetNumber(n);
try {
n=myDet->setSpeed(slsDetectorDefs::ADC_PIPELINE,-1,0);
} catch (...) {
cout << "Do nothing for this error" << endl;
}
eAdcPipeline->SetNumber(n);
try {
n=myDet->setSpeed(slsDetectorDefs::DBIT_CLOCK,-1,0);
} catch (...) {
cout << "Do nothing for this error" << endl;
}
eDBitClkFreq->SetNumber(n);
try {
n=myDet->setSpeed(slsDetectorDefs::DBIT_PHASE,-1,0);
} catch (...) {
cout << "Do nothing for this error" << endl;
}
eDBitClkPhase->SetNumber(n);
try {
myDet->setSpeed(slsDetectorDefs::DBIT_PIPELINE,0,-1);
} catch (...) {
cout << "Do nothing for this error" << endl;
}
eDBitPipeline->SetNumber(n);
try {
n=myDet->setTimer(slsDetectorDefs::FRAME_NUMBER,-1);
} catch (...) {
cout << "Do nothing for this error" << endl;
}
eFrames->SetNumber(n);
try {
n=myDet->setTimer(slsDetectorDefs::FRAME_PERIOD,-1);
} catch (...) {
cout << "Do nothing for this error" << endl;
}
ePeriod->SetNumber(((Double_t)n)*1E-9);
try {
n=myDet->setTimer(slsDetectorDefs::CYCLES_NUMBER,-1);
} catch (...) {
cout << "Do nothing for this error" << endl;
}
eCycles->SetNumber(n);
// try {
// myDet->setTimer(slsDetectorDefs::MEASUREMENTS_NUMBER,-1);
// } catch (...) {
// cout << "Do nothing for this error" << endl;
// }
// eMeasurements->SetNumber(n);
start=-1;
stop=-1;
n=-1;
std::array<int, 3> loop;
try {
loop=myDet->getPatternLoops(-1);
} catch (...) {
cout << "Do nothing for this error" << endl;
}
eStartAddr->SetHexNumber(loop[0]);
eStopAddr->SetHexNumber(loop[1]);
for (int iloop=0; iloop<NLOOPS; iloop++) { for (int iloop=0; iloop<NLOOPS; iloop++) {
eLoop[iloop]->update(); eLoop[iloop]->update();
} }
for (int iwait=0; iwait<NWAITS; iwait++) { for (int iwait=0; iwait<NWAITS; iwait++) {
@ -843,9 +946,8 @@ void ctbPattern::update() {
getAnalogSamples(); getAnalogSamples();
getDigitalSamples(); getDigitalSamples();
getReadoutMode(); getReadoutMode();
} }
void ctbPattern::setFile() { void ctbPattern::setFile() {
patternFileChanged(patternFile->GetText()); patternFileChanged(patternFile->GetText());
@ -882,8 +984,7 @@ void ctbPattern::setPatternAlias(string line){
string ctbPattern::getPatternAlias() { string ctbPattern::getPatternAlias() {
char line[100000]; char line[100000];
sprintf(line, "PATCOMPILER %s\nPATFILE %s\n",patternCompiler->GetText(),patternFile->GetText()); sprintf("PATCOMPILER %s\nPATFILE %s\n",patternCompiler->GetText(),patternFile->GetText());
return line;
} }
@ -931,103 +1032,154 @@ string ctbPattern::getPatternFile() {
} }
void ctbPattern::setFrames() { void ctbPattern::setFrames() {
try{ try {
myDet->setNumberOfFrames(eFrames->GetNumber()); myDet->setTimer(slsDetectorDefs::FRAME_NUMBER,eFrames->GetNumber());
} CATCH_DISPLAY ("Could not set number of frames", "ctbPattern::setFrames") } catch (...) {
cout << "Do nothing for this error" << endl;
}
} }
void ctbPattern::setTriggers() { void ctbPattern::setCycles() {
try{ try {
myDet->setNumberOfTriggers(eTriggers->GetNumber()); myDet->setTimer(slsDetectorDefs::CYCLES_NUMBER,eFrames->GetNumber());
} CATCH_DISPLAY ("Could not set number of triggers", "ctbPattern::setTriggers") } catch (...) {
cout << "Do nothing for this error" << endl;
}
} }
// void ctbPattern::setMeasurements() {
// try {
// myDet->setTimer(slsDetectorDefs::MEASUREMENTS_NUMBER,eFrames->GetNumber());
// } catch (...) {
// cout << "Do nothing for this error" << endl;
// }
// }
void ctbPattern::setPeriod() { void ctbPattern::setPeriod() {
using std::chrono::duration; try {
using std::chrono::duration_cast; myDet->setTimer(slsDetectorDefs::FRAME_PERIOD,ePeriod->GetNumber()*1E9);
using std::chrono::nanoseconds; } catch (...) {
try{
auto timeNs = ctbDefs::ConvertDoubleStoChronoNS(ePeriod->GetNumber()); cout << "Do nothing for this error" << endl;
myDet->setPeriod(timeNs); }
} CATCH_DISPLAY ("Could not set period", "ctbPattern::setPeriod")
} }
void ctbPattern::setAdcFreq() { void ctbPattern::setAdcFreq() {
try{ try {
myDet->setADCClock(eAdcClkFreq->GetNumber()); myDet->setSpeed(slsDetectorDefs::ADC_CLOCK,eAdcClkFreq->GetNumber(),0);
} CATCH_DISPLAY ("Could not set adc clock", "ctbPattern::setAdcFreq") } catch (...) {
}
cout << "Do nothing for this error" << endl;
}
}
void ctbPattern::setRunFreq() { void ctbPattern::setRunFreq() {
try{ try{
myDet->setRUNClock(eRunClkFreq->GetNumber()); myDet->setSpeed(slsDetectorDefs::CLOCK_DIVIDER,eRunClkFreq->GetNumber(),0);
} CATCH_DISPLAY ("Could not set run clock", "ctbPattern::setRunFreq") } catch (...) {
}
cout << "Do nothing for this error" << endl;
}
}
void ctbPattern::setDBitFreq() { void ctbPattern::setDBitFreq() {
try{ // cout <<"Not setting dbit frequency to " << eDBitClkFreq->GetNumber()<< endl;
myDet->setDBITClock(eDBitClkFreq->GetNumber()); try {
} CATCH_DISPLAY ("Could not set dbit clock", "ctbPattern::setDBitFreq") myDet->setSpeed(slsDetectorDefs::DBIT_CLOCK,eDBitClkFreq->GetNumber(),0);
} } catch (...) {
cout << "Do nothing for this error" << endl;
}
}
void ctbPattern::setAdcPhase() { void ctbPattern::setAdcPhase() {
try{ try {
myDet->setADCPhase(eAdcClkPhase->GetNumber()); myDet->setSpeed(slsDetectorDefs::ADC_PHASE,eAdcClkPhase->GetNumber(),0);
} CATCH_DISPLAY ("Could not set adc phase shift", "ctbPattern::setAdcPhase") } catch (...) {
cout << "Do nothing for this error" << endl;
}
} }
void ctbPattern::setDBitPhase() { void ctbPattern::setDBitPhase() {
try{ // cout <<"Not setting dbit phase to " << eDBitClkPhase->GetNumber()<< endl;
myDet->setDBITPhase(eDBitClkPhase->GetNumber()); try {
} CATCH_DISPLAY ("Could not set dbit phase shift", "ctbPattern::setDBitPhase") myDet->setSpeed(slsDetectorDefs::DBIT_PHASE,eDBitClkPhase->GetNumber(),0);
} catch (...) {
cout << "Do nothing for this error" << endl;
}
} }
void ctbPattern::setAdcPipeline() { void ctbPattern::setAdcPipeline() {
try{ try {
myDet->setADCPipeline(eAdcPipeline->GetNumber()); myDet->setSpeed(slsDetectorDefs::ADC_PIPELINE,eAdcPipeline->GetNumber(),0);
} CATCH_DISPLAY ("Could not set adc pipeline", "ctbPattern::setAdcPipeline") } catch (...) {
cout << "Do nothing for this error" << endl;
}
} }
void ctbPattern::setDBitPipeline() { void ctbPattern::setDBitPipeline() {
try{ // cout <<"Not setting dbit pipeline to " << eDBitPipeline->GetNumber() << endl;
myDet->setDBITPipeline(eDBitPipeline->GetNumber()); try {
} CATCH_DISPLAY ("Could not set dbit pipeline", "ctbPattern::setDBitPipeline") myDet->setSpeed(slsDetectorDefs::DBIT_PIPELINE,eDBitPipeline->GetNumber(),0);
} catch (...) {
cout << "Do nothing for this error" << endl;
}
} }
void ctbPattern::setAnalogSamples() { void ctbPattern::setAnalogSamples() {
try{ try {
myDet->setNumberOfAnalogSamples(eAnalogSamples->GetNumber()); myDet->setTimer(slsDetectorDefs::ANALOG_SAMPLES,eAnalogSamples->GetNumber());
} CATCH_DISPLAY ("Could not set number of analog sampels", "ctbPattern::setAnalogSamples") } catch (...) {
cout << "Do nothing for this error" << endl;
}
analogSamplesChanged(eAnalogSamples->GetNumber()); analogSamplesChanged(eAnalogSamples->GetNumber());
} }
void ctbPattern::setDigitalSamples() { void ctbPattern::setDigitalSamples() {
try{ try {
myDet->setNumberOfDigitalSamples(eDigitalSamples->GetNumber()); myDet->setTimer(slsDetectorDefs::DIGITAL_SAMPLES,eDigitalSamples->GetNumber());
} CATCH_DISPLAY ("Could not set number of digital samples", "ctbPattern::setDigitalSamples") } catch (...) {
cout << "Do nothing for this error" << endl;
}
digitalSamplesChanged(eDigitalSamples->GetNumber()); digitalSamplesChanged(eDigitalSamples->GetNumber());
} }
void ctbPattern::setReadoutMode(Bool_t) { void ctbPattern::setReadoutMode(Bool_t) {
// cout << "Set readout mode to be implemented" << endl;
slsDetectorDefs::readOutFlags flags;
if (cbAnalog->IsOn() && cbDigital->IsOn()) flags=slsDetectorDefs::ANALOG_AND_DIGITAL;
else if (~cbAnalog->IsOn() && cbDigital->IsOn()) flags=slsDetectorDefs::DIGITAL_ONLY;
else if (cbAnalog->IsOn() && ~cbDigital->IsOn()) flags=slsDetectorDefs::NORMAL_READOUT;
else flags=slsDetectorDefs::GET_READOUT_FLAGS;
try { try {
slsDetectorDefs::readoutMode flag = slsDetectorDefs::ANALOG_ONLY; myDet->setReadOutFlags(flags);
if (cbAnalog->IsOn() && cbDigital->IsOn()) } catch (...) {
flag=slsDetectorDefs::ANALOG_AND_DIGITAL;
else if (~cbAnalog->IsOn() && cbDigital->IsOn())
flag=slsDetectorDefs::DIGITAL_ONLY;
else if (cbAnalog->IsOn() && ~cbDigital->IsOn())
flag=slsDetectorDefs::ANALOG_ONLY;
else {
throw runtime_error("unkown readout flag");
}
myDet->setReadoutMode(flag);
cout << "Set readout flag: " << flag << endl;
} CATCH_DISPLAY ("Could not set readout flag", "ctbPattern::setReadoutMode")
cout << "Do nothing for this error" << endl;
}
cout << "Set readout flags " << hex << flags << dec << endl;
getReadoutMode(); getReadoutMode();
// myDet->setTimer(slsDetectorDefs::SAMPLES_CTB,eSamples->GetNumber());
//samplesChanged(eSamples->GetNumber());
} }
void ctbPattern::readoutModeChanged(int flags) { void ctbPattern::readoutModeChanged(int flags) {
@ -1036,70 +1188,72 @@ void ctbPattern::readoutModeChanged(int flags) {
} }
int ctbPattern::getReadoutMode() { int ctbPattern::getReadoutMode() {
int retval=slsDetectorDefs::ANALOG_ONLY; // cout << "Get readout mode to be implemented" << endl;
slsDetectorDefs::readOutFlags flags;
try {
flags=(slsDetectorDefs::readOutFlags) myDet->setReadOutFlags();
} catch (...) {
if (myDet->getDetectorType().squash() == slsDetectorDefs::CHIPTESTBOARD) { cout << "Do nothing for this error" << endl;
try{ }
retval = myDet->getReadoutMode().tsquash("Different values");
} CATCH_DISPLAY ("Could not get readout flags", "ctbPattern::getReadoutMode")
switch(retval) { cout << "++++++++++++++++++++"<< hex << flags << dec << endl;
case slsDetectorDefs::ANALOG_AND_DIGITAL: if (flags&slsDetectorDefs::ANALOG_AND_DIGITAL) {
cout << "analog and digital" << endl; cout << "analog and digital" << hex << slsDetectorDefs::ANALOG_AND_DIGITAL << dec<< endl;
cbAnalog->SetOn(kTRUE); cbAnalog->SetOn(kTRUE);
cbDigital->SetOn(kTRUE); cbDigital->SetOn(kTRUE);
break; } else if (flags&slsDetectorDefs::DIGITAL_ONLY) {
case slsDetectorDefs::DIGITAL_ONLY: cout << "digital only" << hex << slsDetectorDefs::DIGITAL_ONLY << dec << endl;
cout << "digital only" << endl; cbAnalog->SetOn(kFALSE);
cbAnalog->SetOn(kFALSE); cbDigital->SetOn(kTRUE);
cbDigital->SetOn(kTRUE); }// else if (flags==slsDetectorDefs::NORMAL_READOUT) {
break; // cbAnalog->SetOn(kTRUE);
case slsDetectorDefs::ANALOG_ONLY: // cbDigital->SetOn(kFALSE);
cout << "analog only" << endl; // }
cbAnalog->SetOn(kTRUE); else {
cbDigital->SetOn(kFALSE); cout << "analog only" << endl;
break; flags=slsDetectorDefs::NORMAL_READOUT;
default: cbAnalog->SetOn(kTRUE);
throw("unknown readout flag"); cbDigital->SetOn(kFALSE);
} }
} else {
cbAnalog->SetOn(kTRUE);
cbDigital->SetOn(kFALSE);
}
Emit("readoutModeChanged(int)",static_cast<int>(retval));
return retval;
Emit("readoutModeChanged(int)",(int)flags);
return (int)flags;
// myDet->setTimer(slsDetectorDefs::SAMPLES_CTB,eSamples->GetNumber());
//samplesChanged(eSamples->GetNumber());
} }
int ctbPattern::getAnalogSamples() { int ctbPattern::getAnalogSamples() {
try{ int n;
auto retval = myDet->getNumberOfAnalogSamples().tsquash("Different values"); try {
eAnalogSamples->SetNumber((Double_t)retval); n=(myDet->setTimer(slsDetectorDefs::ANALOG_SAMPLES,-1));
Emit("analogSamplesChanged(const int)", eAnalogSamples->GetNumber()); } catch (...) {
return eAnalogSamples->GetNumber();
} CATCH_DISPLAY ("Could not get number of triggers.", "ctbPattern::update")
return -1; cout << "Do nothing for this error" << endl;
}
eAnalogSamples->SetNumber((Double_t)n);
Emit("analogSamplesChanged(const int)", eAnalogSamples->GetNumber());
return eAnalogSamples->GetNumber();
} }
int ctbPattern::getDigitalSamples() { int ctbPattern::getDigitalSamples() {
int retval=0; int n;
if (myDet->getDetectorType().squash() == slsDetectorDefs::CHIPTESTBOARD) { try {
try{
auto retval = myDet->getNumberOfDigitalSamples().tsquash("Different values"); n=(myDet->setTimer(slsDetectorDefs::DIGITAL_SAMPLES,-1));
} CATCH_DISPLAY ("Could not get number of digital samples.", "ctbPattern::getDigitalSamples") } catch (...) {
}
eDigitalSamples->SetNumber((Double_t)retval); cout << "Do nothing for this error" << endl;
}
eDigitalSamples->SetNumber(((Double_t)n));
Emit("digitalSamplesChanged(const int)", eDigitalSamples->GetNumber()); Emit("digitalSamplesChanged(const int)", eDigitalSamples->GetNumber());
return eDigitalSamples->GetNumber(); return eDigitalSamples->GetNumber();
return -1;
} }
void ctbPattern::analogSamplesChanged(const int t){ void ctbPattern::analogSamplesChanged(const int t){
Emit("analogSamplesChanged(const int)", t); Emit("analogSamplesChanged(const int)", t);
} }

View File

@ -27,10 +27,7 @@ class energyCalibration;
class TGTextButton; class TGTextButton;
class TGTab; class TGTab;
namespace sls class multiSlsDetector;
{
class Detector;
};
#include <string> #include <string>
@ -49,10 +46,10 @@ class ctbLoop : public TGHorizontalFrame {
int id; int id;
sls::Detector *myDet; multiSlsDetector *myDet;
public: public:
ctbLoop(TGGroupFrame *page, int i,sls::Detector *det); ctbLoop(TGGroupFrame *page, int i,multiSlsDetector *det);
void setNLoops(); void setNLoops();
void update(); void update();
@ -70,10 +67,10 @@ class ctbWait : public TGHorizontalFrame {
int id; int id;
sls::Detector *myDet; multiSlsDetector *myDet;
public: public:
ctbWait(TGGroupFrame *page, int i,sls::Detector *det); ctbWait(TGGroupFrame *page, int i,multiSlsDetector *det);
void setWaitTime(); void setWaitTime();
void update(); void update();
@ -102,7 +99,7 @@ private:
TGNumberEntry *eStopAddr; TGNumberEntry *eStopAddr;
TGNumberEntry *eFrames; TGNumberEntry *eFrames;
TGNumberEntry *ePeriod; TGNumberEntry *ePeriod;
TGNumberEntry *eTriggers; TGNumberEntry *eCycles;
// TGNumberEntry *eMeasurements; // TGNumberEntry *eMeasurements;
TGNumberEntry *eAdcPipeline; TGNumberEntry *eAdcPipeline;
TGNumberEntry *eDBitPipeline; TGNumberEntry *eDBitPipeline;
@ -125,11 +122,11 @@ private:
char pat[PATLEN*8]; char pat[PATLEN*8];
sls::Detector *myDet; multiSlsDetector *myDet;
public: public:
ctbPattern(TGVerticalFrame *page, sls::Detector *det); ctbPattern(TGVerticalFrame *page, multiSlsDetector *det);
void update(); void update();
void setAdcFreq(); void setAdcFreq();
@ -141,7 +138,7 @@ public:
void setAdcPipeline(); void setAdcPipeline();
void setDBitPipeline(); void setDBitPipeline();
void setFrames(); void setFrames();
void setTriggers(); void setCycles();
// void setMeasurements(); // void setMeasurements();
void setPeriod(); void setPeriod();

View File

@ -10,48 +10,61 @@
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
#include "ctbDefs.h"
#include "ctbDacs.h" #include "ctbDacs.h"
#include "ctbPowers.h" #include "ctbPowers.h"
#include "Detector.h" #include "multiSlsDetector.h"
#include "sls_detector_defs.h" #include "sls_detector_defs.h"
using namespace std; using namespace std;
ctbPower::ctbPower(TGGroupFrame* f, int i, sls::Detector* d) ctbPower::ctbPower(TGGroupFrame* f, int i, multiSlsDetector* d)
: ctbDac(f, i, d) : ctbDac(f, i, d)
{ {
cout << "****************************************************************power " << i << endl; cout << "****************************************************************power " << i << endl;
dacsUnit->SetOn(kTRUE); dacsUnit->SetOn(kTRUE);
dacsUnit->SetEnabled(kFALSE); dacsUnit->SetEnabled(kFALSE);
int ii=0;
switch(i) { switch(i) {
case slsDetectorDefs::V_POWER_IO: case slsDetectorDefs::V_POWER_IO:
dacsLabel->SetText("VIO"); dacsLabel->SetText("VIO");
ii=slsDetectorDefs::I_POWER_IO;
break; break;
case slsDetectorDefs::V_POWER_A: case slsDetectorDefs::V_POWER_A:
dacsLabel->SetText("VA"); dacsLabel->SetText("VA");
ii=slsDetectorDefs::I_POWER_A;
break; break;
case slsDetectorDefs::V_POWER_B: case slsDetectorDefs::V_POWER_B:
dacsLabel->SetText("VB"); dacsLabel->SetText("VB");
ii=slsDetectorDefs::I_POWER_B;
break; break;
case slsDetectorDefs::V_POWER_C: case slsDetectorDefs::V_POWER_C:
dacsLabel->SetText("VC"); dacsLabel->SetText("VC");
ii=slsDetectorDefs::I_POWER_C;
break; break;
case slsDetectorDefs::V_POWER_D: case slsDetectorDefs::V_POWER_D:
dacsLabel->SetText("VD"); dacsLabel->SetText("VD");
ii=slsDetectorDefs::I_POWER_D;
break; break;
case slsDetectorDefs::V_POWER_CHIP: case slsDetectorDefs::V_POWER_CHIP:
dacsLabel->SetText("VCHIP"); dacsLabel->SetText("VCHIP");
dacsLabel->SetEnabled(kFALSE); dacsLabel->SetEnabled(kFALSE);
ii=-1;
break; break;
default: default:
dacsLabel->SetText("Bad index"); dacsLabel->SetText("Bad index");
ii=-1;
break; break;
}; };
// ctbSlowAdc *vm=new ctbSlowAdc(f,i,d);
// vm->setLabel("V: ");
// if (ii>=0) {
// ctbSlowAdc *im=new ctbSlowAdc(f,ii,d);
// im->setLabel("I: ");
// }
TGTextEntry *e=dacsEntry->TGNumberEntry::GetNumberEntry(); TGTextEntry *e=dacsEntry->TGNumberEntry::GetNumberEntry();
e->Disconnect ("ReturnPressed()"); e->Disconnect ("ReturnPressed()");
@ -91,45 +104,44 @@ string ctbPower::getLabel() {
} }
line << " " << dacsLabel->GetText() << endl; line << " " << dacsLabel->GetText() << endl;
return line.str(); return line.str();
} }
void ctbPower::setValue(Long_t a) {ctbPower::setValue();}
void ctbPower::setValue(Long_t a) {cout << "ssssssssss" << endl; ctbPower::setValue();}
void ctbPower::setValue() { void ctbPower::setValue() {
cout << "***************************Setting power " << dacsEntry->GetIntNumber() << " " << id << " " << 1 << endl;
try {
myDet->setVoltage(static_cast<slsDetectorDefs::dacIndex>(id), dacsEntry->GetIntNumber()); cout << "***************************Setting power " << dacsEntry->GetIntNumber() << " " << (slsDetectorDefs::dacIndex)id <<" " << 1 << endl;
} CATCH_DISPLAY ("Could not set power " + to_string(id) + ".", "ctbPower::setValue") myDet->setDAC(dacsEntry->GetIntNumber(), (slsDetectorDefs::dacIndex)id, 1);
getValue(); getValue();
} }
int ctbPower::getValue() { int ctbPower::getValue() {
try {
int val = myDet->getVoltage(static_cast<slsDetectorDefs::dacIndex>(id)).tsquash("Different values"); int val=myDet->setDAC(-1, (slsDetectorDefs::dacIndex)id, 1);
cout << "****************************Getting power " << val << " " << id << " " << 1 << endl; char s[100];
cout << "****************************Getting power " << val << " " << (slsDetectorDefs::dacIndex)id <<" " << 1 << endl;
dacsValue->SetText(to_string(val).c_str()); sprintf(s,"%d",val);
if (val > 0) { dacsValue->SetText(s);
if (id != static_cast<int>(slsDetectorDefs::V_POWER_CHIP)) if (val>0) {
if (id!=slsDetectorDefs::V_POWER_CHIP)
dacsLabel->SetOn(kTRUE); dacsLabel->SetOn(kTRUE);
} else { } else {
dacsLabel->SetOn(kFALSE); dacsLabel->SetOn(kFALSE);
} }
return val; return val;
} CATCH_DISPLAY ("Could not get power " + to_string(id) + ".", "ctbPower::getValue")
return -1;
} }
ctbPowers::ctbPowers(TGVerticalFrame* page, sls::Detector* det) : TGGroupFrame(page,"Power Supplies",kVerticalFrame) , myDet(det){ ctbPowers::ctbPowers(TGVerticalFrame* page, multiSlsDetector* det) : TGGroupFrame(page,"Power Supplies",kVerticalFrame) , myDet(det){
SetTitlePos(TGGroupFrame::kLeft); SetTitlePos(TGGroupFrame::kLeft);
@ -147,8 +159,9 @@ ctbPowers::ctbPowers(TGVerticalFrame* page, sls::Detector* det) : TGGroupFrame
int ctbPowers::setPwrAlias(string line) { int ctbPowers::setPwrAlias(string line) {
int is=-1; int is=-1, mv=0;
char tit[100]; char tit[100];
int narg;
if (sscanf(line.c_str(),"VA %s",tit)) { if (sscanf(line.c_str(),"VA %s",tit)) {
dacs[0]->setLabel(tit,1); dacs[0]->setLabel(tit,1);
@ -199,6 +212,7 @@ string ctbPowers::getPwrAlias() {
string ctbPowers::getPwrParameters() { string ctbPowers::getPwrParameters() {
ostringstream line; ostringstream line;
line << "v_a" << " " << dacs[0]->getValue() << " mv" << endl; line << "v_a" << " " << dacs[0]->getValue() << " mv" << endl;
line << "v_b" << " " << dacs[1]->getValue() << " mv" << endl; line << "v_b" << " " << dacs[1]->getValue() << " mv" << endl;
@ -211,13 +225,19 @@ string ctbPowers::getPwrParameters() {
// line << "dac:" << i << " " << dacs[i]->getValue() << endl; // line << "dac:" << i << " " << dacs[i]->getValue() << endl;
// } // }
return line.str(); return line.str();
} }
void ctbPowers::update() { void ctbPowers::update() {
for (int idac=0; idac<NPOWERS; idac++) { for (int idac=0; idac<NPOWERS; idac++) {
dacs[idac]->getValue(); dacs[idac]->getValue();
} }
} }

View File

@ -3,7 +3,14 @@
#include <TGFrame.h> #include <TGFrame.h>
#ifndef CTB
#define NPOWERS 0
#else
#define NPOWERS 6 #define NPOWERS 6
#endif
@ -15,10 +22,8 @@ class TGCheckButton;
namespace sls class multiSlsDetector;
{
class Detector;
};
#include <string> #include <string>
using namespace std; using namespace std;
@ -31,7 +36,7 @@ class ctbPower : public ctbDac {
public: public:
ctbPower(TGGroupFrame* f, int i, sls::Detector* d); ctbPower(TGGroupFrame* f, int i, multiSlsDetector* d);
string getLabel(); string getLabel();
@ -49,11 +54,11 @@ class ctbPowers : public TGGroupFrame
ctbPower *dacs[NPOWERS]; ctbPower *dacs[NPOWERS];
sls::Detector* myDet; multiSlsDetector* myDet;
public: public:
//ctbPowers(); //ctbPowers();
ctbPowers(TGVerticalFrame*, sls::Detector*); ctbPowers(TGVerticalFrame*, multiSlsDetector*);
int setPwrAlias(string); int setPwrAlias(string);
string getPwrAlias(); string getPwrAlias();

View File

@ -34,8 +34,7 @@
#include "ctbSignals.h" #include "ctbSignals.h"
#include "ctbDefs.h" #include "multiSlsDetector.h"
#include "Detector.h"
using namespace std; using namespace std;
@ -44,7 +43,7 @@ using namespace std;
//#define DEFAULTFN "run_0.encal" //#define DEFAULTFN "run_0.encal"
ctbSignal::ctbSignal(TGFrame *page, int i, sls::Detector *det) ctbSignal::ctbSignal(TGFrame *page, int i, multiSlsDetector *det)
: TGHorizontalFrame(page, 800,50), myDet(det), id(i), hsig(NULL) { : TGHorizontalFrame(page, 800,50), myDet(det), id(i), hsig(NULL) {
@ -179,6 +178,10 @@ int ctbSignal::fixOutput(int i) {
int ctbSignal::setDbitList(Long64_t r) { int ctbSignal::setDbitList(Long64_t r) {
Long64_t mask=((Long64_t)1<<id);
// cout << hex << r << dec <<endl;
if (r) if (r)
sDbitList->SetOn(kTRUE,kFALSE); sDbitList->SetOn(kTRUE,kFALSE);
else else
@ -194,6 +197,7 @@ int ctbSignal::isPlot() { return sPlot->IsOn();}
Pixel_t ctbSignal::getColor(){return fColorSel->GetColor();} Pixel_t ctbSignal::getColor(){return fColorSel->GetColor();}
void ctbSignal::ToggledOutput(Bool_t b) { void ctbSignal::ToggledOutput(Bool_t b) {
Long_t mask=b<<id;
ToggledSignalOutput(id); ToggledSignalOutput(id);
if (b) { if (b) {
// sClock->SetEnabled(kTRUE); // sClock->SetEnabled(kTRUE);
@ -245,7 +249,7 @@ void ctbSignal::ToggledSignalPlot(Int_t b){
} }
ctbSignals::ctbSignals(TGVerticalFrame *page, sls::Detector *det) ctbSignals::ctbSignals(TGVerticalFrame *page, multiSlsDetector *det)
: TGGroupFrame(page,"IO Signals",kVerticalFrame), myDet(det) { : TGGroupFrame(page,"IO Signals",kVerticalFrame), myDet(det) {
@ -255,6 +259,7 @@ ctbSignals::ctbSignals(TGVerticalFrame *page, sls::Detector *det)
TGHorizontalFrame *hframe; TGHorizontalFrame *hframe;
char tit[100];
TGHorizontalFrame* hhframe=new TGHorizontalFrame(this, 800,800); TGHorizontalFrame* hhframe=new TGHorizontalFrame(this, 800,800);
AddFrame(hhframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1)); AddFrame(hhframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
@ -285,6 +290,36 @@ ctbSignals::ctbSignals(TGVerticalFrame *page, sls::Detector *det)
} }
// #ifdef CTB
// idac=62;
// signals[idac]=new ctbSignal(vframe,idac,myDet);
// vframe->AddFrame(signals[idac],new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
// signals[idac]->MapWindow();
// sprintf(tit,"DBIT Latch");
// signals[idac]->setSignalAlias(tit,-1,-1);
// signals[idac]->Connect("ToggledSignalOutput(Int_t)","ctbSignals",this,"ToggledOutReg(Int_t)");
// signals[idac]->Connect("ToggledSignalDbitList(Int_t)","ctbSignals",this,"ToggledDbitList(Int_t)");
// signals[idac]->Connect("ToggledSignalPlot(Int_t)","ctbSignals",this,"ToggledPlot(Int_t)");
// #endif
// idac=63;
// signals[idac]=new ctbSignal(vframe,idac,myDet);
// vframe->AddFrame(signals[idac],new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
// signals[idac]->MapWindow();
// sprintf(tit,"ADC Latch");
// signals[idac]->setSignalAlias(tit,-1,-1);
// signals[idac]->Connect("ToggledSignalOutput(Int_t)","ctbSignals",this,"ToggledOutReg(Int_t)");
// signals[idac]->Connect("ToggledSignalDbitList(Int_t)","ctbSignals",this,"ToggledDbitList(Int_t)");
// signals[idac]->Connect("ToggledSignalPlot(Int_t)","ctbSignals",this,"ToggledPlot(Int_t)");
hframe=new TGHorizontalFrame(vframe, 800,50); hframe=new TGHorizontalFrame(vframe, 800,50);
vframe->AddFrame(hframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1)); vframe->AddFrame(hframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
hframe->MapWindow(); hframe->MapWindow();
@ -363,142 +398,121 @@ string ctbSignals::getSignalAlias() {
void ctbSignals::update() { void ctbSignals::update() {
try { Long64_t oreg=myDet->setPatternIOControl();//setCTBWord(-1,-1);
// Long64_t creg=myDet->setPatternClockControl();//setCTBWord(-2,-1);
Long64_t oreg = static_cast<Long64_t>(myDet->getPatternIOControl().tsquash("Different values"));
cout << hex << oreg << dec << endl;
for (int idac=0; idac<NIOSIGNALS; idac++) { char val[1000];
signals[idac]->setOutput(oreg); cout << hex << oreg << dec << endl;
} // cout << hex << creg << dec << endl;
} CATCH_DISPLAY ("Could not get patternIOcontrol.", "ctbSignals::update") sprintf(val,"%llX",oreg);
// eIOCntrlRegister->SetHexNumber(oreg);
if (myDet->getDetectorType().squash() == slsDetectorDefs::MOENCH) {
// enable all for (int idac=0; idac<NIOSIGNALS; idac++) {
signals[idac]->setOutput(oreg);
}
Long64_t mask;
std::vector <int> dbitlist=myDet->getReceiverDbitList();
if (dbitlist.empty())
for (int is=0; is<64; is++) { for (int is=0; is<64; is++) {
signals[is]->setDbitList(1); signals[is]->setDbitList(1);
} }
eDbitOffset->SetNumber(0);
}
// ctb
else { else {
try { for (int is=0; is<64; is++) signals[is]->setDbitList(0);
for (const auto &value : dbitlist) {
auto dbitlist = myDet->getRxDbitList().tsquash("Different values"); signals[value]->setDbitList(1);
// enable all }
if (dbitlist.empty()) {
for (int is=0; is<64; is++) {
signals[is]->setDbitList(1);
}
}
else {
// disable all
for (int is=0; is<64; is++) {
signals[is]->setDbitList(0);
}
// enable selected
for (const auto &value : dbitlist) {
signals[value]->setDbitList(1);
}
}
} CATCH_DISPLAY ("Could not get receiver dbit list.", "ctbSignals::update")
try {
auto val = myDet->getRxDbitOffset().tsquash("Different values");
eDbitOffset->SetNumber(val);
} CATCH_DISPLAY ("Could not get receiver dbit offset.", "ctbSignals::update")
} }
eDbitOffset->SetNumber(myDet->getReceiverDbitOffset());
} }
string ctbSignals::getSignalParameters() { string ctbSignals::getSignalParameters() {
try {
auto val = myDet->getPatternIOControl().tsquash("Different values"); ostringstream line;
ostringstream line; line << "patioctrl " << hex << myDet->setPatternIOControl() << dec << endl;//setCTBWord(-1,-1)
line << "patioctrl " << hex << val << dec << endl; return line.str();
return line.str();
} CATCH_DISPLAY ("Could not get patternIOcontrol.", "ctbSignals::getSignalParameters")
return ("");
} }
void ctbSignals::ToggledOutReg(Int_t mask) { void ctbSignals::ToggledOutReg(Int_t mask) {
try {
Long64_t oreg = static_cast<Long64_t>(myDet->getPatternIOControl().tsquash("Different values")); char val[1000];
Long64_t m=((Long64_t)1)<<mask; Long64_t oreg=myDet->setPatternIOControl();//setCTBWord(-1,-1);
cout << dec << sizeof(Long64_t) << " " << mask << " " << hex << m << " ioreg " << oreg; Long64_t m=((Long64_t)1)<<mask;
if (signals[mask]->isOutput()) {
cout << " or " << m ;
oreg|=m;
} else {
cout << " not " << ~m ;
oreg&=~m;
}
cout << " after " << oreg << endl;
myDet->setPatternIOControl(static_cast<uint64_t>(oreg)); cout << dec << sizeof(Long64_t) << " " << mask << " " << hex << m << " ioreg " << oreg;
oreg = static_cast<Long64_t>(myDet->getPatternIOControl().tsquash("Different values"));
cout << dec << sizeof(Long64_t) << " " << mask << " " << hex << m << " ioreg " << oreg << endl;
eIOCntrlRegister->SetText(to_string(oreg).c_str());
} CATCH_DISPLAY ("Could not get/set patternIOcontrol.", "ctbSignals::ToggledOutReg")
if (signals[mask]->isOutput()) {
cout << " or " << m ;
oreg|=m;
} else {
cout << " not " << ~m ;
oreg&=~m;
}
cout << " after " << oreg << endl;
myDet->setPatternIOControl(oreg);//setCTBWord(-1,oreg);
oreg=myDet->setPatternIOControl();//myDet->setCTBWord(-1,-1);
cout << dec << sizeof(Long64_t) << " " << mask << " " << hex << m << " ioreg " << oreg << endl;
sprintf(val,"%llX",oreg);
// eIOCntrlRegister->SetHexNumber(oreg);
eIOCntrlRegister->SetText(val);
// eIOCntrlRegister->SetNumber(oreg);
} }
void ctbSignals::ToggledDbitList(Int_t mask){ void ctbSignals::ToggledDbitList(Int_t mask){
try {
auto dbitlist = myDet->getRxDbitList().tsquash("Different values");
// anyway all enabled
if ((dbitlist.empty()) && (signals[mask]->isDbitList())) {
;
}
// set the dbitlist
else {
std::vector <int> new_dbitlist;
for (int is=0; is<64; is++) {
if (signals[is]->isDbitList()){
new_dbitlist.push_back(is);
cout << is << " " << new_dbitlist.size() - 1 << endl;
}
}
if (new_dbitlist.size() > 64)
new_dbitlist.clear();
myDet->setRxDbitList(new_dbitlist);
// get list again
dbitlist = myDet->getRxDbitList().tsquash("Different values");
}
// enable all cout << "************* Here" << endl;
if (dbitlist.empty()) {
for (int is=0; is<64; is++) {
signals[is]->setDbitList(1);
} std::vector <int> new_dbitlist;
} std::vector <int> old_dbitlist=myDet->getReceiverDbitList();
else {
// disable all char val[1000];
for (int is=0; is<64; is++) { Long64_t m=((Long64_t)1)<<mask;
signals[is]->setDbitList(0);
} if (old_dbitlist.empty() && signals[mask]->isDbitList())
// enable selected ;
for (const auto &value : dbitlist) { else {
signals[value]->setDbitList(1); int ns=0;
for (int is=0; is<64; is++) {
if (signals[is]->isDbitList()){
new_dbitlist.push_back(is);
ns++;
cout << is << " " << ns << endl;
} }
} }
if (ns>63) new_dbitlist.clear();
myDet->setReceiverDbitList(new_dbitlist);
}
std::vector <int> dbitlist=myDet->getReceiverDbitList();
if (dbitlist.empty())
for (int is=0; is<64; is++) signals[is]->setDbitList(1);
else
for (int is=0; is<64; is++) signals[is]->setDbitList(0);
for (const auto &value : dbitlist) signals[value]->setDbitList(1);
} CATCH_DISPLAY ("Could not get/set receiver dbit list.", "ctbSignals::ToggledDbitList")
} }
@ -519,23 +533,16 @@ void ctbSignals::ToggledSignalPlot(Int_t b) {
Pixel_t ctbSignals::getColor(int i){ Pixel_t ctbSignals::getColor(int i){
if (i>=0 && i<NSIGNALS) if (i>=0 && i<NSIGNALS) return signals[i]->getColor();
return signals[i]->getColor();
return static_cast<Pixel_t>(-1);
} }
int ctbSignals::getPlot(int i){ int ctbSignals::getPlot(int i){
if (i>=0 && i<NSIGNALS) if (i>=0 && i<NSIGNALS) return signals[i]->isPlot();
return signals[i]->isPlot();
return -1;
}; };
void ctbSignals::setDbitOffset(Long_t) { void ctbSignals::setDbitOffset(Long_t) {
setDbitOffset(); setDbitOffset();
} }
void ctbSignals::setDbitOffset(){ void ctbSignals::setDbitOffset(){
try { myDet->setReceiverDbitOffset(eDbitOffset->GetNumber());
myDet->setRxDbitOffset(eDbitOffset->GetNumber());
} CATCH_DISPLAY ("Could not set receiver dbit offset.", "ctbSignals::setDbitOffset")
} }

View File

@ -25,10 +25,7 @@ class TGColorSelect;
class TGNumberEntry; class TGNumberEntry;
namespace sls class multiSlsDetector;
{
class Detector;
};
class ctbSignal; class ctbSignal;
#include <string> #include <string>
@ -48,14 +45,14 @@ private:
TGNumberEntry *sEntry; TGNumberEntry *sEntry;
TGColorSelect *fColorSel; TGColorSelect *fColorSel;
sls::Detector *myDet; multiSlsDetector *myDet;
Int_t id; Int_t id;
TH1I *hsig; TH1I *hsig;
public: public:
ctbSignal(TGFrame *page, int i, sls::Detector *det); ctbSignal(TGFrame *page, int i, multiSlsDetector *det);
int setSignalAlias(char *tit, int plot, int col); int setSignalAlias(char *tit, int plot, int col);
string getSignalAlias(); string getSignalAlias();
@ -92,10 +89,10 @@ private:
TGNumberEntry *eIOCntrlRegister; TGNumberEntry *eIOCntrlRegister;
TGNumberEntry *eDbitOffset; TGNumberEntry *eDbitOffset;
sls::Detector *myDet; multiSlsDetector *myDet;
public: public:
ctbSignals(TGVerticalFrame *page, sls::Detector *det); ctbSignals(TGVerticalFrame *page, multiSlsDetector *det);
int setSignalAlias(string line); int setSignalAlias(string line);
string getSignalAlias(); string getSignalAlias();

View File

@ -9,8 +9,7 @@
#include <TGButton.h> #include <TGButton.h>
#include "ctbSlowAdcs.h" #include "ctbSlowAdcs.h"
#include "ctbDefs.h" #include "multiSlsDetector.h"
#include "Detector.h"
#include "sls_detector_defs.h" #include "sls_detector_defs.h"
using namespace std; using namespace std;
@ -18,7 +17,7 @@ using namespace std;
ctbSlowAdc::ctbSlowAdc(TGGroupFrame *page, int idac, sls::Detector *det) : TGHorizontalFrame(page, 800,50) , id(idac), myDet(det) { ctbSlowAdc::ctbSlowAdc(TGGroupFrame *page, int idac, multiSlsDetector *det) : TGHorizontalFrame(page, 800,50) , id(idac), myDet(det) {
TGHorizontalFrame *hframe=this; TGHorizontalFrame *hframe=this;
@ -56,6 +55,9 @@ ctbSlowAdc::ctbSlowAdc(TGGroupFrame *page, int idac, sls::Detector *det) : TGHor
b->SetTextJustify(kTextLeft); b->SetTextJustify(kTextLeft);
b->Connect("Clicked()","ctbSlowAdc",this,"getValue()"); b->Connect("Clicked()","ctbSlowAdc",this,"getValue()");
} }
@ -64,50 +66,38 @@ int ctbSlowAdc::setLabel(char *tit) {
if(tit) if(tit)
dacsLabel->SetText(tit); dacsLabel->SetText(tit);
return id; return id;
} }
string ctbSlowAdc::getLabel() { string ctbSlowAdc::getLabel() {
ostringstream line; ostringstream line;
line << dacsLabel->GetText() << endl; line << dacsLabel->GetText() << endl;
// line << "DAC" << dec << id << " " << dacsUnit->IsOn() << endl; // line << "DAC" << dec << id << " " << dacsUnit->IsOn() << endl;
return line.str(); return line.str();
} }
int ctbSlowAdc::getValue() { int ctbSlowAdc::getValue() {
try {
std::string s;
// temp int val=myDet->getADC((slsDetectorDefs::dacIndex)id);
if (id == static_cast<int>(slsDetectorDefs::SLOW_ADC_TEMP)) { char s[100];
cout << "adc " << id << " " << val << endl;
sprintf(s,"%d mV",val);
if (id==999)
sprintf(s,"%d <20>C",val);
dacsValue->SetText(s);
int val = myDet->getTemperature(static_cast<slsDetectorDefs::dacIndex>(id)).tsquash("Different values");
cout << "slow adc temp" << " " << val << endl;
s = to_string(val) + " " + to_string(0x00b0) + "C";//<2F>C
dacsValue->SetText(s.c_str());
return val;
}
// mv return val;
else {
int val = myDet->getSlowADC(static_cast<slsDetectorDefs::dacIndex>(id)).tsquash("Different values");
cout << "slow adc " << id << " " << val << endl;
s = to_string(val) + " mV";
dacsValue->SetText(s.c_str());
return val;
}
} CATCH_DISPLAY ("Could not get slow dac " + to_string(id) + ".", "ctbSlowAdc::getValue")
return -1;
} }
@ -116,7 +106,8 @@ int ctbSlowAdc::getValue() {
ctbSlowAdcs::ctbSlowAdcs(TGVerticalFrame *page, sls::Detector *det) : TGGroupFrame(page,"Sense",kVerticalFrame) , myDet(det){ ctbSlowAdcs::ctbSlowAdcs(TGVerticalFrame *page, multiSlsDetector *det) : TGGroupFrame(page,"Sense",kVerticalFrame) , myDet(det){
SetTitlePos(TGGroupFrame::kLeft); SetTitlePos(TGGroupFrame::kLeft);
page->AddFrame(this,new TGLayoutHints( kLHintsTop | kLHintsExpandX , 10,10,10,10)); page->AddFrame(this,new TGLayoutHints( kLHintsTop | kLHintsExpandX , 10,10,10,10));
@ -125,12 +116,14 @@ ctbSlowAdcs::ctbSlowAdcs(TGVerticalFrame *page, sls::Detector *det) : TGGroupF
// cout << "window mapped " << endl; // cout << "window mapped " << endl;
for (int idac=0; idac<NSLOWADCS + 1; idac++) { for (int idac=0; idac<NSLOWADCS; idac++) {
adcs[idac]=new ctbSlowAdc(this, idac+1000, myDet); adcs[idac]=new ctbSlowAdc(this, idac+1000, myDet);
} }
adcs[NSLOWADCS]->setLabel((char*)"Temperature"); adcs[NSLOWADCS]=new ctbSlowAdc(this, 999, myDet);
adcs[NSLOWADCS]->setLabel("Temperature");
} }
@ -140,7 +133,7 @@ int ctbSlowAdcs::setSlowAdcAlias(string line) {
int is=-1, mv=0; int is=-1, mv=0;
char tit[100]; char tit[100];
int narg=sscanf(line.c_str(),"SENSE%d %s %d",&is,tit,&mv); int narg=sscanf(line.c_str(),"SENSE%d %s",&is,tit,&mv);
if (narg<2) if (narg<2)
return -1; return -1;
if (is>=0 && is<NSLOWADCS) if (is>=0 && is<NSLOWADCS)
@ -156,6 +149,7 @@ string ctbSlowAdcs::getSlowAdcAlias() {
for (int i=0; i<NSLOWADCS; i++) for (int i=0; i<NSLOWADCS; i++)
line << adcs[i]->getLabel() << endl; line << adcs[i]->getLabel() << endl;
return line.str(); return line.str();
} }
@ -163,6 +157,7 @@ string ctbSlowAdcs::getSlowAdcAlias() {
string ctbSlowAdcs::getAdcParameters() { string ctbSlowAdcs::getAdcParameters() {
ostringstream line; ostringstream line;
for (int i=0; i<NSLOWADCS; i++) { for (int i=0; i<NSLOWADCS; i++) {
@ -171,12 +166,20 @@ string ctbSlowAdcs::getAdcParameters() {
} }
line << "adc:-1" << adcs[NSLOWADCS]->getValue() << endl; line << "adc:-1" << adcs[NSLOWADCS]->getValue() << endl;
return line.str(); return line.str();
} }
void ctbSlowAdcs::update() { void ctbSlowAdcs::update() {
for (int idac=0; idac<NSLOWADCS+1; idac++) { for (int idac=0; idac<NSLOWADCS+1; idac++) {
adcs[idac]->getValue(); adcs[idac]->getValue();
} }
} }

View File

@ -19,10 +19,7 @@ class TGTextButton;
namespace sls class multiSlsDetector;
{
class Detector;
};
#include <string> #include <string>
using namespace std; using namespace std;
@ -38,9 +35,9 @@ class ctbSlowAdc : public TGHorizontalFrame {
TGLabel *dacsValue; TGLabel *dacsValue;
int id; int id;
sls::Detector* myDet; multiSlsDetector* myDet;
public: public:
ctbSlowAdc(TGGroupFrame*, int , sls::Detector*); ctbSlowAdc(TGGroupFrame*, int , multiSlsDetector*);
int getValue(); int getValue();
int setLabel(char *tit); int setLabel(char *tit);
@ -59,10 +56,10 @@ private:
ctbSlowAdc *adcs[NSLOWADCS+1]; ctbSlowAdc *adcs[NSLOWADCS+1];
sls::Detector* myDet; multiSlsDetector* myDet;
public: public:
ctbSlowAdcs(TGVerticalFrame *page, sls::Detector*); ctbSlowAdcs(TGVerticalFrame *page, multiSlsDetector*);
int setSlowAdcAlias(string line); int setSlowAdcAlias(string line);
// int setDacAlias(string line); // int setDacAlias(string line);

View File

@ -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

View File

@ -1,93 +1,67 @@
find_package(Doxygen REQUIRED) find_package(Doxygen)
find_package(Sphinx REQUIRED) find_package(Sphinx)
if (DOXYGEN_FOUND AND SPHINX_FOUND)
# #Utility to generate command line documentation
add_executable(gendoc src/gendoc.cpp)
target_link_libraries(gendoc PRIVATE
slsDetectorShared
)
set_target_properties(gendoc PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
# Utility to generate command line documentation #Doxygen
add_executable(gendoc src/gendoc.cpp) set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
# This is a bit hacky, but better than exposing stuff? set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
target_include_directories(gendoc PRIVATE ${PROJECT_SOURCE_DIR}/slsDetectorSoftware/src) configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
target_link_libraries(gendoc PRIVATE
slsDetectorShared
)
set_target_properties(gendoc PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
#Sphinx
set(SPHINX_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/src)
set(SPHINX_BUILD ${CMAKE_CURRENT_BINARY_DIR})
set(SPHINX_SOURCE_FILES
src/commandline.rst
src/container_utils.rst
src/dependencies.rst
src/detector.rst
src/index.rst
src/installation.rst
src/pydetector.rst
src/pyenums.rst
src/pyexamples.rst
src/receiver.rst
src/result.rst
src/type_traits.rst
src/ToString.rst
)
#Doxygen foreach(filename ${SPHINX_SOURCE_FILES})
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${filename}
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) "${SPHINX_BUILD}/${filename}")
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY) endforeach(filename ${SPHINX_SOURCE_FILES})
#Sphinx configure_file(
set(SPHINX_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/src) "${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in"
set(SPHINX_BUILD ${CMAKE_CURRENT_BINARY_DIR}) "${SPHINX_BUILD}/conf.py"
@ONLY)
set(SPHINX_SOURCE_FILES add_custom_target(docs
src/commandline.rst gendoc
src/container_utils.rst COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
src/consuming.rst COMMAND ${SPHINX_EXECUTABLE} -a -b html
src/dependencies.rst -Dbreathe_projects.slsDetectorPackage=${CMAKE_CURRENT_BINARY_DIR}/xml
src/detector.rst -c "${SPHINX_BUILD}"
src/index.rst ${SPHINX_BUILD}/src
src/installation.rst ${SPHINX_BUILD}/html
src/pydetector.rst COMMENT "Generating documentation with Sphinx")
src/pyenums.rst
src/pyexamples.rst
src/servers.rst
src/receiver.rst
src/result.rst
src/type_traits.rst
src/ToString.rst
src/examples.rst
src/pygettingstarted.rst
src/firmware.rst
src/serverupgrade.rst
)
foreach(filename ${SPHINX_SOURCE_FILES})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${filename}
"${SPHINX_BUILD}/${filename}")
endforeach(filename ${SPHINX_SOURCE_FILES})
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in"
"${SPHINX_BUILD}/conf.py"
@ONLY)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/gen_server_doc.py.in"
"${SPHINX_BUILD}/gen_server_doc.py"
@ONLY)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/static/extra.css"
"${SPHINX_BUILD}/static/css/extra.css"
@ONLY)
add_custom_target(server_rst python gen_server_doc.py)
add_custom_target(docs
gendoc
COMMAND python gen_server_doc.py
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
COMMAND ${SPHINX_EXECUTABLE} -a -b html
-Dbreathe_projects.slsDetectorPackage=${CMAKE_CURRENT_BINARY_DIR}/xml
-c "${SPHINX_BUILD}"
${SPHINX_BUILD}/src
${SPHINX_BUILD}/html
COMMENT "Generating documentation with Sphinx")
add_custom_target(rst
COMMAND ${SPHINX_EXECUTABLE} -a -b html
-Dbreathe_projects.slsDetectorPackage=${CMAKE_CURRENT_BINARY_DIR}/xml
-c "${SPHINX_BUILD}"
${SPHINX_BUILD}/src
${SPHINX_BUILD}/html
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)

View File

@ -21,7 +21,7 @@ print(sys.path)
# -- Project information ----------------------------------------------------- # -- Project information -----------------------------------------------------
project = 'slsDetectorPackage' project = 'slsDetectorPackage'
copyright = '2020, PSD Detector Group' copyright = '2019, PSD Detector Group'
author = 'PSD Detector Group' author = 'PSD Detector Group'
version = '@PROJECT_VERSION@' version = '@PROJECT_VERSION@'
@ -59,8 +59,4 @@ html_theme = "sphinx_rtd_theme"
# Add any paths that contain custom static files (such as style sheets) here, # Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files, # relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css". # so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['static'] #html_static_path = ['_static']
def setup(app):
app.add_stylesheet('css/extra.css') # may also be an URL

View File

@ -1,86 +0,0 @@
import os
import re
from pathlib import Path
def remove_comments(text):
def replacer(match):
s = match.group(0)
if s.startswith('/'):
return " " # note: a space and not an empty string
else:
return s
pattern = re.compile(
r'//.*?$|/\*.*?\*/|\'(?:\\.|[^\\\'])*\'|"(?:\\.|[^\\"])*"',
re.DOTALL | re.MULTILINE
)
return re.sub(pattern, replacer, text)
# @CMAKE_CURRENT_BINARY_DIR@
print('\n\n\n\n SERVER CSV')
src = Path('@CMAKE_SOURCE_DIR@')/'slsDetectorServers/'
detectors = ['Mythen3', 'Gotthard2', 'Eiger',
'Jungfrau', 'Moench', 'Gotthard', 'Ctb']
for det in detectors:
print(det)
in_fname = src/f'{det.lower()}DetectorServer/slsDetectorServer_defs.h'
#print(f'Reading: {in_fname}')
with open(in_fname) as f:
lines = f.read().replace('\\\n', '')
lines = lines.splitlines(keepends = True)
lines = [l.strip('#define').strip(' ') for l in lines if l.startswith('#define')]
output = []
signals = []
fields = ['Name,', 'Value', 'Comment']
excluded = ['DAC_NAMES', 'DEFAULT_DAC_VALS', 'CLK_NAMES', 'ONCHIP_DAC_NAMES']
header = f'{fields[0]:35}{fields[1]:35}\n'
output.append(header)
signals.append(header)
dac_names = []
dac_values = []
for line in lines:
name, *parts = line.split()
arg = ' '.join(parts)
value, *comments = arg.split('//')
value = value.strip('() ')
# value = value.replace(', ', ' ')
value = value.replace('\"', '')
if name not in excluded:
name += ','
if name.startswith('SIGNAL_'):
signals.append(f'{name:35}{value}\n')
else:
output.append(f'{name:35}\"{value}\"\n')
elif name == 'DAC_NAMES':
dac_names = [v.strip(', ') for v in value.split()]
dac_names = [n+',' for n in dac_names]
elif name == 'DEFAULT_DAC_VALS':
dac_values = remove_comments(value).strip('{}; ')
dac_values = dac_values.replace(',', '').split()
dac_values = [v.strip('') for v in dac_values]
print(f"dac_names: {len(dac_names)}, dac_values={len(dac_values)}")
if len(dac_values) == 0:
dac_values = ['N/A']*len(dac_names)
rstpath = Path('@CMAKE_SOURCE_DIR@')/'docs/src/'
out_fname = Path.cwd()/f'src/{det.lower()}.csv'
out_dac_fname = Path.cwd()/f'src/{det.lower()}-dacs.csv'
#print(f'Writing: {out_fname}')
with open(out_fname, 'w') as f:
f.writelines(output)
output = [f'{n:35}{v}\n' for n,v in zip(dac_names, dac_values)]
output.insert(0, header)
with open(out_dac_fname, 'w') as f:
f.writelines(output)
print('END\n\n\n\n')

View File

@ -4,28 +4,12 @@ Command line interface
Usage Usage
------------- -------------
Commands can be used either with sls_detector_get or sls_detector_put Commands can be uses either with sls_detector_get or sls_detector_put
.. code-block:: .. code-block::
sls_detector_get vrf sls_detector_get vrf
Help
--------
.. code-block::
# get list of commands
sls_detector_get list
# search for a particular command using a word
sls_detector_get list | grep adc
# get help for a particular command
sls_detector_get -h fpath
sls_detector_help fpath
Commands Commands
----------- -----------

View File

@ -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

View File

@ -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
@ -42,7 +42,7 @@ The documentation that you are reading now is built with
* Doxygen (to extract C++ classes etc.) * Doxygen (to extract C++ classes etc.)
* Breathe (Sphinx plugin to handle doxygen xml) * Breathe (Sphinx plugin to handle doxygen xml)
* Sphinx with sphinx_rtd_theme * Sphinx
----------------------- -----------------------
Packaged in libs/ Packaged in libs/

View File

@ -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);

View File

@ -1,357 +0,0 @@
Firmware Upgrade
=================
Eiger
-------------
.. note ::
| Eiger firmware can be upgraded remotely.
| The programming executable (bcp) and corresponding bit files are provided by the SLS Detector group.
Compatibility
^^^^^^^^^^^^^
**Release candidate 5.0.0-rc1**
.. code-block:: bash
Minimum compatible version : 27
Latest compatible version : 27
`Older versions <https://www.psi.ch/en/detectors/latest-installation>`_
Upgrade
^^^^^^^^
#. Tftp must be already installed on your pc to use the bcp executable.
#. Kill the on-board servers and copy new servers to the board.
.. code-block:: bash
# Option 1: from detector console
# kill old server
ssh root@bebxxx
killall eigerDetectorServer
# copy new server
cd executables
scp user@pc:/path/eigerDetectorServerxxx .
chmod 777 eigerDetectorServerxxx
ln -sf eigerDetectorServerxxx eigerDetectorServer
sync
# Options 2: from client console for multiple modules
for i in bebxxx bebyyy;
do ssh root@$i killall eigerDetectorServer;
scp eigerDetectorServerxxx root@$i:~/executables/eigerDetectorServer;
ssh root@$i sync; done
* This is crucial when registers between firmwares change. Failure to do so will result in linux on boards to crash and boards can't be pinged anymore.
#. Bring the board into programmable mode using either of the 2 ways. Both methods result in only the central LED blinking.
* **Manual:**
Do a hard reset for each half module on back panel boards, between the LEDs, closer to each of the 1G ethernet connectors. Push until all LEDs start to blink.
* Software:
.. code-block:: bash
ssh root@bebxxx
cd executables
./boot_recovery
#. Start a terminal for each half module and run the following to see progress.
.. code-block:: bash
nc -p 3000 -u bebxxx 3000
# Press enter twice to see prompt with board name.
> bebxxx
# After each bcp command, wait for this terminal to print "Success".
#. In another terminal, run the following to update firmware. Please update bit files with great caution as it could make your board inaccessible, if done incorrectly.
.. code-block:: bash
#update back end fpga
bcp download.bit bebxxx:/fw0
#update front left fpga
bcp download.bit bebxxx:/febl
#update front right fpga
bcp download.bit bebxxx:/febr
#update kernel (only if required by the SLS Detector Group)
bcp download.bit bebxxx:/kernel
#. Reboot the detector.
Jungfrau
-------------
.. note ::
| Jungfrau firmware can be upgraded remotely.
| The corresponding programming file (pof) is provided by the SLS Detector group.
Compatibility
^^^^^^^^^^^^^
**Release candidate 5.0.0-rc1**
.. code-block:: bash
# PCB v1.0
Minimum compatible version : 24.07.2020 (v0.8)
Latest compatible version : 24.07.2020 (v0.8)
# PCB v2.0
Minimum compatible version : 21.07.2020 (v2.1)
Latest compatible version : 21.07.2020 (v2.1)
`Older versions <https://www.psi.ch/en/detectors/latest-installation>`_
Upgrade (from v4.x.x)
^^^^^^^^^^^^^^^^^^^^
#. Tftp must be installed on pc.
#. Update client package to the latest (5.0.0-rc1).
#. Disable server respawning or kill old server
.. code-block:: bash
# Option 1: if respawning enabled
telnet bchipxxx
# edit /etc/inittab
# comment out line #ttyS0::respawn:/jungfrauDetectorServervxxx
reboot
# ensure servers did not start up after reboot
telnet bchipxxx
ps
# Option 2: if respawning already disabled
telnet bchipxxx
killall jungfrauDetectorServerv*
#. Copy new server and start in update mode
.. code-block:: bash
tftp pcxxx -r jungfrauDetectorServervxxx -g
chmod 777 jungfrauDetectorServervxxx
./jungfrauDetectorServervxxx -u
#. Program fpga from the client console
.. code-block:: bash
sls_detector_get free
# Crucial that the next command executes without any errors
sls_detector_put hostname bchipxxx
sls_detector_put programfpga xxx.pof
#. After programming, kill update server using Ctrl + C.
#. Enable server respawning if needed
.. code-block:: bash
telnet bchipxxx
# edit /etc/inittab
# uncomment out line #ttyS0::respawn:/jungfrauDetectorServervxxx
# ensure the line has the new server name
reboot
# ensure both servers are running using ps
jungfrauDetectorServervxxx
jungfrauDetectorServervxxx --stop-server 1953
Upgrade (from v5.0.0-rc1)
^^^^^^^^^^^^^^^^^^^^^^^^
#. Program from console
.. code-block:: bash
# copies server from tftp folder of pc, programs fpga,
# removes old server from respawn, sets up new server to respawn
# and reboots
sls_detector_put update jungfrauDetectorServervxxx pcxxx xx.pof
# Or only program firmware
sls_detector_put programfpga xxx.pof
Gotthard
---------
.. warning ::
| Gotthard firmware cannot be upgraded remotely and requires the use of USB-Blaster.
| It is generally updated by the SLS Detector group.
Compatibility
^^^^^^^^^^^^^
**Release candidate 5.0.0-rc1**
.. code-block:: bash
Minimum compatible version : 11.01.2013
Latest compatible version : 08.02.2018 (50um and 25um Master)
09.02.2018 (25 um Slave)
`Older versions <https://www.psi.ch/en/detectors/latest-installation>`_
Upgrade
^^^^^^^^
#. Download `Altera Quartus software or Quartus programmer <https://fpgasoftware.intel.com/20.1/?edition=standard&platform=linux&product=qprogrammer#tabs-4>`_.
#. Start Quartus programmer, click on Hardware Setup. In the "Currently selected hardware" window, select USB-Blaster.
#. In the Mode combo box, select "Active Serial Programming".
#. Plug the end of your USB-Blaster with the adaptor provided to the connector 'AS config' on the Gotthard board.
#. Click on 'Add file'. Select programming (pof) file provided by the SLS Detector group.
#. Check "Program/Configure" and "Verify". Push the start button. Wait until the programming process is finished.
#. In case of error messages, check the polarity of cable (that pin1 corresponds) and that the correct programming connector is selected.
#. Reboot the detector.
Mythen3
-------
.. note ::
| Mythen3 firmware can be upgraded remotely.
| The corresponding programming file (rbf) is provided by the SLS Detector group.
Compatibility
^^^^^^^^^^^^^
**Release candidate 5.0.0-rc1**
.. code-block:: bash
Minimum compatible version : 25.09.2020
Latest compatible version : 25.09.2020
Upgrade (from v5.0.0-rc1)
^^^^^^^^^^^^^^^^^^^^^^^^
#. Program from console
.. code-block:: bash
# copies server from tftp folder of pc, programs fpga,
# and reboots (new server not respawned currently)
sls_detector_put update mythen3DetectorServervxxx pcxxx xxx.rbf
# Or only program firmware
sls_detector_put programfpga xxx.rbf
Gotthard2
----------
.. note ::
| Gotthard2 firmware can be upgraded remotely.
| The corresponding programming file (rbf) is provided by the SLS Detector group.
Compatibility
^^^^^^^^^^^^^
**Release candidate 5.0.0-rc1**
.. code-block:: bash
Minimum compatible version : 25.09.2020
Latest compatible version : 25.09.2020
Upgrade (from v5.0.0-rc1)
^^^^^^^^^^^^^^^^^^^^^^^^
#. Program from console
.. code-block:: bash
# copies server from tftp folder of pc, programs fpga,
# and reboots (new server not respawned currently)
sls_detector_put update gotthard2DetectorServervxxx pcxxx xxx.rbf
# Or only program firmware
sls_detector_put programfpga xxx.rbf
Moench
------
.. note ::
| Moench firmware can be upgraded remotely.
| The corresponding programming file (pof) is provided by the SLS Detector group.
Compatibility
^^^^^^^^^^^^^
**Release candidate 5.0.0-rc1**
.. code-block:: bash
Minimum compatible version : 02.03.2020
Latest compatible version : 02.03.2020
Upgrade (from v5.0.0-rc1)
^^^^^^^^^^^^^^^^^^^^^^^^
#. Program from console
.. code-block:: bash
# copies server from tftp folder of pc, programs fpga,
# removes old server from respawn, sets up new server to respawn
# and reboots
sls_detector_put update moenchDetectorServervxxx pcxxx xx.pof
# Or only program firmware
sls_detector_put programfpga xxx.pof
Ctb
---
.. note ::
| Ctb firmware can be upgraded remotely.
| The corresponding programming file (pof) is provided by the SLS Detector group.
Compatibility
^^^^^^^^^^^^^
**Release candidate 5.0.0-rc1**
.. code-block:: bash
Minimum compatible version : 27.11.2019
Latest compatible version : 27.11.2019
Upgrade (from v5.0.0-rc1)
^^^^^^^^^^^^^^^^^^^^^^^^
#. Program from console
.. code-block:: bash
# copies server from tftp folder of pc, programs fpga,
# removes old server from respawn, sets up new server to respawn
# and reboots
sls_detector_put update ctbDetectorServervxxx pcxxx xx.pof
# Or only program firmware
sls_detector_put programfpga xxx.pof

View File

@ -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"
@ -35,7 +36,7 @@ int main() {
std::cout << "Generating command line documentation!\n"; std::cout << "Generating command line documentation!\n";
sls::CmdProxy proxy(nullptr); sls::CmdProxy<sls::Detector> proxy(nullptr);
auto commands = proxy.GetProxyCommands(); auto commands = proxy.GetProxyCommands();
std::ofstream fs("commands.rst"); std::ofstream fs("commands.rst");
@ -48,7 +49,8 @@ int main() {
auto tmp = os.str().erase(0, cmd.size()); auto tmp = os.str().erase(0, cmd.size());
auto usage = tmp.substr(0, tmp.find_first_of('\n')); auto usage = tmp.substr(0, tmp.find_first_of('\n'));
tmp.erase(0, usage.size()); tmp.erase(0, usage.size());
auto help = replace_all(tmp, "\n\t", "\n\t\t| "); auto help = replace_all(tmp, "\n\t", "\n\t\t");
fs << '\t' << cmd << usage << help << "\n"; fs << '\t' << cmd << usage << help << "\n";
} }
} }

View File

@ -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,13 +20,11 @@ Welcome to slsDetectorPackage's documentation!
detector detector
result result
receiver receiver
examples
.. toctree:: .. toctree::
:caption: Python API :caption: Python API
:maxdepth: 2 :maxdepth: 2
pygettingstarted
pydetector pydetector
pyenums pyenums
pyexamples pyexamples
@ -50,17 +42,6 @@ Welcome to slsDetectorPackage's documentation!
type_traits type_traits
ToString ToString
.. toctree::
:caption: Servers
servers
serverupgrade
.. toctree::
:caption: Firmware
firmware
.. Indices and tables .. Indices and tables
.. ================== .. ==================

View File

@ -1,134 +1,5 @@
.. 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.
.. warning ::
Before building from source make sure that you have the
:doc:`dependencies <../dependencies>` installed. If installing using conda, conda will
manage the dependencies.
Installation Installation
============================================== ==============================================
Build from source using CMake get the source etc.
---------------------------------
Note that on some systems, for example RH7, cmake v3+ is available under the cmake3 alias.
It is also required to clone with the option --recursive to get the git submodules used
in the package.
.. code-block:: bash
git clone --recursive https://github.com/slsdetectorgroup/slsDetectorPackage.git
mkdir build && cd build
cmake ../slsDetectorPackage -DCMAKE_INSTALL_PREFIX=/your/install/path
make -j12 #or whatever number of cores you are using to build
make install
The easiest way to configure options is to use the ccmake utility.
.. code-block:: bash
#from the build directory
ccmake .
Build using cmk.sh script
-------------------------
.. code-block:: bash
# new build and make with 9 parallel threads
./cmk.sh -cbj9
# build with python
./cmk.sh -bpj9
# build with GUI
./cmk.sh -bgj9
# build with hdf5
./cmk.sh -hj9 -d [path of hdf5 dir]
# get all options
./cmk.sh -?
Install binaries using conda
--------------------------------
Conda is not only useful to manage python environments but can also
be used as a user space package manager.
We have three different packages available:
* **slsdetlib**, shared libraries and command line utilities
* **slsdetgui**, GUI
* **slsdet**, Python bindings
.. 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.07.23.dev0
conda activate myenv
#ready to use
sls_detector_get exptime
etc ...
.. code-block:: bash
#List available versions
conda search slsdet
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
Then enable the option SLS_BUILD_DOCS to create the targets
.. code-block:: bash
make docs # generate API docs and build Sphinx RST
make rst # rst only, saves time in case the API did not change

View File

@ -1,10 +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:
:inherited-members:

View File

@ -4,80 +4,9 @@ Enums
These enums are defined in slsDetectorDefs in the C++ package and These enums are defined in slsDetectorDefs in the C++ package and
exposed to Python through pybind11. exposed to Python through pybind11.
.. py:currentmodule:: sls_detector
::
# Most settings are represented as enums that can be
# explicitly imported
from slsdet import Detector, fileFormat
d = Detector()
d.fformat = fileFormat.BINARY
# Altough not recommended for convenience all enums
# and some other things can be impored using *
from slsdet import *
d.speed = speedLevel.FULL_SPEED
# To list the available enums, use dir()
import slsdet.enums
for enum in dir(slsdet.enums):
# filter out special memebers
if not enum.startswith('_'):
print(enum)
.. py:currentmodule:: slsdet
.. autoclass:: runStatus .. autoclass:: runStatus
:members:
:undoc-members: :undoc-members:
:show-inheritance:
.. autoclass:: detectorType
:undoc-members:
.. autoclass:: frameDiscardPolicy
:undoc-members:
.. autoclass:: fileFormat
:undoc-members:
.. autoclass:: dimension
:undoc-members:
.. autoclass:: externalSignalFlag
:undoc-members:
.. autoclass:: timingMode
:undoc-members:
.. autoclass:: dacIndex
:undoc-members:
.. autoclass:: detectorSettings
:undoc-members:
.. autoclass:: clockIndex
:undoc-members:
.. autoclass:: speedLevel
:undoc-members:
.. autoclass:: readoutMode
:undoc-members:
.. autoclass:: masterFlags
:undoc-members:
.. autoclass:: frameModeType
:undoc-members:
.. autoclass:: detectorModeType
:undoc-members:
.. autoclass:: burstMode
:undoc-members:
.. autoclass:: timingSourceType
:undoc-members:

View File

@ -1,73 +1,7 @@
Examples Examples
================ ================
Some short examples on how to use slsdet. If something is missing don't hesitate to Some short hints on how to use the detector
open an issue in our our `github repo
<https://github.com/slsdetectorgroup/slsDetectorPackage>`_.
------------------------------------
Setting exposure time
------------------------------------
Setting and reading back exposure time can be done either using a Python datetime.timedelta
or by setting the time in seconds.
::
# Set exposure time to 1.2 seconds
>>> d.exptime = 1.2
# Setting exposure time using timedelta
import datetime as dt
>>> d.exptime = dt.timedelta(seconds = 1.2)
# With timedelta any arbitrary combination of units can be used
>>> t = dt.timedelta(microseconds = 100, seconds = 5.3, minutes = .3)
# To set exposure time for individual detector one have to resort
# to the C++ style API.
# Sets exposure time to 1.2 seconds for module 0, 6 and 12
>>> d.setExptime(1.2, [0, 6, 12])
>>> d.setExptime(dt.timedelta(seconds = 1.2), [0, 6, 12])
------------------------------------
Converting numbers to hex
------------------------------------
Python support entering numbers in format by using the 0x prefix. However, when reading
back you will get a normal integer. This can then be converted to a hex string representation
using the built in hex() function.
.. code-block :: python
from slsdet import Detector
>>> d = Detector()
>>> d.patwait0 = 0xaa
>>> d.patwait0
170
# Convert to string
>>> hex(d.patwait0)
'0xaa'
For multiple values one can use a list comprehension to loop over the values.
.. code-block :: python
>>> values = [1,2,3,4,5]
>>> [(v) for v in values]
['0x1', '0x2', '0x3', '0x4', '0x5']
# or to a single string by passing the list to .join
>>> ', '.join([hex(v) for v in values])
'0x1, 0x2, 0x3, 0x4, 0x5'
------------------------ ------------------------
Simple threshold scan Simple threshold scan
@ -78,7 +12,7 @@ file writing etc.
.. code-block:: python .. code-block:: python
from slsdet import Eiger from sls_detector import Eiger
d = Eiger() d = Eiger()
threshold = range(0, 2000, 200) threshold = range(0, 2000, 200)
@ -140,39 +74,37 @@ But lets start looking at the at the manual way:
:: ::
import time import time
from slsdet import Detector, runStatus from sls_detector import Eiger
d = Eiger()
n = 10
t = 1
n_frames = 10 d.exposure_time = t
t_exp = 1 d.n_frames = n
d.reset_frames_caught()
# Set exposure time and number of frames #Start the measurement
d = Detector()
d.exptime = t_exp
d.frames = n_frames
# Start the measurement
t0 = time.time() t0 = time.time()
d.startDetector() d.start_receiver()
d.startReceiver() d.start_detector()
# Wait for the detector to be ready or do other important stuff #Wait for the detector to be ready or do other important stuff
time.sleep(t_exp * n_frames) time.sleep(t*n)
# check if the detector is ready otherwise wait a bit longer #check if the detector is ready otherwise wait a bit longer
while d.status != runStatus.IDLE: while d.status != 'idle':
time.sleep(0.1) time.sleep(0.1)
# Stop the receiver after we got the frames #Stop the receiver after we got the frames
# Detector is already idle so we don't need to stop it #Detector is already idle so we don't need to stop it
d.stopReceiver() d.stop_receiver()
lost = d.rx_framescaught - n_frames
print(
f"{n_frames} frames of {t_exp}s took {time.time()-t0:{.3}}s with {lost} frames lost "
)
lost = d.frames_caught - n
print(f'{n} frames of {t}s took {time.time()-t0:{.3}}s with {lost} frames lost ')
#Reset to not interfere with a potential next measurement
d.reset_frames_caught()
Instead launching d.acq() from a different process is a bit easier since the control of receiver and detector Instead launching d.acq() from a different process is a bit easier since the control of receiver and detector
is handled in the acq call. However, you need to join the process used otherwise a lot of zombie processes would is handled in the acq call. However, you need to join the process used otherwise a lot of zombie processes would
@ -182,104 +114,30 @@ hang around until the main process exits.
import time import time
from multiprocessing import Process from multiprocessing import Process
from slsdet import Detector, runStatus from sls_detector import Eiger
def acquire():
"""
Create a new Eiger object that still referes to the same actual detector
and same shared memory. Then launch acq.
"""
detector = Eiger()
detector.acq()
d = Detector() #This is the detector we use throughout the session
d = Eiger()
#Create a separate process to run acquire in #Process to run acquire
p = Process(target=d.acquire) p = Process(target=acquire)
#Start the thread and short sleep to allow the acq to start #Start the thread and short sleep to allow the acq to start
p.start() p.start()
time.sleep(0.01) time.sleep(0.01)
#Do some other work #Do some other work
while d.status != runStatus.IDLE: while d.busy is True:
print("Working") print(d.busy)
time.sleep(0.1) time.sleep(0.1)
#Join the process #Join the process
p.join() p.join()
------------------------------
Setting and getting times
------------------------------
::
import datetime as dt
from slsdet import Detector
from slsdet.utils import element_if_equal
d = Detector()
# The simplest way is to set the exposure time in
# seconds by using the exptime property
# This sets the exposure time for all modules
d.exptime = 0.5
# exptime also accepts a python datetime.timedelta
# which can be used to set the time in almost any unit
t = dt.timedelta(milliseconds = 2.3)
d.exptime = t
# or combination of units
t = dt.timedelta(minutes = 3, seconds = 1.23)
d.exptime = t
# exptime however always returns the time in seconds
>>> d.exptime
181.23
# To get back the exposure time for each module
# it's possible to use getExptime, this also returns
# the values as datetime.timedelta
>>> d.getExptime()
[datetime.timedelta(seconds=181, microseconds=230000), datetime.timedelta(seconds=181, microseconds=230000)]
# In case the values are the same it's possible to use the
# element_if_equal function to reduce the values to a single
# value
>>> t = d.getExptime()
>>> element_if_equal(t)
datetime.timedelta(seconds=1)
--------------
Reading dacs
--------------
::
from slsdet import Detector, Eiger, dacIndex
#using the specialized class
e = Eiger()
>>> e.dacs
========== DACS =========
vsvp : 0 0
vtrim : 2480 2480
vrpreamp : 3300 3300
vrshaper : 1400 1400
vsvn : 4000 4000
vtgstv : 2556 2556
vcmp_ll : 1000 1000
vcmp_lr : 1000 1000
vcal : 0 0
vcmp_rl : 1000 1000
rxb_rb : 1100 1100
rxb_lb : 1100 1100
vcmp_rr : 1000 1000
vcp : 1000 1000
vcn : 2000 2000
vishaper : 1550 1550
iodelay : 650 650
# or using the general class and the list
d = Detector()
for dac in d.daclist:
r = d.getDAC(dac, False)
print(f'{dac.name:10s} {r}')

View File

@ -1,228 +0,0 @@
Getting Started
==================
--------------------
Which Python?
--------------------
We require at lest Python 3.6 and strongly recommended that you don't use the system
Python installation. The examples in this documentation uses `conda
<https://docs.conda.io/en/latest/miniconda.html>`_ since it provides good support
also for non Python packages but there are also other alternatives like, pyenv.
Using something like conda also allows you to quickly switch beteen different Python
environments.
.. warning ::
If you use conda avoid also installing packages with pip.
---------------------
PYTHONPATH
---------------------
If you install slsdet using conda everything is set up and you can
directly start using the Python bindings. However, if you build
from source you need to tell Python where to find slsdet. This
is be done by adding your build/bin directory to PYTHONPATH.
.. code-block:: bash
export PYTHONPATH = /path/to/your/build/bin:$PYTHONPATH
.. note ::
Don't forget to compile with the option SLS_USE_PYTHON=ON to enable
the Python bindings or if you use the cmk.sh script -p.
--------------------------------------
Which detector class should I use?
--------------------------------------
We provide a generic class called Detector and detector specific
versions like, Eiger, Jungfrau etc. The most or all functionality
is there in the base class except the convenient access to dacs
and temperatures.
::
from slsdet import Detector, Eiger
d = Detector()
e = Eiger()
# Both classes can be used to control an Eiger detector
d.exptime = 0.5
e.period = 1
# But Eiger gives a simpler interface to the dacs
>>> e.dacs
========== DACS =========
vsvp : 0
vtrim : 2480
vrpreamp : 3300
vrshaper : 1400
vsvn : 4000
vtgstv : 2556
vcmp_ll : 1000
vcmp_lr : 1000
vcal : 0
vcmp_rl : 1000
rxb_rb : 1100
rxb_lb : 1100
vcmp_rr : 1000
vcp : 1000
vcn : 2000
vishaper : 1550
iodelay : 650
.. note ::
Depending on user feedback we might move some detector specific
functionality to the specialized classes.
----------------------------------
Hey, there seems to be two APIs?
----------------------------------
To make the Python API approachable, both if you come from the command line
or are using the C++ API, we provide two interfaces to the detector.
One is property based and tries to stay as close to the command line syntax
as is possible, and the other one directly maps the C++ API found in Detector.h.
There is also an underlying design reason for the two APIs since we auto
generate the bindings to the C++ code using a mix of pybind11 and clang-tools.
The property based API covers most of the functionality but in some cases
you have to reach for the C++ like interface.
::
d = Detector()
# C++ like API
d.setExptime(0.1)
# or a bit more pythonic
d.exptime = 0.1
The c++ style API offers more control over access to individual modules
in a large detector.
::
# Set exposure time for module 1, 5 and 7
d.setExptime(0.1, [1,5,7])
--------------------
Finding functions
--------------------
To find out which properties and methods that a Python object have you
can use dir()
::
>>> from slsdet import Detector
>>> d = Detector()
>>> dir(d)
['__class__', '__delattr__', '__dict__', '__dir__', '__doc__',
'__eq__', '__format__', '__ge__', '__getattribute__', '__gt__',
'__hash__', '__init__', '__init_subclass__', '__le__', '__len__',
'__lt__', '__module__', '__ne__', '__new__', '__reduce__',
'__reduce_ex__', '__repr__', '__setattr__', '__sizeof__',
'__str__', '__subclasshook__', '_adc_register', '_frozen',
'_register', 'acquire', 'adcclk', 'adcphase', 'adcpipeline',
'adcreg', 'asamples', 'auto_comp_disable', 'clearAcquiringFlag',
'clearBit', 'clearROI', 'client_version', 'config', 'copyDetectorServer',
'counters', 'daclist', 'dacvalues', 'dbitclk', 'dbitphase' ...
Since the list for Detector is rather long it's an good idea to filter it.
The following example gives you properties and methods containing time in
their name.
::
>>> [item for item in dir(d) if 'time' in item]
['exptime', 'getExptime', 'getExptimeForAllGates', 'getExptimeLeft',
'getSubExptime', 'patwaittime0', 'patwaittime1', 'patwaittime2',
'setExptime', 'setSubExptime', 'subdeadtime', 'subexptime']
The above method works on any Python object but for convenience we also
included two functions to find names. View prints the names one per line
while find returns a list of names.
::
from slsdet.lookup import view, find
>>> view('exptime')
exptime
getExptime
getExptimeForAllGates
getExptimeLeft
getSubExptime
setExptime
setSubExptime
subexptime
>>> find('exptime')
['exptime', 'getExptime', 'getExptimeForAllGates', 'getExptimeLeft',
'getSubExptime', 'setExptime', 'setSubExptime', 'subexptime']
------------------------------------
Finding out what the function does
------------------------------------
To access the documentation of a function directly from the Python prompt use help().
.. code-block :: python
>>> help(Detector.period)
Help on property:
Period between frames, accepts either a value in seconds or datetime.timedelta
Note
-----
:getter: always returns in seconds. To get in datetime.delta, use getPeriod
Examples
-----------
>>> d.period = 1.05
>>> d.period = datetime.timedelta(minutes = 3, seconds = 1.23)
>>> d.period
181.23
>>> d.getPeriod()
[datetime.timedelta(seconds=181, microseconds=230000)]
----------------------
Where are the ENUMs?
----------------------
To set some of the detector settings like file format you have
to pass in an enum.
::
>>> d.setFileFormat(fileFormat.BINARY)
The enums can be found in slsdet.enums
::
import slsdet
>>> [e for e in dir(slsdet.enums) if not e.startswith('_')]
['burstMode', 'clockIndex', 'dacIndex', 'detectorModeType',
'detectorSettings', 'detectorType', 'dimension', 'externalSignalFlag',
'fileFormat', 'frameDiscardPolicy', 'frameModeType', 'masterFlags',
'readoutMode', 'runStatus', 'speedLevel', 'timingMode',
'timingSourceType']
# Even though importing using * is not recommended one could
# get all the enums like this:
>>> from slsdet.enums import *

View File

@ -1,6 +1,6 @@
Receiver Receiver
============================================== ==============================================
.. doxygenclass:: Receiver .. doxygenclass:: slsReceiver
:members: :members:
.. :undoc-members: .. :undoc-members:

View File

@ -1,108 +0,0 @@
Default values
==============================================
Some general intro
Mythen3
-------------
.. csv-table:: Default values
:file: mythen3.csv
:widths: 35, 35
:header-rows: 1
DACS
^^^^^^^^^^^^^
.. csv-table:: Mythen3 DACS
:file: mythen3-dacs.csv
:widths: 35, 35
:header-rows: 1
Gotthard2
-------------
.. csv-table:: Default values
:file: gotthard2.csv
:widths: 35, 35
:header-rows: 1
DACS
^^^^^^^^^^^^^
.. csv-table:: Gotthard 2 DACS
:file: gotthard2-dacs.csv
:widths: 35, 35
:header-rows: 1
Moench
-------------
.. csv-table:: Default values
:file: moench.csv
:widths: 35, 35
:header-rows: 1
DACS
^^^^^^^^^^^^^
.. csv-table:: Moench DACS
:file: moench-dacs.csv
:widths: 35, 35
:header-rows: 1
Ctb
-------------
.. csv-table:: Default values
:file: ctb.csv
:widths: 35, 35
:header-rows: 1
Eiger
-------------
.. csv-table:: Default values
:file: eiger.csv
:widths: 35, 35
:header-rows: 1
DACS
^^^^^^^^^^^^^
.. csv-table:: Eiger DACS
:file: eiger-dacs.csv
:widths: 35, 35
:header-rows: 1
Jungfrau
-------------
.. csv-table:: Default values
:file: jungfrau.csv
:widths: 35, 35
:header-rows: 1
DACS
^^^^^^^^^^^^^
.. csv-table:: Jungfrau DACS
:file: jungfrau-dacs.csv
:widths: 35, 35
:header-rows: 1
Gotthard
-------------
.. csv-table:: Default values
:file: gotthard.csv
:widths: 35, 35
:header-rows: 1
DACS
^^^^^^^^^^^^^
.. csv-table:: Gotthard DACS
:file: gotthard-dacs.csv
:widths: 35, 35
:header-rows: 1

View File

@ -1,88 +0,0 @@
Server Upgrade
=================
Eiger
-------------
#. Kill old server and copy new server
.. code-block:: bash
# Option 1: from detector console
# kill old server
ssh root@bebxxx
killall eigerDetectorServer
# copy new server
cd executables
scp user@pc:/path/eigerDetectorServerxxx .
chmod 777 eigerDetectorServerxxx
ln -sf eigerDetectorServerxxx eigerDetectorServer
sync
# Options 2: from client console for multiple modules
for i in bebxxx bebyyy;
do ssh root@$i killall eigerDetectorServer;
scp eigerDetectorServerxxx root@$i:~/executables/eigerDetectorServer;
ssh root@$i sync; done
#. Reboot the detector.
Jungfrau
-------------
#. Program from console (only from 5.0.0-rc1)
.. code-block:: bash
# copies new server from pc tftp folder, respawns and reboots
sls_detector_put copydetectorserver jungfrauDetectorServerxxx pcxxx
Gotthard
---------
#. Program from console (only from 5.0.0-rc1)
.. code-block:: bash
# copies new server from pc tftp folder, respawns and reboots
sls_detector_put copydetectorserver gotthardDetectorServerxxx pcxxx
Mythen3
-------
#. Program from console (only from 5.0.0-rc1)
.. code-block:: bash
# copies new server from pc tftp folder and reboots (does not respawn)
sls_detector_put copydetectorserver mythen3DetectorServerxxx pcxxx
Gotthard2
----------
#. Program from console (only from 5.0.0-rc1)
.. code-block:: bash
# copies new server from pc tftp folder and reboots (does not respawn)
sls_detector_put copydetectorserver gotthard2DetectorServerxxx pcxxx
Moench
------
#. Program from console (only from 5.0.0-rc1)
.. code-block:: bash
# copies new server from pc tftp folder, respawns and reboots
sls_detector_put copydetectorserver moenchDetectorServerxxx pcxxx
Ctb
---
#. Program from console (only from 5.0.0-rc1)
.. code-block:: bash
# copies new server from pc tftp folder, respawns and reboots
sls_detector_put copydetectorserver ctbDetectorServerxxx pcxxx

View File

@ -1,4 +0,0 @@
/* override table no-wrap */
.wy-table-responsive table td, .wy-table-responsive table th {
white-space: normal;
}

View File

@ -12,7 +12,7 @@ hostname bchip007
0:rx_udpip 129.129.202.98 0:rx_udpip 129.129.202.98
0:rx_hostname pc6898 0:rx_hostname pc6898
0:outdir /bigRAID/datadir_gotthard/rec_test_data 0:outdir /bigRAID/datadir_gotthard/rec_test_data
0:highvoltage 120 0:vhighvoltage 120
master -1 master -1
sync none sync none
outdir /bigRAID/datadir_gotthard/rec_test_data outdir /bigRAID/datadir_gotthard/rec_test_data

View File

@ -1,129 +0,0 @@
#Gain index ADU value (12 bit)
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655
1 3655

View File

@ -1,129 +0,0 @@
#G0 pedestal G1 pedestal G2 pedestal G0 gain G1 gain G2 gain #G1 Energy #G2 Energy
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000
100 100 100 10 1 0.1 300 7000

View File

@ -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

View File

@ -8,7 +8,7 @@ period 0.000024984
delay 0.999999968 delay 0.999999968
gates 1 gates 1
frames 300000.000000000 frames 300000.000000000
triggers 1.000000000 cycles 1.000000000
timing auto timing auto
fineoff 0.000000 fineoff 0.000000
startscript none startscript none

View File

@ -6,12 +6,12 @@ hostname bchip074+bchip075+
0:extsig:0 trigger_in_rising_edge 0:extsig:0 trigger_in_rising_edge
0:rx_tcpport 1954 0:rx_tcpport 1954
0:rx_udpport 50001 0:rx_udpport 50001
0:highvoltage 0 0:vhighvoltage 0
1:extsig:0 trigger_in_rising_edge 1:extsig:0 trigger_in_rising_edge
1:rx_tcpport 1955 1:rx_tcpport 1955
1:rx_udpport 50002 1:rx_udpport 50002
1:highvoltage 0 1:vhighvoltage 0
############################################################################## ##############################################################################
######### #########
@ -41,11 +41,11 @@ hostname bchip074+bchip075+
r_readfreq 1 r_readfreq 1
rx_zmqstream 1 rx_datastream 1
#replace my_receiver_hostname with the hostname of 1Gb IP of the machine where the receiver runs #replace my_receiver_hostname with the hostname of 1Gb IP of the machine where the receiver runs
rx_hostname my_receiver_hostname rx_hostname my_receiver_hostname
rx_zmqstream 1 rx_datastream 1
outdir /tmp/ outdir /tmp/
@ -53,5 +53,5 @@ settings veryhighgain
exptime 0.000005 exptime 0.000005
period 0.0001 period 0.0001
highvoltage 90 vhighvoltage 90

View File

@ -6,7 +6,7 @@ hostname localhost
rx_hostname localhost rx_hostname localhost
#powerchip 1 #powerchip 1
#highvoltage 200 #vhighvoltage 200
#extsig:0 trigger_in_rising_edge #extsig:0 trigger_in_rising_edge
#timing trigger #timing trigger

View File

@ -17,7 +17,7 @@ hostname bchip048+bchip052+
rx_hostname pcmoench01 rx_hostname pcmoench01
powerchip 1 powerchip 1
highvoltage 200 vhighvoltage 200
#extsig:0 trigger_in_rising_edge #extsig:0 trigger_in_rising_edge
#timing trigger #timing trigger

View 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
rx_zmqstream 1
rx_zmqfreq 1
dac 6 800
dac 0 1300
dac 4 1428
dac 1 1000
dac 7 900
dac 3 680
dac 2 1400
dac 5 1200 #turn on datastream from commandline
rx_datastream 1
r_readfreq 1
#0:configuremac -1
rx_datastream 1
r_readfreq 1
dac:6 800
dac:0 1300
dac:4 1428
dac:1 1000
dac:7 900
dac:3 680
dac:2 1400
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
vhighvoltage 90
period 0.005
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
highvoltage 90 frames 100
period 0.1
outdir /scratch/
enablefwrite 0

View File

@ -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_zmqstream 1
frames 100000
period 0.0006
#############################################
### edit with directory you want to write to
############################################
fpath /mnt/moench_data/scratch/
fwrite 0
rx_zmqstream 1
rx_jsonpara frameMode frame
rx_jsonpara detectorMode counting
rx_discardpolicy discardpartial
adcpipeline 15
powerchip 1
highvoltage 90
#adcreg 0x14 0x40

View File

@ -19,7 +19,7 @@ hostname bchip007+bchip009+
0:rx_udpip 10.1.1.1 0:rx_udpip 10.1.1.1
0:rx_hostname 129.129.202.134 0:rx_hostname 129.129.202.134
0:outdir /data/speedt 0:outdir /data/speedt
0:highvoltage 120 0:vhighvoltage 120
#1:hostname bchip009 #1:hostname bchip009
@ -37,7 +37,7 @@ hostname bchip007+bchip009+
1:rx_udpip 10.1.2.1 1:rx_udpip 10.1.2.1
1:rx_hostname 129.129.202.134 1:rx_hostname 129.129.202.134
1:outdir /data/speedt 1:outdir /data/speedt
1:highvoltage 120 1:vhighvoltage 120
master -1 master -1

View File

@ -1,12 +1,12 @@
#include "DetectorImpl.h"
#include "catch.hpp" #include "catch.hpp"
#include "multiSlsDetector.h"
#include "string_utils.h" #include "string_utils.h"
#include "tests/globals.h" #include "tests/globals.h"
#include <iostream> #include <iostream>
class MultiDetectorFixture { class MultiDetectorFixture {
protected: protected:
DetectorImpl d; multiSlsDetector d;
public: public:
MultiDetectorFixture() : d(0, true, true) { MultiDetectorFixture() : d(0, true, true) {
@ -22,56 +22,56 @@ TEST_CASE_METHOD(MultiDetectorFixture, "Set and get dacs",
auto th = 1000; auto th = 1000;
// set and read back each individual dac of EIGER // set and read back each individual dac of EIGER
d.setDAC(0, di::SVP, 0); d.setDAC(0, di::E_SvP, 0);
CHECK(d.setDAC(-1, di::SVP, 0) == 0); CHECK(d.setDAC(-1, di::E_SvP, 0) == 0);
d.setDAC(4000, di::SVN, 0); d.setDAC(4000, di::E_SvN, 0);
CHECK(d.setDAC(-1, di::SVN, 0) == 4000); CHECK(d.setDAC(-1, di::E_SvN, 0) == 4000);
d.setDAC(2000, di::VTR, 0); d.setDAC(2000, di::E_Vtr, 0);
CHECK(d.setDAC(-1, di::VTR, 0) == 2000); CHECK(d.setDAC(-1, di::E_Vtr, 0) == 2000);
d.setDAC(3500, di::VRF, 0); d.setDAC(3500, di::E_Vrf, 0);
CHECK(d.setDAC(-1, di::VRF, 0) == 3500); CHECK(d.setDAC(-1, di::E_Vrf, 0) == 3500);
d.setDAC(1400, di::VRS, 0); d.setDAC(1400, di::E_Vrs, 0);
CHECK(d.setDAC(-1, di::VRS, 0) == 1400); CHECK(d.setDAC(-1, di::E_Vrs, 0) == 1400);
d.setDAC(2556, di::VTGSTV, 0); d.setDAC(2556, di::E_Vtgstv, 0);
CHECK(d.setDAC(-1, di::VTGSTV, 0) == 2556); CHECK(d.setDAC(-1, di::E_Vtgstv, 0) == 2556);
d.setDAC(1500, di::VCMP_LL, 0); d.setDAC(1500, di::E_Vcmp_ll, 0);
CHECK(d.setDAC(-1, di::VCMP_LL, 0) == 1500); CHECK(d.setDAC(-1, di::E_Vcmp_ll, 0) == 1500);
d.setDAC(1400, di::VCMP_LR, 0); d.setDAC(1400, di::E_Vcmp_lr, 0);
CHECK(d.setDAC(-1, di::VCMP_LR, 0) == 1400); CHECK(d.setDAC(-1, di::E_Vcmp_lr, 0) == 1400);
d.setDAC(4000, di::CAL, 0); d.setDAC(4000, di::E_cal, 0);
CHECK(d.setDAC(-1, di::CAL, 0) == 4000); CHECK(d.setDAC(-1, di::E_cal, 0) == 4000);
d.setDAC(1300, di::VCMP_RL, 0); d.setDAC(1300, di::E_Vcmp_rl, 0);
CHECK(d.setDAC(-1, di::VCMP_RL, 0) == 1300); CHECK(d.setDAC(-1, di::E_Vcmp_rl, 0) == 1300);
d.setDAC(1200, di::VCMP_RR, 0); d.setDAC(1200, di::E_Vcmp_rr, 0);
CHECK(d.setDAC(-1, di::VCMP_RR, 0) == 1200); CHECK(d.setDAC(-1, di::E_Vcmp_rr, 0) == 1200);
d.setDAC(1100, di::RXB_RB, 0); d.setDAC(1100, di::E_rxb_rb, 0);
CHECK(d.setDAC(-1, di::RXB_RB, 0) == 1100); CHECK(d.setDAC(-1, di::E_rxb_rb, 0) == 1100);
d.setDAC(1100, di::RXB_LB, 0); d.setDAC(1100, di::E_rxb_lb, 0);
CHECK(d.setDAC(-1, di::RXB_LB, 0) == 1100); CHECK(d.setDAC(-1, di::E_rxb_lb, 0) == 1100);
d.setDAC(1500, di::VCP, 0); d.setDAC(1500, di::E_Vcp, 0);
CHECK(d.setDAC(-1, di::VCP, 0) == 1500); CHECK(d.setDAC(-1, di::E_Vcp, 0) == 1500);
d.setDAC(2000, di::VCN, 0); d.setDAC(2000, di::E_Vcn, 0);
CHECK(d.setDAC(-1, di::VCN, 0) == 2000); CHECK(d.setDAC(-1, di::E_Vcn, 0) == 2000);
d.setDAC(1550, di::VIS, 0); d.setDAC(1550, di::E_Vis, 0);
CHECK(d.setDAC(-1, di::VIS, 0) == 1550); CHECK(d.setDAC(-1, di::E_Vis, 0) == 1550);
d.setDAC(660, di::IO_DELAY, 0); d.setDAC(660, di::IO_DELAY, 0);
CHECK(d.setDAC(-1, di::IO_DELAY, 0) == 660); CHECK(d.setDAC(-1, di::IO_DELAY, 0) == 660);
// setting threshold sets all individual vcmp // setting threshold sets all individual vcmp
d.setDAC(th, di::THRESHOLD, 0); d.setDAC(th, di::THRESHOLD, 0);
CHECK(d.setDAC(-1, di::THRESHOLD, 0) == th); CHECK(d.setDAC(-1, di::THRESHOLD, 0) == th);
CHECK(d.setDAC(-1, di::VCMP_LL, 0) == th); CHECK(d.setDAC(-1, di::E_Vcmp_ll, 0) == th);
CHECK(d.setDAC(-1, di::VCMP_LR, 0) == th); CHECK(d.setDAC(-1, di::E_Vcmp_lr, 0) == th);
CHECK(d.setDAC(-1, di::VCMP_RL, 0) == th); CHECK(d.setDAC(-1, di::E_Vcmp_rl, 0) == th);
CHECK(d.setDAC(-1, di::VCMP_RR, 0) == th); CHECK(d.setDAC(-1, di::E_Vcmp_rr, 0) == th);
// different values gives -1 // different values gives -1
if (d.getNumberOfDetectors() > 1) { if (d.getNumberOfDetectors() > 1) {
d.setDAC(1600, di::VCMP_LL, 0, 0); d.setDAC(1600, di::E_Vcmp_ll, 0, 0);
d.setDAC(1700, di::VCMP_LL, 0, 1); d.setDAC(1700, di::E_Vcmp_ll, 0, 1);
CHECK(d.setDAC(-1, di::VCMP_LL, 0, 0) == 1600); CHECK(d.setDAC(-1, di::E_Vcmp_ll, 0, 0) == 1600);
CHECK(d.setDAC(-1, di::VCMP_LL, 0, 1) == 1700); CHECK(d.setDAC(-1, di::E_Vcmp_ll, 0, 1) == 1700);
CHECK(d.setDAC(-1, di::VCMP_LL, 0) == -1); CHECK(d.setDAC(-1, di::E_Vcmp_ll, 0) == -1);
CHECK(d.setDAC(-1, di::THRESHOLD, 0) == -1); CHECK(d.setDAC(-1, di::THRESHOLD, 0) == -1);
CHECK(d.setDAC(-1, di::THRESHOLD, 0, 0) == -1); CHECK(d.setDAC(-1, di::THRESHOLD, 0, 0) == -1);
CHECK(d.setDAC(-1, di::THRESHOLD, 0, 1) == -1); CHECK(d.setDAC(-1, di::THRESHOLD, 0, 1) == -1);

135
integrationTests/test-integrationDectector.cpp Normal file → Executable file
View 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 "multiSlsDetector.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);
@ -101,8 +102,8 @@ TEST_CASE("single EIGER detector no receiver basic set and get",
// Setting and reading exposure time // Setting and reading exposure time
auto t = 1000000000; auto t = 1000000000;
d.setExptime(t); d.setTimer(slsDetectorDefs::timerIndex::ACQUISITION_TIME, t);
CHECK(d.getExptime() == t); CHECK(d.setTimer(slsDetectorDefs::timerIndex::ACQUISITION_TIME) == t);
// size of an eiger half module with and without gap pixels // size of an eiger half module with and without gap pixels
CHECK(d.getTotalNumberOfChannels() == 256 * 256 * 4); CHECK(d.getTotalNumberOfChannels() == 256 * 256 * 4);
@ -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
@ -140,8 +143,8 @@ TEST_CASE("Locking mechanism and last ip", "[.integration][.single]") {
// Can we still access the detector while it's locked // Can we still access the detector while it's locked
auto t = 1300000000; auto t = 1300000000;
d.setExptime(t); d.setTimer(slsDetectorDefs::timerIndex::ACQUISITION_TIME, t);
CHECK(d.getExptime() == t); CHECK(d.setTimer(slsDetectorDefs::timerIndex::ACQUISITION_TIME) == t);
// unlock again and free // unlock again and free
d.lockServer(0); d.lockServer(0);
@ -151,20 +154,21 @@ TEST_CASE("Locking mechanism and last ip", "[.integration][.single]") {
d.freeSharedMemory(); d.freeSharedMemory();
} }
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 cycles */ ACQUISITION_TIME,
// /**< exposure time */ FRAME_PERIOD, /**< period between exposures */ // /**< exposure time */ FRAME_PERIOD, /**< period between exposures */
// DELAY_AFTER_TRIGGER, /**< delay between trigger and start of exposure or // DELAY_AFTER_TRIGGER, /**< delay between trigger and start of exposure or
// readout (in triggered mode) */ GATES_NUMBER, /**< number of gates per // readout (in triggered mode) */ GATES_NUMBER, /**< number of gates per
// frame (in gated mode) */ TRIGGER_NUMBER, /**< number of triggers: total // frame (in gated mode) */ CYCLES_NUMBER, /**< number of cycles: total
// number of acquisitions is number or frames*number of triggers */ // number of acquisitions is number or frames*number of cycles */
// ACTUAL_TIME, /**< Actual time of the detector's internal timer */ // ACTUAL_TIME, /**< Actual time of the detector's internal timer */
// MEASUREMENT_TIME, /**< Time of the measurement from the detector (fifo) // MEASUREMENT_TIME, /**< Time of the measurement from the detector (fifo)
// */ // */
@ -181,58 +185,71 @@ 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
auto frames = 5; auto frames = 5;
d.setNumberOfFrames(frames); d.setTimer(slsDetectorDefs::timerIndex::FRAME_NUMBER, frames);
CHECK(d.getNumberOfFrames() == frames); CHECK(d.setTimer(slsDetectorDefs::timerIndex::FRAME_NUMBER) == frames);
auto exptime = 2000000000; auto exptime = 2000000000;
d.setExptime(exptime); d.setTimer(slsDetectorDefs::timerIndex::ACQUISITION_TIME, exptime);
CHECK(d.getExptime() == exptime); CHECK(d.setTimer(slsDetectorDefs::timerIndex::ACQUISITION_TIME) == exptime);
auto period = 2000000000; auto period = 2000000000;
d.setPeriod(period); d.setTimer(slsDetectorDefs::timerIndex::FRAME_PERIOD, period);
CHECK(d.getPeriod() == period); CHECK(d.setTimer(slsDetectorDefs::timerIndex::FRAME_PERIOD) == period);
if (test::type != dt::EIGER) { if (test::type != dt::EIGER) {
auto delay = 10000; auto delay = 10000;
d.setDelayAfterTrigger(delay); d.setTimer(slsDetectorDefs::timerIndex::DELAY_AFTER_TRIGGER, delay);
CHECK(d.getDelayAfterTrigger() == delay); CHECK(d.setTimer(slsDetectorDefs::timerIndex::DELAY_AFTER_TRIGGER) ==
delay);
} }
auto triggers = 2; if (test::type != dt::EIGER) {
d.setNumberOfTriggers(triggers); auto gates = 1;
CHECK(d.getNumberOfTriggers() == triggers); d.setTimer(slsDetectorDefs::timerIndex::GATES_NUMBER, gates);
CHECK(d.setTimer(slsDetectorDefs::timerIndex::GATES_NUMBER) == gates);
}
auto cycles = 2;
d.setTimer(slsDetectorDefs::timerIndex::CYCLES_NUMBER, cycles);
CHECK(d.setTimer(slsDetectorDefs::timerIndex::CYCLES_NUMBER) == cycles);
if (test::type == dt::EIGER) { if (test::type == dt::EIGER) {
auto subtime = 200; auto subtime = 200;
d.setSubExptime(subtime); d.setTimer(slsDetectorDefs::timerIndex::SUBFRAME_ACQUISITION_TIME,
CHECK(d.getSubExptime() == subtime); subtime);
CHECK(d.setTimer(
slsDetectorDefs::timerIndex::SUBFRAME_ACQUISITION_TIME) ==
subtime);
} }
// for (int i =0; i!=frames; ++i) // for (int i =0; i!=frames; ++i)
d.startAndReadAll(); d.startAndReadAll();
d.freeSharedMemory(); d.freeSharedMemory();
// If we add a timer we should add tests for the timer
CHECK(slsDetectorDefs::MAX_TIMERS == 19);
} }
// 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;
// auto exptime = 100000000; // auto exptime = 100000000;
// d.setNumberOfFrames(5); // d.setTimer(slsDetectorDefs::timerIndex::FRAME_NUMBER, 5);
// d.setExptime(exptime); // d.setTimer(slsDetectorDefs::timerIndex::ACQUISITION_TIME, exptime);
// d.setPeriod(period); // d.setTimer(slsDetectorDefs::timerIndex::FRAME_PERIOD, period);
// d.startAndReadAll(); // d.startAndReadAll();
// auto rperiod = // auto rperiod =
// d.getMeasuredPeriod(); // d.getTimeLeft(slsDetectorDefs::timerIndex::MEASURED_PERIOD);
// CHECK(rperiod == 0.1); // CHECK(rperiod == 0.1);
// d.freeSharedMemory(); // d.freeSharedMemory();
@ -246,7 +263,7 @@ TEST_CASE(
int ratecorr = 125; int ratecorr = 125;
// pick up multi detector from shm id 0 // pick up multi detector from shm id 0
DetectorImpl m(0); multiSlsDetector m(0);
// ensure eiger detector type, hostname and online // ensure eiger detector type, hostname and online
REQUIRE(m.getDetectorTypeAsEnum() == c.type_enum); REQUIRE(m.getDetectorTypeAsEnum() == c.type_enum);
@ -296,7 +313,7 @@ TEST_CASE("Chiptestboard Loading Patterns", "[.ctbintegration]") {
SingleDetectorConfig c; SingleDetectorConfig c;
// pick up multi detector from shm id 0 // pick up multi detector from shm id 0
DetectorImpl m(0); multiSlsDetector m(0);
// ensure ctb detector type, hostname and online // ensure ctb detector type, hostname and online
REQUIRE(m.getDetectorTypeAsEnum() == c.type_enum); REQUIRE(m.getDetectorTypeAsEnum() == c.type_enum);
@ -376,12 +393,12 @@ 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
DetectorImpl m(0); multiSlsDetector m(0);
// ensure ctb detector type, hostname and online // ensure ctb detector type, hostname and online
REQUIRE(m.getDetectorTypeAsEnum() == c.type_enum); REQUIRE(m.getDetectorTypeAsEnum() == c.type_enum);
@ -397,7 +414,7 @@ TEST_CASE("Chiptestboard Dbit offset, list, sampling, advinvert",
// dbit list // dbit list
std::vector<int> list = m.getReceiverDbitList(); std::vector <int> list = m.getReceiverDbitList();
list.clear(); list.clear();
for (int i = 0; i < 10; ++i) for (int i = 0; i < 10; ++i)
list.push_back(i); list.push_back(i);
@ -408,14 +425,14 @@ TEST_CASE("Chiptestboard Dbit offset, list, sampling, advinvert",
list.push_back(64); list.push_back(64);
CHECK_THROWS_AS(m.setReceiverDbitList(list), sls::RuntimeError); CHECK_THROWS_AS(m.setReceiverDbitList(list), sls::RuntimeError);
CHECK_THROWS_WITH(m.setReceiverDbitList(list), CHECK_THROWS_WITH(m.setReceiverDbitList(list),
Catch::Matchers::Contains("be between 0 and 63")); Catch::Matchers::Contains("be between 0 and 63"));
list.clear(); list.clear();
for (int i = 0; i < 65; ++i) for (int i = 0; i < 65; ++i)
list.push_back(i); list.push_back(i);
CHECK(list.size() == 65); CHECK(list.size() == 65);
CHECK_THROWS_WITH(m.setReceiverDbitList(list), CHECK_THROWS_WITH(m.setReceiverDbitList(list),
Catch::Matchers::Contains("be greater than 64")); Catch::Matchers::Contains("be greater than 64"));
list.clear(); list.clear();
m.setReceiverDbitList(list); m.setReceiverDbitList(list);
@ -435,7 +452,7 @@ TEST_CASE("Chiptestboard Dbit offset, list, sampling, advinvert",
m.setExternalSamplingSource(62); m.setExternalSamplingSource(62);
CHECK(m.getExternalSamplingSource() == 62); CHECK(m.getExternalSamplingSource() == 62);
CHECK_THROWS_WITH(m.setExternalSamplingSource(64), CHECK_THROWS_WITH(m.setExternalSamplingSource(64),
Catch::Matchers::Contains("be 0-63")); Catch::Matchers::Contains("be 0-63"));
CHECK(m.getExternalSamplingSource() == 62); CHECK(m.getExternalSamplingSource() == 62);
m.setExternalSampling(1); m.setExternalSampling(1);
CHECK(m.getExternalSampling() == 1); CHECK(m.getExternalSampling() == 1);
@ -444,23 +461,20 @@ 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); multiSlsDetector 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.setTimer(slsDetectorDefs::FRAME_NUMBER, 1) == 1);
// starting fnum // starting fnum
uint64_t val = 8; uint64_t val = 8;
@ -492,11 +506,10 @@ TEST_CASE("Eiger readnlines", "[.eigerintegration][readnlines]") {
SingleDetectorConfig c; SingleDetectorConfig c;
// pick up multi detector from shm id 0 // pick up multi detector from shm id 0
DetectorImpl m(0); multiSlsDetector 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);

12
integrationTests/test-integrationMulti.cpp Normal file → Executable file
View File

@ -1,5 +1,5 @@
#include "DetectorImpl.h"
#include "catch.hpp" #include "catch.hpp"
#include "multiSlsDetector.h"
#include "string_utils.h" #include "string_utils.h"
#include "tests/globals.h" #include "tests/globals.h"
#include <iostream> #include <iostream>
@ -9,7 +9,7 @@ using namespace Catch::literals;
TEST_CASE("Initialize a multi detector", "[.integration][.multi]") { TEST_CASE("Initialize a multi detector", "[.integration][.multi]") {
auto hostnames = sls::split(test::hostname, '+'); auto hostnames = sls::split(test::hostname, '+');
DetectorImpl d(0, true, true); multiSlsDetector d(0, true, true);
d.setHostname(test::hostname.c_str()); d.setHostname(test::hostname.c_str());
CHECK(d.getHostname() == test::hostname); CHECK(d.getHostname() == test::hostname);
@ -24,9 +24,11 @@ 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); multiSlsDetector d(0, true, true);
d.setHostname(test::hostname.c_str()); d.setHostname(test::hostname.c_str());
// FRAME_NUMBER // FRAME_NUMBER
@ -48,13 +50,14 @@ TEST_CASE("Set and read timers", "[.integration][.multi]") {
// DELAY_AFTER_TRIGGER, // DELAY_AFTER_TRIGGER,
// GATES_NUMBER, // GATES_NUMBER,
// TRIGGER_NUMBER, // CYCLES_NUMBER,
// ACTUAL_TIME // ACTUAL_TIME
// MEASUREMENT_TIME // MEASUREMENT_TIME
// 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);

View File

@ -17,13 +17,13 @@
/*! \file document.h */ /*! \file document.h */
#include "encodedstream.h" #include "reader.h"
#include "internal/meta.h" #include "internal/meta.h"
#include "internal/strfunc.h" #include "internal/strfunc.h"
#include "memorystream.h" #include "memorystream.h"
#include "reader.h" #include "encodedstream.h"
#include <limits>
#include <new> // placement new #include <new> // placement new
#include <limits>
RAPIDJSON_DIAG_PUSH RAPIDJSON_DIAG_PUSH
#ifdef _MSC_VER #ifdef _MSC_VER

View File

@ -15,8 +15,8 @@
#ifndef RAPIDJSON_ENCODEDSTREAM_H_ #ifndef RAPIDJSON_ENCODEDSTREAM_H_
#define RAPIDJSON_ENCODEDSTREAM_H_ #define RAPIDJSON_ENCODEDSTREAM_H_
#include "memorystream.h"
#include "stream.h" #include "stream.h"
#include "memorystream.h"
#ifdef __GNUC__ #ifdef __GNUC__
RAPIDJSON_DIAG_PUSH RAPIDJSON_DIAG_PUSH

View File

@ -15,9 +15,9 @@
#ifndef RAPIDJSON_STRTOD_ #ifndef RAPIDJSON_STRTOD_
#define RAPIDJSON_STRTOD_ #define RAPIDJSON_STRTOD_
#include "ieee754.h"
#include "biginteger.h" #include "biginteger.h"
#include "diyfp.h" #include "diyfp.h"
#include "ieee754.h"
#include "pow10.h" #include "pow10.h"
RAPIDJSON_NAMESPACE_BEGIN RAPIDJSON_NAMESPACE_BEGIN

View File

@ -164,8 +164,8 @@
#include "msinttypes/inttypes.h" #include "msinttypes/inttypes.h"
#else #else
// Other compilers should have this. // Other compilers should have this.
#include <inttypes.h>
#include <stdint.h> #include <stdint.h>
#include <inttypes.h>
#endif #endif
//!@endcond //!@endcond
#ifdef RAPIDJSON_DOXYGEN_RUNNING #ifdef RAPIDJSON_DOXYGEN_RUNNING

View File

@ -18,11 +18,11 @@
/*! \file reader.h */ /*! \file reader.h */
#include "allocators.h" #include "allocators.h"
#include "stream.h"
#include "encodedstream.h" #include "encodedstream.h"
#include "internal/meta.h" #include "internal/meta.h"
#include "internal/stack.h" #include "internal/stack.h"
#include "internal/strtod.h" #include "internal/strtod.h"
#include "stream.h"
#include <limits> #include <limits>
#if defined(RAPIDJSON_SIMD) && defined(_MSC_VER) #if defined(RAPIDJSON_SIMD) && defined(_MSC_VER)

View File

@ -99,7 +99,7 @@ If one desires to set the zmqport manually, he offset has to be taken into accou
{\tt{slsMultiReceiver}} uses two or more receivers in one single terminal: {\tt{./slsMultiReceiver startTCPPort numReceivers withCallback}}, where startTCPPort assumes the other ports are consecutively increased. {\tt{slsMultiReceiver}} uses two or more receivers in one single terminal: {\tt{./slsMultiReceiver startTCPPort numReceivers withCallback}}, where startTCPPort assumes the other ports are consecutively increased.
The command {\tt{r\_framesperfile}} (\tt{\textcolor{red}{rx\_framesperfile}}) sets the number of frames written in the same file. By default now it is 10000. It can be changes. It needs to be lowered particularly if one wants to parallelize the following conversion of the files. The command {\tt{r\_framesperfile}} sets the number of frames written in the same file. By default now it is 10000. It can be changes. It needs to be lowered particularly if one wants to parallelize the following conversion of the files.
\subsection{Mandatory setup - Client} \subsection{Mandatory setup - Client}
@ -122,23 +122,7 @@ To do that:
sls_detector_put 0-config mydetector.config sls_detector_put 0-config mydetector.config
\end{verbatim} \end{verbatim}
In the config file, if client, receiver and detector are using \textbf{1GbE} the following lines are mandatory (see slsDetectorsPackage/examples/eiger\_1Gb.config). It has been adapted to the the new 5.0 major release change: In the config file, if client, receiver and detector are using \textbf{1GbE} the following lines are mandatory (see slsDetectorsPackage/examples/eiger\_1Gb.config):
\begin{verbatim}
detsize 1024 512 #detector geometry, long side of the module first
hostname beb059+beb058+ #1Gb detector hostname for controls
#1Gb receiver pc hostname to be inserted immediately and tcp\_ports to be stated immediately
rx_hostname x12sa-vcons:1991+pc1875:1992+
0:udp_dstport 50011 #udp port first quadrant, first halfmodule
0:udp_dstport2 50012 #udp port second quadrant, first halfmodule
1:udp_dstport 50013 #udp port first quadrant, second halfmodule
1:udp_dstport2 50014 #udp port second quadrant, second halfmodule
0:udp_srcip 129.129.202.237
0:udp_dstip auto
1:udp_srcip 129.129.202.236
1:udp_dstip auto
fpath /sls/X12SA/data/x12saop/Data10/Eiger0.5M
\end{verbatim}
In the old 3.x and 4.x release it was:
\begin{verbatim} \begin{verbatim}
detsizechan 1024 512 #detector geometry, long side of the module first detsizechan 1024 512 #detector geometry, long side of the module first
hostname beb059+beb058+ #1Gb detector hostname for controls hostname beb059+beb058+ #1Gb detector hostname for controls
@ -154,39 +138,21 @@ threaded 1
\end{verbatim} \end{verbatim}
In the config file, if client, receiver and detector commands are on 1Gb, but detector data to receiver are sent using \textbf{10GbE} the following lines are mandatory (see slsDetectorsPackage/examples/eiger\_10Gb.config): In the config file, if client, receiver and detector commands are on 1Gb, but detector data to receiver are sent using \textbf{10GbE} the following lines are mandatory (see slsDetectorsPackage/examples/eiger\_10Gb.config):
It has been adapted to the the new 5.0 major release change:
\begin{verbatim}
detsize 1024 512
hostname beb059+beb058+
rx_hostname pc1875:1955+pc1875:1956+
0:udp_dstport 50011
0:udp_dstport2 50012
0:udp_dstip 10.0.30.210
0:udp_srcip 10.0.30.100
1:flippeddatax 1
1:udp_dstport 50013
1:udp_dstport2 50014
1:udp_dstip 0.0.40.210
1:udp_srcip 10.0.40.101
fpath /sls/X12SA/data/x12saop/Data10/Eiger0.5M
\end{verbatim}
In the old 3.x and 4.x release it was:
\begin{verbatim} \begin{verbatim}
detsizechan 1024 512 #detector geometry, long side of the module first detsizechan 1024 512 #detector geometry, long side of the module first
hostname beb059+beb058+ #1Gb detector hostname for controls hostname beb059+beb058+ #1Gb detector hostname for controls
0:rx_tcpport 1955 #tcpport for the first halfmodule 0:rx_tcpport 1991 #tcpport for the first halfmodule
0:rx_udpport 50011 #udp port first quadrant, first halfmodule 0:rx_udpport 50011 #udp port first quadrant, first halfmodule
0:rx_udpport2 50012 #udp port second quadrant, first halfmodule 0:rx_udpport2 50012 #udp port second quadrant, first halfmodule
0:rx_udpip 10.0.30.210 #udp IP of the receiver over 10Gb 0:rx_udpip 10.0.30.210 #udp IP of the receiver over 10Gb
0:detectorip 10.0.30.100 #first half module 10 Gb IP 0:detectorip 10.0.30.100 #first half module 10 Gb IP
1:flippeddatax 1 1:rx_tcpport 1992 #tcpport for the second halfmodule
1:rx_tcpport 1956 #tcpport for the second halfmodule
1:rx_udpport 50013 #udp port first quadrant, second halfmodule 1:rx_udpport 50013 #udp port first quadrant, second halfmodule
1:rx_udpport2 50014 #udp port second quadrant, second halfmodule 1:rx_udpport2 50014 #udp port second quadrant, second halfmodule
1:rx_udpip 10.0.40.210 #udp IP of the receiver over 10Gb, 1:rx_udpip 10.0.40.210 #udp IP of the receiver over 10Gb,
can be the same or different from 0:rx_udpip can be the same or different from 0:rx_udpip
1:detectorip 10.0.40.101 #second half module 10 Gb IP 1:detectorip 10.0.40.101 #second half module 10 Gb IP
rx_hostname pc1875 #1Gb receiver pc hostname rx_hostname x12sa-vcons #1Gb receiver pc hostname
outdir /sls/X12SA/data/x12saop/Data10/Eiger0.5M outdir /sls/X12SA/data/x12saop/Data10/Eiger0.5M
threaded 1 threaded 1
\end{verbatim} \end{verbatim}
@ -206,25 +172,23 @@ configuremac 0
rx_udpmac xx:xx:... rx_udpmac xx:xx:...
\end{verbatim} \end{verbatim}
Now we will give general communication commands. Commands with a diffent name in the \textcolor{red}{5.x} realease will be highlighted in \textcolor{red}{red}.
One can configure all the detector settings in a parameter file {\tt{setup.det}}, which is loaded by doing: One can configure all the detector settings in a parameter file {\tt{setup.det}}, which is loaded by doing:
\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{highvoltage 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:
\begin{itemize} \begin{itemize}
\item {\tt{tengiga 0/1}}, which sets whether the detector is enabled to send data through the 1~or the 10~Gb Ethernet. \item {\tt{tengiga 0/1}}, which sets whether the detector is enabled to send data through the 1~or the 10~Gb Ethernet.
\item {\tt{flags parallel/nonparallel}} or {\tt{\textcolor{red}{parallel 1/0}}}, which sets whether the detector is set in parallel acquisition and readout or in sequential mode. This changes the readout time of the chip and affects the frame rate capability (faster is {\tt{parallel}}). \item {\tt{flags parallel/nonparallel}}, which sets whether the detector is set in parallel acquisition and readout or in sequential mode. This changes the readout time of the chip and affects the frame rate capability (faster is {\tt{parallel}}, with higher noise but needed when the frame rate is $>2$~kHz.
\item {\tt{dr 32/16/8/4}} sets the detector in autosumming mode (32 bit counter or not autosumming, 12 bit out of the chip). This is strictly connected to what is required for the readout clock of chip. See next point. \item {\tt{dr 32/16/8/4}} sets the detector in autosumming mode (32 bit counter or not autosumming, 12 bit out of the chip). This is strictly connected to what is required for the readout clock of chip. See next point.
\item {\tt{clkdivider 0/1/2}} or {\tt{\textcolor{red}{speed full\_speed/half\_speed/quart\_speed}}}. Changes the readout clock: 200, 100, 50~MHz (also referred to as full, half, quarter speed). Note that autosumming mode ({\tt{dr 32}} only works at \tt{clkdivider 2}=\tt{quart\_speed}). By selecting Refer to readout timing specifications in~section\ref{timing} for how to set the detector. \item {\tt{clkdivider 0/1/2}}. Changes the readout clock: 200, 100, 50~MHz (also referred to as full, half, quarter speed). Note that autosumming mode ({\tt{dr 32}} only works at {clkdivider 2}=quarter speed). By selecting Refer to readout timing specifications in~section\ref{timing} for how to set the detector.
\item {\tt{flags continuous/storeinram}}. Allows to take frame continuously or storing them on memory. Users should use the {\tt{continuous}} flags. Enabling the {\tt{stroreinram}} flag makes the data to be sent out all at the end of the acquisition. Refer to readout timing specifications in section~\ref{timing} for how to set the detector. Examples will be given in section~\ref{}. \item {\tt{flags continuous/storeinram}}. Allows to take frame continuously or storing them on memory. Users should use the {\tt{continuous}} flags. Enabling the {\tt{stroreinram}} flag makes the data to be sent out all at the end of the acquisition. Refer to readout timing specifications in section~\ref{timing} for how to set the detector. Examples will be given in section~\ref{}.
\end{itemize} \end{itemize}
One should notice that, by default, by choosing the option {\tt{dr 32}}, then the software automatically sets the detector to {\tt{clkdivider 2}} ({\tt{\textcolor{red}{quart\_speed}}}). By choosing the option {\tt{dr 16}}, the software automatically sets the detector to {\tt{clkdivider 1}} ({\tt{\textcolor{red}{speed quart\_speed}}}). From release 5.x, One should notice that, by default, by choosing the option {\tt{dr 32}}, then the software automatically sets the detector to {\tt{clkdivider 2}}. By choosing the option {\tt{dr 16}}, the software automatically sets the detector to {\tt{clkdivider 1}}. One needs to choose {\tt{clkdivider 0}} after setting the {\tt{dr 16}} option to have the fastest frame rate.
We would recommend expert users (beamline people) to write their parameters file for the users.
\section{API versioning} \label{api} \section{API versioning} \label{api}
The eigerDetectorServer running on the boards has a versioning API scheme that will make it crash if used with a wrong firmware. The eigerDetectorServer running on the boards has a versioning API scheme that will make it crash if used with a wrong firmware.
@ -245,18 +209,10 @@ Killing and starting the server on the boards allows you to check the firmware v
\section{Setting up the threshold} \section{Setting up the threshold}
\begin{verbatim} \begin{verbatim}
sls_detector_put 0-settingsdir /path
sls_detector_put 0-trimen N xxxx yyyy zzzz sls_detector_put 0-trimen N xxxx yyyy zzzz
sls_detector_put 0-settings standard sls_detector_put 0-settings standard
sls_detector_put 0-threshold energy_in_eV standard sls_detector_put 0-threshold energy_in_eV standard
\end{verbatim} \end{verbatim}
or in \textcolor{red}{5.x}:
\begin{verbatim}
sls_detector_put 0-settingspath /path}
sls_detector_put 0-trimen N xxxx yyyy zzzz}
sls_detector_put 0-threshold energy_in_eV standard
\end{verbatim}
The first line requires to specify how many ({\tt{N}}) and at which energies in eV {\{tt{xxxx}}, {\tt{yyyy}}, {\tt{zzzz}} and so on) trimmed files were generated (to allow for an interpolation). This line should normally be included into the {\tt{mydetector.config}} file and should be set for you by one of the detector group. The first line requires to specify how many ({\tt{N}}) and at which energies in eV {\{tt{xxxx}}, {\tt{yyyy}}, {\tt{zzzz}} and so on) trimmed files were generated (to allow for an interpolation). This line should normally be included into the {\tt{mydetector.config}} file and should be set for you by one of the detector group.
NORMALLY, in this new calibration scheme, only {\tt{settings standard}} will be provided to you, unless specific cases to be discussed. NORMALLY, in this new calibration scheme, only {\tt{settings standard}} will be provided to you, unless specific cases to be discussed.
The threshold at 6000 eV , for example would be set as:{\tt{sls\_detector\_put 0-threshold 6000 standard}}. The threshold at 6000 eV , for example would be set as:{\tt{sls\_detector\_put 0-threshold 6000 standard}}.
@ -287,11 +243,11 @@ In this acquisition 10 consecutive 1~s frames will be acquired. Note that {\tt{p
You need to setup where the files will be written to You need to setup where the files will be written to
\begin{verbatim} \begin{verbatim}
sls_detector_put 0-outdir /scratch (\textcolor{red}{0-fpath}) sls_detector_put 0-outdir /scratch
sls_detector_put 0-fname run sls_detector_put 0-fname run
sls_detector_put 0-index 0 (\textcolor{red}{0-findex}) sls_detector_put 0-index 0
\end{verbatim} \end{verbatim}
this way your files will all be named /scratch/run\_dj\_i.raw where $j$ is relative to each specific half module, $i$ in the {\tt{index}} starts from 0 when starting the detector the first time and is automatically incremented. The next acquisition {\tt{index}} will be 1. One can reset the {\tt{index}} (\tt{\textcolor{red}{findex}}) to what wished. this way your files will all be named /scratch/run\_dj\_i.raw where $j$ is relative to each specific half module, $i$ in the {\tt{index}} starts from 0 when starting the detector the first time and is automatically incremented. The next acquisition {\tt{index}} will be 1. One can reset the {\tt{index}} to what wished.
To acquire simply type: To acquire simply type:
\begin{verbatim} \begin{verbatim}
@ -310,13 +266,12 @@ sls_detector_get receiver
There is a more complex way of performing an acquisition, that is useful for debugging and in case one wants a non blocking behavior: There is a more complex way of performing an acquisition, that is useful for debugging and in case one wants a non blocking behavior:
You can then reset to zero the number of frames caught (in releases<5.0), then start the receiver and the detector: You can then reset to zero the number of frames caught, then start the receiver and the detector:
\begin{enumerate} \begin{enumerate}
\item {\tt{sls\_detector\_put 0-resetframescaught 0}} \item {\tt{sls\_detector\_put 0-resetframescaught 0}}
\item {\tt{sls\_detector\_put 0-receiver start}} \item {\tt{sls\_detector\_put 0-receiver start}}
\item {\tt{sls\_detector\_put 0-status start}} \item {\tt{sls\_detector\_put 0-status start}}
\end{enumerate} \end{enumerate}
In release \textcolor{red}{5.0} it is not needed to reset the frames caughts.
You can poll the detector status using: You can poll the detector status using:
\begin{verbatim} \begin{verbatim}
@ -391,32 +346,29 @@ col : 257 pixels
\end{verbatim} \end{verbatim}
\section{Readout timing- maximum frame rate}\label{timing} \section{Readout timing- maximum frame rate}\label{timing}
IMPORTANT: to have faster readout and smaller dead time, one can configure {\tt{clkdivider}}, i.e. the {\tt{textcolor}{red}{speed} at which the data are read, i.e. 200/100/50~MHz for {\tt{clkdivider 0/1/2}} ({\tt{ IMPORTANT: to have faster readout and smaller dead time, one can configure {\tt{clkdivider}}, i.e. the speed at which the data are read, i.e. 200/100/50~MHz for {\tt{clkdivider 0/1/2}} and the dead time between frames through {\tt{flags parallel}}, i.e. acquire and read at the same time or acquire and then read out.
\textcolor{red}{speed full\_speed/half\_speed/quart\_speed}}) and the dead time between frames through {\tt{flags parallel}} or {\tt{\textcolor{red}{parallel 1}}}, i.e. acquire and read at the same time or acquire and then read out. The configuration of this timing variables allows to achieve different frame rates. NOTE THAT IN EIGER, WHATEVER YOU DO, THE FRAME RATE LIMITATIONS COME FROM THE NETWORK BOTTLENECK AS THE HARDWARE GOES FASTER THAN THE DATA OUT.
The configuration of this timing variables allows to achieve different frame rates. NOTE THAT IN EIGER, WHATEVER YOU DO, THE FRAME RATE LIMITATIONS COME FROM THE NETWORK BOTTLENECK AS THE HARDWARE GOES FASTER THAN THE DATA OUT. WE recconmmend using the detector in \tt{dr 4/8/16}, \tt{\textcolor{red}{speed full\_speed}}, \tt{parallel 1} or \tt{dr 32}, \tt{\textcolor{red}{speed quart\_speed}}, \tt{parallel 1. All those options are now the defaults options starting from version 5.x.
In the case of REAL CONTINUOUS readout, i.e. continuous acquire and readout from the boards (independent on how the chip is set), the continuous frame rates are listed in table~\ref{tcont}. The time to send out the frame out of the board In the case of REAL CONTINUOUS readout, i.e. continuous acquire and readout from the boards (independent on how the chip is set), the continuous frame rates are listed in table~\ref{tcont}. The time to send out the frame out of the board
\begin{table} \begin{table}
\begin{tabular}{|c|c|c|c|c|} \begin{tabular}{|c|c|c|c|c|}
\hline \hline
\tiny{GbE} & \tiny{dynamic range} & \tiny{continuos maximum frame rate(Hz)} & \tiny{minimum period ($\mu$s)}& \tiny{calculated/measered time to send out data ($\mu$s)}\\ \tiny{GbE} & \tiny{dynamic range} & \tiny{continuos maximum frame rate(Hz)} & \tiny{minimum period ($\mu$s)}& \tiny{time to send out data ($\mu$s)}\\
\hline \hline
1 & 16 & \textbf{256} & 3901 & \\ 1 & 16 & \textbf{256} & 3901 & \\
\hline \hline
1 & 32 & \textbf{128} & 7820 & \\ 1 & 32 & \textbf{128} & 7820 & \\
\hline \hline
10 & 4 & \textbf{7813} & 98 & 105/128\\ 10 & 4 & \textbf{10240} & 98 & 100\\
\hline \hline
10 & 8 & \textbf{4000} & 196 & 210/250\\ 10 & 8 & \textbf{5120} & 196 & 200\\
\hline \hline
10 & 16 & \textbf{2000} & 391 & 420/490\\ 10 & 16 & \textbf{2560} & 391 & 400\\
\hline \hline
10 & 32 & \textbf{1023} & 782 & 840/977\\ 10 & 32 & \textbf{1280} & 782 & 800\\
\hline \hline
\end{tabular} \end{tabular}
\caption{Frame rate limits for the CONTINUOS streaming out of images, i.e. the data rate out is just below 1Gb/s or 10Gb/s. 1023~Hz for 32-bit, 10GbE is obtained from the 10GbE limitation. The maximum achievable frame rate is 977~Hz.} \caption{Frame rate limits for the CONTINUOS streaming out of images, i.e. the data rate out is just below 1Gb/s or 10Gb/s. 1280~Hz for 32-bit, 10GbE is obtained from the 10GbE limitation. The maximum achievable frame rate is 977~Hz.}
\label{tcont}\end{table} \label{tcont}\end{table}
Note that in the {\tt{continuous}} flag mode, some buffering is still done on the memories, so a higher frame rate than the proper real continuous one can be achieved. Still, this extra buffering is possible till the memories are not saturated. The number of images that can be stored on the DDR2 on board memories are listed in table~\ref{timgs}. Note that in the {\tt{continuous}} flag mode, some buffering is still done on the memories, so a higher frame rate than the proper real continuous one can be achieved. Still, this extra buffering is possible till the memories are not saturated. The number of images that can be stored on the DDR2 on board memories are listed in table~\ref{timgs}.
\begin{table} \begin{table}
@ -431,11 +383,11 @@ dynamic range & images\\
16 & 7600\\ 16 & 7600\\
\hline \hline
\end{tabular} \end{tabular}
\caption{Amount of images that can be stored on board. As while we store them, we start to send them out, the effective number of images could be larger than this, but it will depend on the network setup (how fast you stream out images).} \caption{Amount of images that can be stored on board. As while we store them, we start to send them out, the effective number of images could be larger than this, but it will depend on the network setup (how fats you stream out images).}
\label{timgs} \label{timgs}
\end{table} \end{table}
The maximum frame rate achievable with 10~GbE, {\tt{dr 16}}, {\tt{flags continuous}}, {\tt{flags parallel}} ({\tt{\textcolor{red}{parallel 1}}}),{\tt{clkdivider 0}} ({\tt{\textcolor{red}{speed full\_speed}}}), \textbf{6.1~kHz}. This is currently limited by the connection between the Front End Board and the Backend board. We expect the 32 bit mode limit, internally, to be \textbf{2~kHz} ({\tt{clkdivider 2}}). The maximum frame rate achievable with 10~GbE, {\tt{dr 16}}, {\tt{flags continuous}}, {\tt{flags parallel}},{\tt{clkdivider 0}}, \textbf{6.1~kHz}. This is currently limited by the connection between the Front End Board and the Backend board. We expect the 32 bit mode limit, internally, to be \textbf{2~kHz} ({\tt{clkdivider 2}}).
In dynamic range {\tt{dr 8}} the frame rate is \textbf{11~kHz} and for{\tt{dr 4}} is \textbf{22~kHz}. For 4 and 8 bit mode the frame rate are directly limited by the speed of the detector chip and not by the readout boards. In dynamic range {\tt{dr 8}} the frame rate is \textbf{11~kHz} and for{\tt{dr 4}} is \textbf{22~kHz}. For 4 and 8 bit mode the frame rate are directly limited by the speed of the detector chip and not by the readout boards.
\subsection{Minimum time between frames and Maximum frame rate} \subsection{Minimum time between frames and Maximum frame rate}
@ -506,23 +458,6 @@ where the 'minimum time between frames' and the minimum period will be discussed
\textbf{From software version 4.0.0, there is a very useful function {\tt{sls\_detector\_get measuredperiod}} which return the measured period AFTER the acquisition. This is important to check that the settings to obtain the targeted frame rate was correct.} \textbf{From software version 4.0.0, there is a very useful function {\tt{sls\_detector\_get measuredperiod}} which return the measured period AFTER the acquisition. This is important to check that the settings to obtain the targeted frame rate was correct.}
In release \textcolor{red}{5.0} in 4-bit modes one can set a sort of ROI in the detector such to read half of the module (the central part) or a quarter of it with almost double or four times the frame rate. By default the \tt{\textcolor{red}{readnlines}} is set to \tt{256} meaning the whole chip. With \tt{\textcolor{red}{readnlines 128}} or \tt{\textcolor{red}{readnlines 64}} one sets to read half/quarter rows from the chip. In table~\ref{table:hfrpartial} the maximum frame rates, exposure time and period for the partial readout.\\
\begin{tabular}{|c|c|c|c|c|c|c|}
\hline
readnlines & \# pixels & Active area (cm$^2$) & Max frame rate (kHz) & Period ($\mu$s) & Dead time ($\mu$s) & \# buffered images\\
\hline
256 &1024 $\times$ 512 & 8 $\times$ 3.8 & 22.7 & 44.0 &4.1 & 30k\\
\hline
128 &1024 $\times$ 256 & 8 $\times$ 1.9 & 42.1 & 23.7 &4.2 & 60k\\
\hline
64 & 1024 $\times$ 128 & 8 $\times$ 0.95 & 73.5 & 13.6 &4.2 & 120k\\
\hline
\end{tabular}
\label{table:hfrpartial}
\textbf{If you run too fast, the detector could become noisier (see problem shooting), it is important to match the detector settings to your frame rate. This can be done having more parameters files and load the one suitable with your experiment.} We experienced that with low energy settings could not reach 6~kHz and no noise. \textbf{If you run too fast, the detector could become noisier (see problem shooting), it is important to match the detector settings to your frame rate. This can be done having more parameters files and load the one suitable with your experiment.} We experienced that with low energy settings could not reach 6~kHz and no noise.
In 16 bit mode, it could make sense, in case of noise and low threshold to either reduce the frame rate: In 16 bit mode, it could make sense, in case of noise and low threshold to either reduce the frame rate:
\begin{equation} \begin{equation}
@ -643,10 +578,10 @@ The number of subframes composing a single 32bit acquisition can be calculated a
\end{equation} \end{equation}
This also means that {\tt{exptime}}$<${\tt{subexptime}} will be rounded to{\tt{subexptime}}. If you want shorter acquisitions, either reduce the {\tt{subexptime}} or switch two 16-bit mode (you can always sum offline if needed). This also means that {\tt{exptime}}$<${\tt{subexptime}} will be rounded to{\tt{subexptime}}. If you want shorter acquisitions, either reduce the {\tt{subexptime}} or switch two 16-bit mode (you can always sum offline if needed).
From release 4.0.0, an extra {\tt{flag overflow/nooverflow}} is added (\tt{\textcolor{red}{overflow 0/1}}), with {\tt{nooverflow}} (\tt{\textcolor{red}{overflow 0}}) default: From release 4.0.0, an extra {\tt{flag overflow/nooverflow}} is added, with {\tt{nooverflow}} default:
\begin{itemize} \begin{itemize}
\item {\tt{nooverflow}} (\tt{\textcolor{red}{overflow 0}}): the internal 12-bit result is summed, even if there was saturation of the 12-bit counter (4095) in any of the subframes. Note that if there is saturation for every subframe, you might get as a result a value of the counter equal to (4095$\times$~number~of~subframes), which you need to correctly identify. On the other hand if the saturation occurred only one time, you will get something "close'' to the real number. \item {\tt{nooverflow}}: the internal 12-bit result is summed, even if there was saturation of the 12-bit counter (4095) in any of the subframes. Note that if there is saturation for every subframe, you might get as a result a value of the counter equal to (4095$\times$~number~of~subframes), which you need to correctly identify. On the other hand if the saturation occurred only one time, you will get something "close'' to the real number.
\item {\tt{overflow}} (\tt{\textcolor{red}{overflow 1}})): In this case, even if a pixel saturate only 1 time in a subframe, you will be returned as a value of the counter for that pixel: $2^{32}-1$, i.e. 4294967295. \item {\tt{overflow}}: In this case, even if a pixel saturate only 1 time in a subframe, you will be returned as a value of the counter for that pixel: $2^{32}-1$, i.e. 4294967295.
\end{itemize} \end{itemize}
The UDP header will contain, after you receive the data, the effective number of subframe per image (see section~\ref{UDP}) as "SubFrame Num or Exp Time", i.e. the number of subframes recorded (32 bit eiger). The UDP header will contain, after you receive the data, the effective number of subframe per image (see section~\ref{UDP}) as "SubFrame Num or Exp Time", i.e. the number of subframes recorded (32 bit eiger).
@ -674,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 (\textcolor{red}{triggers}) sls_detector_put 0-cycles 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 {\tt{cycles}} (\textcolor{red}{triggers}) to 1. 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 cycles (i.e. triggers) to 1 using {\tt{cycles}}. 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}} ({\tt{\textcolor{red}{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{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{burst\_trigger}} gets only 1 trigger, but allows to take many frames. With {\tt{frames}} one can change the number of frames. {\tt{cycles}} ({\tt{\textcolor{red}{triggers}}}) 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{cycles}} 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}} (\tt{\textcolor{red}{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. \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.
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}}.
@ -694,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}} (\tt{\textcolor{red}{triggers}}) 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{cycles}} 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 (\textcolor{red}{triggers}) sls_detector_put 0-cycles 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}.
@ -780,8 +714,8 @@ 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} (only for releases < 5.x) 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} (\tt{\textcolor{red}{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{cycles} (\tt{\textcolor{red}{trigger}}) 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{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.
\end{enumerate} \end{enumerate}
@ -810,7 +744,7 @@ Extremely advanced options allow to:
\begin{itemize} \begin{itemize}
\item Activate the flow control for 10~Gb/s~E (by default the 1~Gb/s~E is always active and cannot be switched off: \item Activate the flow control for 10~Gb/s~E (by default the 1~Gb/s~E is always active and cannot be switched off:
\begin{verbatim} \begin{verbatim}
./sls_detector_put flowcontrol_10g 1 (\textcolor{red}{flowcontrol10g}) ./sls_detector_put flowcontrol_10g 1
\end{verbatim} \end{verbatim}
\item Delay the transmission of the left port. This delay option is useful in the case of many simultaneous receivers running, such that it reduces the throughput to the receivers all at the same time. To be used board by board (i.e {\tt{X:, Y:,etc..}} with different units: \item Delay the transmission of the left port. This delay option is useful in the case of many simultaneous receivers running, such that it reduces the throughput to the receivers all at the same time. To be used board by board (i.e {\tt{X:, Y:,etc..}} with different units:
\begin{verbatim} \begin{verbatim}
@ -860,23 +794,9 @@ Transmission delays should be chosen only to accomodate the writing speed of the
Table~\ref{tcont} gives the times that are needed to transfer 1 images out of the 10~Gb Ethernet connection. This reflects the CONTINUOS frame rate achieavable. The disk speed can be monitored with {\tt{dstat}}. One you have worked out this, you can calculated the {\tt{txndelay\_frame}} delay as: Table~\ref{tcont} gives the times that are needed to transfer 1 images out of the 10~Gb Ethernet connection. This reflects the CONTINUOS frame rate achieavable. The disk speed can be monitored with {\tt{dstat}}. One you have worked out this, you can calculated the {\tt{txndelay\_frame}} delay as:
\begin{equation} \begin{equation}
{\tt{txndelay\_frame}}=-t_sending+dr \cdot \frac{4*256*256*N\_half\_modules}{1024 \cdot 1000 \cdot disk\_speed [MB/s] \cdot 8} {\tt{txndelay\_frame}}=-tsending+dr \cdot \frac{4*256*256*N\_half\_modules}{1024 \cdot 1000 \cdot disk\_speed [MB/s]}
\end{equation} \end{equation}
In 4-bit mode, for a disk seed of 320MB/s, the {\tt{txndelay\_frame}} is 300~$\mu$s (30000 to be set up to the detector). The sending time is 100~$\mu$s, such that an total ackievable writing speed of 1/400~$\mu$s (2.5~kHz) in achieved. In 4-bit mode, for a disk seed of 320MB/s, the {\tt{txndelay\_frame}} is 300~$\mu$s (30000 to be set up to the detector). The sending time is 100~$\mu$s, such that an total ackievable writing sped of 1/400~$\mu$s (2.5~kHz) in achieved.
Note that:
\begin{enumerate}
\item The continuos frame rate goes down when transmission delays are introduced:
\begin{equation}
continuos\_frame\_rate= \frac{1}{\tt{txndelay\_frame}+t\_sending}
\end{equation}
\item If your transmission delays reduce the continuos frame rate, you will saturate the memory on board at some point and you will corrupt images. Conservatively, we say that the number of maximum images in buffered mode is the one listed in table~\ref{timgs}, call N\_images. However, one can approximately say that (and here we need to test more, so do not believe to these numbers yet),
\begin{equation}
N\_tot\_images= N\_images+\frac{ N\_images}{frame\_rate \cdot (t\_delay\_frame + t\_sending) }
\end{equation}
\end{enumerate}
\section{Setting up the PC settings for 10Gb}\label{10g} \section{Setting up the PC settings for 10Gb}\label{10g}
@ -898,12 +818,16 @@ ethtool -G xth1 rx 4096 #or wheterver is the max number for your pc
ethtool -C xth1 rx-usecs 100 ethtool -C xth1 rx-usecs 100
ethtool -A xth1 rx on ethtool -A xth1 rx on
\end{verbatim} \end{verbatim}
where {\tt{xth1}} can be replaced with the correct 10Gb device. where {\tt{xth1}} can be replaced with the correct 10Gb device. To minimise loosing packets, priorities are set better as root user, so have the receiver as root.
NOTE THAT THIS SETTINGS WILL BE LOST IF YOU REBOOT THE COMPUTER. To try to bypass being root, we trued something like this:
\begin{verbatim}
/etc/security/limits.conf username rtprio 99
\end{verbatim}
but somehow it did not fully worked so we kept the trick of being root.
Very important is to activate the flow control in 10Gb (in 1Gb it is on by default and not configurable) Very important is to activate the flow control in 10Gb (in 1Gb it is on by default and not configurable)
\begin{verbatim} \begin{verbatim}
./sls_detector_put flowcontrol_10g 1 (\textcolor{red}{flowcontrol10g 1}) ./sls_detector_put flowcontrol_10g 1
\end{verbatim} \end{verbatim}
You ned to check that flow control is setup on the reeceiving interfaces. Check with: You ned to check that flow control is setup on the reeceiving interfaces. Check with:
\begin{verbatim} \begin{verbatim}
@ -933,18 +857,10 @@ to make the settings permanent, edit /etc/sysctl.conf:
\begin{verbatim} \begin{verbatim}
# 100MiB # 100MiB
net.core.rmem_max = 104857600 net.core.rmem_max = 104857600
net.core.rmem_default= 104857600
net.core.netdev_max_backlog = 250000 net.core.netdev_max_backlog = 250000
\end{verbatim} \end{verbatim}
and run \textbf{sysctl -p}. and run \textbf{sysctl -p}.
To minimise loosing packets, priorities are set better as root user, so have the receiver as root.
To try to bypass being root, we trued something like this:
\begin{verbatim}
/etc/security/limits.conf username rtprio 99
\end{verbatim}
but somehow it did not fully worked so we kept the trick of being root.
Last, you can disable power saving in the CPU frequency (chose the appropriate command for your system): Last, you can disable power saving in the CPU frequency (chose the appropriate command for your system):
\begin{verbatim} \begin{verbatim}
cpupower frequency-info cpupower frequency-info
@ -979,6 +895,9 @@ mount -t tmpfs none /mnt/ramdisk -o size=10G
\end{verbatim} \end{verbatim}
check how many GB memory you can allocate, to avoid swapping otherwise check how many GB memory you can allocate, to avoid swapping otherwise
\section{Offline processing and monitoring} \section{Offline processing and monitoring}
\subsection{Data out of the detector: UDP packets}\label{UDP} \subsection{Data out of the detector: UDP packets}\label{UDP}
@ -1016,22 +935,19 @@ If you use the option of writing raw files, you will have a raw file for each UD
The master file is named: {\tt{filename\_master\_0.raw}} and for version ``4.0.0'' of the slsDetectorSoftware looks like: The master file is named: {\tt{filename\_master\_0.raw}} and for version ``4.0.0'' of the slsDetectorSoftware looks like:
\begin{verbatim} \begin{verbatim}
Version : 4.0 Version : 2.0
Detector Type : 3
Dynamic Range : 32 Dynamic Range : 32
Ten Giga : 1 Ten Giga : 1
Image Size : 524288 bytes Image Size : 524288 bytes
nPixelsX : 512 pixels x : 512 pixels
nPixelsY : 256 pixels y : 256 pixels
Max Frames Per File : 10000 Max. Frames Per File : 10000
Total Frames : 3 Total Frames : 1
Exptime (ns) : 10000000 Exptime (ns) : 1000000000
SubExptime (ns) : 2621440 SubExptime (ns) : 2621440
SubPeriod(ns) : 2621440 SubPeriod(ns) : 2621440
Period (ns) : 0 Period (ns) : 1000000000
Gap Pixels Enable : 0 Timestamp : Mon Sep 3 09:07:05 2018
Quad Enable : 0
Timestamp : Wed Aug 21 16:30:20 2019
#Frame Header #Frame Header
@ -1041,9 +957,9 @@ Packet Number : 4 bytes
Bunch ID : 8 bytes Bunch ID : 8 bytes
Timestamp : 8 bytes Timestamp : 8 bytes
Module Id : 2 bytes Module Id : 2 bytes
Row : 2 bytes X Coordinate : 2 bytes
Column : 2 bytes Y Coordinate : 2 bytes
Reserved : 2 bytes Z Coordinate : 2 bytes
Debug : 4 bytes Debug : 4 bytes
Round Robin Number : 2 bytes Round Robin Number : 2 bytes
Detector Type : 1 byte Detector Type : 1 byte
@ -1054,18 +970,17 @@ 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 or the {\tt{v4.0.0}} branch if in 4.0.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 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}
The default is 2000 in the 3.1.X release. The default has been changed to 10000 frm realease 4.0.X and now this is picked up automatically without doing anything. The default is 2000.
\subsubsection{cbf} \subsubsection{cbf}
The cbf executable executable uses the CBFlib-0.9.5 library (downloaded from the web as it downloads architecture dependent packages at installation).Edit the Makefile to correclty point at it.\\ The cbf executable executable uses the CBFlib-0.9.5 library (downloaded from the web as it downloads architecture dependent packages at installation).Edit the Makefile to correclty point at it.\\
@ -1110,12 +1025,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:
@ -1164,10 +1078,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:
@ -1192,10 +1102,10 @@ In 500k--2M pixel systems there is a hardware temperature safety switch, which w
The HV can also be set and read through the software: The HV can also be set and read through the software:
\begin{verbatim} \begin{verbatim}
./sls_detector_put vhighvoltage 150 (\textcolor{red}{highvoltage}) ./sls_detector_put vhighvoltage 150
./sls_detector_get vhighvoltage (\textcolor{red}{highvoltage}) ./sls_detector_get vhighvoltage
\end{verbatim} \end{verbatim}
Note that the get {\tt{vhighvoltage}}(\tt{\textcolor{red}{highvoltage}}) would return the measured HV from the master module only. If getting the highvoltage for individual halfmodules, only the master will have a value different from -999. Note that the get {\tt{vhighvoltage}} would return the measured HV from the master module only. If getting the vhighvoltage for individual halfmodules, only the master will have a value different from -999.
\appendix \appendix
@ -1277,21 +1187,13 @@ do the same for the other boards. You can program in parallel many boards, but y
There are two ways to pulse the detector: There are two ways to pulse the detector:
\begin{itemize} \begin{itemize}
\item \textbf{Pulse digitally:} when you are interested to the output readout and do not care about the analog response from the pixels: \item \textbf{Pulse digitally:} when you are interested to the output readout and do not care about the analog response from the pixels:
\begin{verbatim} \begin{verbatim}
sls_detector_put vthreshold 4000 sls_detector_put vthreshold 4000
sls_detector_put vtr 4000 sls_detector_put vtr 4000
sls_detector_put pulsechip N #to pulse N sls_detector_put pulsechip N #to pulse N
sls_detector_put pulsechip -1 #to get out of testing mode sls_detector_put pulsechip -1 #to get out of testing mode
\end{verbatim} \end{verbatim}
Note that the answer will be $2 \cdot \textrm{{\tt{N}}} +2$ in this case. Note that the answer will be $2 \cdot \textrm{{\tt{N}}} +2$ in this case.
Or in \textcolor{red}{5.x}:
\begin{verbatim}
sls_detector_put vthreshold 4000
sls_detector_put vtrim 4000
sls_detector_put pulsechip N #to pulse N
sls_detector_put pulsechip -1 #to get out of testing mode
\end{verbatim}
Note that the answer will be $2 \cdot \textrm{{\tt{N}}} +4$ in this case.
\item \textbf{Pulse analogically:} You want to really check the analogical part of the detector, not just the readout. \item \textbf{Pulse analogically:} You want to really check the analogical part of the detector, not just the readout.
@ -1310,25 +1212,8 @@ sls_detector_put resmat 0
sls_detector_acquire sls_detector_acquire
\end{verbatim} \end{verbatim}
You read {\tt{N}} in every pixel if you are setup correctly. You read {\tt{N}} in every pixel if you are setup correctly.
or in realese \textcolor{red}{5.x}:
\begin{verbatim}
sls_detector_put vcal 3600
sls_detector_put vthreshold 1700
sls_detector_put vrpreamp 3100
for i in $(seq 0 7) ;
do px=$((-255+i));
sls_detector_put pulse 0 $px 0;
for j in $(seq 0 255) ; do
sls_detector_put pulsenmove 100 0 1;
done;
done;
sls_detector_put partialreset 1
\end{verbatim}
\end{itemize} \end{itemize}
\section{Load a noise pattern with shape} \section{Load a noise pattern with shape}
For debug purposes, we have created a noise pattern with a shape. If you reconstruct correctly your image, you should be able to read ".EIGER'' in the same direction for both the top and bottom in normal human readable orientation. For debug purposes, we have created a noise pattern with a shape. If you reconstruct correctly your image, you should be able to read ".EIGER'' in the same direction for both the top and bottom in normal human readable orientation.
To load the special noise file look at {\tt{settingsdir/eiger/standard/eigernoise.sn0xx}} in the package. To load the special noise file look at {\tt{settingsdir/eiger/standard/eigernoise.sn0xx}} in the package.
@ -1351,10 +1236,10 @@ We have also been requested if we could speed up the threshold scan. At the mome
\begin{verbatim} \begin{verbatim}
./sls_detector_put exptime 0.01 ./sls_detector_put exptime 0.01
./sls_detector_put timing trigger ./sls_detector_put timing trigger
./sls_detector_put enablefwrite 0 (\textcolor{red}{fwrite} 0) ./sls_detector_put enablefwrite 0
./sls_detector_put resetframescaught 0 (\textcolor{red}{not needed anymore}) ./sls_detector_put resetframescaught 0
./sls_detector_put index 0 (\textcolor{red}{findex} 0) ./sls_detector_put index 0
./sls_detector_put cycles 21 (\textcolor{red}{triggers} 21) ./sls_detector_put cycles 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);
@ -1472,7 +1357,7 @@ Environment variable SLSDETNAME can be set for using 2 different detectors from
\subsection{Measure the HV} \subsection{Measure the HV}
For every system: For every system:
\begin{itemize} \begin{itemize}
\item Software-wise measure it (now the software returns the measured value), with {\tt{sls\_detector\_get highvoltage}}. The returned value is the HV (for proper Eiger setting is approximately 150~V) if it is correctly set. If two master modules are presents (multi systems), the average is returned (still to be tested). If one asks for the individual $n$ half module bias voltage through {\tt{sls\_detector\_get n:highvoltage}}, if the $n$ module is a master, the actual voltage will be returned. If it is a slave, -999 will be returned. \item Software-wise measure it (now the software returns the measured value), with {\tt{sls\_detector\_get vhighvoltage}}. The returned value is the HV (for proper Eiger setting is approximately 150~V) if it is correctly set. If two master modules are presents (multi systems), the average is returned (still to be tested). If one asks for the individual $n$ half module bias voltage through {\tt{sls\_detector\_get n:vhighvoltage}}, if the $n$ module is a master, the actual voltage will be returned. If it is a slave, -999 will be returned.
\item Hardware-wise (opening the detector) measure value of HV on C14 on the power distribution board. Check also that the small HV connector cable is really connected. \item Hardware-wise (opening the detector) measure value of HV on C14 on the power distribution board. Check also that the small HV connector cable is really connected.
\end{itemize} \end{itemize}
@ -1523,7 +1408,7 @@ Scroll up in the terminal till you find:\\
There is also an easier way, that is that only the master module will return the real value of the HV. If you have more than 1 detector system, then you will have more than 1 physical master, as the HV needs to be applied to all the systems. There is also an easier way, that is that only the master module will return the real value of the HV. If you have more than 1 detector system, then you will have more than 1 physical master, as the HV needs to be applied to all the systems.
\begin{verbatim} \begin{verbatim}
for i in $(seq 0 36); do sls_detector_put $i:highvoltage; done for i in $(seq 0 36); do sls_detector_put $i:vhighvoltage; done
\end{verbatim} \end{verbatim}
Only the master will return to you a sensible number (150 normally). the others will return -999. Only the master will return to you a sensible number (150 normally). the others will return -999.
@ -1684,10 +1569,10 @@ ratecorr number
where {\tt{number}} is a string that should be interpreted as a float in s. 0.000000 means correction off. Values above zero are the value of $\tau$ in ns. where {\tt{number}} is a string that should be interpreted as a float in s. 0.000000 means correction off. Values above zero are the value of $\tau$ in ns.
\item \begin{verbatim} \item \begin{verbatim}
sls_detector_get highvoltage sls_detector_get vhighvoltage
highvoltage number vhighvoltage number
\end{verbatim} \end{verbatim}
where {\tt{number}} is a string that should be interpreted as an int and for proper Eiger setting is approximately 150~V if it is correctly set. If two master modules are presents (multi systems), the average is returned (still to be tested). If one asks for the individual $n$ half module bias voltage through {\tt{sls\_detector\_get n:highvoltage}}, if the $n$ module is a master, the actual voltage will be returned. If it is a slave, -999 will be returned. where {\tt{number}} is a string that should be interpreted as an int and for proper Eiger setting is approximately 150~V if it is correctly set. If two master modules are presents (multi systems), the average is returned (still to be tested). If one asks for the individual $n$ half module bias voltage through {\tt{sls\_detector\_get n:vhighvoltage}}, if the $n$ module is a master, the actual voltage will be returned. If it is a slave, -999 will be returned.
\item \begin{verbatim} \item \begin{verbatim}
sls_detector_get busy sls_detector_get busy

View File

@ -111,7 +111,7 @@
"delay"; // sets/gets delay after trigger in s "delay"; // sets/gets delay after trigger in s
"gates"; // sets/gets number of gates per frame in gated mode "gates"; // sets/gets number of gates per frame in gated mode
"frames"; // sets/gets number of frames "frames"; // sets/gets number of frames
"triggers"; // sets/gets number of triggers (use in trigger mode) "cycles"; // sets/gets number of cycles (use in trigger mode)
"probes"; // sets/gets number of probes (advanced!) "probes"; // sets/gets number of probes (advanced!)
"measurements"; // sets/gets number of non-real time measurements "measurements"; // sets/gets number of non-real time measurements
/* read only timers */ /* read only timers */
@ -120,7 +120,7 @@
"delayl"; // gets delay left "delayl"; // gets delay left
"gatesl"; // gets number of gates left "gatesl"; // gets number of gates left
"framesl"; // gets number of frames left "framesl"; // gets number of frames left
"triggersl"; // gets number of triggers left "cyclesl"; // gets number of cycles left
"now"; // gets time stamp from the dteector "now"; // gets time stamp from the dteector
"timestamp"; // gets time stamp for the frames (fifo-style) "timestamp"; // gets time stamp for the frames (fifo-style)
"framescaught";// gets the entire frames caught by receiver "framescaught";// gets the entire frames caught by receiver
@ -142,7 +142,7 @@
"vpreamp"; // sets/get vpreamp value (advanced! Mythen) "vpreamp"; // sets/get vpreamp value (advanced! Mythen)
"vshaper1"; // sets/get vshaper1 value (advanced! Mythen) "vshaper1"; // sets/get vshaper1 value (advanced! Mythen)
"vshaper2"; // sets/get vshaper2 value (advanced! Mythen) "vshaper2"; // sets/get vshaper2 value (advanced! Mythen)
"highvoltage"; // sets/get highvoltage value (advanced! Chiptest board and Eiger) "vhighvoltage"; // sets/get vhighvoltage value (advanced! Chiptest board and Eiger)
"vapower"; // sets/get vapower value (advanced! Chiptest board) "vapower"; // sets/get vapower value (advanced! Chiptest board)
"vddpower"; // sets/get vddpower value (advanced! Chiptest board) "vddpower"; // sets/get vddpower value (advanced! Chiptest board)
"vshpower"; // sets/get vshpower value (advanced! Chiptest board) "vshpower"; // sets/get vshpower value (advanced! Chiptest board)

View File

@ -94,7 +94,7 @@ where: \\
\textit{v0} is the scan0 variable with the desired precision, if scan0 is enabled;\\ \textit{v0} is the scan0 variable with the desired precision, if scan0 is enabled;\\
\textit{v1} is the scan1 variable with the desired precision, if scan1 is enabled;\\ \textit{v1} is the scan1 variable with the desired precision, if scan1 is enabled;\\
\textit{p} is the position index, if different positions are configured;\\ \textit{p} is the position index, if different positions are configured;\\
\textit{f} is the frame index of the first frame stored in the file, if many frames and triggers are configured;\\ \textit{f} is the frame index of the first frame stored in the file, if many frames and cycles are configured;\\
\textit{i} is the file index;\\ \textit{i} is the file index;\\
\textit{ext} is the file extension e.g. \textit{.raw} for MYTHEN and \E raw data, \textit{.dat} for MYTHEN processed data. \textit{ext} is the file extension e.g. \textit{.raw} for MYTHEN and \E raw data, \textit{.dat} for MYTHEN processed data.
\item[index i] Sets the starting index of the file i at the beginning of the acquisition (automatically incremented for each measurement). \item[index i] Sets the starting index of the file i at the beginning of the acquisition (automatically incremented for each measurement).
@ -115,10 +115,10 @@ Sets the number of gates per frame in gated (stroboscopic) mode.\\
Refer to the detailed documentation to understand how the different timing modes work. Refer to the detailed documentation to understand how the different timing modes work.
\item[frames n] \item[frames n]
Sets the number of frames acquired sequentially per cycle (e.g. after each trigger), with the exposure time defined by exptime and the period defined by period (unless in gated mode). The frame index in the output file name will automatically be incremented.\\ Sets the number of frames acquired sequentially per cycle (e.g. after each trigger), with the exposure time defined by exptime and the period defined by period (unless in gated mode). The frame index in the output file name will automatically be incremented.\\
Note that the total number of images will be frames times triggers. Refer to detailed documentation to understand how the different timing modes work. Note that the total number of images will be frames times cycles. Refer to detailed documentation to understand how the different timing modes work.
\item[triggers n] \item[cycles n]
Sets the number of triggers (e.g. number of triggers). The frame index in the output file name will automatically be incremented. \\ Sets the number of cycles (e.g. number of triggers). The frame index in the output file name will automatically be incremented. \\
Note that the total number of images will be by frames times triggers. Refer to the detailed documentation to understand how the different timing modes work. Note that the total number of images will be by frames times cycles. Refer to the detailed documentation to understand how the different timing modes work.
\item[probes] Sets the number of probes to accumulate for stroboscopic measurements. \\ \item[probes] Sets the number of probes to accumulate for stroboscopic measurements. \\
Refer to detailed documentation to understand how the different timing modes work. Refer to detailed documentation to understand how the different timing modes work.
\item[measurements] Sets the number of repetitions of the acquisitions (non real time!). The file index in the file name will be automatically incremented.\\ \item[measurements] Sets the number of repetitions of the acquisitions (non real time!). The file index in the file name will be automatically incremented.\\
@ -231,7 +231,7 @@ It is normally recommended to use \verb=sls\_detector\_acquire [j-]=, which take
%\item[delayl] %\item[delayl]
%\item[gatesl] %\item[gatesl]
%\item[framesl] %\item[framesl]
%\item[triggersl] %\item[cyclesl]
%\item[frameindex] %\item[frameindex]
%\item[now] %\item[now]
\end{description} \end{description}
@ -335,7 +335,7 @@ Advanced settings changing the analog or digital performance of the acquisition.
\item[vpreamp n] Sets the DAC value of the preamp feedback to n. \item[vpreamp n] Sets the DAC value of the preamp feedback to n.
\item[vshaper1 n] Sets the DAC value of the shaper1 feedback to n. \item[vshaper1 n] Sets the DAC value of the shaper1 feedback to n.
\item[vshaper2 n] Sets the DAC value of the shaper2 feedback to n. \item[vshaper2 n] Sets the DAC value of the shaper2 feedback to n.
\item[highvoltage n] Sets the DAC value of the high voltage to n (in V). \item[vhighvoltage n] Sets the DAC value of the high voltage to n (in V).
\item[vapower n] CHIPTEST BOARD ONLY - Sets the DAC value of the analog voltage to n. \item[vapower n] CHIPTEST BOARD ONLY - Sets the DAC value of the analog voltage to n.
\item[vddpower n] CHIPTEST BOARD ONLY - Sets the DAC value of the analog voltage to n. \item[vddpower n] CHIPTEST BOARD ONLY - Sets the DAC value of the analog voltage to n.
\item[vshpower n] CHIPTEST BOARD ONLY - Sets the comparator power supply in dac units (0-1024). \item[vshpower n] CHIPTEST BOARD ONLY - Sets the comparator power supply in dac units (0-1024).
@ -430,11 +430,11 @@ Returns the number of gates per frame in gated (stroboscopic) mode.
Refer to detailed documentation to understand how the different timing modes work. Refer to detailed documentation to understand how the different timing modes work.
\item[frames] \item[frames]
Returns the number of frames acquired sequentially per cycle (e.g. after each trigger), with the exposure time defined by exptime and the period defined by period (unless in gated mode). Returned as a string to be interpreted as an integer ``frames integer'' Returns the number of frames acquired sequentially per cycle (e.g. after each trigger), with the exposure time defined by exptime and the period defined by period (unless in gated mode). Returned as a string to be interpreted as an integer ``frames integer''
Note that the total number of images is frames times triggers. Note that the total number of images is frames times cycles.
Refer to detailed documentation to understand how the different timing modes work. Refer to detailed documentation to understand how the different timing modes work.
\item[triggers n] \item[cycles n]
Returns the number of triggers (e.g. number of triggers). Returned as atring to be interpreted as an integer ``triggers integer'' Returns the number of cycles (e.g. number of triggers). Returned as atring to be interpreted as an integer ``cycles integer''
Note that the total number of images is frames times triggers. Note that the total number of images is frames times cycles.
Refer to detailed documentation to understand how the different timing modes work. Refer to detailed documentation to understand how the different timing modes work.
\item[probes] Returns the number of probes to accumulate for stroboscopic measurements. \item[probes] Returns the number of probes to accumulate for stroboscopic measurements.
Refer to detailed documentation to understand how the different timing modes work. Refer to detailed documentation to understand how the different timing modes work.
@ -556,7 +556,7 @@ It is normally recommended to use \verb=sls\_detector\_acquire [j-]=, which take
\item[delayl] Returns the delay after trigger left for the current frame. \item[delayl] Returns the delay after trigger left for the current frame.
\item[gatesl] Returns the number of gates left for the current frame. \item[gatesl] Returns the number of gates left for the current frame.
\item[framesl] Returns the number of frames left for the current cycle. \item[framesl] Returns the number of frames left for the current cycle.
\item[triggersl] Returns the number of triggers left for the current acquisition. \item[cyclesl] Returns the number of cycles left for the current acquisition.
\item[now] Returns the current timestamp of the detector clock. \item[now] Returns the current timestamp of the detector clock.
\item[timestamp] Returns the timestamp of the acquisitions in a First-In/First-Out mode i.e. every time it is called it returns the timestamp of the first acquisition start of readout. The FIFO is reset everytime the acquisition is started. \item[timestamp] Returns the timestamp of the acquisitions in a First-In/First-Out mode i.e. every time it is called it returns the timestamp of the first acquisition start of readout. The FIFO is reset everytime the acquisition is started.
\end{description} \end{description}
@ -648,7 +648,7 @@ Advanced settings changing the analog or digital performance of the acquisition.
\item[vpreamp] Returns the DAC value of the preamp feedback to n. \item[vpreamp] Returns the DAC value of the preamp feedback to n.
\item[vshaper1] Returns the DAC value of the shaper1 feedback to n. \item[vshaper1] Returns the DAC value of the shaper1 feedback to n.
\item[vshaper2] Returns the DAC value of the shaper2 feedback to n. \item[vshaper2] Returns the DAC value of the shaper2 feedback to n.
\item[highvoltage] Returns the DAC value of the high voltage to n. \item[vhighvoltage] Returns the DAC value of the high voltage to n.
\item[vapower] CHIPTEST BOARD ONLY - Returns the DAC value of the analog voltage to n. \item[vapower] CHIPTEST BOARD ONLY - Returns the DAC value of the analog voltage to n.
\item[vddpower] CHIPTEST BOARD ONLY - Returns the DAC value of the analog voltage to n. \item[vddpower] CHIPTEST BOARD ONLY - Returns the DAC value of the analog voltage to n.
\item[vshpower] CHIPTEST BOARD ONLY - Returns the comparator power supply in dac units (0-1024). \item[vshpower] CHIPTEST BOARD ONLY - Returns the comparator power supply in dac units (0-1024).
@ -714,7 +714,7 @@ One can configure all the detector settings in a parameter file {\tt{setup.det}}
sls_detector_put parameters setup.det sls_detector_put parameters setup.det
\end{verbatim} \end{verbatim}
In the case of \E, the parameter file ({\tt{setup.det}} needs to setup the proper bias voltage of the sensor, i.e. needs to contain the line {\tt{highvoltage 150}}. In the case of \E, the parameter file ({\tt{setup.det}} needs to setup the proper bias voltage of the sensor, i.e. needs to contain the line {\tt{vhighvoltage 150}}.
\subsection{Standard acquisition} \subsection{Standard acquisition}

View File

@ -217,7 +217,7 @@ is used to configure the detector parameter var
\item[delay t] Sets the delay after trigger (in s) \item[delay t] Sets the delay after trigger (in s)
\item[gates n] Sets the number of gates per frame \item[gates n] Sets the number of gates per frame
\item[frames n] Sets the number of frames per cycle (e.g. after each trigger) \item[frames n] Sets the number of frames per cycle (e.g. after each trigger)
\item[triggers n] Sets the number of triggers (e.g. number of triggers) \item[cycles n] Sets the number of cycles (e.g. number of triggers)
\item[probes n] Sets the number of probes to accumulate (max 3) \item[probes n] Sets the number of probes to accumulate (max 3)
\item[dr n] Sets the dynamic range - can be (1,) 4, 8,16 or 24 bits \item[dr n] Sets the dynamic range - can be (1,) 4, 8,16 or 24 bits
\item[flags mode] Sets the readout flags - can be none or storeinram \item[flags mode] Sets the readout flags - can be none or storeinram
@ -298,7 +298,7 @@ is used to retrieve the detector parameter var
\item[delay] Gets the delay after trigger (in s) \item[delay] Gets the delay after trigger (in s)
\item[gates] Gets the number of gates per frame \item[gates] Gets the number of gates per frame
\item[frames] Gets the number of frames per cycle (e.g. after each trigger) \item[frames] Gets the number of frames per cycle (e.g. after each trigger)
\item[triggers] Gets the number of triggers (e.g. number of triggers) \item[cycles] Gets the number of cycles (e.g. number of triggers)
\item[probes] Gets the number of probes to accumulate (max 3) \item[probes] Gets the number of probes to accumulate (max 3)
\item[timestamp] Gets the internal time stamp of the nex frame acquired (i.e. during an acquisition, all timestamps of the frames are stored in a FIFO which can be read after the acquisition - returns -1 if the FIFO is empty) \item[timestamp] Gets the internal time stamp of the nex frame acquired (i.e. during an acquisition, all timestamps of the frames are stored in a FIFO which can be read after the acquisition - returns -1 if the FIFO is empty)
\item[dr] Gets the dynamic range \item[dr] Gets the dynamic range

View File

@ -372,7 +372,7 @@ gs 1 -1 sc (Number of frames) col0 sh gr
gs 1 -1 sc (Number of frames) col0 sh gr gs 1 -1 sc (Number of frames) col0 sh gr
/Times-Roman ff 450.00 scf sf /Times-Roman ff 450.00 scf sf
11325 9150 m 11325 9150 m
gs 1 -1 sc (Number of triggers) col0 sh gr gs 1 -1 sc (Number of cycles) col0 sh gr
/Times-Roman ff 240.00 scf sf /Times-Roman ff 240.00 scf sf
5325 4950 m 5325 4950 m
gs 1 -1 sc (Readout) col0 sh gr gs 1 -1 sc (Readout) col0 sh gr

View File

@ -118,7 +118,7 @@ Single
21900 2700 22050 2700 21900 2700 22050 2700
4 0 0 50 0 0 30 0.0000 4 300 3225 6975 7800 Number of frames\001 4 0 0 50 0 0 30 0.0000 4 300 3225 6975 7800 Number of frames\001
4 0 0 50 0 0 30 0.0000 4 300 3225 15975 7800 Number of frames\001 4 0 0 50 0 0 30 0.0000 4 300 3225 15975 7800 Number of frames\001
4 0 0 50 0 0 30 0.0000 4 405 3090 11325 9150 Number of triggers\001 4 0 0 50 0 0 30 0.0000 4 405 3090 11325 9150 Number of cycles\001
4 0 0 50 0 0 16 0.0000 4 165 810 5325 4950 Readout\001 4 0 0 50 0 0 16 0.0000 4 165 810 5325 4950 Readout\001
4 0 0 50 0 0 30 0.0000 4 300 2565 825 4125 Detection time\001 4 0 0 50 0 0 30 0.0000 4 300 2565 825 4125 Detection time\001
4 0 0 50 0 0 30 0.0000 4 300 1785 825 5550 Dead time\001 4 0 0 50 0 0 30 0.0000 4 300 1785 825 5550 Dead time\001

View File

@ -95,7 +95,7 @@ Single
4 0 0 50 0 0 30 0.0000 4 405 2580 9450 6600 Exposure time\001 4 0 0 50 0 0 30 0.0000 4 405 2580 9450 6600 Exposure time\001
4 0 0 50 0 0 30 0.0000 4 300 3225 6975 7800 Number of frames\001 4 0 0 50 0 0 30 0.0000 4 300 3225 6975 7800 Number of frames\001
4 0 0 50 0 0 30 0.0000 4 300 3225 15975 7800 Number of frames\001 4 0 0 50 0 0 30 0.0000 4 300 3225 15975 7800 Number of frames\001
4 0 0 50 0 0 30 0.0000 4 405 3090 11325 9150 Number of triggers\001 4 0 0 50 0 0 30 0.0000 4 405 3090 11325 9150 Number of cycles\001
4 0 0 50 0 0 16 0.0000 4 165 810 5325 4950 Readout\001 4 0 0 50 0 0 16 0.0000 4 165 810 5325 4950 Readout\001
4 0 0 50 0 0 30 0.0000 4 300 2565 1050 4125 Detection time\001 4 0 0 50 0 0 30 0.0000 4 300 2565 1050 4125 Detection time\001
4 0 0 50 0 0 30 0.0000 4 300 1785 1050 5550 Dead time\001 4 0 0 50 0 0 30 0.0000 4 300 1785 1050 5550 Dead time\001

View File

@ -341,7 +341,7 @@ gs 1 -1 sc (Number of frames) col0 sh gr
gs 1 -1 sc (Number of frames) col0 sh gr gs 1 -1 sc (Number of frames) col0 sh gr
/Times-Roman ff 450.00 scf sf /Times-Roman ff 450.00 scf sf
11325 9150 m 11325 9150 m
gs 1 -1 sc (Number of triggers) col0 sh gr gs 1 -1 sc (Number of cycles) col0 sh gr
/Times-Roman ff 240.00 scf sf /Times-Roman ff 240.00 scf sf
5325 4950 m 5325 4950 m
gs 1 -1 sc (Readout) col0 sh gr gs 1 -1 sc (Readout) col0 sh gr

View File

@ -79,7 +79,7 @@ Single
4200 5850 4650 5850 4200 5850 4650 5850
4 0 0 50 0 0 30 0.0000 4 300 3225 6975 7800 Number of frames\001 4 0 0 50 0 0 30 0.0000 4 300 3225 6975 7800 Number of frames\001
4 0 0 50 0 0 30 0.0000 4 300 3225 15975 7800 Number of frames\001 4 0 0 50 0 0 30 0.0000 4 300 3225 15975 7800 Number of frames\001
4 0 0 50 0 0 30 0.0000 4 405 3090 11325 9150 Number of triggers\001 4 0 0 50 0 0 30 0.0000 4 405 3090 11325 9150 Number of cycles\001
4 0 0 50 0 0 16 0.0000 4 165 810 5325 4950 Readout\001 4 0 0 50 0 0 16 0.0000 4 165 810 5325 4950 Readout\001
4 0 0 50 0 0 30 0.0000 4 300 2565 825 4125 Detection time\001 4 0 0 50 0 0 30 0.0000 4 300 2565 825 4125 Detection time\001
4 0 0 50 0 0 30 0.0000 4 300 1785 825 5550 Dead time\001 4 0 0 50 0 0 30 0.0000 4 300 1785 825 5550 Dead time\001

View File

@ -118,7 +118,7 @@ Single
21900 2700 22050 2700 21900 2700 22050 2700
4 0 0 50 0 0 30 0.0000 4 300 3225 6975 7800 Number of frames\001 4 0 0 50 0 0 30 0.0000 4 300 3225 6975 7800 Number of frames\001
4 0 0 50 0 0 30 0.0000 4 300 3225 15975 7800 Number of frames\001 4 0 0 50 0 0 30 0.0000 4 300 3225 15975 7800 Number of frames\001
4 0 0 50 0 0 30 0.0000 4 405 3090 11325 9150 Number of triggers\001 4 0 0 50 0 0 30 0.0000 4 405 3090 11325 9150 Number of cycles\001
4 0 0 50 0 0 16 0.0000 4 165 810 5325 4950 Readout\001 4 0 0 50 0 0 16 0.0000 4 165 810 5325 4950 Readout\001
4 0 0 50 0 0 30 0.0000 4 300 2565 825 4125 Detection time\001 4 0 0 50 0 0 30 0.0000 4 300 2565 825 4125 Detection time\001
4 0 0 50 0 0 30 0.0000 4 300 1785 825 5550 Dead time\001 4 0 0 50 0 0 30 0.0000 4 300 1785 825 5550 Dead time\001

View File

@ -401,7 +401,7 @@ gs 1 -1 sc (External trigger) col0 sh gr
gs 1 -1 sc (Number of frames) col0 sh gr gs 1 -1 sc (Number of frames) col0 sh gr
/Times-Roman ff 450.00 scf sf /Times-Roman ff 450.00 scf sf
12600 9150 m 12600 9150 m
gs 1 -1 sc (Number of triggers) col0 sh gr gs 1 -1 sc (Number of cycles) col0 sh gr
/Times-Roman ff 240.00 scf sf /Times-Roman ff 240.00 scf sf
6600 4950 m 6600 4950 m
gs 1 -1 sc (Readout) col0 sh gr gs 1 -1 sc (Readout) col0 sh gr

View File

@ -111,7 +111,7 @@ Single
4 0 0 50 0 0 30 0.0000 4 300 1785 825 5550 Dead time\001 4 0 0 50 0 0 30 0.0000 4 300 1785 825 5550 Dead time\001
4 0 0 50 0 0 30 0.0000 4 405 2760 825 2700 External trigger\001 4 0 0 50 0 0 30 0.0000 4 405 2760 825 2700 External trigger\001
4 0 0 50 0 0 30 0.0000 4 300 3225 8250 7800 Number of frames\001 4 0 0 50 0 0 30 0.0000 4 300 3225 8250 7800 Number of frames\001
4 0 0 50 0 0 30 0.0000 4 405 3090 12600 9150 Number of triggers\001 4 0 0 50 0 0 30 0.0000 4 405 3090 12600 9150 Number of cycles\001
4 0 0 50 0 0 16 0.0000 4 165 810 6600 4950 Readout\001 4 0 0 50 0 0 16 0.0000 4 165 810 6600 4950 Readout\001
4 0 0 50 0 0 30 0.0000 4 405 2580 4575 6225 Exposure time\001 4 0 0 50 0 0 30 0.0000 4 405 2580 4575 6225 Exposure time\001
4 0 0 50 0 0 30 0.0000 4 300 1140 9525 6225 Period\001 4 0 0 50 0 0 30 0.0000 4 300 1140 9525 6225 Period\001

View File

@ -79,7 +79,7 @@ Single
4200 5850 4650 5850 4200 5850 4650 5850
4 0 0 50 0 0 30 0.0000 4 300 3225 6975 7800 Number of frames\001 4 0 0 50 0 0 30 0.0000 4 300 3225 6975 7800 Number of frames\001
4 0 0 50 0 0 30 0.0000 4 300 3225 15975 7800 Number of frames\001 4 0 0 50 0 0 30 0.0000 4 300 3225 15975 7800 Number of frames\001
4 0 0 50 0 0 30 0.0000 4 405 3090 11325 9150 Number of triggers\001 4 0 0 50 0 0 30 0.0000 4 405 3090 11325 9150 Number of cycles\001
4 0 0 50 0 0 16 0.0000 4 165 810 5325 4950 Readout\001 4 0 0 50 0 0 16 0.0000 4 165 810 5325 4950 Readout\001
4 0 0 50 0 0 30 0.0000 4 300 2565 825 4125 Detection time\001 4 0 0 50 0 0 30 0.0000 4 300 2565 825 4125 Detection time\001
4 0 0 50 0 0 30 0.0000 4 300 1785 825 5550 Dead time\001 4 0 0 50 0 0 30 0.0000 4 300 1785 825 5550 Dead time\001

View File

@ -217,7 +217,7 @@ is used to configure the detector parameter var
\item[delay t] Sets the delay after trigger (in s) \item[delay t] Sets the delay after trigger (in s)
\item[gates n] Sets the number of gates per frame \item[gates n] Sets the number of gates per frame
\item[frames n] Sets the number of frames per cycle (e.g. after each trigger) \item[frames n] Sets the number of frames per cycle (e.g. after each trigger)
\item[triggers n] Sets the number of triggers (e.g. number of triggers) \item[cycles n] Sets the number of cycles (e.g. number of triggers)
\item[probes n] Sets the number of probes to accumulate (max 3) \item[probes n] Sets the number of probes to accumulate (max 3)
\item[dr n] Sets the dynamic range - can be (1,) 4, 8,16 or 24 bits \item[dr n] Sets the dynamic range - can be (1,) 4, 8,16 or 24 bits
\item[flags mode] Sets the readout flags - can be none or storeinram \item[flags mode] Sets the readout flags - can be none or storeinram
@ -298,7 +298,7 @@ is used to retrieve the detector parameter var
\item[delay] Gets the delay after trigger (in s) \item[delay] Gets the delay after trigger (in s)
\item[gates] Gets the number of gates per frame \item[gates] Gets the number of gates per frame
\item[frames] Gets the number of frames per cycle (e.g. after each trigger) \item[frames] Gets the number of frames per cycle (e.g. after each trigger)
\item[triggers] Gets the number of triggers (e.g. number of triggers) \item[cycles] Gets the number of cycles (e.g. number of triggers)
\item[probes] Gets the number of probes to accumulate (max 3) \item[probes] Gets the number of probes to accumulate (max 3)
\item[timestamp] Gets the internal time stamp of the nex frame acquired (i.e. during an acquisition, all timestamps of the frames are stored in a FIFO which can be read after the acquisition - returns -1 if the FIFO is empty) \item[timestamp] Gets the internal time stamp of the nex frame acquired (i.e. during an acquisition, all timestamps of the frames are stored in a FIFO which can be read after the acquisition - returns -1 if the FIFO is empty)
\item[dr] Gets the dynamic range \item[dr] Gets the dynamic range

View File

@ -127,7 +127,7 @@ where: \\
\textit{v0} is the scan0 variable with the desired precision, if scan0 is enabled;\\ \textit{v0} is the scan0 variable with the desired precision, if scan0 is enabled;\\
\textit{v1} is the scan1 variable with the desired precision, if scan1 is enabled;\\ \textit{v1} is the scan1 variable with the desired precision, if scan1 is enabled;\\
\textit{p} is the position index, if different positions are configured;\\ \textit{p} is the position index, if different positions are configured;\\
\textit{f} is the frame index of the first frame stored in the file, if many frames and triggers are configured;\\ \textit{f} is the frame index of the first frame stored in the file, if many frames and cycles are configured;\\
\textit{i} is the file index;\\ \textit{i} is the file index;\\
\textit{ext} is the file extension e.g. \textit{.raw} for MYTHEN raw data, \textit{.dat} for MYTHEN processed data. \textit{ext} is the file extension e.g. \textit{.raw} for MYTHEN raw data, \textit{.dat} for MYTHEN processed data.
@ -241,7 +241,7 @@ Figure~\ref{eq:acqflow} shows in which sequence the various scripts and loops ar
If you prefere to handle the acquisition from your acquisition enviroment, simply leave al scripts and scans disabled and call the acquition from your acquisition enviroment. \\ If you prefere to handle the acquisition from your acquisition enviroment, simply leave al scripts and scans disabled and call the acquition from your acquisition enviroment. \\
Only the frames and triggers loops are defined in firmware and guarantee a precise timing of the acquisition which cannot replaced by any other method (you can synchronize to your beamline by hardware connection of the IO signals as described in~\ref{sec:timing}). Only the frames and cycles loops are defined in firmware and guarantee a precise timing of the acquisition which cannot replaced by any other method (you can synchronize to your beamline by hardware connection of the IO signals as described in~\ref{sec:timing}).
Hereafter a description of the meaning of the various loops: Hereafter a description of the meaning of the various loops:
\begin{description} \begin{description}
@ -259,11 +259,11 @@ Hereafter a description of the meaning of the various loops:
The detector is moved in the angular positions specified by the positions command.\\ The detector is moved in the angular positions specified by the positions command.\\
The command for moving the detector should be defined as described in~\ref{sec:usersFunc}.\\ The command for moving the detector should be defined as described in~\ref{sec:usersFunc}.\\
All data acquired during a position loop will be merged together, unless the number of positions is set to 0. In this case single frames will be converted to angle without merging.\\ All data acquired during a position loop will be merged together, unless the number of positions is set to 0. In this case single frames will be converted to angle without merging.\\
Avoid using the position loop together with many frames/triggers. Avoid using the position loop together with many frames/cycles.
\item[Triggers loop] is executed in real time and defines e.g. the number of triggers that will be accepted. The total number of images will be given by frames times triggers. \item[Cycles loop] is executed in real time and defines e.g. the number of triggers that will be accepted. The total number of images will be given by frames times cycles.
\item[Frames loop] is executed in real time and defines e.g. the images acquired per trigger. The total number of images will be given by frames times triggers. \item[Frames loop] is executed in real time and defines e.g. the images acquired per trigger. The total number of images will be given by frames times cycles.
\end{description} \end{description}
Executing a script simply consists in a system call with the arguments specified below. The various scripts are executed only if they are enabled and different than \textit{none}. \\ Executing a script simply consists in a system call with the arguments specified below. The various scripts are executed only if they are enabled and different than \textit{none}. \\
@ -332,11 +332,11 @@ In the following is a list of the main parameters involved in the acquisition ti
\item[Period] is the period of the images acquired. If it is shorter than the exposure time plus readout time, it will be ignored. \item[Period] is the period of the images acquired. If it is shorter than the exposure time plus readout time, it will be ignored.
\item[Delay after trigger] can be set as a delay between the trigger signal and the start of the detection time. \item[Delay after trigger] can be set as a delay between the trigger signal and the start of the detection time.
\item[Number of gates] is used only in \textit{gating} mode and is the number of times that the gate is toggled before the detector is read out. Useful for stroboscopic measurements with gate period shorter than the minim acquisition period of the detector, otherwise can be left to 1. \item[Number of gates] is used only in \textit{gating} mode and is the number of times that the gate is toggled before the detector is read out. Useful for stroboscopic measurements with gate period shorter than the minim acquisition period of the detector, otherwise can be left to 1.
\item[Number of frames] is the number of images to be acquired per cycle. Frames and triggers have the same meaning except in trigger mode, when frames means the number of images per trigger. The total number of images is frames time triggers. \item[Number of frames] is the number of images to be acquired per cycle. Frames and cycles have the same meaning except in trigger mode, when frames means the number of images per trigger. The total number of images is frames time cycles.
\item[Number of triggers] is the number of times that the frames are acquired. Frames and triggers have the same meaning except in trigger mode, when triggers means the number of triggers that will be accepted. The total number of images is frames time triggers. \item[Number of cycles] is the number of times that the frames are acquired. Frames and cycles have the same meaning except in trigger mode, when cycles means the number of triggers that will be accepted. The total number of images is frames time cycles.
\item[Number of probes] is used in stoboscopic measurements when the period is longer than the minimum acquisition period, but shorter than the frame rate.\\ \item[Number of probes] is used in stoboscopic measurements when the period is longer than the minimum acquisition period, but shorter than the frame rate.\\
In this case the data can be summed in firmware. \\ In this case the data can be summed in firmware. \\
Currently it is implemented for Mythen only. If probes is set to 0, works normallyreturning an image for each readout, otherwise set number of triggers to 1. The maximum number of probes that can be set is 3. The detector will return a number of image equal to the number of probes, where all frames are going to be accumulated. The total number of readouts is number of frames time probes and for probes=1 the detector will return one image where all frames have been summed, for probes=2 two images where every second frame has been summed (each image accumulates the number of frames), for probes=3 three images where every third image has been summed (each image accumulates the number of frames).\\ Currently it is implemented for Mythen only. If probes is set to 0, works normallyreturning an image for each readout, otherwise set number of cycles to 1. The maximum number of probes that can be set is 3. The detector will return a number of image equal to the number of probes, where all frames are going to be accumulated. The total number of readouts is number of frames time probes and for probes=1 the detector will return one image where all frames have been summed, for probes=2 two images where every second frame has been summed (each image accumulates the number of frames), for probes=3 three images where every third image has been summed (each image accumulates the number of frames).\\
The returned images will always have 32~bit dynamic range, while the dynamic range if the detector defines the bit depth of the counters in rder to limit the readout time, if necessary.\\ The returned images will always have 32~bit dynamic range, while the dynamic range if the detector defines the bit depth of the counters in rder to limit the readout time, if necessary.\\
The probes counter waorks also in trigger and gating modes. The probes counter waorks also in trigger and gating modes.
\end{description} \end{description}
@ -349,14 +349,14 @@ The probes counter waorks also in trigger and gating modes.
\begin{center} \begin{center}
\includegraphics[width=\textwidth]{images/normal_acquisition.eps} \includegraphics[width=\textwidth]{images/normal_acquisition.eps}
\end{center} \end{center}
\caption{Auto timing: the detection time is defined by the exposure time and the period by period (if longer than exposure time plus readout time). The total number of images is frames (in the example 3) times triggers (in the example 2), and in this case there is no difference between the acquisition of the two.}\label{fig:autotiming} \caption{Auto timing: the detection time is defined by the exposure time and the period by period (if longer than exposure time plus readout time). The total number of images is frames (in the example 3) times cycles (in the example 2), and in this case there is no difference between the acquisition of the two.}\label{fig:autotiming}
\end{figure} \end{figure}
\begin{figure} \begin{figure}
\begin{center} \begin{center}
\includegraphics[width=\textwidth]{images/gated_acquisition.eps} \includegraphics[width=\textwidth]{images/gated_acquisition.eps}
\end{center} \end{center}
\caption{Gating mode: the detector acquires for a number of gates define by the user (in this case 4) before being read out, independently on the timing of the gates. The detector remains insensitive during the readout time and then starts being active again. External gates given during the readout time are ignored. The total number of images is frames (in the example 3) times triggers (in the example 2), and in this case there is no difference between the acquisition of the two. The polarity of the external gate signal can be defined by the user through the \textit{external signal flag} (in the example active high).}\label{fig:gating} \caption{Gating mode: the detector acquires for a number of gates define by the user (in this case 4) before being read out, independently on the timing of the gates. The detector remains insensitive during the readout time and then starts being active again. External gates given during the readout time are ignored. The total number of images is frames (in the example 3) times cycles (in the example 2), and in this case there is no difference between the acquisition of the two. The polarity of the external gate signal can be defined by the user through the \textit{external signal flag} (in the example active high).}\label{fig:gating}
\end{figure} \end{figure}
@ -365,7 +365,7 @@ The probes counter waorks also in trigger and gating modes.
\begin{center} \begin{center}
\includegraphics[width=\textwidth]{images/trigger_acquisition.eps} \includegraphics[width=\textwidth]{images/trigger_acquisition.eps}
\end{center} \end{center}
\caption{Trigger mode: the external trigger signal defines the start of the beginning of the acquisition, which starts after the delay set by the user. For each trigger, the number of frames is acquired (in the example 3) and all trigger signals ignored. The number of trigger accepted is given by the number of triggers (in the example 2). The polarity of the external trigger signal can be defined by the user through the \textit{external signal flag} (in the example rising edge).}\label{fig:trig} \caption{Trigger mode: the external trigger signal defines the start of the beginning of the acquisition, which starts after the delay set by the user. For each trigger, the number of frames is acquired (in the example 3) and all trigger signals ignored. The number of trigger accepted is given by the number of cycles (in the example 2). The polarity of the external trigger signal can be defined by the user through the \textit{external signal flag} (in the example rising edge).}\label{fig:trig}
\end{figure} \end{figure}
@ -373,7 +373,7 @@ The probes counter waorks also in trigger and gating modes.
\begin{center} \begin{center}
\includegraphics[width=\textwidth]{images/ro_trigger_acquisition.eps} \includegraphics[width=\textwidth]{images/ro_trigger_acquisition.eps}
\end{center} \end{center}
\caption{Read Out Trigger mode: the external trigger signal defines the beginning of the readout. The exposure time works as a time out for the waiting time for the trigger signal. The number of trigger accepted is given by the number of triggers (in the example 3) and it does not make sense to program more than one frame. The polarity of the external trigger signal can be defined by the user through the \textit{external signal flag} (in the example rising edge).}\label{fig:trig} \caption{Read Out Trigger mode: the external trigger signal defines the beginning of the readout. The exposure time works as a time out for the waiting time for the trigger signal. The number of trigger accepted is given by the number of cycles (in the example 3) and it does not make sense to program more than one frame. The polarity of the external trigger signal can be defined by the user through the \textit{external signal flag} (in the example rising edge).}\label{fig:trig}
\end{figure} \end{figure}

View File

@ -91,7 +91,7 @@ where: \\
\textit{v0} is the scan0 variable with the desired precision, if scan0 is enabled;\\ \textit{v0} is the scan0 variable with the desired precision, if scan0 is enabled;\\
\textit{v1} is the scan1 variable with the desired precision, if scan1 is enabled;\\ \textit{v1} is the scan1 variable with the desired precision, if scan1 is enabled;\\
\textit{p} is the position index, if different positions are configured;\\ \textit{p} is the position index, if different positions are configured;\\
\textit{f} is the frame index of the first frame stored in the file, if many frames and triggers are configured;\\ \textit{f} is the frame index of the first frame stored in the file, if many frames and cycles are configured;\\
\textit{i} is the file index;\\ \textit{i} is the file index;\\
\textit{ext} is the file extension e.g. \textit{.raw} for MYTHEN raw data, \textit{.dat} for MYTHEN processed data. \textit{ext} is the file extension e.g. \textit{.raw} for MYTHEN raw data, \textit{.dat} for MYTHEN processed data.
\item[index i] Sets the starting index of the file i at the beginning of the acquisition (automatically incremented for each measurement). \item[index i] Sets the starting index of the file i at the beginning of the acquisition (automatically incremented for each measurement).
@ -110,10 +110,10 @@ Sets the number of gates per frame in gated (stroboscopic) mode.\\
Refere to the detailed documentation to understand how the different timing modes work. Refere to the detailed documentation to understand how the different timing modes work.
\item[frames n] \item[frames n]
Sets the number of frames acquired sequentially per cycle (e.g. after each trigger), with the exposure time defined by exptime and the period defined by period (unless in gated mode). The frame index in the output file name will automatically be incremented.\\ Sets the number of frames acquired sequentially per cycle (e.g. after each trigger), with the exposure time defined by exptime and the period defined by period (unless in gated mode). The frame index in the output file name will automatically be incremented.\\
Note that the total number of images will be frames times triggers. Refere to detailed documentation to understand how the different timing modes work. Note that the total number of images will be frames times cycles. Refere to detailed documentation to understand how the different timing modes work.
\item[triggers n] \item[cycles n]
Sets the number of triggers (e.g. number of triggers). The frame index in the output file name will automatically be incremented. \\ Sets the number of cycles (e.g. number of triggers). The frame index in the output file name will automatically be incremented. \\
Note that the total number of images will be by frames times triggers. Refere to the detailed documentation to understand how the different timing modes work. Note that the total number of images will be by frames times cycles. Refere to the detailed documentation to understand how the different timing modes work.
\item[probes] Sets the number of probes to accumulate for stroboscopic measurements. \\ \item[probes] Sets the number of probes to accumulate for stroboscopic measurements. \\
Refere to detailed documentation to understand how the different timing modes work. Refere to detailed documentation to understand how the different timing modes work.
\item[measurements] Sets the number of repetitions of the acquisitions (non real time!). The file index in the file name will be automotically incremented.\\ \item[measurements] Sets the number of repetitions of the acquisitions (non real time!). The file index in the file name will be automotically incremented.\\
@ -234,7 +234,7 @@ It is normally reccomended to use \verb=sls\_detector\_acquire [j-]=, which take
%\item[delayl] %\item[delayl]
%\item[gatesl] %\item[gatesl]
%\item[framesl] %\item[framesl]
%\item[triggersl] %\item[cyclesl]
%\item[frameindex] %\item[frameindex]
%\item[now] %\item[now]
\end{description} \end{description}
@ -322,7 +322,7 @@ Advanced settings changing the analog or digital performance of the acquisition.
\item[vpreamp n] Sets the DAC value of the preamp feedback to n. \item[vpreamp n] Sets the DAC value of the preamp feedback to n.
\item[vshaper1 n] Sets the DAC value of the shaper1 feedback to n. \item[vshaper1 n] Sets the DAC value of the shaper1 feedback to n.
\item[vshaper2 n] Sets the DAC value of the shaper2 feedback to n. \item[vshaper2 n] Sets the DAC value of the shaper2 feedback to n.
\item[highvoltage n] CHIPTEST BOARD ONLY - Sets the DAC value of the high voltage to n. \item[vhighvoltage n] CHIPTEST BOARD ONLY - Sets the DAC value of the high voltage to n.
\item[vapower n] CHIPTEST BOARD ONLY - Sets the DAC value of the analog voltage to n. \item[vapower n] CHIPTEST BOARD ONLY - Sets the DAC value of the analog voltage to n.
\item[vddpower n] CHIPTEST BOARD ONLY - Sets the DAC value of the analog voltage to n. \item[vddpower n] CHIPTEST BOARD ONLY - Sets the DAC value of the analog voltage to n.
\item[vshpower n] CHIPTEST BOARD ONLY - Sets the comparator power supply in dac units (0-1024). \item[vshpower n] CHIPTEST BOARD ONLY - Sets the comparator power supply in dac units (0-1024).
@ -393,11 +393,11 @@ Returns the number of gates per frame in gated (stroboscopic) mode.
Refere to detailed documentation to understand how the different timing modes work. Refere to detailed documentation to understand how the different timing modes work.
\item[frames] \item[frames]
Returns the number of frames acquired sequentially per cycle (e.g. after each trigger), with the exposure time defined by exptime and the period defined by period (unless in gated mode). Returns the number of frames acquired sequentially per cycle (e.g. after each trigger), with the exposure time defined by exptime and the period defined by period (unless in gated mode).
Note that the total number of images is frames times triggers. Note that the total number of images is frames times cycles.
Refere to detailed documentation to understand how the different timing modes work. Refere to detailed documentation to understand how the different timing modes work.
\item[triggers n] \item[cycles n]
Returns the number of triggers (e.g. number of triggers). Returns the number of cycles (e.g. number of triggers).
Note that the total number of images is frames times triggers. Note that the total number of images is frames times cycles.
Refere to detailed documentation to understand how the different timing modes work. Refere to detailed documentation to understand how the different timing modes work.
\item[probes] Returns the number of probes to accumulate for stroboscopic measurements. \item[probes] Returns the number of probes to accumulate for stroboscopic measurements.
Refere to detailed documentation to understand how the different timing modes work. Refere to detailed documentation to understand how the different timing modes work.
@ -518,7 +518,7 @@ It is normally reccomended to use \verb=sls\_detector\_acquire [j-]=, which take
\item[delayl] Returns the delay after trigger left for the current frame. \item[delayl] Returns the delay after trigger left for the current frame.
\item[gatesl] Returns the number of gates left for the current frame. \item[gatesl] Returns the number of gates left for the current frame.
\item[framesl] Returns the number of frames left for the current cycle. \item[framesl] Returns the number of frames left for the current cycle.
\item[triggersl] Returns the number of triggers left for the current acquisition. \item[cyclesl] Returns the number of cycles left for the current acquisition.
\item[now] Returns the current timestamp of the detector clock. \item[now] Returns the current timestamp of the detector clock.
\item[timestamp] Returns the timestamp of the acquisitions in a First-In/First-Out mode i.e. every time it is called it returns the timestamp of the first acquisition start of readout. The FIFO is reset everytime the acquisition is started. \item[timestamp] Returns the timestamp of the acquisitions in a First-In/First-Out mode i.e. every time it is called it returns the timestamp of the first acquisition start of readout. The FIFO is reset everytime the acquisition is started.
\end{description} \end{description}
@ -594,7 +594,7 @@ Advanced settings changing the analog or digital performance of the acquisition.
\item[vpreamp] Returns the DAC value of the preamp feedback to n. \item[vpreamp] Returns the DAC value of the preamp feedback to n.
\item[vshaper1] Returns the DAC value of the shaper1 feedback to n. \item[vshaper1] Returns the DAC value of the shaper1 feedback to n.
\item[vshaper2] Returns the DAC value of the shaper2 feedback to n. \item[vshaper2] Returns the DAC value of the shaper2 feedback to n.
\item[highvoltage] CHIPTEST BOARD ONLY - Returns the DAC value of the high voltage to n. \item[vhighvoltage] CHIPTEST BOARD ONLY - Returns the DAC value of the high voltage to n.
\item[vapower] CHIPTEST BOARD ONLY - Returns the DAC value of the analog voltage to n. \item[vapower] CHIPTEST BOARD ONLY - Returns the DAC value of the analog voltage to n.
\item[vddpower] CHIPTEST BOARD ONLY - Returns the DAC value of the analog voltage to n. \item[vddpower] CHIPTEST BOARD ONLY - Returns the DAC value of the analog voltage to n.
\item[vshpower] CHIPTEST BOARD ONLY - Returns the comparator power supply in dac units (0-1024). \item[vshpower] CHIPTEST BOARD ONLY - Returns the comparator power supply in dac units (0-1024).

View File

@ -217,7 +217,7 @@ is used to configure the detector parameter var
\item[delay t] Sets the delay after trigger (in s) \item[delay t] Sets the delay after trigger (in s)
\item[gates n] Sets the number of gates per frame \item[gates n] Sets the number of gates per frame
\item[frames n] Sets the number of frames per cycle (e.g. after each trigger) \item[frames n] Sets the number of frames per cycle (e.g. after each trigger)
\item[triggers n] Sets the number of triggers (e.g. number of triggers) \item[cycles n] Sets the number of cycles (e.g. number of triggers)
\item[probes n] Sets the number of probes to accumulate (max 3) \item[probes n] Sets the number of probes to accumulate (max 3)
\item[dr n] Sets the dynamic range - can be (1,) 4, 8,16 or 24 bits \item[dr n] Sets the dynamic range - can be (1,) 4, 8,16 or 24 bits
\item[flags mode] Sets the readout flags - can be none or storeinram \item[flags mode] Sets the readout flags - can be none or storeinram
@ -298,7 +298,7 @@ is used to retrieve the detector parameter var
\item[delay] Gets the delay after trigger (in s) \item[delay] Gets the delay after trigger (in s)
\item[gates] Gets the number of gates per frame \item[gates] Gets the number of gates per frame
\item[frames] Gets the number of frames per cycle (e.g. after each trigger) \item[frames] Gets the number of frames per cycle (e.g. after each trigger)
\item[triggers] Gets the number of triggers (e.g. number of triggers) \item[cycles] Gets the number of cycles (e.g. number of triggers)
\item[probes] Gets the number of probes to accumulate (max 3) \item[probes] Gets the number of probes to accumulate (max 3)
\item[timestamp] Gets the internal time stamp of the nex frame acquired (i.e. during an acquisition, all timestamps of the frames are stored in a FIFO which can be read after the acquisition - returns -1 if the FIFO is empty) \item[timestamp] Gets the internal time stamp of the nex frame acquired (i.e. during an acquisition, all timestamps of the frames are stored in a FIFO which can be read after the acquisition - returns -1 if the FIFO is empty)
\item[dr] Gets the dynamic range \item[dr] Gets the dynamic range

Some files were not shown because too many files have changed in this diff Show More