Compare commits

..

19 Commits

Author SHA1 Message Date
d81587646e merge from developer on commit b6db097800 to properly clear udp destination in fpga for jungfrau mainly 2022-09-02 09:57:11 +02:00
5508f0135d merge fix 2022-03-21 11:08:02 +01:00
f2b8aa9dbd Merge branch 'developer' into rr_rxr 2022-03-21 10:56:41 +01:00
e554099bd9 binaries in 2022-03-21 10:34:09 +01:00
001fcf03d9 merge fix 2022-03-21 10:32:49 +01:00
1c6369a5a8 binaries in 2021-11-26 11:57:53 +01:00
4012f139ec merge fix from 6.1.0 2021-11-26 10:59:23 +01:00
630b7cd539 fixed 2021-10-26 15:35:56 +02:00
3ebb3e7508 wip 2021-10-25 17:22:50 +02:00
a1c4eb6d05 wip 2021-10-25 12:33:02 +02:00
b9b5c623ec rx_hostname, port, port2, dstlist works 2021-10-25 11:10:12 +02:00
41dc8329ab first try on setrxhostname 2021-10-22 17:15:04 +02:00
c3499c0b93 Merge branch 'developer' into rr_rxr 2021-10-22 16:12:04 +02:00
578528eb59 merge fix 2021-10-19 14:54:39 +02:00
0658d1c843 merge fix 2021-10-08 09:50:36 +02:00
ce6dc589c8 merge fix 2021-09-30 16:07:30 +02:00
0b45fdfed8 merge fix 2021-09-28 16:09:51 +02:00
9217d9f22c Merge branch 'developer' into rr_rxr 2021-09-15 11:41:29 +02:00
7d4e2470a3 hacky version compiles 2021-09-13 15:45:46 +02:00
226 changed files with 7263 additions and 9960 deletions

View File

@ -19,7 +19,6 @@ Checks: '*,
-google-readability-braces-around-statements,
-modernize-use-trailing-return-type,
-readability-isolate-declaration,
-readability-implicit-bool-conversion,
-llvmlibc-*'
HeaderFilterRegex: \.h

View File

@ -8,8 +8,11 @@ set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
cmake_policy(SET CMP0074 NEW)
include(cmake/project_version.cmake)
#functions to add compiler flags
include(cmake/SlsAddFlag.cmake)
include(cmake/SlsFindZeroMQ.cmake)
# Include additional modules that are used unconditionally
include(GNUInstallDirs)
# If conda build, always set lib dir to 'lib'
@ -23,7 +26,7 @@ string(TOLOWER "${PROJECT_NAME}" PROJECT_NAME_LOWER)
# Set targets export name (used by slsDetectorPackage and dependencies)
set(TARGETS_EXPORT_NAME "${PROJECT_NAME_LOWER}-targets")
set(namespace "sls::")
#set(namespace "${PROJECT_NAME}::")
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
@ -34,8 +37,6 @@ if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(SLS_MASTER_PROJECT ON)
endif()
option(SLS_USE_HDF5 "HDF5 File format" OFF)
option(SLS_BUILD_SHARED_LIBRARIES "Build shared libaries" ON)
option(SLS_USE_TEXTCLIENT "Text Client" ON)
@ -68,20 +69,6 @@ if(SLS_BUILD_ONLY_MOENCH)
endif()
option(SLS_EXT_BUILD "external build of part of the project" OFF)
if(SLS_EXT_BUILD)
message(STATUS "External build using already installed libraries")
set(SLS_BUILD_SHARED_LIBRARIES OFF CACHE BOOL "Should already exist" FORCE)
set(SLS_USE_TEXTCLIENT OFF CACHE BOOL "Should already exist" FORCE)
set(SLS_USE_DETECTOR OFF CACHE BOOL "Should already exist" FORCE)
set(SLS_USE_RECEIVER OFF CACHE BOOL "Should already exist" FORCE)
set(SLS_USE_RECEIVER_BINARIES OFF CACHE BOOL "Should already exist" FORCE)
set(SLS_MASTER_PROJECT OFF CACHE BOOL "No master proj in case of extbuild" FORCE)
endif()
#Maybe have an option guarding this?
set(SLS_INTERNAL_RAPIDJSON_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libs/rapidjson)
set(ClangFormat_EXCLUDE_PATTERNS "build/"
"libs/"
"slsDetectorCalibration/"
@ -92,6 +79,9 @@ set(ClangFormat_EXCLUDE_PATTERNS "build/"
${CMAKE_BINARY_DIR})
find_package(ClangFormat)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
@ -110,68 +100,62 @@ else()
endif()
if(SLS_EXT_BUILD)
# Find ourself in case of external build
find_package(slsDetectorPackage ${PROJECT_VERSION} REQUIRED)
endif()
#Add two fake libraries to manage options
add_library(slsProjectOptions INTERFACE)
add_library(slsProjectWarnings INTERFACE)
target_compile_features(slsProjectOptions INTERFACE cxx_std_11)
target_compile_options(slsProjectWarnings INTERFACE
-Wall
-Wextra
-Wno-unused-parameter
# -Wold-style-cast
-Wnon-virtual-dtor
-Woverloaded-virtual
-Wdouble-promotion
-Wformat=2
-Wredundant-decls
# -Wconversion
-Wvla
-Wdouble-promotion
-Werror=return-type
)
#Settings for C code
add_library(slsProjectCSettings INTERFACE)
target_compile_options(slsProjectCSettings INTERFACE
-std=gnu99 #fixed
-Wall
-Wextra
-Wno-unused-parameter
-Wdouble-promotion
-Wformat=2
-Wredundant-decls
-Wdouble-promotion
-Werror=return-type
)
# slsProjectOptions and slsProjectWarnings are used
# to control options for the libraries
if(NOT TARGET slsProjectOptions)
add_library(slsProjectOptions INTERFACE)
target_compile_features(slsProjectOptions INTERFACE cxx_std_11)
endif()
if (NOT TARGET slsProjectWarnings)
add_library(slsProjectWarnings INTERFACE)
target_compile_options(slsProjectWarnings INTERFACE
-Wall
-Wextra
-Wno-unused-parameter
# -Wold-style-cast
-Wnon-virtual-dtor
-Woverloaded-virtual
-Wdouble-promotion
-Wformat=2
-Wredundant-decls
# -Wconversion
-Wvla
-Wdouble-promotion
-Werror=return-type
)
# Add or disable warnings depending on if the compiler supports them
# The function checks internally and sets HAS_warning-name
sls_enable_cxx_warning("-Wnull-dereference")
sls_enable_cxx_warning("-Wduplicated-cond")
sls_disable_cxx_warning("-Wclass-memaccess")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5 AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
target_compile_options(slsProjectWarnings INTERFACE
-Wno-missing-field-initializers)
#Testing for minimum version for compilers
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.2)
message(FATAL_ERROR "Clang version must be at least 3.2!")
endif()
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
message(FATAL_ERROR "GCC version must be at least 4.8!")
endif()
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5)
target_compile_options(slsProjectWarnings INTERFACE
-Wno-missing-field-initializers)
endif()
endif()
if (NOT TARGET slsProjectCSettings)
#Settings for C code
add_library(slsProjectCSettings INTERFACE)
target_compile_options(slsProjectCSettings INTERFACE
-std=gnu99 #fixed
-Wall
-Wextra
-Wno-unused-parameter
-Wdouble-promotion
-Wformat=2
-Wredundant-decls
-Wdouble-promotion
-Werror=return-type
)
sls_disable_c_warning("-Wstringop-truncation")
endif()
# Add or disable warnings depending on if the compiler supports them
# The function checks internally and sets HAS_warning-name
sls_enable_cxx_warning("-Wnull-dereference")
sls_enable_cxx_warning("-Wduplicated-cond")
sls_disable_cxx_warning("-Wclass-memaccess")
sls_disable_c_warning("-Wstringop-truncation")
if(SLS_USE_SANITIZER)
@ -186,22 +170,58 @@ if(SLS_TUNE_LOCAL)
endif()
if(SLS_MASTER_PROJECT)
install(TARGETS slsProjectOptions slsProjectWarnings
#rapidjson
add_library(rapidjson INTERFACE)
target_include_directories(rapidjson INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/libs/rapidjson>
)
# Install fake the libraries
install(TARGETS slsProjectOptions slsProjectWarnings rapidjson
EXPORT "${TARGETS_EXPORT_NAME}"
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
endif()
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_INSTALL_RPATH $ORIGIN)
# set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
custom_find_zmq()
set(ZeroMQ_HINT "" CACHE STRING "Hint where ZeroMQ could be found")
#Adapted from: https://github.com/zeromq/cppzmq/
if (NOT TARGET libzmq)
if(ZeroMQ_HINT)
message(STATUS "Looking for ZeroMQ in: ${ZeroMQ_HINT}")
find_package(ZeroMQ 4
NO_DEFAULT_PATH
HINTS ${ZeroMQ_DIR}
)
else()
find_package(ZeroMQ 4 QUIET)
endif()
# libzmq autotools install: fallback to pkg-config
if(NOT ZeroMQ_FOUND)
message(STATUS "CMake libzmq package not found, trying again with pkg-config (normal install of zeromq)")
list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/libzmq-pkg-config)
find_package(ZeroMQ 4 REQUIRED)
endif()
# TODO "REQUIRED" above should already cause a fatal failure if not found, but this doesn't seem to work
if(NOT ZeroMQ_FOUND)
message(FATAL_ERROR "ZeroMQ was not found, neither as a CMake package nor via pkg-config")
endif()
if (ZeroMQ_FOUND AND NOT TARGET libzmq)
message(FATAL_ERROR "ZeroMQ version not supported!")
endif()
endif()
get_target_property(VAR libzmq INTERFACE_INCLUDE_DIRECTORIES)
message(STATUS "zmq: ${VAR}")
if (SLS_USE_TESTS)
enable_testing()
@ -209,9 +229,8 @@ if (SLS_USE_TESTS)
endif(SLS_USE_TESTS)
if(NOT SLS_EXT_BUILD)
add_subdirectory(slsSupportLib)
endif()
# Common functionallity to detector and receiver
add_subdirectory(slsSupportLib)
if (SLS_USE_DETECTOR OR SLS_USE_TEXTCLIENT)
add_subdirectory(slsDetectorSoftware)
@ -235,7 +254,7 @@ endif (SLS_USE_INTEGRATION_TESTS)
if (SLS_USE_PYTHON)
find_package (Python 3.6 COMPONENTS Interpreter Development)
add_subdirectory(libs/pybind11 ${CMAKE_BINARY_DIR}/bin/)
add_subdirectory(libs/pybind11)
add_subdirectory(python)
endif(SLS_USE_PYTHON)

View File

@ -47,42 +47,10 @@ This document describes the differences between v7.0.0 and v6.x.x
- stop servers also check for errors at startup( in case it was running with an older version)
- hostname cmd failed when connecting to servers in update mode (ctb, moench, jungfrau, eiger)
- missingpackets signed (negative => extra packets)
- framescaught and frameindex now returns a vector for each port
- progress looks at activated or enabled ports, so progress does not stagnate
- (eiger) disable datastreaming also for virtual servers only for 10g
- missing packets also takes care of disabled ports
- added geometry to metadata
- 10g eiger nextframenumber get fixed.
- stop, able to set nextframenumber to a consistent (max + 1) for all modules if different (eiger/ctb/jungfrau/moench)
- ctb: can set names for all the dacs
- fpga/kernel programming, checks if drive is a special file and not a normal file
- gotthard 25 um image reconstructed in gui and virtual hdf5 (firmware updated for slave to reverse channels)
- master binary file in json format now
- fixed bug introduced in 6.0.0: hdf5 files created 1 file per frame after the initial file which had maxframesperfile
- rx_roi
- m3 polarity, interpolation (enables all counters when enabled), pump probe, analog pulsing, digital pulsing
- updatedetectorserver - removes old server current binary pointing to for blackfin
- removing copydetectorserver using tftp
- registerCallBackRawDataReady and registerCallBackRawDataModifyReady now gives a sls_receiver_header* instead of a char*, and uint32_t to size_t
- registerCallBackStartAcquisition gave incorrect imagesize (+120 bytes). corrected.
- registerCallBackStartAcquisition parameter is a const string reference
- m3 (runnig config second time with tengiga 0, dr !=32, counters !=0x7) calculated incorrect image size expected
- fixed row column indexing (mainly for multi module Jungfrau 2 interfaces )
- eiger gui row indices not flipped anymore (fix in config)
- m3 (settings dac check disabled temporarily?)
- m3 virtual server sends the right pacets now
- gap pixels in gui enabled by default
- rxr src files and classes (detectordata, ZmqSocket, helpDacs) added to sls namespace, and macros (namely from logger (logINFO etc)), slsDetectorGui (make_unique in implemtnation requires sls nemspace (points to std otherwise) but not deectorImpl.cpp)
- blackfin programing made seamless (nCE fixed which helps)
-save settings file for m3 and eiger
- m3 threshold changes
- g2 and m3 clkdiv 2 (system clock) change should affect time settings (g2: exptime, period, delayaftertrigger, burstperiod, m3: exptime, gatedelay, gateperiod, period, delayaftertrigger)
- g2 system frequency is the same irrespective of timing source
- (apparently) rxr doesnt get stuck anymore from 6.1.1
- rxr mem size changed (fifo header size from 8 to 16) due to sls rxr header = 112.. 112+ 16=128 (reduces packet losss especially for g2)
-udp_srcip and udp_Srcip2: can set to auto (for virtual or 1g data networks)
- set dataset name for all hdf5 files to "data" only
- number of storage cells is not updated in teh receiver. done. and also allowing it to be modified in running status
2. Resolved Issues
==================

View File

@ -1,38 +0,0 @@
function(custom_find_zmq)
set(ZeroMQ_HINT "" CACHE STRING "Hint where ZeroMQ could be found")
#Adapted from: https://github.com/zeromq/cppzmq/
if (NOT TARGET libzmq)
if(ZeroMQ_HINT)
message(STATUS "Looking for ZeroMQ in: ${ZeroMQ_HINT}")
find_package(ZeroMQ 4
NO_DEFAULT_PATH
HINTS ${ZeroMQ_HINT}
)
else()
find_package(ZeroMQ 4 QUIET)
endif()
# libzmq autotools install: fallback to pkg-config
if(ZeroMQ_FOUND)
message(STATUS "Found libzmq using find_package")
else()
message(STATUS "CMake libzmq package not found, trying again with pkg-config (normal install of zeromq)")
list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake/libzmq-pkg-config)
find_package(ZeroMQ 4 REQUIRED)
endif()
# TODO "REQUIRED" above should already cause a fatal failure if not found, but this doesn't seem to work
if(NOT ZeroMQ_FOUND)
message(FATAL_ERROR "ZeroMQ was not found, neither as a CMake package nor via pkg-config")
endif()
if (ZeroMQ_FOUND AND NOT TARGET libzmq)
message(FATAL_ERROR "ZeroMQ version not supported!")
endif()
endif()
get_target_property(VAR libzmq IMPORTED_LOCATION)
message(STATUS "Using libzmq: ${VAR}")
endfunction()

View File

@ -1,36 +0,0 @@
#From: https://github.com/zeromq/cppzmq/
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH ON)
find_package(PkgConfig)
pkg_check_modules(PC_LIBZMQ QUIET libzmq)
set(ZeroMQ_VERSION ${PC_LIBZMQ_VERSION})
find_path(ZeroMQ_INCLUDE_DIR zmq.h
PATHS ${ZeroMQ_DIR}/include
${PC_LIBZMQ_INCLUDE_DIRS}
)
find_library(ZeroMQ_LIBRARY
NAMES zmq
PATHS ${ZeroMQ_DIR}/lib
${PC_LIBZMQ_LIBDIR}
${PC_LIBZMQ_LIBRARY_DIRS}
)
if(ZeroMQ_LIBRARY OR ZeroMQ_STATIC_LIBRARY)
set(ZeroMQ_FOUND ON)
message(STATUS "Found libzmq using PkgConfig")
endif()
set ( ZeroMQ_LIBRARIES ${ZeroMQ_LIBRARY} )
set ( ZeroMQ_INCLUDE_DIRS ${ZeroMQ_INCLUDE_DIR} )
if (NOT TARGET libzmq)
add_library(libzmq UNKNOWN IMPORTED)
set_target_properties(libzmq PROPERTIES
IMPORTED_LOCATION ${ZeroMQ_LIBRARIES}
INTERFACE_INCLUDE_DIRECTORIES ${ZeroMQ_INCLUDE_DIRS})
endif()
include ( FindPackageHandleStandardArgs )
find_package_handle_standard_args ( ZeroMQ DEFAULT_MSG ZeroMQ_LIBRARIES ZeroMQ_INCLUDE_DIRS )

View File

@ -26,7 +26,7 @@ install(FILES
)
install(FILES
"${CMAKE_SOURCE_DIR}/cmake/libzmq-pkg-config/FindZeroMQ.cmake"
"${CMAKE_SOURCE_DIR}/libzmq-pkg-config/FindZeroMQ.cmake"
COMPONENT devel
DESTINATION ${CMAKE_INSTALL_DIR}/libzmq-pkg-config
)

130
cmk.sh
View File

@ -18,7 +18,6 @@ CTBGUI=0
MANUALS=0
MANUALS_ONLY_RST=0
MOENCHZMQ=0
ZMQ_HINT_DIR=""
CLEAN=0
@ -27,26 +26,25 @@ CMAKE_PRE=""
CMAKE_POST=""
usage() { echo -e "
Usage: $0 [-b] [-c] [-d <HDF5 directory>] [e] [g] [-h] [i] [-j <Number of threads>] [-k <CMake command>] [-l <Install directory>] [m] [n] [-p] [-q <Zmq hint directory>] [r] [s] [t] [u] [z]
Usage: $0 [-c] [-b] [-p] [e] [t] [r] [g] [s] [u] [i] [m] [n] [-h] [z] [-d <HDF5 directory>] [-l Install directory] [-k <CMake command>] [-j <Number of threads>]
-[no option]: only make
-b: Builds/Rebuilds CMake files normal mode
-c: Clean
-d: HDF5 Custom Directory
-e: Debug mode
-g: Build/Rebuilds only gui
-b: Builds/Rebuilds CMake files normal mode
-p: Builds/Rebuilds Python API
-h: Builds/Rebuilds Cmake files with HDF5 package
-i: Builds tests
-j: Number of threads to compile through
-d: HDF5 Custom Directory
-k: CMake command
-l: Install directory
-t: Build/Rebuilds only text client
-r: Build/Rebuilds only receiver
-g: Build/Rebuilds only gui
-s: Simulator
-u: Chip Test Gui
-j: Number of threads to compile through
-e: Debug mode
-i: Builds tests
-m: Manuals
-n: Manuals without compiling doxygen (only rst)
-p: Builds/Rebuilds Python API
-q: Zmq hint directory
-r: Build/Rebuilds only receiver
-s: Simulator
-t: Build/Rebuilds only text client
-u: Chip Test Gui
-z: Moench zmq processor
Rebuild when you switch to a new build and compile in parallel:
@ -83,50 +81,69 @@ For rebuilding only certain sections
" ; exit 1; }
while getopts ":bcd:eghij:k:l:mnpq:rstuz" opt ; do
while getopts ":bpchd:k:l:j:trgeisumnz" opt ; do
case $opt in
b)
echo "Building of CMake files Required"
REBUILD=1
;;
p)
echo "Compiling Options: Python"
PYTHON=1
REBUILD=1
;;
c)
echo "Clean Required"
CLEAN=1
;;
d)
echo "New HDF5 directory: $OPTARG"
HDF5DIR=$OPTARG
;;
e)
echo "Compiling Options: Debug"
DEBUG=1
;;
g)
echo "Compiling Options: GUI"
GUI=1
REBUILD=1
;;
h)
echo "Building of CMake files with HDF5 option Required"
HDF5=1
REBUILD=1
;;
i)
echo "Compiling Options: Tests"
TESTS=1
;;
j)
echo "Number of compiler threads: $OPTARG"
COMPILERTHREADS=$OPTARG
;;
k)
echo "CMake command: $OPTARG"
CMAKE="$OPTARG"
d)
echo "New HDF5 directory: $OPTARG"
HDF5DIR=$OPTARG
;;
l)
echo "CMake install directory: $OPTARG"
INSTALLDIR="$OPTARG"
;;
k)
echo "CMake command: $OPTARG"
CMAKE="$OPTARG"
;;
j)
echo "Number of compiler threads: $OPTARG"
COMPILERTHREADS=$OPTARG
;;
t)
echo "Compiling Options: Text Client"
TEXTCLIENT=1
REBUILD=1
;;
r)
echo "Compiling Options: Receiver"
RECEIVER=1
REBUILD=1
;;
g)
echo "Compiling Options: GUI"
GUI=1
REBUILD=1
;;
e)
echo "Compiling Options: Debug"
DEBUG=1
;;
i)
echo "Compiling Options: Tests"
TESTS=1
;;
s)
echo "Compiling Options: Simulator"
SIMULATOR=1
;;
m)
echo "Compiling Manuals"
MANUALS=1
@ -135,37 +152,14 @@ while getopts ":bcd:eghij:k:l:mnpq:rstuz" opt ; do
echo "Compiling Manuals (Only RST)"
MANUALS_ONLY_RST=1
;;
p)
echo "Compiling Options: Python"
PYTHON=1
REBUILD=1
;;
q)
echo "Zmq hint directory: $OPTARG"
ZMQ_HINT_DIR=$OPTARG
;;
r)
echo "Compiling Options: Receiver"
RECEIVER=1
REBUILD=1
;;
s)
echo "Compiling Options: Simulator"
SIMULATOR=1
;;
t)
echo "Compiling Options: Text Client"
TEXTCLIENT=1
REBUILD=1
z)
echo "Compiling Moench Zmq Processor"
MOENCHZMQ=1
;;
u)
echo "Compiling Options: Chip Test Gui"
CTBGUI=1
;;
z)
echo "Compiling Moench Zmq Processor"
MOENCHZMQ=1
;;
\?)
echo "Invalid option: -$OPTARG"
usage
@ -260,12 +254,6 @@ if [ $TESTS -eq 1 ]; then
echo "Tests Option enabled"
fi
#zmq hint dir
if [ -n "$ZMQ_HINT_DIR" ]; then
CMAKE_POST+=" -DZeroMQ_HINT="$ZMQ_HINT_DIR
CMAKE_POST+=" -DZeroMQ_DIR="
# echo "Enabling Zmq Hint Directory: $ZMQ_HINT_DIR"
fi
#hdf5 rebuild
if [ $HDF5 -eq 1 ]; then

View File

@ -19,4 +19,4 @@ cp build/install/bin/slsMultiReceiver $PREFIX/bin/.
cp build/install/include/sls/* $PREFIX/include/sls
cp -rv build/install/share $PREFIX
cp -r build/install/share/ $PREFIX/share

View File

@ -828,14 +828,14 @@ void ctbAcquisition::setCanvas(TCanvas* c) {
myCanvas->AddExec("dynamic",Form("((ctbAcquisition*)%p)->canvasClicked()",this));
// myCanvas->AddExec("ex","canvasClicked()");
}
void ctbAcquisition::dataCallback(sls::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) {
// return
((ctbAcquisition*)pArgs)->plotData(data,index);
}
int ctbAcquisition::plotData(sls::detectorData *data, int index) {
int ctbAcquisition::plotData(detectorData *data, int index) {
/*
******************************************************************

View File

@ -28,8 +28,8 @@ class TGTextButton;
namespace sls
{
class Detector;
class detectorData;
};
class detectorData;
template <class dataType> class slsDetectorData;
@ -201,10 +201,10 @@ class ctbAcquisition : public TGGroupFrame {
void setBitGraph (int i ,int en, Pixel_t col);
void startAcquisition();
static void progressCallback(double,void*);
static void dataCallback(sls::detectorData*, long unsigned int, unsigned int, void*);
static void dataCallback(detectorData*, long unsigned int, unsigned int, void*);
int StopFlag;
int plotData(sls::detectorData*, int);
int plotData(detectorData*, int);
void setPatternFile(const char* t);

View File

@ -45,7 +45,6 @@ int main() {
for (const auto &cmd : commands) {
std::ostringstream os;
std::cout << cmd << '\n';
proxy.Call(cmd, {}, -1, slsDetectorDefs::HELP_ACTION, os);
auto tmp = os.str().erase(0, cmd.size());

View File

@ -136,7 +136,7 @@ can use dir()
'__str__', '__subclasshook__', '_adc_register', '_frozen',
'_register', 'acquire', 'adcclk', 'adcphase', 'adcpipeline',
'adcreg', 'asamples', 'auto_comp_disable', 'clearAcquiringFlag',
'clearBit', 'clearROI', 'client_version', 'config',
'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.

View File

@ -5,42 +5,17 @@ Detector Server Upgrade
**Location:** slsDetectorPackage/serverBin/ folder for every release.
.. note ::
For Mythen3, Gotthard2 and Eiger, you need to add scripts to automatically start detector server upon power on. See :ref:`Automatic start<Automatic start servers>` for more details.
.. note ::
Eiger requires a manual reboot. Or killall the servers and restart the new linked one. If you are in the process of updating firmware, then don't reboot yet.
From 6.1.1 and above (no tftp required)
---------------------------------------
#. Program from console
.. code-block:: bash
# the following command copies new server, creates a soft link to xxxDetectorServerxxx
# [Jungfrau][CTB][Moench] also deletes the old server binary and edits initttab to respawn server on reboot
# Then, the detector controller will reboot (except Eiger)
sls_detector_put updatedetectorserver /complete-path-to-binary/xxxDetectorServerxxx
#. Copy the detector server specific config files or any others required to the detector:
.. code-block:: bash
sls_detector_put execcommand "tftp pcxxx -r configxxx -g"
5.0.0 - 6.1.1
--------------
#. Install tftp and copy detector server binary to tftp folder
#. Program from console
.. note ::
These instructions are for upgrades from v5.0.0. For earlier versions, contact us.
.. code-block:: bash
# the following command copies new server from pc tftp folder, creates a soft link to xxxDetectorServerxxx
# copies new server from pc tftp folder, creates a soft link to xxxDetectorServerxxx
# [Jungfrau][CTB][Moench] also edits initttab to respawn server on reboot
# Then, the detector controller will reboot (except Eiger)
sls_detector_put copydetectorserver xxxDetectorServerxxx pcxxx
@ -52,15 +27,18 @@ From 6.1.1 and above (no tftp required)
sls_detector_put execcommand "tftp pcxxx -r configxxx -g"
Troubleshooting with tftp
^^^^^^^^^^^^^^^^^^^^^^^^^
.. note ::
For Mythen3, Gotthard2 and Eiger, you need to add scripts to automatically start detector server upon power on. See :ref:`Automatic start<Automatic start servers>` for more details.
.. note ::
Eiger requires a manual reboot. Or killall the servers and restart the new linked one. If you are in the process of updating firmware, then don't reboot yet.
Errors
------
#. tftp write error: There is no space left. Please delete some old binaries and try again.
#. text file busy: You are trying to copy the same server.
Older than 5.0.0
-----------------
Please contact us.
#. text file busy: You are trying to copy the same server.

View File

@ -409,18 +409,18 @@ patword 018d 0008599f0008503a
patioctrl 8f0effff6dbffdbf
patclkctrl 0000000000000000
patlimits 0000 018c
patloop 0 013a 016b
patnloop 0 199
patloop 1 0400 0400
patnloop 1 0
patloop 2 0400 0400
patnloop 2 0
patwait 0 00aa
patwaittime 0 10000
patwait 1 0400
patwaittime 1 0
patwait 2 0400
patwaittime 2 0
patloop0 013a 016b
patnloop0 199
patloop1 0400 0400
patnloop1 0
patloop2 0400 0400
patnloop2 0
patwait0 00aa
patwaittime0 10000
patwait1 0400
patwaittime1 0
patwait2 0400
patwaittime2 0
#############################################
### edit with hostname or 1Gbs IP address of your server

View File

@ -0,0 +1,12 @@
hostname bchip258+
0:rx_hostname pc13784:1954+pc13784:1955+
udp_srcip 10.0.2.184
udp_dstip 10.0.2.1
0:0 udp_dstport 50000
0:1 udp_dstport 50001
#0:0 udp_dstlist port=50001
#0:1 udp_dstlist port=50002

View File

@ -427,18 +427,18 @@ patword 0x018c 0x0008599f0008503a
patword 0x018d 0x0008599f0008503a
patioctrl 0x8f0effff6dbffdbf
patlimits 0x0000 0x018c
patloop 0 0x013a 0x016b
patnloop 0 0x199
patloop 1 0x0400 0x0400
patnloop 1 0
patloop 2 0x0400 0x0400
patnloop 2 0
patwait 0 0x00aa
patwaittime 0 10000
patwait 1 0x0400
patwaittime 1 0
patwait 2 0x0400
patwaittime 2 0
patloop0 0x013a 0x016b
patnloop0 0x199
patloop1 0x0400 0x0400
patnloop1 0
patloop2 0x0400 0x0400
patnloop2 0
patwait0 0x00aa
patwaittime0 10000
patwait1 0x0400
patwaittime1 0
patwait2 0x0400
patwaittime2 0
# dacs
dac 6 800

View File

@ -6,8 +6,6 @@
#include "tests/globals.h"
#include <iostream>
namespace sls {
class MultiDetectorFixture {
protected:
DetectorImpl d;
@ -138,7 +136,7 @@ TEST_CASE_METHOD(MultiDetectorFixture, "Get ID", "[.eigerintegration][cli]") {
std::string hn = test::hostname;
hn.erase(std::remove(begin(hn), end(hn), 'b'), end(hn));
hn.erase(std::remove(begin(hn), end(hn), 'e'), end(hn));
auto hostnames = split(hn, '+');
auto hostnames = sls::split(hn, '+');
CHECK(hostnames.size() == d.getNumberOfDetectors());
for (int i = 0; i != d.getNumberOfDetectors(); ++i) {
CHECK(d.getId(defs::DETECTOR_SERIAL_NUMBER, 0) ==
@ -200,5 +198,3 @@ TEST_CASE_METHOD(MultiDetectorFixture, "rate correction",
d.setRateCorrection(200);
CHECK(d.getRateCorrection() == 200);
}
} // namespace sls

View File

@ -24,8 +24,6 @@
// extern std::string detector_type;
// extern dt type;
namespace sls {
TEST_CASE("Single detector no receiver", "[.integration][.single]") {
auto t = Module::getTypeFromDetector(test::hostname);
CHECK(t == test::type);
@ -285,14 +283,14 @@ TEST_CASE(
CHECK(m.getRateCorrection() == ratecorr);
// ratecorr fail with dr 4 or 8
CHECK_THROWS_AS(m.setDynamicRange(8), RuntimeError);
CHECK_THROWS_AS(m.setDynamicRange(8), sls::RuntimeError);
CHECK(m.getRateCorrection() == 0);
m.setDynamicRange(16);
m.setDynamicRange(16);
m.setRateCorrection(ratecorr);
m.setDynamicRange(16);
m.setRateCorrection(ratecorr);
CHECK_THROWS_AS(m.setDynamicRange(4), RuntimeError);
CHECK_THROWS_AS(m.setDynamicRange(4), sls::RuntimeError);
CHECK(m.getRateCorrection() == 0);
}
@ -331,11 +329,11 @@ TEST_CASE("Chiptestboard Loading Patterns", "[.ctbintegration]") {
m.setPatternWord(addr, word);
CHECK(m.setPatternWord(addr, -1) == word);
addr = MAX_ADDR;
CHECK_THROWS_AS(m.setPatternWord(addr, word), RuntimeError);
CHECK_THROWS_AS(m.setPatternWord(addr, word), sls::RuntimeError);
CHECK_THROWS_WITH(m.setPatternWord(addr, word),
Catch::Matchers::Contains("be between 0 and"));
addr = -1;
CHECK_THROWS_AS(m.setPatternWord(addr, word), RuntimeError);
CHECK_THROWS_AS(m.setPatternWord(addr, word), sls::RuntimeError);
CHECK_THROWS_WITH(m.setPatternWord(addr, word),
Catch::Matchers::Contains("be between 0 and"));
@ -410,7 +408,7 @@ TEST_CASE("Chiptestboard Dbit offset, list, sampling, advinvert",
CHECK(m.getReceiverDbitList().size() == 10);
list.push_back(64);
CHECK_THROWS_AS(m.setReceiverDbitList(list), RuntimeError);
CHECK_THROWS_AS(m.setReceiverDbitList(list), sls::RuntimeError);
CHECK_THROWS_WITH(m.setReceiverDbitList(list),
Catch::Matchers::Contains("be between 0 and 63"));
@ -478,7 +476,7 @@ TEST_CASE("Eiger or Jungfrau nextframenumber",
CHECK(m.acquire() == slsDetectorDefs::OK);
CHECK(m.getReceiverCurrentFrameIndex() == val);
CHECK_THROWS_AS(m.setNextFrameNumber(0), RuntimeError);
CHECK_THROWS_AS(m.setNextFrameNumber(0), sls::RuntimeError);
if (m.getDetectorTypeAsString() == "Eiger") {
val = 281474976710655;
@ -513,10 +511,8 @@ TEST_CASE("Eiger partialread", "[.eigerintegration][partialread]") {
m.setDynamicRange(8);
m.setPartialReadout(256);
CHECK(m.getPartialReadout() == 256);
CHECK_THROWS_AS(m.setPartialReadout(1), RuntimeError);
CHECK_THROWS_AS(m.setPartialReadout(1), sls::RuntimeError);
CHECK(m.getPartialReadout() == 256);
CHECK_THROWS_AS(m.setPartialReadout(0), RuntimeError);
CHECK_THROWS_AS(m.setPartialReadout(0), sls::RuntimeError);
m.setPartialReadout(256);
}
} // namespace sls
}

View File

@ -6,12 +6,10 @@
#include "tests/globals.h"
#include <iostream>
namespace sls {
using namespace Catch::literals;
TEST_CASE("Initialize a multi detector", "[.integration][.multi]") {
auto hostnames = split(test::hostname, '+');
auto hostnames = sls::split(test::hostname, '+');
DetectorImpl d(0, true, true);
d.setHostname(test::hostname.c_str());
@ -104,6 +102,3 @@ TEST_CASE("Set and read timers", "[.integration][.multi]") {
d.freeSharedMemory();
}
} // namespace sls

View File

@ -0,0 +1,27 @@
#From: https://github.com/zeromq/cppzmq/
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH ON)
find_package(PkgConfig)
pkg_check_modules(PC_LIBZMQ QUIET libzmq)
set(ZeroMQ_VERSION ${PC_LIBZMQ_VERSION})
find_library(ZeroMQ_LIBRARY NAMES libzmq.so libzmq.dylib libzmq.dll
PATHS ${PC_LIBZMQ_LIBDIR} ${PC_LIBZMQ_LIBRARY_DIRS})
find_library(ZeroMQ_STATIC_LIBRARY NAMES libzmq-static.a libzmq.a libzmq.dll.a
PATHS ${PC_LIBZMQ_LIBDIR} ${PC_LIBZMQ_LIBRARY_DIRS})
if(ZeroMQ_LIBRARY OR ZeroMQ_STATIC_LIBRARY)
set(ZeroMQ_FOUND ON)
endif()
if (TARGET libzmq)
# avoid errors defining targets twice
return()
endif()
add_library(libzmq SHARED IMPORTED)
set_property(TARGET libzmq PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${PC_LIBZMQ_INCLUDE_DIRS})
set_property(TARGET libzmq PROPERTY IMPORTED_LOCATION ${ZeroMQ_LIBRARY})
add_library(libzmq-static STATIC IMPORTED ${PC_LIBZMQ_INCLUDE_DIRS})
set_property(TARGET libzmq-static PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${PC_LIBZMQ_INCLUDE_DIRS})
set_property(TARGET libzmq-static PROPERTY IMPORTED_LOCATION ${ZeroMQ_STATIC_LIBRARY})

View File

@ -29,7 +29,6 @@ set( PYTHON_FILES
decorators.py
detector_property.py
detector.py
defines.py
eiger.py
enums.py
errors.py

View File

@ -11,7 +11,7 @@ enums.cpp
import re
import subprocess
from parse import remove_comments, remove_ifdefs
from parse import remove_comments
allow_bitwise_op = ["streamingInterface", "M3_GainCaps"]
@ -98,25 +98,25 @@ def generate_enum_string(enums):
return ''.join(data)
# def remove_ifdefs(lines):
# """Keeps C++ version of the code"""
# out = []
# it = iter(lines)
# skip = False
# for line in it:
def remove_ifdefs(lines):
"""Keeps C++ version of the code"""
out = []
it = iter(lines)
skip = False
for line in it:
# if "#ifdef __cplusplus" in line:
# line = next(it)
if "#ifdef __cplusplus" in line:
line = next(it)
# if "#else" in line:
# skip = True
if "#else" in line:
skip = True
# if "#endif" in line:
# skip = False
if "#endif" in line:
skip = False
# if not skip and "#endif" not in line:
# out.append(line)
# return out
if not skip and "#endif" not in line:
out.append(line)
return out
with open('../../slsSupportLib/include/sls/sls_detector_defs.h') as f:

View File

@ -1,30 +0,0 @@
import re
import subprocess
from parse import remove_comments, remove_ifdefs
with open('../../slsSupportLib/include/sls/sls_detector_defs.h') as f:
data = f.read()
data = remove_comments(data)
data = data.splitlines()
# data = remove_ifdefs(data)
ignore = ['#define MYROOT', '#define __cplusplus']
defines = {}
for i, line in enumerate(data):
if line.startswith('#define') and line not in ignore:
_, name, value = line.split(maxsplit = 2)
print(f'{name}={value}')
defines[name]=value
warning = '#WARINING This file is auto generated any edits might be overwritten without warning\n\n'
with open('../slsdet/defines.py', 'w') as f:
f.write(warning)
for key, value in defines.items():
f.write(f'{key}={value}\n')

View File

@ -25,25 +25,7 @@ def remove_comments(text):
)
return re.sub(pattern, replacer, text)
def remove_ifdefs(lines):
"""Keeps C++ version of the code"""
out = []
it = iter(lines)
skip = False
for line in it:
if "#ifdef __cplusplus" in line:
line = next(it)
if "#else" in line:
skip = True
if "#endif" in line:
skip = False
if not skip and "#endif" not in line:
out.append(line)
return out
#based on ccsyspath: https://github.com/AndrewWalker/ccsyspath

View File

@ -17,9 +17,8 @@ import _slsdet
xy = _slsdet.xy
defs = _slsdet.slsDetectorDefs
#Make enums and #defines available at top level
from .enums import *
from .defines import *
IpAddr = _slsdet.IpAddr
MacAddr = _slsdet.MacAddr

View File

@ -1,45 +1,43 @@
# SPDX-License-Identifier: LGPL-3.0-or-other
# Copyright (C) 2021 Contributors to the SLS Detector Package
from .detector import Detector, freeze
from .detector import Detector
from .utils import element_if_equal
from .dacs import DetectorDacs, NamedDacs
from .dacs import DetectorDacs
import _slsdet
dacIndex = _slsdet.slsDetectorDefs.dacIndex
from .detector_property import DetectorProperty
# class CtbDacs(DetectorDacs):
# """
# Ctb dacs
# """
# _dacs = [('dac0', dacIndex(0), 0, 4000, 1400),
# ('dac1', dacIndex(1), 0, 4000, 1200),
# ('dac2', dacIndex(2), 0, 4000, 900),
# ('dac3', dacIndex(3), 0, 4000, 1050),
# ('dac4', dacIndex(4), 0, 4000, 1400),
# ('dac5', dacIndex(5), 0, 4000, 655),
# ('dac6', dacIndex(6), 0, 4000, 2000),
# ('dac7', dacIndex(7), 0, 4000, 1400),
# ('dac8', dacIndex(8), 0, 4000, 850),
# ('dac9', dacIndex(9), 0, 4000, 2000),
# ('dac10', dacIndex(10), 0, 4000, 2294),
# ('dac11', dacIndex(11), 0, 4000, 983),
# ('dac12', dacIndex(12), 0, 4000, 1475),
# ('dac13', dacIndex(13), 0, 4000, 1200),
# ('dac14', dacIndex(14), 0, 4000, 1600),
# ('dac15', dacIndex(15), 0, 4000, 1455),
# ('dac16', dacIndex(16), 0, 4000, 0),
# ('dac17', dacIndex(17), 0, 4000, 1000),
# ]
# _dacnames = [_d[0] for _d in _dacs]
class CtbDacs(DetectorDacs):
"""
Ctb dacs
"""
_dacs = [('dac0', dacIndex(0), 0, 4000, 1400),
('dac1', dacIndex(1), 0, 4000, 1200),
('dac2', dacIndex(2), 0, 4000, 900),
('dac3', dacIndex(3), 0, 4000, 1050),
('dac4', dacIndex(4), 0, 4000, 1400),
('dac5', dacIndex(5), 0, 4000, 655),
('dac6', dacIndex(6), 0, 4000, 2000),
('dac7', dacIndex(7), 0, 4000, 1400),
('dac8', dacIndex(8), 0, 4000, 850),
('dac9', dacIndex(9), 0, 4000, 2000),
('dac10', dacIndex(10), 0, 4000, 2294),
('dac11', dacIndex(11), 0, 4000, 983),
('dac12', dacIndex(12), 0, 4000, 1475),
('dac13', dacIndex(13), 0, 4000, 1200),
('dac14', dacIndex(14), 0, 4000, 1600),
('dac15', dacIndex(15), 0, 4000, 1455),
('dac16', dacIndex(16), 0, 4000, 0),
('dac17', dacIndex(17), 0, 4000, 1000),
]
_dacnames = [_d[0] for _d in _dacs]
from .utils import element
@freeze
class Ctb(Detector):
def __init__(self, id = 0):
super().__init__(id)
self._frozen = False
# self._dacs = CtbDacs(self)
self._dacs = NamedDacs(self)
self._dacs = CtbDacs(self)
@property
def dacs(self):

View File

@ -36,79 +36,6 @@ class Dac(DetectorProperty):
dacstr = ''.join([f'{item:5d}' for item in self.get()])
return f'{self.__name__:15s}:{dacstr}'
class NamedDacs:
"""
New implementation of the detector dacs. Used at the momen for
Ctb but should replace the old one for all detectors
"""
_frozen = False
_direct_access = ['_detector', '_current', '_dacnames']
def __init__(self, detector):
self._detector = detector
self._current = 0
self._dacnames = [n.replace(" ", "") for n in detector.getDacNames()]
# # Populate the dacs
for i,name in enumerate(self._dacnames):
#name, enum, low, high, default, detector
setattr(self, name, Dac(name, dacIndex(i), 0, 4000, 1000, detector))
self._frozen = True
# def __getattr__(self, name):
# return self.__getattribute__('_' + name)
def __setattr__(self, name, value):
if not self._frozen:
#durining init we need to be able to set up the class
super().__setattr__(name, value)
else:
#Later we restrict us to manipulate dacs and a few fields
if name in self._direct_access:
super().__setattr__(name, value)
elif name in self._dacnames:
return self.__getattribute__(name).__setitem__(slice(None, None, None), value)
else:
raise AttributeError(f'Dac not found: {name}')
def __next__(self):
if self._current >= len(self._dacnames):
self._current = 0
raise StopIteration
else:
self._current += 1
return self.__getattribute__(self._dacnames[self._current-1])
# return self.__getattr__(self._dacnames[self._current-1])
def __iter__(self):
return self
def __repr__(self):
r_str = ['========== DACS =========']
r_str += [repr(dac) for dac in self]
return '\n'.join(r_str)
def get_asarray(self):
"""
Read the dacs into a numpy array with dimensions [ndacs, nmodules]
"""
dac_array = np.zeros((len(self._dacnames), len(self._detector)))
for i, _d in enumerate(self):
dac_array[i,:] = _d[:]
return dac_array
def to_array(self):
return self.get_asarray()
def set_from_array(self, dac_array):
"""
Set the dacs from an numpy array with dac values. [ndacs, nmodules]
"""
dac_array = dac_array.astype(np.int)
for i, _d in enumerate(self):
_d[:] = dac_array[i]
def from_array(self, dac_array):
self.set_from_array(dac_array)
class DetectorDacs:
_dacs = []
@ -123,7 +50,7 @@ class DetectorDacs:
# Index to support iteration
self._current = 0
# Name the attributes?
# Populate the dacs
for _d in self._dacs:
setattr(self, '_'+_d[0], Dac(*_d, detector))
@ -132,10 +59,7 @@ class DetectorDacs:
def __getattr__(self, name):
return self.__getattribute__('_' + name)
@property
def dacnames(self):
return [_d[0] for _d in _dacs]
def __setattr__(self, name, value):
if name in self._dacnames:
return self.__getattribute__('_' + name).__setitem__(slice(None, None, None), value)

View File

@ -1,31 +0,0 @@
#WARINING This file is auto generated any edits might be overwritten without warning
BIT32_MASK=0xFFFFFFFF
MAX_RX_DBIT=64
DEFAULT_PORTNO=1952
DEFAULT_UDP_PORTNO=50001
DEFAULT_ZMQ_CL_PORTNO=30001
DEFAULT_ZMQ_RX_PORTNO=30001
DEFAULT_UDP_SRC_PORTNO=32410
DEFAULT_UDP_DST_PORTNO=50001
MAX_UDP_DESTINATION=32
SLS_DETECTOR_HEADER_VERSION=0x2
SLS_DETECTOR_JSON_HEADER_VERSION=0x4
UDP_PACKET_DATA_BYTES=(1344)
MAX_TRIMEN=100
MAX_BLACKFIN_PROGRAM_SIZE=(128 * 1024)
GET_FLAG=-1
DEFAULT_DET_MAC="00:aa:bb:cc:dd:ee"
DEFAULT_DET_IP="129.129.202.45"
DEFAULT_DET_MAC2="00:aa:bb:cc:dd:ff"
DEFAULT_DET_IP2="129.129.202.46"
LOCALHOST_IP="127.0.0.1"
MAX_STR_LENGTH=1000
SHORT_STR_LENGTH=20
MAX_PATTERN_LENGTH=0x2000
MAX_PATTERN_LEVELS=6
M3_MAX_PATTERN_LEVELS=3
DEFAULT_STREAMING_TIMER_IN_MS=500
NUM_RX_THREAD_IDS=9
MAX_NUM_PACKETS=512
TRIMBITMASK=0x3f

View File

@ -17,7 +17,7 @@ from .utils import element_if_equal, all_equal, get_set_bits, list_to_bitmask
from .utils import Geometry, to_geo, element, reduce_time, is_iterable
from _slsdet import xy
from . import utils as ut
from .proxy import JsonProxy, SlowAdcProxy, ClkDivProxy, MaxPhaseProxy, ClkFreqProxy, PatLoopProxy, PatNLoopProxy, PatWaitProxy, PatWaitTimeProxy
from .proxy import JsonProxy, SlowAdcProxy, ClkDivProxy, MaxPhaseProxy, ClkFreqProxy
from .registers import Register, Adc_register
import datetime as dt
@ -599,7 +599,7 @@ class Detector(CppDetectorApi):
@property
@element
def rx_framescaught(self):
"""Number of frames caught by each port in receiver."""
"""Number of frames caught by receiver."""
return self.getFramesCaught()
@property
@ -1442,21 +1442,20 @@ class Detector(CppDetectorApi):
@property
def trimbits(self):
"""
[Eiger][Mythen3] Loads/Saves custom trimbit file to detector.
[Eiger][Mythen3] Loads custom trimbit file to detector.
Note
-----
If no extension specified, serial number of each module is attached.
:setter: Loads the trimbit file to detector
:getter: Saves the trimbits from the detector to file. Not implemented with 'trimbits'. Use saveTrimbits().
:getter: Not implemented
Example
-------
>>> d.trimbits = '/path_to_file/noise'
- 14:53:27.931 INFO: Settings file loaded: /path_to_file/noise.sn000
"""
raise NotImplementedError('trimbits is set only. Use saveTrimbits()')
return NotImplementedError("trimbits are set only")
@trimbits.setter
def trimbits(self, fname):
@ -1572,16 +1571,8 @@ class Detector(CppDetectorApi):
@property
def daclist(self):
"""
List of enums for every dac for this detector.
:setter: Only implemented for Chiptestboard
"""
return self.getDacNames()
@daclist.setter
def daclist(self, value):
self.setDacNames(value)
"""Gets the list of enums for every dac for this detector."""
return self.getDacList()
@property
def dacvalues(self):
@ -1834,13 +1825,13 @@ class Detector(CppDetectorApi):
@property
@element
def threshold(self):
"""[Eiger][Mythen3] Threshold in eV
"""[Eiger] Threshold in eV
Note
----
To change settings as well or set threshold without trimbits, use setThresholdEnergy.
:setter: It loads trim files from settingspath.\n [Mythen3] An energy of -1 will pick up values from detector.
:setter: It loads trim files from settingspath.
"""
if self.type == detectorType.MYTHEN3:
return self.getAllThresholdEnergy()
@ -1927,7 +1918,7 @@ class Detector(CppDetectorApi):
@property
@element
def rx_frameindex(self):
"""Current frame index received for each port in receiver during acquisition."""
"""Current frame index received in receiver during acquisition."""
return self.getRxCurrentFrameIndex()
@property
@ -2618,7 +2609,7 @@ class Detector(CppDetectorApi):
-------
>>> d.vetophoton = (2, 24, 2560, '/tmp/bla.txt')
"""
raise NotImplementedError('vetophoton is set only')
raise NotImplementedError('vetofile is set only')
@vetophoton.setter
def vetophoton(self, args):
@ -3098,24 +3089,6 @@ class Detector(CppDetectorApi):
def patmask(self, mask):
ut.set_using_dict(self.setPatternMask, mask)
@property
# @element
def patwait(self):
"""
[Ctb][Moench][Mythen3] Wait address of loop level provided.
Example
-------
>>> d.patwait[0] = 5
>>> d.patwait[0]
5
>>> d.patwait
0: 5
1: 20
2: 30
"""
return PatWaitProxy(self)
@property
@element
def patwait0(self):
@ -3176,23 +3149,6 @@ class Detector(CppDetectorApi):
addr = ut.merge_args(2, addr)
ut.set_using_dict(self.setPatternWaitAddr, *addr)
@property
def patwaittime(self):
"""
[Ctb][Moench][Mythen3] Wait time in clock cycles of loop level provided.
Example
-------
>>> d.patwaittime[0] = 5
>>> d.patwaittime[0]
5
>>> d.patwaittime
0: 5
1: 20
2: 30
"""
return PatWaitTimeProxy(self)
@property
@element
def patwaittime0(self):
@ -3227,23 +3183,6 @@ class Detector(CppDetectorApi):
ut.set_using_dict(self.setPatternWaitTime, *nclk)
@property
def patloop(self):
"""
[Ctb][Moench][Mythen3] Limits (start and stop address) of the loop provided.
Example
-------
>>> d.patloop[0] = [5, 20]
>>> d.patloop[0]
[5, 20]
>>> d.patloop
0: [5, 20]
1: [20, 4]
2: [30, 5]
"""
return PatLoopProxy(self)
@property
@element
def patloop0(self):
@ -3306,24 +3245,6 @@ class Detector(CppDetectorApi):
addr = ut.merge_args(2, addr)
ut.set_using_dict(self.setPatternLoopAddresses, *addr)
@property
def patnloop(self):
"""
[Ctb][Moench][Mythen3] Number of cycles of the loop provided.
Example
-------
>>> d.patnloop[0] = 5
>>> d.patnloop[0]
5
>>> d.patnloop
0: 5
1: 20
2: 30
"""
return PatNLoopProxy(self)
@property
@element
def patnloop0(self):
@ -3569,60 +3490,10 @@ class Detector(CppDetectorApi):
def readout(self):
"""
[Mythen3] Starts detector readout. Status changes to TRANSMITTING and automatically returns to idle at the end of readout.
Mythen3] Starts detector readout. Status changes to TRANSMITTING and automatically returns to idle at the end of readout.
"""
self.startDetectorReadout()
@property
@element
def polarity(self):
"""[Mythen3] Set positive or negative polarity. Enum: polarity"""
return self.getPolarity()
@polarity.setter
def polarity(self, value):
ut.set_using_dict(self.setPolarity, value)
@property
@element
def interpolation(self):
"""[Mythen3] Enable or disable interpolation. interpolation mode enables all counters and disables vth3. Disabling sets back counter mask and vth3. """
return self.getInterpolation()
@interpolation.setter
def interpolation(self, value):
ut.set_using_dict(self.setInterpolation, value)
@property
@element
def pumpprobe(self):
"""[Mythen3] Enable or disable pump probe mode. Pump probe mode only enables vth2. Disabling sets back to previous value """
return self.getPumpProbe()
@pumpprobe.setter
def pumpprobe(self, value):
ut.set_using_dict(self.setPumpProbe, value)
@property
@element
def apulse(self):
"""[Mythen3] Enable or disable analog pulsing. """
return self.getAnalogPulsing()
@apulse.setter
def apulse(self, value):
ut.set_using_dict(self.setAnalogPulsing, value)
@property
@element
def dpulse(self):
"""[Mythen3] Enable or disable digital pulsing. """
return self.getDigitalPulsing()
@dpulse.setter
def dpulse(self, value):
ut.set_using_dict(self.setDigitalPulsing, value)
"""
---------------------------<<<Debug>>>---------------------------

View File

@ -2,24 +2,14 @@
# Copyright (C) 2021 Contributors to the SLS Detector Package
from .utils import element_if_equal
from .enums import dacIndex
from .defines import M3_MAX_PATTERN_LEVELS, MAX_PATTERN_LEVELS
from _slsdet import slsDetectorDefs
def set_proxy_using_dict(func, key, value, unpack = False):
def set_proxy_using_dict(func, key, value):
if isinstance(value, dict) and all(isinstance(k, int) for k in value.keys()):
if unpack:
for dkey, dvalue in value.items():
func(key, *dvalue, [dkey])
else:
for dkey, dvalue in value.items():
func(key, dvalue, [dkey])
for dkey, dvalue in value.items():
func(key, dvalue, [dkey])
else:
if unpack:
func(key, *value)
else:
func(key, value)
func(key, value)
class JsonProxy:
"""
@ -137,118 +127,4 @@ class ClkFreqProxy:
else:
rstr += f'{i}: {r}\n'
return rstr.strip('\n')
class PatLoopProxy:
"""
Proxy class to allow for more intuitive reading patloop
"""
def __init__(self, det):
self.det = det
def __getitem__(self, key):
return element_if_equal(self.det.getPatternLoopAddresses(key))
def __setitem__(self, key, value):
set_proxy_using_dict(self.det.setPatternLoopAddresses, key, value, unpack = True)
def __repr__(self):
max_levels = MAX_PATTERN_LEVELS
if self.det.type == slsDetectorDefs.detectorType.MYTHEN3:
max_levels = M3_MAX_PATTERN_LEVELS
rstr = ''
for i in range(max_levels):
r = self.__getitem__(i)
if isinstance(r[0], list):
part = ' '.join(f'{item}' for item in r)
rstr += f'{i}: {part}\n'
else:
rstr += f'{i}: {r}\n'
return rstr.strip('\n')
class PatNLoopProxy:
"""
Proxy class to allow for more intuitive reading patnloop
"""
def __init__(self, det):
self.det = det
def __getitem__(self, key):
return element_if_equal(self.det.getPatternLoopCycles(key))
def __setitem__(self, key, value):
set_proxy_using_dict(self.det.setPatternLoopCycles, key, value)
def __repr__(self):
max_levels = MAX_PATTERN_LEVELS
if self.det.type == slsDetectorDefs.detectorType.MYTHEN3:
max_levels = M3_MAX_PATTERN_LEVELS
rstr = ''
for i in range(max_levels):
r = element_if_equal(self.__getitem__(i))
if isinstance(r, list):
part = ', '.join(f'{item}' for item in r)
rstr += f'{i}: {part}\n'
else:
rstr += f'{i}: {r}\n'
return rstr.strip('\n')
class PatWaitProxy:
"""
Proxy class to allow for more intuitive reading patwait
"""
def __init__(self, det):
self.det = det
def __getitem__(self, key):
return element_if_equal(self.det.getPatternWaitAddr(key))
def __setitem__(self, key, value):
set_proxy_using_dict(self.det.setPatternWaitAddr, key, value)
def __repr__(self):
max_levels = MAX_PATTERN_LEVELS
if self.det.type == slsDetectorDefs.detectorType.MYTHEN3:
max_levels = M3_MAX_PATTERN_LEVELS
rstr = ''
for i in range(max_levels):
r = element_if_equal(self.__getitem__(i))
if isinstance(r, list):
part = ', '.join(f'{item}' for item in r)
rstr += f'{i}: {part}\n'
else:
rstr += f'{i}: {r}\n'
return rstr.strip('\n')
class PatWaitTimeProxy:
"""
Proxy class to allow for more intuitive reading patwaittime
"""
def __init__(self, det):
self.det = det
def __getitem__(self, key):
return element_if_equal(self.det.getPatternWaitTime(key))
def __setitem__(self, key, value):
set_proxy_using_dict(self.det.setPatternWaitTime, key, value)
def __repr__(self):
max_levels = MAX_PATTERN_LEVELS
if self.det.type == slsDetectorDefs.detectorType.MYTHEN3:
max_levels = M3_MAX_PATTERN_LEVELS
rstr = ''
for i in range(max_levels):
r = element_if_equal(self.__getitem__(i))
if isinstance(r, list):
part = ', '.join(f'{item}' for item in r)
rstr += f'{i}: {part}\n'
else:
rstr += f'{i}: {r}\n'
return rstr.strip('\n')
return rstr.strip('\n')

View File

@ -144,10 +144,6 @@ void init_det(py::module &m) {
(void (Detector::*)(const std::string &, sls::Positions)) &
Detector::loadTrimbits,
py::arg(), py::arg() = Positions{})
.def("saveTrimbits",
(void (Detector::*)(const std::string &, sls::Positions)) &
Detector::saveTrimbits,
py::arg(), py::arg() = Positions{})
.def("getAllTrimbits",
(Result<int>(Detector::*)(sls::Positions) const) &
Detector::getAllTrimbits,
@ -191,12 +187,12 @@ void init_det(py::module &m) {
(void (Detector::*)(void (*)(double, int, void *), void *)) &
Detector::registerAcquisitionFinishedCallback,
py::arg(), py::arg())
.def("registerDataCallback",
(void (Detector::*)(
void (*)(sls::detectorData *, uint64_t, uint32_t, void *),
void *)) &
Detector::registerDataCallback,
py::arg(), py::arg())
.def(
"registerDataCallback",
(void (Detector::*)(
void (*)(detectorData *, uint64_t, uint32_t, void *), void *)) &
Detector::registerDataCallback,
py::arg(), py::arg())
.def("getNumberOfFrames",
(Result<int64_t>(Detector::*)(sls::Positions) const) &
Detector::getNumberOfFrames,
@ -497,17 +493,13 @@ void init_det(py::module &m) {
Detector::getReceiverStatus,
py::arg() = Positions{})
.def("getFramesCaught",
(Result<std::vector<int64_t>>(Detector::*)(sls::Positions) const) &
(Result<int64_t>(Detector::*)(sls::Positions) const) &
Detector::getFramesCaught,
py::arg() = Positions{})
.def("getNumMissingPackets",
(Result<std::vector<int64_t>>(Detector::*)(sls::Positions) const) &
Detector::getNumMissingPackets,
py::arg() = Positions{})
.def("getRxCurrentFrameIndex",
(Result<std::vector<int64_t>>(Detector::*)(sls::Positions) const) &
Detector::getRxCurrentFrameIndex,
py::arg() = Positions{})
.def("getNextFrameNumber",
(Result<uint64_t>(Detector::*)(sls::Positions) const) &
Detector::getNextFrameNumber,
@ -790,15 +782,6 @@ void init_det(py::module &m) {
.def("setRxArping",
(void (Detector::*)(bool, sls::Positions)) & Detector::setRxArping,
py::arg(), py::arg() = Positions{})
.def("getIndividualRxROIs",
(Result<defs::ROI>(Detector::*)(sls::Positions) const) &
Detector::getIndividualRxROIs,
py::arg())
.def("getRxROI", (defs::ROI(Detector::*)() const) & Detector::getRxROI)
.def("setRxROI",
(void (Detector::*)(const defs::ROI)) & Detector::setRxROI,
py::arg())
.def("clearRxROI", (void (Detector::*)()) & Detector::clearRxROI)
.def("getFileFormat",
(Result<defs::fileFormat>(Detector::*)(sls::Positions) const) &
Detector::getFileFormat,
@ -1303,46 +1286,6 @@ void init_det(py::module &m) {
.def("getGainCaps",
(Result<int>(Detector::*)(sls::Positions)) & Detector::getGainCaps,
py::arg() = Positions{})
.def("getPolarity",
(Result<defs::polarity>(Detector::*)(sls::Positions) const) &
Detector::getPolarity,
py::arg() = Positions{})
.def("setPolarity",
(void (Detector::*)(defs::polarity, sls::Positions)) &
Detector::setPolarity,
py::arg(), py::arg() = Positions{})
.def("getInterpolation",
(Result<bool>(Detector::*)(sls::Positions) const) &
Detector::getInterpolation,
py::arg() = Positions{})
.def("setInterpolation",
(void (Detector::*)(bool, sls::Positions)) &
Detector::setInterpolation,
py::arg(), py::arg() = Positions{})
.def("getPumpProbe",
(Result<bool>(Detector::*)(sls::Positions) const) &
Detector::getPumpProbe,
py::arg() = Positions{})
.def("setPumpProbe",
(void (Detector::*)(bool, sls::Positions)) &
Detector::setPumpProbe,
py::arg(), py::arg() = Positions{})
.def("getAnalogPulsing",
(Result<bool>(Detector::*)(sls::Positions) const) &
Detector::getAnalogPulsing,
py::arg() = Positions{})
.def("setAnalogPulsing",
(void (Detector::*)(bool, sls::Positions)) &
Detector::setAnalogPulsing,
py::arg(), py::arg() = Positions{})
.def("getDigitalPulsing",
(Result<bool>(Detector::*)(sls::Positions) const) &
Detector::getDigitalPulsing,
py::arg() = Positions{})
.def("setDigitalPulsing",
(void (Detector::*)(bool, sls::Positions)) &
Detector::setDigitalPulsing,
py::arg(), py::arg() = Positions{})
.def("getNumberOfAnalogSamples",
(Result<int>(Detector::*)(sls::Positions) const) &
Detector::getNumberOfAnalogSamples,
@ -1480,19 +1423,6 @@ void init_det(py::module &m) {
(void (Detector::*)(bool, sls::Positions)) &
Detector::setLEDEnable,
py::arg(), py::arg() = Positions{})
.def("setDacNames",
(void (Detector::*)(const std::vector<std::string>)) &
Detector::setDacNames,
py::arg())
.def("getDacNames", (std::vector<std::string>(Detector::*)() const) &
Detector::getDacNames)
.def("getDacIndex",
(defs::dacIndex(Detector::*)(const std::string &)) &
Detector::getDacIndex,
py::arg())
.def("getDacName",
(std::string(Detector::*)(defs::dacIndex)) & Detector::getDacName,
py::arg())
.def("setPattern",
(void (Detector::*)(const std::string &, sls::Positions)) &
Detector::setPattern,
@ -1597,13 +1527,17 @@ void init_det(py::module &m) {
Detector::setAdditionalJsonParameter,
py::arg(), py::arg(), py::arg() = Positions{})
.def("programFPGA",
(void (Detector::*)(const std::string &, const bool,
sls::Positions)) &
(void (Detector::*)(const std::string &, sls::Positions)) &
Detector::programFPGA,
py::arg(), py::arg(), py::arg() = Positions{})
py::arg(), py::arg() = Positions{})
.def("resetFPGA",
(void (Detector::*)(sls::Positions)) & Detector::resetFPGA,
py::arg() = Positions{})
.def("copyDetectorServer",
(void (Detector::*)(const std::string &, const std::string &,
sls::Positions)) &
Detector::copyDetectorServer,
py::arg(), py::arg(), py::arg() = Positions{})
.def("updateDetectorServer",
(void (Detector::*)(const std::string &, sls::Positions)) &
Detector::updateDetectorServer,
@ -1615,6 +1549,11 @@ void init_det(py::module &m) {
.def("rebootController",
(void (Detector::*)(sls::Positions)) & Detector::rebootController,
py::arg() = Positions{})
.def("updateFirmwareAndServer",
(void (Detector::*)(const std::string &, const std::string &,
const std::string &, sls::Positions)) &
Detector::updateFirmwareAndServer,
py::arg(), py::arg(), py::arg(), py::arg() = Positions{})
.def("updateFirmwareAndServer",
(void (Detector::*)(const std::string &, const std::string &,
sls::Positions)) &
@ -1717,5 +1656,9 @@ void init_det(py::module &m) {
Detector::getMeasurementTime,
py::arg() = Positions{})
.def("getUserDetails",
(std::string(Detector::*)() const) & Detector::getUserDetails);
(std::string(Detector::*)() const) & Detector::getUserDetails)
.def("getRxCurrentFrameIndex",
(Result<uint64_t>(Detector::*)(sls::Positions) const) &
Detector::getRxCurrentFrameIndex,
py::arg() = Positions{});
}

View File

@ -315,9 +315,4 @@ void init_enums(py::module &m) {
.value("FIX_G2", slsDetectorDefs::gainMode::FIX_G2)
.value("FIX_G0", slsDetectorDefs::gainMode::FIX_G0)
.export_values();
py::enum_<slsDetectorDefs::polarity>(Defs, "polarity")
.value("POSITIVE", slsDetectorDefs::polarity::POSITIVE)
.value("NEGATIVE", slsDetectorDefs::polarity::NEGATIVE)
.export_values();
}

View File

@ -14,7 +14,7 @@ void init_pattern(py::module &m) {
using pat = sls::patternParameters;
py::class_<pat> patternParameters(m, "patternParameters");
PYBIND11_NUMPY_DTYPE(pat, word, ioctrl, limits, startloop, stoploop, nloop, wait,
PYBIND11_NUMPY_DTYPE(pat, word, ioctrl, limits, loop, nloop, wait,
waittime);
patternParameters.def(py::init());

View File

@ -56,8 +56,7 @@ foreach(exe ${MOENCH_EXECUTABLES})
../dataStructures
../interpolations
../../slsReceiverSoftware/include/
../../slsSupportLib/include/
${SLS_INTERNAL_RAPIDJSON_DIR}
../../slsSupportLib/include/
)
target_link_libraries(${exe}

View File

@ -429,28 +429,23 @@ class singlePhotonDetector : public analogDetector<uint16_t> {
for (ic = -(clusterSize / 2); ic < (clusterSize / 2) + 1;
ic++) {
if ((iy + ir) >= 0 && (iy + ir) < ny &&
(ix + ic) >= 0 && (ix + ic) < nx) {
if ((iy + ir) >= iy && (ix + ic) >= ix ) {
if ((iy + ir) >= iy && (iy + ir) < ny &&
(ix + ic) >= ix && (ix + ic) < nx) {
val[(iy + ir) * nx + ix + ic] =
subtractPedestal(data, ix + ic, iy + ir, cm);
}
v = &(val[(iy + ir) * nx + ix + ic]);
tot += *v;
if (ir <= 0 && ic <= 0)
bl += *v;
if (ir <= 0 && ic >= 0)
br += *v;
if (ir >= 0 && ic <= 0)
tl += *v;
if (ir >= 0 && ic >= 0)
tr += *v;
if (*v > max) //{
max = *v;
//}
v = &(val[(iy + ir) * nx + ix + ic]);
tot += *v;
if (ir <= 0 && ic <= 0)
bl += *v;
if (ir <= 0 && ic >= 0)
br += *v;
if (ir >= 0 && ic <= 0)
tl += *v;
if (ir >= 0 && ic >= 0)
tr += *v;
if (*v > max) {
max = *v;
}
}
}
}
@ -518,19 +513,12 @@ class singlePhotonDetector : public analogDetector<uint16_t> {
for (ic = -(clusterSize / 2);
ic < (clusterSize / 2) + 1; ic++) {
if ((iy + ir) >= 0 && (iy + ir) < ny &&
(ix + ic) >= 0 && (ix + ic) < nx) {
(clusters + nph)
(ix + ic) >= 0 && (ix + ic) < nx)
(clusters + nph)
->set_data(val[(iy + ir) * nx + ix + ic],
ic, ir);
if (val[(iy + ir) * nx + ix + ic]>max)
good=0;
}
}
}
if (good==0) {
(clusters + nph)->print();
cout << max << " " << val[iy * nx + ix] << endl;
}
good = 1;
if (eMin > 0 && tot < eMin)
good = 0;

View File

@ -216,18 +216,14 @@ class single_photon_hit {
// int ix, iy;
printf("***************\n");
printf("** %d %d **\n",x,y);
for (int iy = 0; iy < dy; iy++) {
for (int ix = 0; ix < dx; ix++) {
printf("%d \t", data[ix + iy * dx]);
}
printf("\n");
}
printf("***************\n");
}
/**
assign the value to the element of the cluster matrix, with relative
coordinates where the center of the cluster is (0,0) \param v value to be

View File

@ -235,7 +235,6 @@
</property>
<addaction name="actionLoadConfiguration"/>
<addaction name="actionLoadTrimbits"/>
<addaction name="actionSaveTrimbits"/>
<addaction name="actionLoadParameters"/>
</widget>
<widget class="QMenu" name="menuModes">
@ -420,11 +419,6 @@ p, li { white-space: pre-wrap; }
<string>&amp;About</string>
</property>
</action>
<action name="actionSaveTrimbits">
<property name="text">
<string>Save Trimbits</string>
</property>
</action>
</widget>
<resources>
<include location="../include/icons.qrc"/>

View File

@ -20,105 +20,7 @@
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="5">
<widget class="QLabel" name="lblRxRoiEnabled">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>120</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>139</red>
<green>142</green>
<blue>142</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>Rx Roi Enabled</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="0" colspan="7">
<widget class="QGroupBox" name="boxPlot">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<family>Sans Serif</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="title">
<string>Sample Plot</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="flat">
<bool>true</bool>
</property>
<layout class="QGridLayout" name="plotLayout">
<property name="margin">
<number>9</number>
</property>
<property name="spacing">
<number>0</number>
</property>
</layout>
</widget>
</item>
<item row="2" column="0" colspan="7">
<item row="2" column="0" colspan="4">
<widget class="QWidget" name="widgetStatistics" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@ -310,69 +212,37 @@
</property>
</spacer>
</item>
<item row="1" column="1">
<widget class="QLabel" name="lblCompleteImage">
<item row="0" column="0" colspan="4">
<widget class="QGroupBox" name="boxPlot">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>120</width>
<height>0</height>
</size>
<property name="font">
<font>
<family>Sans Serif</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>150</green>
<blue>110</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>150</green>
<blue>110</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>139</red>
<green>142</green>
<blue>142</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>Complete Image</string>
<property name="title">
<string>Sample Plot</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="flat">
<bool>true</bool>
</property>
<layout class="QGridLayout" name="plotLayout">
<property name="margin">
<number>9</number>
</property>
<property name="spacing">
<number>0</number>
</property>
</layout>
</widget>
</item>
<item row="1" column="2">
@ -385,7 +255,7 @@
</property>
<property name="minimumSize">
<size>
<width>110</width>
<width>40</width>
<height>0</height>
</size>
</property>
@ -440,6 +310,71 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="lblCompleteImage">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>40</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>150</green>
<blue>110</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>150</green>
<blue>110</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>139</red>
<green>142</green>
<blue>142</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="text">
<string>Complete Image</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>

View File

@ -32,29 +32,17 @@
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="0" colspan="3">
<widget class="QTabWidget" name="tabWidget">
<item row="0" column="0">
<widget class="QLabel" name="lblReadout">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>5</horstretch>
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="currentIndex">
<number>1</number>
<property name="text">
<string>Readout: </string>
</property>
<widget class="QWidget" name="tabDAC">
<attribute name="title">
<string>DACs</string>
</attribute>
<layout class="QGridLayout" name="gridlayoutDac"/>
</widget>
<widget class="QWidget" name="tabADC">
<attribute name="title">
<string>ADCs</string>
</attribute>
<layout class="QGridLayout" name="gridlayoutAdc"/>
</widget>
</widget>
</item>
<item row="0" column="1">
@ -89,17 +77,143 @@
</property>
</spacer>
</item>
<item row="0" column="0">
<widget class="QLabel" name="lblReadout">
<item row="1" column="0">
<widget class="QLabel" name="lblComboHV">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Readout: </string>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;High Voltage&lt;/p&gt;&lt;p&gt; #highvoltage#&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>High Voltage: </string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboHV">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>28</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;High Voltage&lt;/p&gt;&lt;p&gt; #highvoltage#&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<item>
<property name="text">
<string>0</string>
</property>
</item>
<item>
<property name="text">
<string>90</string>
</property>
</item>
<item>
<property name="text">
<string>110</string>
</property>
</item>
<item>
<property name="text">
<string>120</string>
</property>
</item>
<item>
<property name="text">
<string>150</string>
</property>
</item>
<item>
<property name="text">
<string>180</string>
</property>
</item>
<item>
<property name="text">
<string>200</string>
</property>
</item>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="lblSpinHV">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;High Voltage. Range: 60 - 200V. Swich off high voltage by setting to 0.&lt;/p&gt;&lt;p&gt;-1 corresponds to different values from detectors.&lt;/p&gt;&lt;p&gt;#highvoltage#&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>High Voltage: </string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QSpinBox" name="spinHV">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>28</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;High Voltage. Range: 60 - 200V. Swich off high voltage by setting to 0.&lt;/p&gt;&lt;p&gt;-1 corresponds to different values from detectors.&lt;/p&gt;&lt;p&gt;#highvoltage#&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="minimum">
<number>-1</number>
</property>
<property name="maximum">
<number>200</number>
</property>
</widget>
</item>
<item row="3" column="0" colspan="3">
<widget class="QTabWidget" name="tabWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>5</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="currentIndex">
<number>1</number>
</property>
<widget class="QWidget" name="tabDAC">
<attribute name="title">
<string>DACs</string>
</attribute>
<layout class="QGridLayout" name="gridlayoutDac"/>
</widget>
<widget class="QWidget" name="tabADC">
<attribute name="title">
<string>ADCs</string>
</attribute>
<layout class="QGridLayout" name="gridlayoutAdc"/>
</widget>
</widget>
</item>
</layout>

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>775</width>
<height>400</height>
<height>380</height>
</rect>
</property>
<property name="sizePolicy">
@ -32,99 +32,26 @@
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="2" colspan="5">
<widget class="QComboBox" name="comboHV">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>140</width>
<height>28</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;High Voltage&lt;/p&gt;&lt;p&gt; #highvoltage#&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<item>
<property name="text">
<string>0</string>
</property>
</item>
<item>
<property name="text">
<string>90</string>
</property>
</item>
<item>
<property name="text">
<string>110</string>
</property>
</item>
<item>
<property name="text">
<string>120</string>
</property>
</item>
<item>
<property name="text">
<string>150</string>
</property>
</item>
<item>
<property name="text">
<string>180</string>
</property>
</item>
<item>
<property name="text">
<string>200</string>
</property>
</item>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="lblComboHV">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;High Voltage&lt;/p&gt;&lt;p&gt; #highvoltage#&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>High Voltage: </string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="lblThreshold">
<item row="4" column="3">
<widget class="QCheckBox" name="chkCounter2">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>110</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>110</width>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Threshold:</string>
<string>2</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="6" column="4">
<item row="4" column="4">
<widget class="QCheckBox" name="chkCounter3">
<property name="enabled">
<bool>false</bool>
@ -143,23 +70,238 @@
</property>
</widget>
</item>
<item row="4" column="14">
<spacer name="horizontalSpacer_2">
<item row="3" column="2" colspan="3">
<widget class="QComboBox" name="comboDynamicRange">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>140</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>140</width>
<height>16777215</height>
</size>
</property>
<item>
<property name="text">
<string>1.67772e+07</string>
</property>
</item>
<item>
<property name="text">
<string>65535</string>
</property>
</item>
<item>
<property name="text">
<string>4095</string>
</property>
</item>
<item>
<property name="text">
<string>255</string>
</property>
</item>
<item>
<property name="text">
<string>7</string>
</property>
</item>
</widget>
</item>
<item row="2" column="2" colspan="3">
<widget class="QSpinBox" name="spinThreshold">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>140</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>140</width>
<height>16777215</height>
</size>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="suffix">
<string> eV</string>
</property>
<property name="minimum">
<number>-100000</number>
</property>
<property name="maximum">
<number>100000</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
<property name="value">
<number>-1</number>
</property>
</widget>
</item>
<item row="2" column="6">
<widget class="QSpinBox" name="spinThreshold3">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>140</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>140</width>
<height>16777215</height>
</size>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="suffix">
<string> eV</string>
</property>
<property name="minimum">
<number>-100000</number>
</property>
<property name="maximum">
<number>100000</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
<property name="value">
<number>-1</number>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="lblDynamicRange">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>110</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>110</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Dynamic Range:</string>
</property>
</widget>
</item>
<item row="5" column="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
<height>190</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0">
<item row="2" column="8">
<widget class="QPushButton" name="btnSetThreshold">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>30</height>
</size>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>20</red>
<green>20</green>
<blue>20</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>20</red>
<green>20</green>
<blue>20</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>20</red>
<green>20</green>
<blue>20</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="focusPolicy">
<enum>Qt::TabFocus</enum>
</property>
<property name="text">
<string>Set</string>
</property>
<property name="icon">
<iconset resource="../include/icons.qrc">
<normaloff>:/icons/images/rightArrow.png</normaloff>:/icons/images/rightArrow.png</iconset>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="lblSettings">
<property name="enabled">
<bool>true</bool>
@ -181,7 +323,120 @@
</property>
</widget>
</item>
<item row="6" column="2">
<item row="0" column="1">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0">
<widget class="QLabel" name="lblThreshold">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>110</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>110</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Threshold:</string>
</property>
</widget>
</item>
<item row="2" column="5">
<widget class="QSpinBox" name="spinThreshold2">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>140</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>140</width>
<height>16777215</height>
</size>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="suffix">
<string> eV</string>
</property>
<property name="minimum">
<number>-100000</number>
</property>
<property name="maximum">
<number>100000</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
<property name="value">
<number>-1</number>
</property>
</widget>
</item>
<item row="2" column="9">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="0">
<widget class="QLabel" name="lblCounter">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>110</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>110</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Counters:</string>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QCheckBox" name="chkCounter1">
<property name="enabled">
<bool>false</bool>
@ -200,7 +455,7 @@
</property>
</widget>
</item>
<item row="2" column="2" colspan="9">
<item row="0" column="2" colspan="3">
<widget class="QComboBox" name="comboSettings">
<property name="enabled">
<bool>true</bool>
@ -214,7 +469,7 @@
<property name="minimumSize">
<size>
<width>140</width>
<height>28</height>
<height>25</height>
</size>
</property>
<property name="maximumSize">
@ -339,269 +594,7 @@
</item>
</widget>
</item>
<item row="4" column="11">
<widget class="QSpinBox" name="spinThreshold2">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>140</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>140</width>
<height>16777215</height>
</size>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="suffix">
<string> eV</string>
</property>
<property name="minimum">
<number>-100000</number>
</property>
<property name="maximum">
<number>100000</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
<property name="value">
<number>-1</number>
</property>
</widget>
</item>
<item row="4" column="13">
<widget class="QPushButton" name="btnSetThreshold">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>30</height>
</size>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>20</red>
<green>20</green>
<blue>20</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>20</red>
<green>20</green>
<blue>20</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>20</red>
<green>20</green>
<blue>20</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="focusPolicy">
<enum>Qt::TabFocus</enum>
</property>
<property name="text">
<string>Set</string>
</property>
<property name="icon">
<iconset resource="../include/icons.qrc">
<normaloff>:/icons/images/rightArrow.png</normaloff>:/icons/images/rightArrow.png</iconset>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
</item>
<item row="2" column="1">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="12">
<widget class="QSpinBox" name="spinThreshold3">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>140</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>140</width>
<height>16777215</height>
</size>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="suffix">
<string> eV</string>
</property>
<property name="minimum">
<number>-100000</number>
</property>
<property name="maximum">
<number>100000</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
<property name="value">
<number>-1</number>
</property>
</widget>
</item>
<item row="7" column="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>190</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="2" colspan="9">
<widget class="QSpinBox" name="spinThreshold">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>140</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>140</width>
<height>16777215</height>
</size>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="suffix">
<string> eV</string>
</property>
<property name="minimum">
<number>-100000</number>
</property>
<property name="maximum">
<number>100000</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
<property name="value">
<number>-1</number>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="lblCounter">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>110</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>110</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Counters:</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="lblDynamicRange">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>110</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>110</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Dynamic Range:</string>
</property>
</widget>
</item>
<item row="3" column="0">
<item row="1" column="0">
<widget class="QLabel" name="lblGainMode">
<property name="enabled">
<bool>false</bool>
@ -623,70 +616,7 @@
</property>
</widget>
</item>
<item row="5" column="2" colspan="9">
<widget class="QComboBox" name="comboDynamicRange">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>140</width>
<height>28</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>140</width>
<height>16777215</height>
</size>
</property>
<item>
<property name="text">
<string>1.67772e+07</string>
</property>
</item>
<item>
<property name="text">
<string>65535</string>
</property>
</item>
<item>
<property name="text">
<string>4095</string>
</property>
</item>
<item>
<property name="text">
<string>255</string>
</property>
</item>
<item>
<property name="text">
<string>7</string>
</property>
</item>
</widget>
</item>
<item row="6" column="3">
<widget class="QCheckBox" name="chkCounter2">
<property name="enabled">
<bool>false</bool>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>2</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="2" colspan="9">
<item row="1" column="2">
<widget class="QComboBox" name="comboGainMode">
<property name="enabled">
<bool>false</bool>
@ -700,7 +630,7 @@
<property name="minimumSize">
<size>
<width>140</width>
<height>28</height>
<height>25</height>
</size>
</property>
<property name="maximumSize">
@ -744,50 +674,6 @@
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="lblSpinHV">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;High Voltage. Range: 60 - 200V. Swich off high voltage by setting to 0.&lt;/p&gt;&lt;p&gt;-1 corresponds to different values from detectors.&lt;/p&gt;&lt;p&gt;#highvoltage#&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>High Voltage: </string>
</property>
</widget>
</item>
<item row="1" column="2" colspan="5">
<widget class="QSpinBox" name="spinHV">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>140</width>
<height>28</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;High Voltage. Range: 60 - 200V. Swich off high voltage by setting to 0.&lt;/p&gt;&lt;p&gt;-1 corresponds to different values from detectors.&lt;/p&gt;&lt;p&gt;#highvoltage#&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="minimum">
<number>-1</number>
</property>
<property name="maximum">
<number>200</number>
</property>
</widget>
</item>
</layout>
</widget>
<tabstops>

View File

@ -5,8 +5,6 @@
#include <QMainWindow>
#include <QString>
namespace sls {
class SlsQtH1D;
class SlsQt1DPlot;
class SlsQt2DPlot;
@ -45,5 +43,3 @@ class qCloneWidget : public QMainWindow, private Ui::ClonePlotObject {
static int NumClones;
};
} // namespace sls

View File

@ -6,13 +6,11 @@
#include "ui_form_dac.h"
#include <string>
namespace sls {
class qDacWidget : public QWidget, private Ui::WidgetDacObject {
Q_OBJECT
public:
qDacWidget(QWidget *parent, Detector *detector, bool d, std::string n,
qDacWidget(QWidget *parent, sls::Detector *detector, bool d, std::string n,
slsDetectorDefs::dacIndex i);
~qDacWidget();
void SetDetectorIndex(int id);
@ -27,10 +25,8 @@ class qDacWidget : public QWidget, private Ui::WidgetDacObject {
void GetAdc();
void Refresh();
Detector *det;
sls::Detector *det;
bool isDac{true};
slsDetectorDefs::dacIndex index;
int detectorIndex{-1};
};
} // namespace sls

View File

@ -14,8 +14,6 @@
#include <ostream>
#include <string>
namespace sls {
using std::chrono::duration;
using std::chrono::duration_cast;
using std::chrono::hours;
@ -49,9 +47,9 @@ class qDefs : public QWidget {
static void DisplayExceptions(std::string emsg, std::string src) {
try {
throw;
} catch (const SocketError &e) {
} catch (const sls::SocketError &e) {
throw;
} catch (const SharedMemoryError &e) {
} catch (const sls::SharedMemoryError &e) {
throw;
} catch (const std::exception &e) {
ExceptionMessage(emsg, e.what(), src);
@ -65,9 +63,9 @@ class qDefs : public QWidget {
typename NonDeduced<CT>::type... Args) {
try {
throw;
} catch (const SocketError &e) {
} catch (const sls::SocketError &e) {
throw;
} catch (const SharedMemoryError &e) {
} catch (const sls::SharedMemoryError &e) {
throw;
} catch (const std::exception &e) {
ExceptionMessage(emsg, e.what(), src);
@ -331,5 +329,3 @@ class qDefs : public QWidget {
source);
}
};
} // namespace sls

View File

@ -6,11 +6,6 @@
#include "ui_form_detectormain.h"
#include <QTabWidget>
class QScrollArea;
class QResizeEvent;
namespace sls {
class qDrawPlot;
class qTabMeasurement;
class qTabDataOutput;
@ -20,6 +15,8 @@ class qTabSettings;
class qTabDebugging;
class qTabDeveloper;
class qTabMessages;
class QScrollArea;
class QResizeEvent;
/** To Over-ride the QTabWidget class to get the tabBar protected
* methodTabWidget */
@ -73,7 +70,7 @@ class qDetectorMain : public QMainWindow, private Ui::DetectorMainObject {
NumberOfTabs
};
slsDetectorDefs::detectorType detType;
std::unique_ptr<Detector> det;
std::unique_ptr<sls::Detector> det;
qDrawPlot *plot;
MyTabWidget *tabs;
QScrollArea *scroll[NumberOfTabs];
@ -91,5 +88,3 @@ class qDetectorMain : public QMainWindow, private Ui::DetectorMainObject {
QString zoomToolTip;
QColor defaultTabColor;
};
} // namespace sls

View File

@ -6,21 +6,18 @@
#include "ui_form_plot.h"
#include <mutex>
class QResizeEvent;
namespace sls {
class SlsQt1DPlot;
class SlsQtH1D;
class SlsQt2DPlot;
class qCloneWidget;
class detectorData;
class QResizeEvent;
class qDrawPlot : public QWidget, private Ui::PlotObject {
Q_OBJECT
public:
qDrawPlot(QWidget *parent, Detector *detector);
qDrawPlot(QWidget *parent, sls::Detector *detector);
~qDrawPlot();
bool GetIsRunning();
void SetRunning(bool enable);
@ -58,7 +55,6 @@ class qDrawPlot : public QWidget, private Ui::PlotObject {
void EnableGainPlot(bool enable);
void ClonePlot();
void SavePlot();
void SetGapPixels(bool enable);
protected:
void resizeEvent(QResizeEvent *event);
@ -95,11 +91,9 @@ class qDrawPlot : public QWidget, private Ui::PlotObject {
void Update2dPlot();
void Update1dXYRange();
void Update2dXYRange();
void rearrangeGotthard25data(double *data);
static const int NUM_PEDESTAL_FRAMES = 20;
static const int NUM_GOTTHARD25_CHANS = 1280;
Detector *det;
sls::Detector *det;
slsDetectorDefs::detectorType detType;
SlsQt1DPlot *plot1d{nullptr};
@ -164,16 +158,10 @@ class qDrawPlot : public QWidget, private Ui::PlotObject {
int64_t currentFrame{0};
mutable std::mutex mPlots;
int64_t currentAcqIndex{0};
slsDetectorDefs::ROI rxRoi{};
bool isRxRoiDisplayed{false};
bool isGapPixels{false};
unsigned int nPixelsX{0};
unsigned int nPixelsY{0};
uint32_t pixelMask{0};
uint32_t gainMask{0};
int gainOffset{0};
bool gotthard25;
};
} // namespace sls

View File

@ -4,15 +4,13 @@
#include "sls/Detector.h"
#include "ui_form_tab_advanced.h"
namespace sls {
class qDrawPlot;
class qTabAdvanced : public QWidget, private Ui::TabAdvancedObject {
Q_OBJECT
public:
qTabAdvanced(QWidget *parent, Detector *detector, qDrawPlot *p);
qTabAdvanced(QWidget *parent, sls::Detector *detector, qDrawPlot *p);
~qTabAdvanced();
public slots:
@ -76,8 +74,6 @@ class qTabAdvanced : public QWidget, private Ui::TabAdvancedObject {
void GetExposureTime();
void GetGateDelay();
Detector *det;
sls::Detector *det;
qDrawPlot *plot;
};
} // namespace sls

View File

@ -4,13 +4,11 @@
#include "sls/Detector.h"
#include "ui_form_tab_dataoutput.h"
namespace sls {
class qTabDataOutput : public QWidget, private Ui::TabDataOutputObject {
Q_OBJECT
public:
qTabDataOutput(QWidget *parent, Detector *detector);
qTabDataOutput(QWidget *parent, sls::Detector *detector);
~qTabDataOutput();
void Refresh();
@ -41,9 +39,7 @@ class qTabDataOutput : public QWidget, private Ui::TabDataOutputObject {
void GetSpeed();
void GetParallel();
Detector *det;
sls::Detector *det;
// Button group for radiobuttons for rate
QButtonGroup *btnGroupRate;
};
} // namespace sls

View File

@ -7,13 +7,11 @@
class QTreeWidget;
class QTreeWidgetItem;
namespace sls {
class qTabDebugging : public QWidget, private Ui::TabDebuggingObject {
Q_OBJECT
public:
qTabDebugging(QWidget *parent, Detector *detector);
qTabDebugging(QWidget *parent, sls::Detector *detector);
~qTabDebugging();
void Refresh();
@ -28,12 +26,10 @@ class qTabDebugging : public QWidget, private Ui::TabDebuggingObject {
void Initialization();
void PopulateDetectors();
Detector *det;
sls::Detector *det;
/** Tree Widget displaying the detectors, modules */
QTreeWidget *treeDet;
QLabel *lblDetectorHostname;
QLabel *lblDetectorFirmware;
QLabel *lblDetectorSoftware;
};
} // namespace sls

View File

@ -6,30 +6,35 @@
#include "ui_form_tab_developer.h"
#include <vector>
namespace sls {
class qDacWidget;
class qTabDeveloper : public QWidget, private Ui::TabDeveloperObject {
Q_OBJECT
public:
qTabDeveloper(QWidget *parent, Detector *detector);
qTabDeveloper(QWidget *parent, sls::Detector *detector);
~qTabDeveloper();
public slots:
void Refresh();
private slots:
void SetHighVoltage();
private:
void SetupWidgetWindow();
void Initialization();
void PopulateDetectors();
void GetHighVoltage();
slsDetectorDefs::dacIndex getSLSIndex(slsDetectorDefs::detectorType detType,
int index);
Detector *det;
sls::Detector *det;
std::vector<qDacWidget *> dacWidgets;
std::vector<qDacWidget *> adcWidgets;
};
} // namespace sls
enum hvVals { HV_0, HV_90, HV_110, HV_120, HV_150, HV_180, HV_200 };
int hvmin;
static const int HV_MIN = 60;
static const int HV_MAX = 200;
};

View File

@ -4,17 +4,14 @@
#include "sls/Detector.h"
#include "ui_form_tab_measurement.h"
class QStandardItemModel;
namespace sls {
class qDrawPlot;
class QStandardItemModel;
class qTabMeasurement : public QWidget, private Ui::TabMeasurementObject {
Q_OBJECT
public:
qTabMeasurement(QWidget *parent, Detector *detector, qDrawPlot *p);
qTabMeasurement(QWidget *parent, sls::Detector *detector, qDrawPlot *p);
~qTabMeasurement();
void Refresh();
@ -84,7 +81,7 @@ class qTabMeasurement : public QWidget, private Ui::TabMeasurementObject {
void FileNameChangedSignal(QString);
private:
Detector *det;
sls::Detector *det;
qDrawPlot *plot;
// enum for the timing mode
enum { AUTO, TRIGGER, GATED, BURST_TRIGGER, TRIGGER_GATED, NUMTIMINGMODES };
@ -101,5 +98,3 @@ class qTabMeasurement : public QWidget, private Ui::TabMeasurementObject {
int numMeasurements{1};
int currentMeasurement{0};
};
} // namespace sls

View File

@ -6,8 +6,6 @@
class QProcess;
class QKeyEvent;
namespace sls {
class qTabMessages : public QWidget, private Ui::TabMessagesObject {
Q_OBJECT
@ -36,5 +34,3 @@ class qTabMessages : public QWidget, private Ui::TabMessagesObject {
QProcess *process;
QStringList lastCommand;
};
} // namespace sls

View File

@ -4,15 +4,13 @@
#include "sls/Detector.h"
#include "ui_form_tab_plot.h"
namespace sls {
class qDrawPlot;
class qTabPlot : public QWidget, private Ui::TabPlotObject {
Q_OBJECT
public:
qTabPlot(QWidget *parent, Detector *detector, qDrawPlot *p);
qTabPlot(QWidget *parent, sls::Detector *detector, qDrawPlot *p);
~qTabPlot();
void SetScanArgument();
void Refresh();
@ -55,7 +53,7 @@ class qTabPlot : public QWidget, private Ui::TabPlotObject {
void SetXYRange();
void MaintainAspectRatio(int dimension);
Detector *det;
sls::Detector *det;
qDrawPlot *plot;
bool is1d;
@ -67,5 +65,3 @@ class qTabPlot : public QWidget, private Ui::TabPlotObject {
static QString defaultImageYAxisTitle;
static QString defaultImageZAxisTitle;
};
} // namespace sls

View File

@ -5,20 +5,17 @@
#include "ui_form_tab_settings.h"
#include <QCheckBox>
namespace sls {
class qTabSettings : public QWidget, private Ui::TabSettingsObject {
Q_OBJECT
public:
qTabSettings(QWidget *parent, Detector *detector);
qTabSettings(QWidget *parent, sls::Detector *detector);
~qTabSettings();
void Refresh();
public slots:
void SetExportMode(bool exportMode);
private slots:
void SetHighVoltage();
void SetSettings(int index);
void SetGainMode(int index);
void SetDynamicRange(int index);
@ -33,7 +30,6 @@ class qTabSettings : public QWidget, private Ui::TabSettingsObject {
void ShowFixG0(bool expertMode);
void Initialization();
void GetHighVoltage();
void GetSettings();
void GetGainMode();
void GetDynamicRange();
@ -41,15 +37,9 @@ class qTabSettings : public QWidget, private Ui::TabSettingsObject {
void GetThresholdEnergies();
void GetCounterMask();
Detector *det;
sls::Detector *det;
std::vector<QCheckBox *> counters;
enum hvVals { HV_0, HV_90, HV_110, HV_120, HV_150, HV_180, HV_200 };
int hvmin;
static const int HV_MIN = 60;
static const int HV_MAX = 200;
enum {
STANDARD,
FAST,
@ -87,5 +77,3 @@ class qTabSettings : public QWidget, private Ui::TabSettingsObject {
DYNAMICRANGE_4
};
};
} // namespace sls

View File

@ -9,14 +9,10 @@
#include <qwt_plot_curve.h>
#include <qwt_plot_marker.h>
#include <qwt_scale_div.h>
#include <qwt_plot_shapeitem.h>
class QPen;
class QwtSymbol;
namespace sls {
class SlsQt1DPlot;
class QwtSymbol;
class SlsQtH1D : public QwtPlotCurve {
@ -140,9 +136,6 @@ class SlsQt1DPlot : public QwtPlot {
void SetLogX(bool yes = 1);
void SetLogY(bool yes = 1);
void EnableRoiBox(std::array<int, 4> roi);
void DisableRoiBox();
private:
SlsQtH1DList *hist_list{nullptr};
SlsQt1DZoomer *zoomer{nullptr};
@ -166,15 +159,9 @@ class SlsQt1DPlot : public QwtPlot {
friend void SlsQtH1D::Attach(SlsQt1DPlot *p);
friend void SlsQtH1D::Detach(SlsQt1DPlot *p);
QwtPlotShapeItem *roiBox{nullptr};
public slots:
void UnZoom();
void Update();
};
} // namespace sls
#endif

View File

@ -8,8 +8,6 @@
#include <qwt_plot_panner.h>
#include <qwt_plot_zoomer.h>
namespace sls {
class SlsQtH1D;
class SlsQt1DZoomer : public QwtPlotZoomer {
@ -53,6 +51,4 @@ class SlsQt1DZoomer : public QwtPlotZoomer {
}
};
} // namespace sls
#endif

View File

@ -9,8 +9,6 @@
#include <qwt_scale_draw.h>
#include <qwt_scale_widget.h>
namespace sls {
class SlsQt2DHist : public QwtRasterData {
private:
@ -127,6 +125,4 @@ class SlsQt2DHist : public QwtRasterData {
}
};
} // namespace sls
#endif

View File

@ -6,14 +6,11 @@
#include <qlist.h>
#include <qwt_plot.h>
#include <qwt_plot_spectrogram.h>
#include <qwt_plot_shapeitem.h>
class QwtPlotPanner;
class QwtScaleWidget;
class QwtLinearColorMap;
namespace sls {
class SlsQt2DPlot : public QwtPlot {
Q_OBJECT
@ -70,8 +67,6 @@ class SlsQt2DPlot : public QwtPlot {
void SetLogz(bool enable, bool isMin, bool isMax, double min, double max);
void SetZRange(bool isMin, bool isMax, double min, double max);
void LogZ(bool on = 1);
void EnableRoiBox(std::array<int, 4> roi);
void DisableRoiBox();
public slots:
void showSpectrogram(bool on);
@ -91,7 +86,4 @@ class SlsQt2DPlot : public QwtPlot {
QList<double> contourLevelsLog;
bool disableZoom{false};
int isLog;
QwtPlotShapeItem *roiBox{nullptr};
};
} // namespace sls

View File

@ -7,8 +7,6 @@
#include <qwt_plot_panner.h>
#include <qwt_plot_zoomer.h>
namespace sls {
class SlsQt2DZoomer : public QwtPlotZoomer {
private:
SlsQt2DHist *hist;
@ -42,6 +40,4 @@ class SlsQt2DZoomer : public QwtPlotZoomer {
}
};
} // namespace sls
#endif

View File

@ -15,10 +15,6 @@
#include <qwt_symbol.h>
#include <stdlib.h>
#include <array>
namespace sls {
#define QwtLog10ScaleEngine QwtLogScaleEngine // hmm
SlsQtH1D::SlsQtH1D(QString title, int n, double min, double max, double *data)
@ -446,28 +442,6 @@ void SlsQt1DPlot::SetLog(int axisId, bool yes) {
Update();
}
void SlsQt1DPlot::EnableRoiBox(std::array<int, 4> roi) {
if (roiBox == nullptr) {
roiBox = new QwtPlotShapeItem();
roiBox->attach(this);
roiBox->setPen(QColor(Qt::yellow), 2.0, Qt::SolidLine);
}
// TopLeft - BottomRight (max points are +1 on graph)
QRect myRect(QPoint(roi[0], roi[2]), QPoint(roi[1] - 1, roi[3] - 1));
roiBox->setRect( QRectF(myRect) );
replot();
}
void SlsQt1DPlot::DisableRoiBox() {
if (roiBox != nullptr) {
roiBox->detach();
replot();
}
}
void SlsQt1DPlot::UnZoom() {
setAxisScale(QwtPlot::xBottom, zoomer->x(), zoomer->x() + zoomer->w());
setAxisScale(QwtPlot::yLeft, zoomer->y(), zoomer->y() + zoomer->h());
@ -606,5 +580,3 @@ void SlsQt1DPlot::DisableZoom(bool disable) {
}
}
}
} // namespace sls

View File

@ -7,8 +7,6 @@
#include <qwt_plot.h>
#include <qwt_scale_div.h>
namespace sls {
void SlsQt1DZoomer::ResetZoomBase() {
SetZoomBase(x0, y0, x1 - x0,
y1 - y0); // for going between log and nonlog plots
@ -95,5 +93,3 @@ void SlsQt1DZoomer::ExtendZoomBase(SlsQtH1D *h) {
ResetZoomBase();
}
} // namespace sls

View File

@ -9,8 +9,6 @@
using std::cout;
using std::endl;
namespace sls {
SlsQt2DHist::SlsQt2DHist(int nbinsx, double xmin, double xmax, int nbinsy,
double ymin, double ymax, double *d, double zmin,
double zmax)
@ -145,5 +143,3 @@ double SlsQt2DHist::SetMinimumToFirstGreaterThanZero() {
return z_min;
}
} // namespace sls

View File

@ -2,7 +2,6 @@
// Copyright (C) 2021 Contributors to the SLS Detector Package
#include "SlsQt2DPlot.h"
// #include "sls/ansi.h"
#include <array>
#include <qlist.h>
#include <qprinter.h>
@ -19,8 +18,6 @@
#include <cmath>
#include <iostream>
namespace sls {
SlsQt2DPlot::SlsQt2DPlot(QWidget *parent) : QwtPlot(parent) {
isLog = 0;
axisScaleEngine(QwtPlot::yLeft)->setAttribute(QwtScaleEngine::Floating);
@ -292,27 +289,4 @@ void SlsQt2DPlot::showSpectrogram(bool on) {
d_spectrogram->setDisplayMode(QwtPlotSpectrogram::ImageMode, on);
d_spectrogram->setDefaultContourPen(on ? QPen() : QPen(Qt::NoPen));
Update();
}
void SlsQt2DPlot::EnableRoiBox(std::array<int, 4> roi) {
if (roiBox == nullptr) {
roiBox = new QwtPlotShapeItem();
}
roiBox->setPen(QColor(Qt::yellow), 2.0, Qt::SolidLine);
// TopLeft - BottomRight (max points are +1 on graph)
QRect myRect(QPoint(roi[0], roi[2]), QPoint(roi[1] - 1, roi[3] - 1));
roiBox->setRect( QRectF(myRect) );
roiBox->attach(this);
replot();
}
void SlsQt2DPlot::DisableRoiBox() {
if (roiBox != nullptr) {
roiBox->detach();
replot();
}
}
} // namespace sls
}

View File

@ -11,8 +11,6 @@
#include <QPainter>
#include <qwt_text.h>
namespace sls {
int qCloneWidget::NumClones{0};
qCloneWidget::qCloneWidget(QWidget *parent, SlsQt1DPlot *p1, SlsQt2DPlot *p2,
@ -46,7 +44,7 @@ qCloneWidget::~qCloneWidget() {
void qCloneWidget::SetupWidgetWindow(QString title) {
std::string winTitle = std::string("Snapshot:") + std::to_string(id) +
std::string(" - ") + Logger::Timestamp();
std::string(" - ") + sls::Logger::Timestamp();
setWindowTitle(QString(winTitle.c_str()));
boxPlot->setFont(QFont("Sans Serif", qDefs::Q_FONT_SIZE, QFont::Normal));
@ -148,6 +146,4 @@ void qCloneWidget::resizeEvent(QResizeEvent *event) {
qDefs::DATA_GAIN_PLOT_RATIO);
}
event->accept();
}
} // namespace sls
}

View File

@ -3,9 +3,7 @@
#include "qDacWidget.h"
#include "qDefs.h"
namespace sls {
qDacWidget::qDacWidget(QWidget *parent, Detector *detector, bool d,
qDacWidget::qDacWidget(QWidget *parent, sls::Detector *detector, bool d,
std::string n, slsDetectorDefs::dacIndex i)
: QWidget(parent), det(detector), isDac(d), index(i) {
setupUi(this);
@ -96,5 +94,3 @@ void qDacWidget::Refresh() {
GetAdc();
}
}
} // namespace sls

View File

@ -59,7 +59,7 @@ int main(int argc, char **argv) {
case 'f':
fname = optarg;
LOG(sls::logDEBUG) << long_options[option_index].name << " " << optarg;
LOG(logDEBUG) << long_options[option_index].name << " " << optarg;
break;
case 'd':
@ -72,7 +72,7 @@ int main(int argc, char **argv) {
case 'v':
tempval = APIGUI;
LOG(sls::logINFO) << "SLS Detector GUI " << GITBRANCH << " (0x"
LOG(logINFO) << "SLS Detector GUI " << GITBRANCH << " (0x"
<< std::hex << tempval << ")";
return 0;
@ -88,7 +88,7 @@ int main(int argc, char **argv) {
"i. Default: 0. Required \n" +
"\t only when more than one multi "
"detector object is needed.\n\n";
LOG(sls::logERROR) << help_message;
LOG(logERROR) << help_message;
return -1;
}
}
@ -96,18 +96,16 @@ int main(int argc, char **argv) {
QApplication app(argc, argv);
app.setStyle(new QPlastiqueStyle); // style is deleted by QApplication
try {
sls::qDetectorMain det(multiId, fname, isDeveloper);
qDetectorMain det(multiId, fname, isDeveloper);
det.show();
app.exec();
} catch (const std::exception &e) {
sls::qDefs::Message(sls::qDefs::CRITICAL,
qDefs::Message(qDefs::CRITICAL,
std::string(e.what()) + "\nExiting Gui :'( ", "main");
}
return 0;
}
namespace sls {
qDetectorMain::qDetectorMain(int multiId, const std::string &fname,
bool isDevel)
: QMainWindow(nullptr), detType(slsDetectorDefs::GENERIC),
@ -197,7 +195,6 @@ void qDetectorMain::SetUpWidgetWindow() {
tabs->setTabEnabled(ADVANCED, false);
tabs->setTabEnabled(DEVELOPER, isDeveloper);
actionLoadTrimbits->setVisible(false);
actionSaveTrimbits->setVisible(false);
dockWidgetPlot->setFloating(false);
dockWidgetPlot->setFeatures(QDockWidget::NoDockWidgetFeatures);
@ -215,7 +212,7 @@ void qDetectorMain::SetUpWidgetWindow() {
void qDetectorMain::SetUpDetector(const std::string &config_file, int multiID) {
// instantiate detector and set window title
det = make_unique<Detector>(multiID);
det = sls::make_unique<sls::Detector>(multiID);
// create messages tab to capture config file loading logs
tabMessages = new qTabMessages(this);
@ -228,12 +225,10 @@ void qDetectorMain::SetUpDetector(const std::string &config_file, int multiID) {
detType = det->getDetectorType().tsquash(
"Different detector type for all modules.");
actionLoadTrimbits->setEnabled(false);
actionSaveTrimbits->setEnabled(false);
switch (detType) {
case slsDetectorDefs::EIGER:
case slsDetectorDefs::MYTHEN3:
actionLoadTrimbits->setEnabled(true);
actionSaveTrimbits->setEnabled(true);
break;
case slsDetectorDefs::GOTTHARD:
case slsDetectorDefs::JUNGFRAU:
@ -243,15 +238,15 @@ void qDetectorMain::SetUpDetector(const std::string &config_file, int multiID) {
default:
std::ostringstream os;
os << det->getHostname() << " has "
<< ToString(det->getDetectorType().squash())
<< sls::ToString(det->getDetectorType().squash())
<< " detector type (" << std::to_string(detType)
<< "). Exiting GUI.";
std::string errorMess = os.str();
throw RuntimeError(errorMess.c_str());
throw sls::RuntimeError(errorMess.c_str());
}
std::ostringstream os;
os << "SLS Detector GUI : "
<< ToString(det->getDetectorType().squash()) << " - "
<< sls::ToString(det->getDetectorType().squash()) << " - "
<< det->getHostname();
std::string title = os.str();
LOG(logINFO) << title;
@ -344,9 +339,9 @@ void qDetectorMain::EnableModes(QAction *action) {
enable = actionExpert->isChecked();
tabs->setTabEnabled(ADVANCED, enable);
bool visible = enable && (detType == slsDetectorDefs::EIGER || detType == slsDetectorDefs::MYTHEN3);
actionLoadTrimbits->setVisible(visible);
actionSaveTrimbits->setVisible(visible);
actionLoadTrimbits->setVisible(enable &&
(detType == slsDetectorDefs::EIGER ||
detType == slsDetectorDefs::MYTHEN3));
tabSettings->SetExportMode(enable);
LOG(logINFO) << "Expert Mode: " << qDefs::stringEnable(enable);
}
@ -422,22 +417,6 @@ void qDetectorMain::ExecuteUtilities(QAction *action) {
LOG(logINFO) << "Trimbits loaded successfully";
}
}
else if (action == actionSaveTrimbits) {
QString fPath =
QString((det->getSettingsPath().squash("/tmp/")).c_str());
LOG(logDEBUG) << "Saving Trimbits";
QString fName = QFileDialog::getSaveFileName(
this, tr("Save Detector Trimbits"), fPath,
tr("Trimbit files (*.trim noise.sn*);;All Files(*)"));
if (!fName.isEmpty()) {
det->saveTrimbits(std::string(fName.toAscii().constData()));
qDefs::Message(qDefs::INFORMATION,
"The Trimbits have been saved successfully.",
"qDetectorMain::ExecuteUtilities");
LOG(logINFO) << "Trimbits saved successfully";
}
}
}
CATCH_DISPLAY("Could not execute utilities.",
"qDetectorMain::ExecuteUtilities")
@ -462,10 +441,10 @@ void qDetectorMain::ExecuteHelp(QAction *action) {
LOG(logINFO) << "About Common GUI for Jungfrau, Eiger, Mythen3, "
"Gotthard, Gotthard2 and Moench detectors";
std::string guiVersion = ToStringHex(APIGUI);
std::string guiVersion = sls::ToStringHex(APIGUI);
std::string clientVersion = "unknown";
try {
clientVersion = ToStringHex(det->getClientVersion());
clientVersion = sls::ToStringHex(det->getClientVersion());
}
CATCH_DISPLAY("Could not get client version.",
"qDetectorMain::ExecuteHelp")
@ -598,8 +577,6 @@ void qDetectorMain::EnableTabs(bool enable) {
tabs->setTabEnabled(ADVANCED, expertTab);
actionLoadTrimbits->setVisible(expertTab &&
detType == slsDetectorDefs::EIGER);
actionSaveTrimbits->setVisible(expertTab &&
detType == slsDetectorDefs::EIGER);
// moved to here, so that its all in order, instead of signals and different
// threads
@ -632,5 +609,3 @@ void qDetectorMain::SetZoomToolTip(bool disable) {
else
dockWidgetPlot->setToolTip(zoomToolTip);
}
} // namespace sls

View File

@ -14,9 +14,7 @@
#include <QResizeEvent>
#include <QtConcurrentRun>
namespace sls {
qDrawPlot::qDrawPlot(QWidget *parent, Detector *detector)
qDrawPlot::qDrawPlot(QWidget *parent, sls::Detector *detector)
: QWidget(parent), det(detector) {
setupUi(this);
SetupWidgetWindow();
@ -82,10 +80,6 @@ void qDrawPlot::SetupWidgetWindow() {
fileSaveName = "Image";
}
gotthard25 = ((detType == slsDetectorDefs::GOTTHARD2 ||
detType == slsDetectorDefs::GOTTHARD) &&
det->size() == 2);
SetupPlots();
SetDataCallBack(true);
det->registerAcquisitionFinishedCallback(&(GetAcquisitionFinishedCallBack),
@ -280,13 +274,11 @@ void qDrawPlot::Select1dPlot(bool enable) {
}
void qDrawPlot::SetPlotTitlePrefix(QString title) {
std::lock_guard<std::mutex> lock(mPlots);
LOG(logINFO) << "Setting Title to " << title.toAscii().constData();
plotTitlePrefix = title;
}
void qDrawPlot::SetXAxisTitle(QString title) {
std::lock_guard<std::mutex> lock(mPlots);
LOG(logINFO) << "Setting X Axis Title to " << title.toAscii().constData();
if (is1d) {
xTitle1d = title;
@ -296,7 +288,6 @@ void qDrawPlot::SetXAxisTitle(QString title) {
}
void qDrawPlot::SetYAxisTitle(QString title) {
std::lock_guard<std::mutex> lock(mPlots);
LOG(logINFO) << "Setting Y Axis Title to " << title.toAscii().constData();
if (is1d) {
yTitle1d = title;
@ -306,7 +297,6 @@ void qDrawPlot::SetYAxisTitle(QString title) {
}
void qDrawPlot::SetZAxisTitle(QString title) {
std::lock_guard<std::mutex> lock(mPlots);
LOG(logINFO) << "Setting Z Axis Title to " << title.toAscii().constData();
zTitle2d = title;
}
@ -324,7 +314,6 @@ void qDrawPlot::SetXYRangeChanged(bool disable, double *xy, bool *isXY) {
}
void qDrawPlot::SetZRange(double *z, bool *isZ) {
std::lock_guard<std::mutex> lock(mPlots);
std::copy(z, z + 2, zRange);
std::copy(isZ, isZ + 2, isZRange);
}
@ -358,7 +347,6 @@ double qDrawPlot::GetYMaximum() {
}
void qDrawPlot::SetDataCallBack(bool enable) {
std::lock_guard<std::mutex> lock(mPlots);
LOG(logINFO) << "Setting data call back to " << std::boolalpha << enable
<< std::noboolalpha;
try {
@ -377,7 +365,6 @@ void qDrawPlot::SetDataCallBack(bool enable) {
}
void qDrawPlot::SetBinary(bool enable, int from, int to) {
std::lock_guard<std::mutex> lock(mPlots);
LOG(logINFO) << (enable ? "Enabling" : "Disabling")
<< " Binary output from " << from << " to " << to;
binaryFrom = from;
@ -386,7 +373,6 @@ void qDrawPlot::SetBinary(bool enable, int from, int to) {
}
void qDrawPlot::SetPersistency(int val) {
std::lock_guard<std::mutex> lock(mPlots);
LOG(logINFO) << "Setting Persistency to " << val;
persistency = val;
}
@ -468,20 +454,17 @@ void qDrawPlot::ResetAccumulate() {
}
void qDrawPlot::DisplayStatistics(bool enable) {
std::lock_guard<std::mutex> lock(mPlots);
LOG(logINFO) << (enable ? "Enabling" : "Disabling")
<< " Statistics Display";
displayStatistics = enable;
}
void qDrawPlot::SetNumDiscardBits(int value) {
std::lock_guard<std::mutex> lock(mPlots);
LOG(logINFO) << "Setting number of bits to discard: " << value;
numDiscardBits = value;
}
void qDrawPlot::EnableGainPlot(bool enable) {
std::lock_guard<std::mutex> lock(mPlots);
LOG(logINFO) << (enable ? "Enabling" : "Disabling") << " Gain Plot";
hasGainData = enable;
}
@ -622,13 +605,6 @@ void qDrawPlot::SavePlot() {
}
}
void qDrawPlot::SetGapPixels(bool enable) {
LOG(logDEBUG) << "Gap pixels enabled";
std::lock_guard<std::mutex> lock(mPlots);
isGapPixels = enable;
}
void qDrawPlot::GetStatistics(double &min, double &max, double &sum) {
LOG(logDEBUG) << "Calculating Statistics";
double *array = data2d;
@ -662,7 +638,6 @@ void qDrawPlot::StartAcquisition() {
currentFrame = 0;
boxPlot->setTitle("Old Plot");
det->clearAcquiringFlag(); // (from previous exit) or if running
isRxRoiDisplayed = false;
// ensure data streaming in receiver (if plot enabled)
if (isPlot) {
@ -730,7 +705,7 @@ void qDrawPlot::AcquisitionFinished(double currentProgress,
int detectorStatus) {
progress = currentProgress;
std::string status =
ToString(static_cast<slsDetectorDefs::runStatus>(detectorStatus));
sls::ToString(static_cast<slsDetectorDefs::runStatus>(detectorStatus));
if (detectorStatus == slsDetectorDefs::ERROR) {
qDefs::Message(qDefs::WARNING,
@ -763,7 +738,6 @@ void qDrawPlot::GetData(detectorData *data, uint64_t frameIndex,
<< " \t dynamic range: " << data->dynamicRange << std::endl
<< " \t file index: " << data->fileIndex << std::endl
<< " \t complete image: " << data->completeImage << std::endl
<< " \t rx Roi: " << ToString(data->rxRoi) << std::endl
<< " ]";
progress = data->progressIndex;
@ -771,22 +745,6 @@ void qDrawPlot::GetData(detectorData *data, uint64_t frameIndex,
currentFrame = frameIndex;
LOG(logDEBUG) << "[ Progress:" << progress << "%, Frame:" << currentFrame
<< " ]";
if (!isRxRoiDisplayed) {
rxRoi.xmin = data->rxRoi[0];
rxRoi.xmax = data->rxRoi[1];
rxRoi.ymin = data->rxRoi[2];
rxRoi.ymax = data->rxRoi[3];
// only for 2d anyway
if (isGapPixels) {
rxRoi.xmin += ((rxRoi.xmin/1024) * 6 + (rxRoi.xmin/256) * 2);
rxRoi.xmax += ((rxRoi.xmax/1024) * 6 + (rxRoi.xmax/256) * 2);
rxRoi.ymin += ((rxRoi.ymin/512) * 34 + (rxRoi.ymin/256) * 2);
rxRoi.ymax += ((rxRoi.ymax/512) * 34 + (rxRoi.ymax/256) * 2);
LOG(logINFO) << "Rx_roi recalculated with gap pixels: " << ToString(rxRoi);
}
LOG(logDEBUG) << "Rx_roi: " << ToString(rxRoi);
}
// 1d check if npixelX has changed (m3 for different counters enabled)
if (is1d && static_cast<int>(nPixelsX) != data->nx) {
@ -849,11 +807,6 @@ void qDrawPlot::GetData(detectorData *data, uint64_t frameIndex,
isGainDataExtracted = false;
}
// gotthard25um rearranging
if (gotthard25) {
rearrangeGotthard25data(rawData);
}
// title and frame index titles
plotTitle =
plotTitlePrefix + QString(data->fileName.c_str()).section('/', -1);
@ -1025,26 +978,6 @@ void qDrawPlot::Update1dPlot() {
xyRangeChanged = false;
}
plot1d->DisableZoom(disableZoom);
if (!isRxRoiDisplayed) {
isRxRoiDisplayed = true;
if (rxRoi.completeRoi()) {
plot1d->DisableRoiBox();
if (isGainDataExtracted) {
gainplot1d->DisableRoiBox();
}
lblRxRoiEnabled->hide();
} else {
plot1d->EnableRoiBox(std::array<int, 4>{rxRoi.xmin, rxRoi.xmax, (int)plot1d->GetYMinimum(), (int)plot1d->GetYMaximum()});
if (isGainDataExtracted) {
gainplot1d->EnableRoiBox(std::array<int, 4>{rxRoi.xmin, rxRoi.xmax, 0, 3});
}
lblRxRoiEnabled->show();
}
}
// ymin and ymax could change (so replot roi every time)
if (!rxRoi.completeRoi()) {
plot1d->EnableRoiBox(std::array<int, 4>{rxRoi.xmin, rxRoi.xmax, (int)plot1d->GetYMinimum(), (int)plot1d->GetYMaximum()});
}
}
void qDrawPlot::Update2dPlot() {
@ -1073,22 +1006,6 @@ void qDrawPlot::Update2dPlot() {
}
plot2d->DisableZoom(disableZoom);
plot2d->SetZRange(isZRange[0], isZRange[1], zRange[0], zRange[1]);
if (!isRxRoiDisplayed) {
isRxRoiDisplayed = true;
if (rxRoi.completeRoi()) {
plot2d->DisableRoiBox();
if (isGainDataExtracted) {
gainplot2d->DisableRoiBox();
}
lblRxRoiEnabled->hide();
} else {
plot2d->EnableRoiBox(rxRoi.getIntArray());
if (isGainDataExtracted) {
gainplot2d->EnableRoiBox(rxRoi.getIntArray());
}
lblRxRoiEnabled->show();
}
}
}
void qDrawPlot::Update1dXYRange() {
@ -1228,18 +1145,6 @@ void qDrawPlot::toDoublePixelData(double *dest, char *source, int size,
}
}
void qDrawPlot::rearrangeGotthard25data(double *data) {
const int nChans = NUM_GOTTHARD25_CHANS;
double temp[nChans * 2] = {0.0};
for (int i = 0; i != nChans; ++i) {
// master module
temp[i * 2] = data[i];
// slave module
temp[i * 2 + 1] = data[nChans + i];
}
memcpy(data, temp, nChans * 2 * sizeof(double));
}
void qDrawPlot::UpdatePlot() {
std::lock_guard<std::mutex> lock(mPlots);
LOG(logDEBUG) << "Update Plot";
@ -1274,5 +1179,3 @@ void qDrawPlot::UpdatePlot() {
LOG(logDEBUG) << "End of Update Plot";
}
} // namespace sls

View File

@ -5,9 +5,7 @@
#include "qDrawPlot.h"
#include "sls/network_utils.h"
namespace sls {
qTabAdvanced::qTabAdvanced(QWidget *parent, Detector *detector,
qTabAdvanced::qTabAdvanced(QWidget *parent, sls::Detector *detector,
qDrawPlot *p)
: QWidget(parent), det(detector), plot(p) {
setupUi(this);
@ -445,7 +443,7 @@ void qTabAdvanced::SetDetectorUDPIP(bool force) {
std::string s = dispDetectorUDPIP->text().toAscii().constData();
LOG(logINFO) << "Setting Detector UDP IP:" << s;
try {
det->setSourceUDPIP(IpAddr{s},
det->setSourceUDPIP(sls::IpAddr{s},
{comboDetector->currentIndex()});
}
CATCH_HANDLE("Could not set Detector UDP IP.",
@ -463,7 +461,7 @@ void qTabAdvanced::SetDetectorUDPMAC(bool force) {
std::string s = dispDetectorUDPMAC->text().toAscii().constData();
LOG(logINFO) << "Setting Detector UDP MAC:" << s;
try {
det->setSourceUDPMAC(MacAddr{s},
det->setSourceUDPMAC(sls::MacAddr{s},
{comboDetector->currentIndex()});
}
CATCH_HANDLE("Could not set Detector UDP MAC.",
@ -491,7 +489,7 @@ void qTabAdvanced::SetCltZMQIP(bool force) {
std::string s = dispZMQIP->text().toAscii().constData();
LOG(logINFO) << "Setting Client ZMQ IP:" << s;
try {
det->setClientZmqIp(IpAddr{s},
det->setClientZmqIp(sls::IpAddr{s},
{comboDetector->currentIndex()});
}
CATCH_HANDLE("Could not set Client ZMQ IP.",
@ -549,7 +547,7 @@ void qTabAdvanced::SetRxrUDPIP(bool force) {
std::string s = dispRxrUDPIP->text().toAscii().constData();
LOG(logINFO) << "Setting Receiver UDP IP:" << s;
try {
det->setDestinationUDPIP(IpAddr{s},
det->setDestinationUDPIP(sls::IpAddr{s},
{comboDetector->currentIndex()});
}
CATCH_HANDLE("Could not set Receiver UDP IP.",
@ -567,7 +565,7 @@ void qTabAdvanced::SetRxrUDPMAC(bool force) {
std::string s = dispRxrUDPMAC->text().toAscii().constData();
LOG(logINFO) << "Setting Receiver UDP MAC:" << s;
try {
det->setDestinationUDPMAC(MacAddr{s},
det->setDestinationUDPMAC(sls::MacAddr{s},
{comboDetector->currentIndex()});
}
CATCH_HANDLE("Could not set Receiver UDP MAC.",
@ -595,7 +593,7 @@ void qTabAdvanced::SetRxrZMQIP(bool force) {
std::string s = dispRxrZMQIP->text().toAscii().constData();
LOG(logINFO) << "Setting Receiver ZMQ IP:" << s;
try {
det->setRxZmqIP(IpAddr{s}, {comboDetector->currentIndex()});
det->setRxZmqIP(sls::IpAddr{s}, {comboDetector->currentIndex()});
}
CATCH_HANDLE("Could not set Receiver ZMQ IP.",
"qTabAdvanced::SetRxrZMQIP", this,
@ -893,5 +891,3 @@ void qTabAdvanced::Refresh() {
}
LOG(logDEBUG) << "**Updated Advanced Tab";
}
} // namespace sls

View File

@ -11,9 +11,7 @@
#include <unistd.h>
namespace sls {
qTabDataOutput::qTabDataOutput(QWidget *parent, Detector *detector)
qTabDataOutput::qTabDataOutput(QWidget *parent, sls::Detector *detector)
: QWidget(parent), det(detector), btnGroupRate(nullptr) {
setupUi(this);
SetupWidgetWindow();
@ -234,7 +232,7 @@ void qTabDataOutput::GetFileFormat() {
comboFileFormat->setCurrentIndex(static_cast<int>(retval));
break;
default:
throw RuntimeError(std::string("Unknown file format: ") +
throw sls::RuntimeError(std::string("Unknown file format: ") +
std::to_string(static_cast<int>(retval)));
}
}
@ -341,7 +339,7 @@ void qTabDataOutput::EnableRateCorrection() {
LOG(logINFO) << "Disabling Rate correction";
// disable
try {
det->setRateCorrection(ns(0));
det->setRateCorrection(sls::ns(0));
}
CATCH_HANDLE("Could not switch off rate correction.",
"qTabDataOutput::EnableRateCorrection", this,
@ -359,7 +357,7 @@ void qTabDataOutput::SetRateCorrection() {
int64_t deadtime = spinCustomDeadTime->value();
LOG(logINFO) << "Setting Rate Correction with custom dead time: "
<< deadtime;
det->setRateCorrection(ns(deadtime));
det->setRateCorrection(sls::ns(deadtime));
}
// default dead time
else {
@ -444,5 +442,3 @@ void qTabDataOutput::Refresh() {
LOG(logDEBUG) << "**Updated DataOutput Tab";
}
} // namespace sls

View File

@ -7,9 +7,7 @@
#include <QGridLayout>
#include <QTreeWidget>
namespace sls {
qTabDebugging::qTabDebugging(QWidget *parent, Detector *detector)
qTabDebugging::qTabDebugging(QWidget *parent, sls::Detector *detector)
: QWidget(parent), det(detector), treeDet(nullptr),
lblDetectorHostname(nullptr), lblDetectorFirmware(nullptr),
lblDetectorSoftware(nullptr) {
@ -64,7 +62,7 @@ void qTabDebugging::GetDetectorStatus() {
LOG(logDEBUG) << "Getting Status";
try {
std::string status = ToString(
std::string status = sls::ToString(
det->getDetectorStatus({comboDetector->currentIndex()})[0]);
lblStatus->setText(QString(status.c_str()).toUpper());
}
@ -90,7 +88,7 @@ void qTabDebugging::GetInfo() {
lblDetectorFirmware->setFixedWidth(100);
layout->addWidget(dispFrame, 0, 1);
QString detName =
QString(ToString(det->getDetectorType().squash()).c_str());
QString(sls::ToString(det->getDetectorType().squash()).c_str());
switch (det->getDetectorType().squash()) {
@ -243,5 +241,3 @@ void qTabDebugging::Refresh() {
GetDetectorStatus();
LOG(logDEBUG) << "**Updated Debugging Tab";
}
} // namespace sls

View File

@ -4,9 +4,7 @@
#include "qDacWidget.h"
#include "qDefs.h"
namespace sls {
qTabDeveloper::qTabDeveloper(QWidget *parent, Detector *detector)
qTabDeveloper::qTabDeveloper(QWidget *parent, sls::Detector *detector)
: QWidget(parent), det(detector) {
setupUi(this);
SetupWidgetWindow();
@ -18,6 +16,12 @@ qTabDeveloper::~qTabDeveloper() {}
void qTabDeveloper::SetupWidgetWindow() {
int tempid = 0;
comboHV->hide();
lblComboHV->hide();
lblSpinHV->hide();
spinHV->hide();
hvmin = HV_MIN;
try {
slsDetectorDefs::detectorType detType = det->getDetectorType().squash();
switch (detType) {
@ -78,6 +82,8 @@ void qTabDeveloper::SetupWidgetWindow() {
break;
case slsDetectorDefs::GOTTHARD:
comboHV->show();
lblComboHV->show();
dacWidgets.push_back(new qDacWidget(
this, det, true,
"v Reference: ", getSLSIndex(detType, tempid++)));
@ -111,6 +117,8 @@ void qTabDeveloper::SetupWidgetWindow() {
break;
case slsDetectorDefs::JUNGFRAU:
lblSpinHV->show();
spinHV->show();
dacWidgets.push_back(
new qDacWidget(this, det, true,
"v vb comp: ", getSLSIndex(detType, tempid++)));
@ -140,6 +148,8 @@ void qTabDeveloper::SetupWidgetWindow() {
break;
case slsDetectorDefs::MOENCH:
lblSpinHV->show();
spinHV->show();
dacWidgets.push_back(
new qDacWidget(this, det, true,
"vbp_colbuf: ", getSLSIndex(detType, tempid++)));
@ -163,6 +173,9 @@ void qTabDeveloper::SetupWidgetWindow() {
break;
case slsDetectorDefs::MYTHEN3:
lblSpinHV->show();
spinHV->show();
hvmin = 0;
dacWidgets.push_back(new qDacWidget(
this, det, true, "vcassh: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(
@ -203,6 +216,9 @@ void qTabDeveloper::SetupWidgetWindow() {
break;
case slsDetectorDefs::GOTTHARD2:
lblSpinHV->show();
spinHV->show();
hvmin = 0;
dacWidgets.push_back(
new qDacWidget(this, det, true,
"vref_h_adc: ", getSLSIndex(detType, tempid++)));
@ -274,6 +290,9 @@ void qTabDeveloper::SetupWidgetWindow() {
void qTabDeveloper::Initialization() {
connect(comboDetector, SIGNAL(currentIndexChanged(int)), this,
SLOT(Refresh()));
connect(comboHV, SIGNAL(currentIndexChanged(int)), this,
SLOT(SetHighVoltage()));
connect(spinHV, SIGNAL(valueChanged(int)), this, SLOT(SetHighVoltage()));
}
void qTabDeveloper::PopulateDetectors() {
@ -290,6 +309,75 @@ void qTabDeveloper::PopulateDetectors() {
comboDetector->setCurrentIndex(0);
}
void qTabDeveloper::GetHighVoltage() {
// not enabled for eiger
if (!comboHV->isVisible() && !spinHV->isVisible())
return;
LOG(logDEBUG) << "Getting High Voltage";
disconnect(spinHV, SIGNAL(valueChanged(int)), this, SLOT(SetHighVoltage()));
disconnect(comboHV, SIGNAL(currentIndexChanged(int)), this,
SLOT(SetHighVoltage()));
try {
// dac units
auto retval = det->getHighVoltage({comboDetector->currentIndex() - 1})
.tsquash("Inconsistent values for high voltage.");
// spinHV
if (spinHV->isVisible()) {
if (retval != 0 && retval < hvmin && retval > HV_MAX) {
throw sls::RuntimeError(std::string("Unknown High Voltage: ") +
std::to_string(retval));
}
spinHV->setValue(retval);
}
// combo HV
else {
switch (retval) {
case 0:
comboHV->setCurrentIndex(HV_0);
break;
case 90:
comboHV->setCurrentIndex(HV_90);
break;
case 110:
comboHV->setCurrentIndex(HV_110);
break;
case 120:
comboHV->setCurrentIndex(HV_120);
break;
case 150:
comboHV->setCurrentIndex(HV_150);
break;
case 180:
comboHV->setCurrentIndex(HV_180);
break;
case 200:
comboHV->setCurrentIndex(HV_200);
break;
default:
throw sls::RuntimeError(std::string("Unknown High Voltage: ") +
std::to_string(retval));
}
}
}
CATCH_DISPLAY("Could not get high voltage.",
"qTabDeveloper::GetHighVoltage")
connect(spinHV, SIGNAL(valueChanged(int)), this, SLOT(SetHighVoltage()));
connect(comboHV, SIGNAL(currentIndexChanged(int)), this,
SLOT(SetHighVoltage()));
}
void qTabDeveloper::SetHighVoltage() {
int val = (comboHV->isVisible() ? comboHV->currentText().toInt()
: spinHV->value());
LOG(logINFO) << "Setting high voltage:" << val;
try {
det->setHighVoltage({comboDetector->currentIndex() - 1});
}
CATCH_HANDLE("Could not set high voltage.", "qTabDeveloper::SetHighVoltage",
this, &qTabDeveloper::GetHighVoltage)
}
slsDetectorDefs::dacIndex
qTabDeveloper::getSLSIndex(slsDetectorDefs::detectorType detType, int index) {
switch (detType) {
@ -343,7 +431,7 @@ qTabDeveloper::getSLSIndex(slsDetectorDefs::detectorType detType, int index) {
case 22:
return slsDetectorDefs::TEMPERATURE_FPGA;
default:
throw RuntimeError(std::string("Unknown dac/adc index") +
throw sls::RuntimeError(std::string("Unknown dac/adc index") +
std::to_string(index));
}
break;
@ -370,7 +458,7 @@ qTabDeveloper::getSLSIndex(slsDetectorDefs::detectorType detType, int index) {
case 9:
return slsDetectorDefs::TEMPERATURE_FPGA;
default:
throw RuntimeError(std::string("Unknown dac/adc index") +
throw sls::RuntimeError(std::string("Unknown dac/adc index") +
std::to_string(index));
}
break;
@ -396,7 +484,7 @@ qTabDeveloper::getSLSIndex(slsDetectorDefs::detectorType detType, int index) {
case 8:
return slsDetectorDefs::TEMPERATURE_ADC;
default:
throw RuntimeError(std::string("Unknown dac/adc index") +
throw sls::RuntimeError(std::string("Unknown dac/adc index") +
std::to_string(index));
}
break;
@ -420,7 +508,7 @@ qTabDeveloper::getSLSIndex(slsDetectorDefs::detectorType detType, int index) {
case 7:
return slsDetectorDefs::IBIAS_SFP;
default:
throw RuntimeError(std::string("Unknown dac/adc index") +
throw sls::RuntimeError(std::string("Unknown dac/adc index") +
std::to_string(index));
}
break;
@ -462,7 +550,7 @@ qTabDeveloper::getSLSIndex(slsDetectorDefs::detectorType detType, int index) {
case 16:
return slsDetectorDefs::VTHRESHOLD;
default:
throw RuntimeError(std::string("Unknown dac/adc index") +
throw sls::RuntimeError(std::string("Unknown dac/adc index") +
std::to_string(index));
}
break;
@ -498,13 +586,13 @@ qTabDeveloper::getSLSIndex(slsDetectorDefs::detectorType detType, int index) {
case 13:
return slsDetectorDefs::VCOM_ADC2;
default:
throw RuntimeError(std::string("Unknown dac/adc index") +
throw sls::RuntimeError(std::string("Unknown dac/adc index") +
std::to_string(index));
}
break;
default:
throw RuntimeError(std::string("Unknown detector type"));
throw sls::RuntimeError(std::string("Unknown detector type"));
}
}
@ -516,7 +604,6 @@ void qTabDeveloper::Refresh() {
for (const auto &it : adcWidgets) {
it->SetDetectorIndex(comboDetector->currentIndex() - 1);
}
GetHighVoltage();
LOG(logDEBUG) << "**Updated Developer Tab";
}
} // namespace sls

View File

@ -7,9 +7,7 @@
#include <QStandardItemModel>
#include <QTimer>
namespace sls {
qTabMeasurement::qTabMeasurement(QWidget *parent, Detector *detector,
qTabMeasurement::qTabMeasurement(QWidget *parent, sls::Detector *detector,
qDrawPlot *p)
: QWidget(parent), det(detector), plot(p), progressTimer(nullptr) {
setupUi(this);
@ -339,26 +337,9 @@ void qTabMeasurement::GetTimingMode() {
disconnect(comboTimingMode, SIGNAL(currentIndexChanged(int)), this,
SLOT(SetTimingMode(int)));
try {
slsDetectorDefs::timingMode retval{slsDetectorDefs::AUTO_TIMING};
// m3: remove slave modes (always trigger) before squashing
if (det->getDetectorType().squash() == slsDetectorDefs::MYTHEN3) {
auto retvals = det->getTimingMode();
auto is_master = det->getMaster();
Result<slsDetectorDefs::timingMode> masterRetvals;
for (size_t i = 0; i != is_master.size(); ++i) {
if (is_master[i]) {
masterRetvals.push_back(retvals[i]);
}
}
retval = masterRetvals.tsquash(
"Inconsistent timing mode for all detectors.");
} else {
retval = det->getTimingMode().tsquash(
"Inconsistent timing mode for all detectors.");
}
auto oldMode = comboTimingMode->currentIndex();
auto retval = det->getTimingMode().tsquash(
"Inconsistent timing mode for all detectors.");
switch (retval) {
case slsDetectorDefs::AUTO_TIMING:
case slsDetectorDefs::TRIGGER_EXPOSURE:
@ -372,7 +353,7 @@ void qTabMeasurement::GetTimingMode() {
}
break;
default:
throw RuntimeError(std::string("Unknown timing mode: ") +
throw sls::RuntimeError(std::string("Unknown timing mode: ") +
std::to_string(retval));
}
}
@ -409,7 +390,7 @@ void qTabMeasurement::GetBurstMode() {
ShowTriggerDelay();
break;
default:
throw RuntimeError(std::string("Unknown burst mode: ") +
throw sls::RuntimeError(std::string("Unknown burst mode: ") +
std::to_string(retval));
}
}
@ -1019,5 +1000,3 @@ void qTabMeasurement::Refresh() {
LOG(logDEBUG) << "**Updated Measurement Tab";
}
} // namespace sls

View File

@ -11,8 +11,6 @@
#include <QTextStream>
#include <string>
namespace sls {
qTabMessages::qTabMessages(QWidget *parent) : QWidget(parent) {
setupUi(this);
SetupWidgetWindow();
@ -144,5 +142,3 @@ void qTabMessages::Refresh() {
dispCommand->clear();
dispCommand->setFocus();
}
} // namespace sls

View File

@ -6,8 +6,6 @@
#include <QStackedLayout>
#include <QStandardItemModel>
namespace sls {
QString qTabPlot::defaultPlotTitle("");
QString qTabPlot::defaultHistXAxisTitle("Channel Number");
QString qTabPlot::defaultHistYAxisTitle("Counts");
@ -15,7 +13,7 @@ QString qTabPlot::defaultImageXAxisTitle("Pixel");
QString qTabPlot::defaultImageYAxisTitle("Pixel");
QString qTabPlot::defaultImageZAxisTitle("Intensity");
qTabPlot::qTabPlot(QWidget *parent, Detector *detector, qDrawPlot *p)
qTabPlot::qTabPlot(QWidget *parent, sls::Detector *detector, qDrawPlot *p)
: QWidget(parent), det(detector), plot(p), is1d(false) {
setupUi(this);
SetupWidgetWindow();
@ -76,10 +74,6 @@ void qTabPlot::SetupWidgetWindow() {
// set zmq high water mark to GUI_ZMQ_RCV_HWM (2)
spinSndHwm->setValue(qDefs::GUI_ZMQ_RCV_HWM);
spinRcvHwm->setValue(qDefs::GUI_ZMQ_RCV_HWM);
if (chkGapPixels->isEnabled()) {
chkGapPixels->setChecked(true);
}
}
void qTabPlot::Initialization() {
@ -333,7 +327,6 @@ void qTabPlot::SetGapPixels(bool enable) {
LOG(logINFO) << "Setting Gap Pixels Enable to " << enable;
try {
det->setGapPixelsinCallback(enable);
plot->SetGapPixels(enable);
}
CATCH_HANDLE("Could not set gap pixels enable.", "qTabPlot::SetGapPixels",
this, &qTabPlot::GetGapPixels)
@ -799,5 +792,3 @@ void qTabPlot::Refresh() {
LOG(logDEBUG) << "**Updated Plot Tab";
}
} // namespace sls

View File

@ -6,9 +6,7 @@
#include "sls/bit_utils.h"
#include <QStandardItemModel>
namespace sls {
qTabSettings::qTabSettings(QWidget *parent, Detector *detector)
qTabSettings::qTabSettings(QWidget *parent, sls::Detector *detector)
: QWidget(parent), det(detector) {
setupUi(this);
SetupWidgetWindow();
@ -19,12 +17,6 @@ qTabSettings::~qTabSettings() {}
void qTabSettings::SetupWidgetWindow() {
comboHV->hide();
lblComboHV->hide();
lblSpinHV->hide();
spinHV->hide();
hvmin = HV_MIN;
counters = std::vector<QCheckBox *>{chkCounter1, chkCounter2, chkCounter3};
spinThreshold2->hide();
@ -43,9 +35,6 @@ void qTabSettings::SetupWidgetWindow() {
// enabling according to det type
slsDetectorDefs::detectorType detType = det->getDetectorType().squash();
if (detType == slsDetectorDefs::MYTHEN3) {
lblSpinHV->show();
spinHV->show();
hvmin = 0;
lblDynamicRange->setEnabled(true);
comboDynamicRange->setEnabled(true);
@ -86,28 +75,13 @@ void qTabSettings::SetupWidgetWindow() {
}
}
} else if (detType == slsDetectorDefs::EIGER) {
lblSpinHV->show();
spinHV->show();
hvmin = 0;
lblDynamicRange->setEnabled(true);
comboDynamicRange->setEnabled(true);
lblThreshold->setEnabled(true);
spinThreshold->setEnabled(true);
} else if (detType == slsDetectorDefs::JUNGFRAU) {
lblSpinHV->show();
spinHV->show();
lblGainMode->setEnabled(true);
comboGainMode->setEnabled(true);
} else if (detType == slsDetectorDefs::GOTTHARD) {
comboHV->show();
lblComboHV->show();
} else if (detType == slsDetectorDefs::MOENCH) {
lblSpinHV->show();
spinHV->show();
} else if (detType == slsDetectorDefs::GOTTHARD2) {
lblSpinHV->show();
spinHV->show();
hvmin = 0;
}
// default settings for the disabled
@ -189,11 +163,6 @@ void qTabSettings::ShowFixG0(bool expertMode) {
}
void qTabSettings::Initialization() {
// High voltage
connect(comboHV, SIGNAL(currentIndexChanged(int)), this,
SLOT(SetHighVoltage()));
connect(spinHV, SIGNAL(valueChanged(int)), this, SLOT(SetHighVoltage()));
// Settings
if (comboSettings->isEnabled())
connect(comboSettings, SIGNAL(currentIndexChanged(int)), this,
@ -230,91 +199,6 @@ void qTabSettings::Initialization() {
}
}
void qTabSettings::GetHighVoltage() {
// not enabled for eiger
if (!comboHV->isVisible() && !spinHV->isVisible())
return;
LOG(logDEBUG) << "Getting High Voltage";
disconnect(spinHV, SIGNAL(valueChanged(int)), this, SLOT(SetHighVoltage()));
disconnect(comboHV, SIGNAL(currentIndexChanged(int)), this,
SLOT(SetHighVoltage()));
try {
Result<int> retvals = det->getHighVoltage();
int retval = 0;
if (det->getDetectorType().squash() != slsDetectorDefs::EIGER) {
retval = retvals.tsquash("Inconsistent values for high voltage.");
}
// eiger slaves return -999
else {
auto is_master = det->getMaster();
Result<int> master_retvals;
for (size_t i = 0; i != retvals.size(); ++i) {
if (is_master[i]) {
master_retvals.push_back(retvals[i]);
}
}
retval = master_retvals.tsquash("Inconsistent values for high voltage.");
}
// spinHV
if (spinHV->isVisible()) {
if (retval != 0 && retval < hvmin && retval > HV_MAX) {
throw RuntimeError(std::string("Unknown High Voltage: ") +
std::to_string(retval));
}
spinHV->setValue(retval);
}
// combo HV
else {
switch (retval) {
case 0:
comboHV->setCurrentIndex(HV_0);
break;
case 90:
comboHV->setCurrentIndex(HV_90);
break;
case 110:
comboHV->setCurrentIndex(HV_110);
break;
case 120:
comboHV->setCurrentIndex(HV_120);
break;
case 150:
comboHV->setCurrentIndex(HV_150);
break;
case 180:
comboHV->setCurrentIndex(HV_180);
break;
case 200:
comboHV->setCurrentIndex(HV_200);
break;
default:
throw RuntimeError(std::string("Unknown High Voltage: ") +
std::to_string(retval));
}
}
}
CATCH_DISPLAY("Could not get high voltage.",
"qTabSettings::GetHighVoltage")
connect(spinHV, SIGNAL(valueChanged(int)), this, SLOT(SetHighVoltage()));
connect(comboHV, SIGNAL(currentIndexChanged(int)), this,
SLOT(SetHighVoltage()));
}
void qTabSettings::SetHighVoltage() {
int val = (comboHV->isVisible() ? comboHV->currentText().toInt()
: spinHV->value());
LOG(logINFO) << "Setting high voltage:" << val;
try {
det->setHighVoltage(val);
}
CATCH_HANDLE("Could not set high voltage.", "qTabSettings::SetHighVoltage",
this, &qTabSettings::GetHighVoltage)
}
void qTabSettings::GetSettings() {
LOG(logDEBUG) << "Getting settings";
disconnect(comboSettings, SIGNAL(currentIndexChanged(int)), this,
@ -331,7 +215,7 @@ void qTabSettings::GetSettings() {
break;
default:
if ((int)retval < -1 || (int)retval >= comboSettings->count()) {
throw RuntimeError(std::string("Unknown settings: ") +
throw sls::RuntimeError(std::string("Unknown settings: ") +
std::to_string(retval));
}
comboSettings->setCurrentIndex(retval);
@ -347,7 +231,7 @@ void qTabSettings::SetSettings(int index) {
// settings
auto val = static_cast<slsDetectorDefs::detectorSettings>(index);
try {
LOG(logINFO) << "Setting Settings to " << ToString(val);
LOG(logINFO) << "Setting Settings to " << sls::ToString(val);
det->setSettings(val);
}
CATCH_HANDLE("Could not set settings.", "qTabSettings::SetSettings", this,
@ -366,7 +250,7 @@ void qTabSettings::GetGainMode() {
auto retval = det->getGainMode().tsquash(
"Inconsistent gain mode for all detectors.");
if ((int)retval < 0 || (int)retval >= comboGainMode->count()) {
throw RuntimeError(std::string("Unknown gain mode: ") +
throw sls::RuntimeError(std::string("Unknown gain mode: ") +
std::to_string(retval));
}
// warning when using fix_g0 and not in export mode
@ -437,7 +321,7 @@ void qTabSettings::GetDynamicRange() {
comboDynamicRange->setCurrentIndex(DYNAMICRANGE_4);
break;
default:
throw RuntimeError(std::string("Unknown dynamic range: ") +
throw sls::RuntimeError(std::string("Unknown dynamic range: ") +
std::to_string(retval));
}
}
@ -468,7 +352,7 @@ void qTabSettings::SetDynamicRange(int index) {
det->setDynamicRange(4);
break;
default:
throw RuntimeError(std::string("Unknown dynamic range: ") +
throw sls::RuntimeError(std::string("Unknown dynamic range: ") +
std::to_string(index));
}
}
@ -515,7 +399,7 @@ void qTabSettings::SetThresholdEnergies() {
slsDetectorDefs::detectorSettings sett =
static_cast<slsDetectorDefs::detectorSettings>(
comboSettings->currentIndex());
LOG(logINFO) << "Setting Threshold Energies to " << ToString(eV)
LOG(logINFO) << "Setting Threshold Energies to " << sls::ToString(eV)
<< " (eV)";
try {
det->setThresholdEnergy(eV, sett);
@ -546,7 +430,7 @@ void qTabSettings::GetCounterMask() {
disconnect(chkCounter3, SIGNAL(toggled(bool)), this,
SLOT(SetCounterMask()));
try {
auto retval = getSetBits(det->getCounterMask().tsquash(
auto retval = sls::getSetBits(det->getCounterMask().tsquash(
"Counter mask is inconsistent for all detectors."));
// default to unchecked
for (auto p : counters) {
@ -555,7 +439,7 @@ void qTabSettings::GetCounterMask() {
// if retval[i] = 2, chkCounter2 is checked
for (auto i : retval) {
if (i > 3) {
throw RuntimeError(
throw sls::RuntimeError(
std::string("Unknown counter index : ") +
std::to_string(static_cast<int>(i)));
}
@ -586,8 +470,6 @@ void qTabSettings::SetCounterMask() {
void qTabSettings::Refresh() {
LOG(logDEBUG) << "**Updating Settings Tab";
GetHighVoltage();
if (comboSettings->isEnabled()) {
GetSettings();
}
@ -614,5 +496,3 @@ void qTabSettings::Refresh() {
LOG(logDEBUG) << "**Updated Settings Tab";
}
} // namespace sls

View File

@ -568,72 +568,6 @@
#define PATTERN_SET_LSB_REG (0x82 << MEM_MAP_SHIFT)
#define PATTERN_SET_MSB_REG (0x83 << MEM_MAP_SHIFT)
/* Pattern Loop 3 Address RW regiser */
#define PATTERN_LOOP_3_ADDR_REG (0x84 << MEM_MAP_SHIFT)
#define PATTERN_LOOP_3_ADDR_STRT_OFST (0)
#define PATTERN_LOOP_3_ADDR_STRT_MSK \
(0x00001FFF << PATTERN_LOOP_3_ADDR_STRT_OFST)
#define PATTERN_LOOP_3_ADDR_STP_OFST (16)
#define PATTERN_LOOP_3_ADDR_STP_MSK (0x00001FFF << PATTERN_LOOP_3_ADDR_STP_OFST)
/* Pattern Loop 3 Iteration RW regiser */
#define PATTERN_LOOP_3_ITERATION_REG (0x85 << MEM_MAP_SHIFT)
/* Pattern Loop 4 Address RW regiser */
#define PATTERN_LOOP_4_ADDR_REG (0x86 << MEM_MAP_SHIFT)
#define PATTERN_LOOP_4_ADDR_STRT_OFST (0)
#define PATTERN_LOOP_4_ADDR_STRT_MSK \
(0x00001FFF << PATTERN_LOOP_4_ADDR_STRT_OFST)
#define PATTERN_LOOP_4_ADDR_STP_OFST (16)
#define PATTERN_LOOP_4_ADDR_STP_MSK (0x00001FFF << PATTERN_LOOP_4_ADDR_STP_OFST)
/* Pattern Loop 4 Iteration RW regiser */
#define PATTERN_LOOP_4_ITERATION_REG (0x87 << MEM_MAP_SHIFT)
/* Pattern Loop 5 Address RW regiser */
#define PATTERN_LOOP_5_ADDR_REG (0x88 << MEM_MAP_SHIFT)
#define PATTERN_LOOP_5_ADDR_STRT_OFST (0)
#define PATTERN_LOOP_5_ADDR_STRT_MSK \
(0x00001FFF << PATTERN_LOOP_5_ADDR_STRT_OFST)
#define PATTERN_LOOP_5_ADDR_STP_OFST (16)
#define PATTERN_LOOP_5_ADDR_STP_MSK (0x00001FFF << PATTERN_LOOP_5_ADDR_STP_OFST)
/* Pattern Loop 5 Iteration RW regiser */
#define PATTERN_LOOP_5_ITERATION_REG (0x89 << MEM_MAP_SHIFT)
/* Pattern Wait 3 RW regiser */
#define PATTERN_WAIT_3_ADDR_REG (0x8A << MEM_MAP_SHIFT)
#define PATTERN_WAIT_3_ADDR_OFST (0)
#define PATTERN_WAIT_3_ADDR_MSK (0x00001FFF << PATTERN_WAIT_3_ADDR_OFST)
/* Pattern Wait 4 RW regiser */
#define PATTERN_WAIT_4_ADDR_REG (0x8B << MEM_MAP_SHIFT)
#define PATTERN_WAIT_4_ADDR_OFST (0)
#define PATTERN_WAIT_4_ADDR_MSK (0x00001FFF << PATTERN_WAIT_4_ADDR_OFST)
/* Pattern Wait 5 RW regiser */
#define PATTERN_WAIT_5_ADDR_REG (0x8C << MEM_MAP_SHIFT)
#define PATTERN_WAIT_5_ADDR_OFST (0)
#define PATTERN_WAIT_5_ADDR_MSK (0x00001FFF << PATTERN_WAIT_5_ADDR_OFST)
/* Pattern Wait Timer 3 64 bit RW register. t = PWT1 x T run clock */
#define PATTERN_WAIT_TIMER_3_LSB_REG (0x8D << MEM_MAP_SHIFT)
#define PATTERN_WAIT_TIMER_3_MSB_REG (0x8E << MEM_MAP_SHIFT)
/* Pattern Wait Timer 4 64 bit RW register. t = PWT1 x T run clock */
#define PATTERN_WAIT_TIMER_4_LSB_REG (0x8F << MEM_MAP_SHIFT)
#define PATTERN_WAIT_TIMER_4_MSB_REG (0x90 << MEM_MAP_SHIFT)
/* Pattern Wait Timer 5 64 bit RW register. t = PWT1 x T run clock */
#define PATTERN_WAIT_TIMER_5_LSB_REG (0x91 << MEM_MAP_SHIFT)
#define PATTERN_WAIT_TIMER_5_MSB_REG (0x92 << MEM_MAP_SHIFT)
/** I2C Control register */
#define I2C_TRANSFER_COMMAND_FIFO_REG (0x100 << MEM_MAP_SHIFT)
#define I2C_RX_DATA_FIFO_REG (0x101 << MEM_MAP_SHIFT)

View File

@ -2060,8 +2060,8 @@ void *start_timer(void *arg) {
header->frameNumber = frameNr + iframes;
header->packetNumber = i;
header->modId = 0;
header->row = detPos[Y];
header->column = detPos[X];
header->row = detPos[X];
header->column = detPos[Y];
// fill data
memcpy(packetData + sizeof(sls_detector_header),

View File

@ -5,7 +5,7 @@
#include "sls/sls_detector_defs.h"
#define MIN_REQRD_VRSN_T_RD_API 0x181130
#define REQRD_FRMWR_VRSN 0x220714
#define REQRD_FRMWR_VRSN 0x201005
#define LINKED_SERVER_NAME "ctbDetectorServer"

View File

@ -1095,19 +1095,19 @@ int *Beb_GetDetectorPosition() { return Beb_positions; }
int Beb_SetDetectorPosition(int pos[]) {
if (!Beb_activated)
return OK;
LOG(logINFO, ("Setting Position: (%d, %d)\n", pos[X], pos[Y]));
LOG(logINFO, ("Got Position values %d %d...\n", pos[0], pos[1]));
// save positions
Beb_positions[Y] = pos[Y];
Beb_positions[X] = pos[X];
Beb_positions[0] = pos[0];
Beb_positions[1] = pos[1];
// get left and right
int posLeft[2] = {Beb_top ? pos[X] : pos[X] + 1, pos[Y]};
int posRight[2] = {Beb_top ? pos[X] + 1 : pos[X], pos[Y]};
int posLeft[2] = {pos[0], Beb_top ? pos[1] : pos[1] + 1};
int posRight[2] = {pos[0], Beb_top ? pos[1] + 1 : pos[1]};
if (Beb_quadEnable) {
posRight[Y] = 1; // right is next row
posRight[X] = 0; // right same first column
posRight[0] = 1; // right is next row
posRight[1] = 0; // right same first column
}
int ret = FAIL;
@ -1122,7 +1122,7 @@ int Beb_SetDetectorPosition(int pos[]) {
uint32_t value = 0;
ret = OK;
// x left
int posval = Beb_swap_uint16(posLeft[Y]);
int posval = Beb_swap_uint16(posLeft[0]);
value = Beb_Read32(csp0base, UDP_HEADER_A_LEFT_OFST);
value &= UDP_HEADER_ID_MSK; // to keep previous id value
Beb_Write32(csp0base, UDP_HEADER_A_LEFT_OFST,
@ -1134,7 +1134,7 @@ int Beb_SetDetectorPosition(int pos[]) {
ret = FAIL;
}
// x right
posval = Beb_swap_uint16(posRight[Y]);
posval = Beb_swap_uint16(posRight[0]);
value = Beb_Read32(csp0base, UDP_HEADER_A_RIGHT_OFST);
value &= UDP_HEADER_ID_MSK; // to keep previous id value
Beb_Write32(csp0base, UDP_HEADER_A_RIGHT_OFST,
@ -1147,7 +1147,7 @@ int Beb_SetDetectorPosition(int pos[]) {
}
// y left (column)
posval = Beb_swap_uint16(posLeft[X]);
posval = Beb_swap_uint16(posLeft[1]);
value = Beb_Read32(csp0base, UDP_HEADER_B_LEFT_OFST);
value &= UDP_HEADER_Z_MSK; // to keep previous z value
Beb_Write32(csp0base, UDP_HEADER_B_LEFT_OFST,
@ -1160,7 +1160,7 @@ int Beb_SetDetectorPosition(int pos[]) {
}
// y right
posval = Beb_swap_uint16(posRight[X]);
posval = Beb_swap_uint16(posRight[1]);
value = Beb_Read32(csp0base, UDP_HEADER_B_RIGHT_OFST);
value &= UDP_HEADER_Z_MSK; // to keep previous z value
Beb_Write32(csp0base, UDP_HEADER_B_RIGHT_OFST,
@ -1176,10 +1176,10 @@ int Beb_SetDetectorPosition(int pos[]) {
Beb_close(fd, csp0base);
}
if (ret == OK) {
LOG(logINFO, ("Position set to (col, row):\n"
LOG(logINFO, ("Position set to...\n"
"\tLeft: [%d, %d]\n"
"\tRight:[%d, %d]\n",
posLeft[X], posLeft[Y], posRight[X], posRight[Y]));
posLeft[0], posLeft[1], posRight[0], posRight[1]));
}
return ret;

View File

@ -19,7 +19,7 @@
#include <pthread.h>
#include <time.h>
#endif
extern int portno;
// Global variable from slsDetectorServer_funcs
extern int debugflag;
extern int updateFlag;
@ -57,6 +57,7 @@ int normal = 0;
int eiger_highvoltage = 0;
int eiger_theo_highvoltage = 0;
int eiger_iodelay = 0;
int eiger_photonenergy = 0;
int eiger_dynamicrange = 0;
int eiger_parallelmode = 0;
int eiger_overflow32 = 0;
@ -681,17 +682,17 @@ void allocateDetectorStructureMemory() {
("modules from 0x%x to 0x%x\n", detectorModules, detectorModules));
LOG(logDEBUG1, ("chans from 0x%x to 0x%x\n", detectorChans, detectorChans));
LOG(logDEBUG1, ("dacs from 0x%x to 0x%x\n", detectorDacs, detectorDacs));
detectorModules->dacs = detectorDacs;
detectorModules->chanregs = detectorChans;
detectorModules->ndac = NDAC;
detectorModules->nchip = NCHIP;
detectorModules->nchan = NCHIP * NCHAN;
detectorModules->reg = 0;
detectorModules->iodelay = 0;
detectorModules->tau = 0;
detectorModules->eV[0] = -1;
detectorModules->eV[1] = -1;
detectorModules->eV[2] = -1;
(detectorModules)->dacs = detectorDacs;
(detectorModules)->chanregs = detectorChans;
(detectorModules)->ndac = NDAC;
(detectorModules)->nchip = NCHIP;
(detectorModules)->nchan = NCHIP * NCHAN;
(detectorModules)->reg = 0;
(detectorModules)->iodelay = 0;
(detectorModules)->tau = 0;
(detectorModules)->eV[0] = 0;
(detectorModules)->eV[1] = 0;
(detectorModules)->eV[2] = 0;
thisSettings = UNINITIALIZED;
// if trimval requested, should return -1 to acknowledge unknown
@ -731,8 +732,9 @@ void setupDetector() {
getSubExpTime(DEFAULT_SUBFRAME_DEADTIME);
setPeriod(DEFAULT_PERIOD);
setNumTriggers(DEFAULT_NUM_CYCLES);
eiger_dynamicrange = DEFAULT_DYNAMIC_RANGE;
setDynamicRange(DEFAULT_DYNAMIC_RANGE);
detectorModules->eV[0] = DEFAULT_PHOTON_ENERGY;
eiger_photonenergy = DEFAULT_PHOTON_ENERGY;
setParallelMode(DEFAULT_PARALLEL_MODE);
setOverFlowMode(DEFAULT_READOUT_OVERFLOW32_MODE);
setReadoutSpeed(DEFAULT_CLK_SPEED);
@ -1125,43 +1127,25 @@ int64_t getMeasuredSubPeriod() {
/* parameters - channel, module, settings */
void getModule(sls_detector_module* myMod) {
// serial number
myMod->serialnumber = detectorModules->serialnumber;
// reg (settings)
myMod->reg = detectorModules->reg;
// iodelay
myMod->iodelay = setIODelay(-1);
// tau
myMod->tau = (int) getCurrentTau();
// eV
myMod->eV[0] = detectorModules->eV[0];
// dacs
for (int idac = 0; idac < (detectorModules->ndac); idac++) {
*((myMod->dacs) + idac) = *((detectorModules->dacs) + idac);
}
// trimbits
for (int ichan = 0; ichan < (detectorModules->nchan); ichan++) {
*((myMod->chanregs) + ichan) = *((detectorModules->chanregs) + ichan);
}
}
int setModule(sls_detector_module myMod, char *mess) {
LOG(logINFO, ("Setting module with settings %d\n", myMod.reg));
if (((myMod.nchan) > (detectorModules->nchan)) || ((myMod.ndac) > (detectorModules->ndac))) {
strcpy(mess, "Could not set module as the number of channels or dacs do not match to the one in the detector server\n");
LOG(logERROR, (mess));
return FAIL;
}
// serial number (pointless)
detectorModules->serialnumber = myMod.serialnumber;
// settings
setSettings((enum detectorSettings)myMod.reg);
// copy module locally (module number, serial number
// dacs (pointless), trimbit values(if needed)
if (detectorModules) {
if (copyModule(detectorModules, &myMod) == FAIL) {
sprintf(mess, "Could not copy module\n");
LOG(logERROR, (mess));
setSettings(UNDEFINED);
LOG(logERROR, ("Settings has been changed to undefined\n"));
return FAIL;
}
}
// iodelay
if (setIODelay(myMod.iodelay) != myMod.iodelay) {
sprintf(mess, "Could not set module. Could not set iodelay %d\n",
@ -1194,15 +1178,60 @@ int setModule(sls_detector_module myMod, char *mess) {
}
}
// trimbits
#ifndef VIRTUAL
// trimbits
if (myMod.nchan == 0) {
LOG(logINFO, ("Setting module without trimbits\n"));
} else {
LOG(logINFO, ("Setting module with trimbits\n"));
if (setTrimbits(myMod.chanregs, mess) == FAIL) {
// includ gap pixels
unsigned int tt[263680];
int ip = 0, ich = 0;
for (int iy = 0; iy < 256; ++iy) {
for (int ichip = 0; ichip < 4; ++ichip) {
for (int ix = 0; ix < 256; ++ix) {
tt[ip++] = myMod.chanregs[ich++];
}
if (ichip < 3) {
tt[ip++] = 0;
tt[ip++] = 0;
}
}
}
// set trimbits
sharedMemory_lockLocalLink();
// if quad, set M8 and PROGRAM manually
if (!Feb_Control_SetChipSignalsToTrimQuad(1)) {
sharedMemory_unlockLocalLink();
return FAIL;
}
if (!Feb_Control_SetTrimbits(tt, top)) {
sprintf(mess, "Could not set module. Could not set trimbits\n");
LOG(logERROR, (mess));
setSettings(UNDEFINED);
LOG(logERROR, ("Settings has been changed to undefined (random "
"trim file)\n"));
// if quad, reset M8 and PROGRAM manually
if (!Feb_Control_SetChipSignalsToTrimQuad(0)) {
sharedMemory_unlockLocalLink();
return FAIL;
}
sharedMemory_unlockLocalLink();
return FAIL;
}
// if quad, reset M8 and PROGRAM manually
if (!Feb_Control_SetChipSignalsToTrimQuad(0)) {
sharedMemory_unlockLocalLink();
return FAIL;
}
sharedMemory_unlockLocalLink();
}
#endif
@ -1255,7 +1284,6 @@ enum detectorSettings setSettings(enum detectorSettings sett) {
return thisSettings;
}
thisSettings = sett;
detectorModules->reg = sett;
LOG(logINFO, ("Settings: %d\n", thisSettings));
return thisSettings;
}
@ -1266,14 +1294,13 @@ enum detectorSettings getSettings() { return thisSettings; }
int getThresholdEnergy() {
LOG(logDEBUG1, ("Getting Threshold energy\n"));
return detectorModules->eV[0];
return eiger_photonenergy;
}
int setThresholdEnergy(int ev) {
LOG(logINFO, ("Setting threshold energy:%d\n", ev));
if (ev >= 0) {
detectorModules->eV[0] = ev;
}
if (ev >= 0)
eiger_photonenergy = ev;
return getThresholdEnergy();
}
@ -1883,7 +1910,6 @@ int setIODelay(int val) {
#else
eiger_iodelay = val;
#endif
detectorModules->iodelay = val;
}
return eiger_iodelay;
}
@ -2127,6 +2153,7 @@ void setDefaultSettingsTau_in_nsec(int t) {
int64_t getCurrentTau() {
if (!getRateCorrectionEnable()) {
eiger_tau_ns = 0;
return 0;
} else {
#ifndef VIRTUAL
sharedMemory_lockLocalLink();
@ -2135,9 +2162,8 @@ int64_t getCurrentTau() {
#else
eiger_tau_ns = eiger_virtual_ratetable_tau_in_ns;
#endif
return eiger_tau_ns;
}
detectorModules->tau = eiger_tau_ns;
return eiger_tau_ns;
}
void setExternalGating(int enable[]) {
@ -2158,68 +2184,6 @@ void setExternalGating(int enable[]) {
enable[1] = eiger_extgatingpolarity;
}
int setTrimbits(int* chanregs, char* mess) {
LOG(logINFO, ("Setting module with trimbits\n"));
#ifndef VIRTUAL
// include gap pixels
unsigned int tt[263680];
int ip = 0, ich = 0;
for (int iy = 0; iy < 256; ++iy) {
for (int ichip = 0; ichip < 4; ++ichip) {
for (int ix = 0; ix < 256; ++ix) {
tt[ip++] = chanregs[ich++];
}
if (ichip < 3) {
tt[ip++] = 0;
tt[ip++] = 0;
}
}
}
// set trimbits
sharedMemory_lockLocalLink();
// if quad, set M8 and PROGRAM manually
if (!Feb_Control_SetChipSignalsToTrimQuad(1)) {
sharedMemory_unlockLocalLink();
return FAIL;
}
if (!Feb_Control_SetTrimbits(tt, top)) {
sprintf(mess, "Could not set module. Could not set trimbits\n");
LOG(logERROR, (mess));
setSettings(UNDEFINED);
LOG(logERROR, ("Settings has been changed to undefined (random "
"trim file)\n"));
// if quad, reset M8 and PROGRAM manually
if (!Feb_Control_SetChipSignalsToTrimQuad(0)) {
sharedMemory_unlockLocalLink();
return FAIL;
}
sharedMemory_unlockLocalLink();
return FAIL;
}
// if quad, reset M8 and PROGRAM manually
if (!Feb_Control_SetChipSignalsToTrimQuad(0)) {
sharedMemory_unlockLocalLink();
return FAIL;
}
sharedMemory_unlockLocalLink();
// copying trimbits locally (if tirmbit value > -1)
for (int ichan = 0; ichan < (detectorModules->nchan); ichan++) {
if (*(chanregs + ichan) >= 0)
*((detectorModules->chanregs) + ichan) = *(chanregs + ichan);
}
#endif
return OK;
}
int setAllTrimbits(int val) {
LOG(logINFO, ("Setting all trimbits to %d\n", val));
#ifndef VIRTUAL
@ -2231,8 +2195,6 @@ int setAllTrimbits(int val) {
}
sharedMemory_unlockLocalLink();
#endif
// copying trimbits locally
if (detectorModules) {
for (int ichan = 0; ichan < (detectorModules->nchan); ichan++) {
*((detectorModules->chanregs) + ichan) = val;
@ -2486,17 +2448,15 @@ void *start_timer(void *arg) {
}
int skipData = 0;
int tgEnable = send_to_ten_gig;
if (!eiger_virtual_activate ||
(tgEnable &&
(!eiger_virtual_left_datastream && !eiger_virtual_right_datastream))) {
(!eiger_virtual_left_datastream && !eiger_virtual_right_datastream)) {
skipData = 1;
LOG(logWARNING, ("Not sending Left and Right datastream\n"));
}
if (tgEnable && !eiger_virtual_left_datastream) {
if (!eiger_virtual_left_datastream) {
LOG(logWARNING, ("Not sending Left datastream\n"));
}
if (tgEnable && !eiger_virtual_right_datastream) {
if (!eiger_virtual_right_datastream) {
LOG(logWARNING, ("Not sending Right datastream\n"));
}
@ -2506,14 +2466,15 @@ void *start_timer(void *arg) {
int dr = eiger_dynamicrange;
double bytesPerPixel = (double)dr / 8.00;
int tgEnable = send_to_ten_gig;
int datasize = (tgEnable ? 4096 : 1024);
int packetsize = datasize + sizeof(sls_detector_header);
int maxPacketsPerFrame = (tgEnable ? 4 : 16) * dr;
int npixelsx = 256 * 2 * bytesPerPixel;
int databytes = 256 * 256 * 2 * bytesPerPixel;
int row = eiger_virtual_detPos[Y];
int colLeft = top ? eiger_virtual_detPos[X] : eiger_virtual_detPos[X] + 1;
int colRight = top ? eiger_virtual_detPos[X] + 1 : eiger_virtual_detPos[X];
int row = eiger_virtual_detPos[0];
int colLeft = top ? eiger_virtual_detPos[1] : eiger_virtual_detPos[1] + 1;
int colRight = top ? eiger_virtual_detPos[1] + 1 : eiger_virtual_detPos[1];
int readNRows = getReadNRows();
if (readNRows == -1) {
@ -2586,20 +2547,8 @@ void *start_timer(void *arg) {
}
break;
case 16:
// to debug multi module geometry (row, column) in virtual servers (all pixels
// in a module set to particular value)
#ifdef TEST_MOD_GEOMETRY
if ((i % 1024) < 512) {
*((uint16_t *)(imageData + i * sizeof(uint16_t))) =
top ? (portno % 1900) : ((portno % 1900) + 1);
} else {
*((uint16_t *)(imageData + i * sizeof(uint16_t))) =
top ? ((portno % 1900) + 1) : (portno % 1900);
}
#else
*((uint16_t *)(imageData + i * sizeof(uint16_t))) =
eiger_virtual_test_mode ? 0xFFE : (uint16_t)pixelVal;
#endif
break;
case 32:
*((uint32_t *)(imageData + i * sizeof(uint32_t))) =
@ -2723,16 +2672,14 @@ void *start_timer(void *arg) {
}
}
}
if ((!tgEnable ||
(tgEnable && eiger_virtual_left_datastream)) &&
i >= startval && i <= endval) {
if (eiger_virtual_left_datastream && i >= startval &&
i <= endval) {
usleep(eiger_virtual_transmission_delay_left);
sendUDPPacket(iRxEntry, 0, packetData, packetsize);
LOG(logDEBUG1, ("Sent left packet: %d\n", i));
}
if ((!tgEnable ||
(tgEnable && eiger_virtual_right_datastream)) &&
i >= startval && i <= endval) {
if (eiger_virtual_right_datastream && i >= startval &&
i <= endval) {
usleep(eiger_virtual_transmission_delay_right);
sendUDPPacket(iRxEntry, 1, packetData2, packetsize);
LOG(logDEBUG1, ("Sent right packet: %d\n", i));
@ -2944,6 +2891,53 @@ void readFrame(int *ret, char *mess) {
/* common */
int copyModule(sls_detector_module *destMod, sls_detector_module *srcMod) {
LOG(logDEBUG1, ("Copying module\n"));
if (srcMod->serialnumber >= 0) {
destMod->serialnumber = srcMod->serialnumber;
}
// no trimbit feature
if (destMod->nchan && ((srcMod->nchan) > (destMod->nchan))) {
LOG(logINFO, ("Number of channels of source is larger than number of "
"channels of destination\n"));
return FAIL;
}
if ((srcMod->ndac) > (destMod->ndac)) {
LOG(logINFO, ("Number of dacs of source is larger than number of dacs "
"of destination\n"));
return FAIL;
}
LOG(logDEBUG1, ("DACs: src %d, dest %d\n", srcMod->ndac, destMod->ndac));
LOG(logDEBUG1, ("Chans: src %d, dest %d\n", srcMod->nchan, destMod->nchan));
if (srcMod->reg >= 0)
destMod->reg = srcMod->reg;
if (srcMod->iodelay >= 0)
destMod->iodelay = srcMod->iodelay;
if (srcMod->tau >= 0)
destMod->tau = srcMod->tau;
if (srcMod->eV[0] >= 0)
destMod->eV[0] = srcMod->eV[0];
LOG(logDEBUG1, ("Copying register %x (%x)\n", destMod->reg, srcMod->reg));
if (destMod->nchan != 0 && srcMod->nchan != 0) {
for (int ichan = 0; ichan < (srcMod->nchan); ichan++) {
if (*((srcMod->chanregs) + ichan) >= 0)
*((destMod->chanregs) + ichan) = *((srcMod->chanregs) + ichan);
}
} else
LOG(logINFO, ("Not Copying trimbits\n"));
for (int idac = 0; idac < (srcMod->ndac); idac++) {
if (*((srcMod->dacs) + idac) >= 0) {
*((destMod->dacs) + idac) = *((srcMod->dacs) + idac);
}
}
return OK;
}
int calculateDataBytes() {
if (send_to_ten_gig)
return eiger_dynamicrange * ONE_GIGA_CONSTANT * TEN_GIGA_BUFFER_SIZE;

View File

@ -1917,7 +1917,7 @@ int setDetectorPosition(int pos[]) {
int ret = OK;
// row
value = detPos[Y];
value = detPos[X];
bus_w(addr, (bus_r(addr) & ~COORD_ROW_MSK) |
((value << COORD_ROW_OFST) & COORD_ROW_MSK));
valueRead = ((bus_r(addr) & COORD_ROW_MSK) >> COORD_ROW_OFST);
@ -1928,7 +1928,7 @@ int setDetectorPosition(int pos[]) {
}
// col
value = detPos[X];
value = detPos[Y];
bus_w(addr, (bus_r(addr) & ~COORD_COL_MSK) |
((value << COORD_COL_OFST) & COORD_COL_MSK));
valueRead = ((bus_r(addr) & COORD_COL_MSK) >> COORD_COL_OFST);
@ -1939,8 +1939,7 @@ int setDetectorPosition(int pos[]) {
}
if (ret == OK) {
LOG(logINFO,
("\tPosition set to [%d, %d] #(col, row)\n", detPos[X], detPos[Y]));
LOG(logINFO, ("\tPosition set to [%d, %d]\n", detPos[X], detPos[Y]));
}
return ret;
@ -2297,24 +2296,6 @@ int setClockDivider(enum CLKINDEX ind, int val) {
setPhase(i, oldPhases[i], 1);
}
}
// update system frequency and time settings that depend on it
if (ind == SYSTEM_C0) {
LOG(logINFO, ("\tUpdating time settings (sys freq change)\n"));
int64_t exptime = getExpTime();
int64_t period = getPeriod();
int64_t delayAfterTrigger = getDelayAfterTrigger();
int64_t burstPeriod = getBurstPeriod();
systemFrequency = ((double)getVCOFrequency(SYSTEM_C0) /
(double)clkDivider[SYSTEM_C0]);
setExpTime(exptime);
setPeriod(period);
setDelayAfterTrigger(delayAfterTrigger);
setBurstPeriod(burstPeriod);
LOG(logINFO, ("\tDone updating time settings\n"));
}
return OK;
}
@ -2816,10 +2797,13 @@ void setTimingSource(enum timingSourceType value) {
case TIMING_INTERNAL:
LOG(logINFO, ("Setting timing source to internal\n"));
bus_w(addr, (bus_r(addr) & ~CONTROL_TIMING_SOURCE_EXT_MSK));
systemFrequency = INT_SYSTEM_C0_FREQUENCY;
break;
case TIMING_EXTERNAL:
LOG(logINFO, ("Setting timing source to exernal\n"));
bus_w(addr, (bus_r(addr) | CONTROL_TIMING_SOURCE_EXT_MSK));
systemFrequency = ((double)getVCOFrequency(SYSTEM_C0) /
(double)clkDivider[SYSTEM_C0]);
break;
default:
LOG(logERROR, ("Unknown timing source %d\n", value));
@ -3111,8 +3095,8 @@ void *start_timer(void *arg) {
header->frameNumber = virtual_currentFrameNumber;
header->packetNumber = 0;
header->modId = virtual_moduleid;
header->row = detPos[Y];
header->column = detPos[X];
header->row = detPos[X];
header->column = detPos[Y];
// fill data
memcpy(packetData + sizeof(sls_detector_header), imageData,
datasize);

View File

@ -432,8 +432,6 @@ void setupDetector() {
// roi, gbit readout
rois.xmin = -1;
rois.xmax = -1;
rois.ymin = -1;
rois.ymax = -1;
setROI(rois); // set adcsyncreg, daqreg, chipofinterestreg, cleanfifos,
setGbitReadout();
@ -859,10 +857,8 @@ int setROI(ROI arg) {
LOG(logINFO, ("Clearing ROI\n"));
rois.xmin = -1;
rois.xmax = -1;
rois.ymin = -1;
rois.ymax = -1;
} else {
LOG(logINFO, ("Setting ROI:(%d, %d, %d, %d)\n", arg.xmin, arg.xmax, arg.ymin, arg.ymax));
LOG(logINFO, ("Setting ROI:(%d, %d)\n", arg.xmin, arg.xmax));
// validation
// xmin divisible by 256 and less than 1280
if (((arg.xmin % NCHAN_PER_ADC) != 0) ||
@ -896,7 +892,7 @@ ROI getROI() {
if (rois.xmin == -1) {
LOG(logINFO, ("\tROI: None\n"));
} else {
LOG(logINFO, ("ROI: (%d,%d,%d,%d)\n", rois.xmin, rois.xmax, rois.ymin, rois.ymax));
LOG(logINFO, ("ROI: (%d,%d)\n", rois.xmin, rois.xmax));
}
return rois;
}

View File

@ -25,7 +25,7 @@ target_include_directories(jungfrauDetectorServer_virtual
)
target_compile_definitions(jungfrauDetectorServer_virtual
PUBLIC JUNGFRAUD VIRTUAL STOP_SERVER #TEST_MOD_GEOMETRY
PUBLIC JUNGFRAUD VIRTUAL STOP_SERVER
)
target_link_libraries(jungfrauDetectorServer_virtual

View File

@ -21,7 +21,7 @@
#include <pthread.h>
#include <time.h>
#endif
extern int portno;
// Global variable from slsDetectorServer_funcs
extern int debugflag;
extern int updateFlag;
@ -1621,7 +1621,6 @@ int configureMAC() {
int setDetectorPosition(int pos[]) {
int ret = OK;
// row, col
uint32_t innerPos[2] = {pos[X], pos[Y]};
uint32_t outerPos[2] = {pos[X], pos[Y]};
int selInterface = getPrimaryInterface();
@ -1631,16 +1630,15 @@ int setDetectorPosition(int pos[]) {
("Setting detector position: 1 Interface %s \n(%d, %d)\n",
(selInterface ? "Inner" : "Outer"), innerPos[X], innerPos[Y]));
} else {
// top has row incremented by 1
++innerPos[Y];
++outerPos[X];
LOG(logDEBUG, ("Setting detector position: 2 Interfaces \n"
" inner top(%d, %d), outer bottom(%d, %d)\n",
innerPos[X], innerPos[Y], outerPos[X], outerPos[Y]));
}
detPos[0] = innerPos[X];
detPos[1] = innerPos[Y];
detPos[2] = outerPos[X];
detPos[3] = outerPos[Y];
detPos[0] = innerPos[0];
detPos[1] = innerPos[1];
detPos[2] = outerPos[0];
detPos[3] = outerPos[1];
// row
// outer
@ -1678,8 +1676,8 @@ int setDetectorPosition(int pos[]) {
if (ret == OK) {
if (getNumberofUDPInterfaces() == 1) {
LOG(logINFOBLUE, ("Position set to [%d, %d] #(col, row)\n",
innerPos[X], innerPos[Y]));
LOG(logINFOBLUE,
("Position set to [%d, %d]\n", innerPos[X], innerPos[Y]));
} else {
LOG(logINFOBLUE, (" Inner (top) position set to [%d, %d]\n",
innerPos[X], innerPos[Y]));
@ -2533,16 +2531,8 @@ void *start_timer(void *arg) {
if (i > 0 && i % pixelsPerPacket == 0) {
++pixelVal;
}
// to debug multi module geometry (row, column) in virtual servers (all pixels
// in a module set to particular value)
#ifdef TEST_MOD_GEOMETRY
*((uint16_t *)(imageData + i * sizeof(uint16_t))) =
portno % 1900 + (i >= npixels / 2 ? 1 : 0);
#else
*((uint16_t *)(imageData + i * sizeof(uint16_t))) =
virtual_image_test_mode ? 0x0FFE : (uint16_t)pixelVal;
#endif
}
}
@ -2567,10 +2557,6 @@ void *start_timer(void *arg) {
int srcOffset = 0;
int srcOffset2 = DATA_BYTES / 2;
int row0 = (numInterfaces == 1 ? detPos[1] : detPos[3]);
int col0 = (numInterfaces == 1 ? detPos[0] : detPos[2]);
int row1 = detPos[1];
int col1 = detPos[0];
// loop packet (128 packets)
for (int i = 0; i != maxPacketsPerFrame; ++i) {
@ -2590,8 +2576,8 @@ void *start_timer(void *arg) {
header->frameNumber = frameNr + iframes;
header->packetNumber = pnum;
header->modId = 0;
header->row = row0;
header->column = col0;
header->row = detPos[0];
header->column = detPos[1];
// fill data
memcpy(packetData + sizeof(sls_detector_header),
@ -2617,8 +2603,8 @@ void *start_timer(void *arg) {
header->frameNumber = frameNr + iframes;
header->packetNumber = pnum;
header->modId = 0;
header->row = row1;
header->column = col1;
header->row = detPos[2];
header->column = detPos[3];
// fill data
memcpy(packetData2 + sizeof(sls_detector_header),

View File

@ -274,28 +274,15 @@ patword 0x0110 0x0008599f0008503a
patword 0x0111 0x0008599f0008503a
patioctrl 0x8f0effff6dbffdbf
patlimits 0x0000 0x0110
patloop 0 0x00be 0x00ef
patnloop 0 199
patloop 1 0x0400 0x0400
patnloop 1 0
patloop 2 0x0400 0x0400
patnloop 2 0
patwait 0 0x002e
patwaittime 0 800
patwait 1 0x0400
patwaittime 1 0
patwait 2 0x0400
patwaittime 2 0
patloop 3 0x0000 0x0000
patnloop 3 0
patloop 4 0x0000 0x0000
patnloop 4 0
patloop 5 0x0000 0x0000
patnloop 5 0
patwait 3 0x0000
patwaittime 3 0
patwait 4 0x0000
patwaittime 4 0
patwait 5 0x0000
patwaittime 5 0
patloop0 0x00be 0x00ef
patnloop0 199
patloop1 0x0400 0x0400
patnloop1 0
patloop2 0x0400 0x0400
patnloop2 0
patwait0 0x002e
patwaittime0 800
patwait1 0x0400
patwaittime1 0
patwait2 0x0400
patwaittime2 0

View File

@ -572,72 +572,5 @@
#define PATTERN_SET_LSB_REG (0x82 << MEM_MAP_SHIFT)
#define PATTERN_SET_MSB_REG (0x83 << MEM_MAP_SHIFT)
/* Pattern Loop 3 Address RW regiser */
#define PATTERN_LOOP_3_ADDR_REG (0x84 << MEM_MAP_SHIFT)
#define PATTERN_LOOP_3_ADDR_STRT_OFST (0)
#define PATTERN_LOOP_3_ADDR_STRT_MSK \
(0x00001FFF << PATTERN_LOOP_3_ADDR_STRT_OFST)
#define PATTERN_LOOP_3_ADDR_STP_OFST (16)
#define PATTERN_LOOP_3_ADDR_STP_MSK (0x00001FFF << PATTERN_LOOP_3_ADDR_STP_OFST)
/* Pattern Loop 3 Iteration RW regiser */
#define PATTERN_LOOP_3_ITERATION_REG (0x85 << MEM_MAP_SHIFT)
/* Pattern Loop 4 Address RW regiser */
#define PATTERN_LOOP_4_ADDR_REG (0x86 << MEM_MAP_SHIFT)
#define PATTERN_LOOP_4_ADDR_STRT_OFST (0)
#define PATTERN_LOOP_4_ADDR_STRT_MSK \
(0x00001FFF << PATTERN_LOOP_4_ADDR_STRT_OFST)
#define PATTERN_LOOP_4_ADDR_STP_OFST (16)
#define PATTERN_LOOP_4_ADDR_STP_MSK (0x00001FFF << PATTERN_LOOP_4_ADDR_STP_OFST)
/* Pattern Loop 4 Iteration RW regiser */
#define PATTERN_LOOP_4_ITERATION_REG (0x87 << MEM_MAP_SHIFT)
/* Pattern Loop 5 Address RW regiser */
#define PATTERN_LOOP_5_ADDR_REG (0x88 << MEM_MAP_SHIFT)
#define PATTERN_LOOP_5_ADDR_STRT_OFST (0)
#define PATTERN_LOOP_5_ADDR_STRT_MSK \
(0x00001FFF << PATTERN_LOOP_5_ADDR_STRT_OFST)
#define PATTERN_LOOP_5_ADDR_STP_OFST (16)
#define PATTERN_LOOP_5_ADDR_STP_MSK (0x00001FFF << PATTERN_LOOP_5_ADDR_STP_OFST)
/* Pattern Loop 5 Iteration RW regiser */
#define PATTERN_LOOP_5_ITERATION_REG (0x89 << MEM_MAP_SHIFT)
/* Pattern Wait 3 RW regiser */
#define PATTERN_WAIT_3_ADDR_REG (0x8A << MEM_MAP_SHIFT)
#define PATTERN_WAIT_3_ADDR_OFST (0)
#define PATTERN_WAIT_3_ADDR_MSK (0x00001FFF << PATTERN_WAIT_3_ADDR_OFST)
/* Pattern Wait 4 RW regiser */
#define PATTERN_WAIT_4_ADDR_REG (0x8B << MEM_MAP_SHIFT)
#define PATTERN_WAIT_4_ADDR_OFST (0)
#define PATTERN_WAIT_4_ADDR_MSK (0x00001FFF << PATTERN_WAIT_4_ADDR_OFST)
/* Pattern Wait 5 RW regiser */
#define PATTERN_WAIT_5_ADDR_REG (0x8C << MEM_MAP_SHIFT)
#define PATTERN_WAIT_5_ADDR_OFST (0)
#define PATTERN_WAIT_5_ADDR_MSK (0x00001FFF << PATTERN_WAIT_5_ADDR_OFST)
/* Pattern Wait Timer 3 64 bit RW register. t = PWT1 x T run clock */
#define PATTERN_WAIT_TIMER_3_LSB_REG (0x8D << MEM_MAP_SHIFT)
#define PATTERN_WAIT_TIMER_3_MSB_REG (0x8E << MEM_MAP_SHIFT)
/* Pattern Wait Timer 4 64 bit RW register. t = PWT1 x T run clock */
#define PATTERN_WAIT_TIMER_4_LSB_REG (0x8F << MEM_MAP_SHIFT)
#define PATTERN_WAIT_TIMER_4_MSB_REG (0x90 << MEM_MAP_SHIFT)
/* Pattern Wait Timer 5 64 bit RW register. t = PWT1 x T run clock */
#define PATTERN_WAIT_TIMER_5_LSB_REG (0x91 << MEM_MAP_SHIFT)
#define PATTERN_WAIT_TIMER_5_MSB_REG (0x92 << MEM_MAP_SHIFT)
/* Round Robin */
#define RXR_ENDPOINT_START_REG (0x1000 << MEM_MAP_SHIFT)

View File

@ -274,28 +274,15 @@ patword 0x0110 0x0008599f0008503a
patword 0x0111 0x0008599f0008503a
patioctrl 0x8f0effff6dbffdbf
patlimits 0x0000 0x0110
patloop 0 0x00be 0x00ef
patnloop 0 199
patloop 1 0x0400 0x0400
patnloop 1 0
patloop 2 0x0400 0x0400
patnloop 2 0
patwait 0 0x002e
patwaittime 0 800
patwait 1 0x0400
patwaittime 1 0
patwait 2 0x0400
patwaittime 2 0
patloop 3 0x0000 0x0000
patnloop 3 0
patloop 4 0x0000 0x0000
patnloop 4 0
patloop 5 0x0000 0x0000
patnloop 5 0
patwait 3 0x0000
patwaittime 3 0
patwait 4 0x0000
patwaittime 4 0
patwait 5 0x0000
patwaittime 5 0
patloop0 0x00be 0x00ef
patnloop0 199
patloop1 0x0400 0x0400
patnloop1 0
patloop2 0x0400 0x0400
patnloop2 0
patwait0 0x002e
patwaittime0 800
patwait1 0x0400
patwaittime1 0
patwait2 0x0400
patwaittime2 0

View File

@ -1731,8 +1731,8 @@ void *start_timer(void *arg) {
header->frameNumber = frameNr + iframes;
header->packetNumber = i;
header->modId = 0;
header->row = detPos[Y];
header->column = detPos[X];
header->row = detPos[X];
header->column = detPos[Y];
// fill data
memcpy(packetData + sizeof(sls_detector_header),

View File

@ -5,7 +5,7 @@
#include "sls/sls_detector_defs.h"
#define MIN_REQRD_VRSN_T_RD_API 0x180314
#define REQRD_FRMWR_VRSN 0x220714
#define REQRD_FRMWR_VRSN 0x201005
#define LINKED_SERVER_NAME "moenchDetectorServer"

View File

@ -242,15 +242,15 @@ patword 0x00f0 0x0000000000000000
patword 0x00f1 0x0000000000000000
patword 0x00f2 0x0000000000000000
patlimits 0x0000 0x00f2
patloop 0 0x0400 0x0400
patnloop 0 0
patloop 1 0x0400 0x0400
patnloop 1 0
patloop 2 0x0400 0x0400
patnloop 2 0
patwait 0 0x0400
patwaittime 0 0
patwait 1 0x0400
patwaittime 1 0
patwait 2 0x0400
patwaittime 2 0
patloop0 0x0400 0x0400
patnloop0 0
patloop1 0x0400 0x0400
patnloop1 0
patloop2 0x0400 0x0400
patnloop2 0
patwait0 0x0400
patwaittime0 0
patwait1 0x0400
patwaittime1 0
patwait2 0x0400
patwaittime2 0

View File

@ -242,15 +242,15 @@ patword 0x00f0 0x0000000000000000
patword 0x00f1 0x0000000000000000
patword 0x00f2 0x0000000000000000
patlimits 0x0000 0x00f2
patloop 0 0x0400 0x0400
patnloop 0 0
patloop 1 0x0400 0x0400
patnloop 1 0
patloop 2 0x0400 0x0400
patnloop 2 0
patwait 0 0x0400
patwaittime 0 0
patwait 1 0x0400
patwaittime 1 0
patwait 2 0x0400
patwaittime 2 0
patloop0 0x0400 0x0400
patnloop0 0
patloop1 0x0400 0x0400
patnloop1 0
patloop2 0x0400 0x0400
patnloop2 0
patwait0 0x0400
patwaittime0 0
patwait1 0x0400
patwaittime1 0
patwait2 0x0400
patwaittime2 0

View File

@ -10,6 +10,20 @@
#include <string.h>
/*
// Common C/C++ structure to handle pattern data
typedef struct __attribute__((packed)) {
uint64_t word[MAX_PATTERN_LENGTH];
uint64_t ioctrl;
uint32_t limits[2];
// loop0 start, loop0 stop .. loop2 start, loop2 stop
uint32_t loop[6];
uint32_t nloop[3];
uint32_t wait[3];
uint64_t waittime[3];
} patternParameters;
*/
int chipStatusRegister = 0;
int setBit(int ibit, int patword) { return patword |= (1 << ibit); }
@ -18,6 +32,44 @@ int clearBit(int ibit, int patword) { return patword &= ~(1 << ibit); }
int getChipStatusRegister() { return chipStatusRegister; }
int gainCapsToCsr(int caps) {
// Translates bit representation
int csr = 0;
if (!(caps & M3_C10pre))
csr |= 1 << _CSR_C10pre;
if (caps & M3_C15sh)
csr |= 1 << CSR_C15sh;
if (caps & M3_C30sh)
csr |= 1 << CSR_C30sh;
if (caps & M3_C50sh)
csr |= 1 << CSR_C50sh;
if (caps & M3_C225ACsh)
csr |= 1 << CSR_C225ACsh;
if (!(caps & M3_C15pre))
csr |= 1 << _CSR_C15pre;
return csr;
}
int csrToGainCaps(int csr) {
// Translates bit representation
int caps = 0;
if (!(csr & (1 << _CSR_C10pre)))
caps |= M3_C10pre;
if (csr & (1 << CSR_C15sh))
caps |= M3_C15sh;
if (csr & (1 << CSR_C30sh))
caps |= M3_C30sh;
if (csr & (1 << CSR_C50sh))
caps |= M3_C50sh;
if (csr & (1 << CSR_C225ACsh))
caps |= M3_C225ACsh;
if (!(csr & (1 << _CSR_C15pre)))
caps |= M3_C15pre;
return caps;
}
patternParameters *setChipStatusRegisterPattern(int csr) {
int iaddr = 0;
int nbits = 18;
@ -73,13 +125,13 @@ patternParameters *setChipStatusRegisterPattern(int csr) {
error = 1;
}
// set pattern wait address
for (int i = 0; i < M3_MAX_PATTERN_LEVELS; i++)
for (int i = 0; i <= 2; i++)
pat->wait[i] = MAX_PATTERN_LENGTH - 1;
// pattern loop
for (int i = 0; i < M3_MAX_PATTERN_LEVELS; i++) {
for (int i = 0; i <= 2; i++) {
// int stop = MAX_PATTERN_LENGTH - 1, nloop = 0;
pat->startloop[i] = MAX_PATTERN_LENGTH - 1;
pat->stoploop[i] = MAX_PATTERN_LENGTH - 1;
pat->loop[i * 2 + 0] = MAX_PATTERN_LENGTH - 1;
pat->loop[i * 2 + 1] = MAX_PATTERN_LENGTH - 1;
pat->nloop[i] = 0;
}
@ -97,116 +149,54 @@ patternParameters *setChipStatusRegisterPattern(int csr) {
return pat;
}
int getGainCaps() {
int csr = chipStatusRegister;
// Translates bit representation
int caps = 0;
if (!(csr & (1 << _CSR_C10pre)))
caps |= M3_C10pre;
if (csr & (1 << CSR_C15sh))
caps |= M3_C15sh;
if (csr & (1 << CSR_C30sh))
caps |= M3_C30sh;
if (csr & (1 << CSR_C50sh))
caps |= M3_C50sh;
if (csr & (1 << CSR_C225ACsh))
caps |= M3_C225ACsh;
if (!(csr & (1 << _CSR_C15pre)))
caps |= M3_C15pre;
return caps;
}
int M3SetGainCaps(int caps) {
int csr = chipStatusRegister & ~GAIN_MASK;
// Translates bit representation
if (!(caps & M3_C10pre))
csr |= 1 << _CSR_C10pre;
if (caps & M3_C15sh)
csr |= 1 << CSR_C15sh;
if (caps & M3_C30sh)
csr |= 1 << CSR_C30sh;
if (caps & M3_C50sh)
csr |= 1 << CSR_C50sh;
if (caps & M3_C225ACsh)
csr |= 1 << CSR_C225ACsh;
if (!(caps & M3_C15pre))
csr |= 1 << _CSR_C15pre;
return csr;
}
int getInterpolation() {
return ((chipStatusRegister & CSR_interp_MSK) >> CSR_interp);
}
int M3SetInterpolation(int enable) {
int csr = 0;
if (enable)
csr = chipStatusRegister | CSR_interp_MSK;
patternParameters *setInterpolation(int mask) {
int csr;
if (mask)
csr = chipStatusRegister | (1 << CSR_interp);
else
csr = chipStatusRegister & ~CSR_interp_MSK;
return csr;
csr = chipStatusRegister & ~(1 << CSR_interp);
return setChipStatusRegisterPattern(csr);
}
int getPumpProbe() {
return ((chipStatusRegister & CSR_pumprobe_MSK) >> CSR_pumprobe);
}
int M3SetPumpProbe(int enable) {
LOG(logINFO, ("%s Pump Probe\n", enable == 0 ? "Disabling" : "Enabling"));
int csr = 0;
if (enable)
csr = chipStatusRegister | CSR_pumprobe_MSK;
patternParameters *setPumpProbe(int mask) {
int csr;
if (mask)
csr = chipStatusRegister | (1 << CSR_pumprobe);
else
csr = chipStatusRegister & ~CSR_pumprobe_MSK;
return csr;
}
csr = chipStatusRegister & ~(1 << CSR_pumprobe);
int getDigitalPulsing() {
return ((chipStatusRegister & CSR_dpulse_MSK) >> CSR_dpulse);
return setChipStatusRegisterPattern(csr);
}
patternParameters *setDigitalPulsing(int mask) {
int M3SetDigitalPulsing(int enable) {
LOG(logINFO,
("%s Digital Pulsing\n", enable == 0 ? "Disabling" : "Enabling"));
int csr = 0;
if (enable)
csr = chipStatusRegister | CSR_dpulse_MSK;
int csr;
if (mask)
csr = chipStatusRegister | (1 << CSR_dpulse);
else
csr = chipStatusRegister & ~CSR_dpulse_MSK;
return csr;
}
csr = chipStatusRegister & ~(1 << CSR_dpulse);
int getAnalogPulsing() {
return ((chipStatusRegister & CSR_apulse_MSK) >> CSR_apulse);
return setChipStatusRegisterPattern(csr);
}
patternParameters *setAnalogPulsing(int mask) {
int M3SetAnalogPulsing(int enable) {
LOG(logINFO,
("%s Analog Pulsing\n", enable == 0 ? "Disabling" : "Enabling"));
int csr = 0;
if (enable)
csr = chipStatusRegister | CSR_apulse_MSK;
int csr;
if (mask)
csr = chipStatusRegister | (1 << CSR_apulse);
else
csr = chipStatusRegister & ~CSR_apulse_MSK;
return csr;
}
csr = chipStatusRegister & ~(1 << CSR_apulse);
int getNegativePolarity() {
return ((chipStatusRegister & CSR_invpol_MSK) >> CSR_invpol);
return setChipStatusRegisterPattern(csr);
}
patternParameters *setNegativePolarity(int mask) {
int M3SetNegativePolarity(int enable) {
LOG(logINFO,
("%s Negative Polarity\n", enable == 0 ? "Disabling" : "Enabling"));
int csr = 0;
if (enable)
csr = chipStatusRegister | CSR_invpol_MSK;
int csr;
if (mask)
csr = chipStatusRegister | (1 << CSR_invpol);
else
csr = chipStatusRegister & ~CSR_invpol_MSK;
return csr;
csr = chipStatusRegister & ~(1 << CSR_invpol);
return setChipStatusRegisterPattern(csr);
}
patternParameters *setChannelRegisterChip(int ichip, int *mask, int *trimbits) {
@ -349,13 +339,13 @@ patternParameters *setChannelRegisterChip(int ichip, int *mask, int *trimbits) {
error = 1;
}
// set pattern wait address
for (int i = 0; i < M3_MAX_PATTERN_LEVELS; i++)
for (int i = 0; i <= 2; i++)
pat->wait[i] = MAX_PATTERN_LENGTH - 1;
// pattern loop
for (int i = 0; i < M3_MAX_PATTERN_LEVELS; i++) {
for (int i = 0; i <= 2; i++) {
// int stop = MAX_PATTERN_LENGTH - 1, nloop = 0;
pat->startloop[i] = MAX_PATTERN_LENGTH - 1;
pat->stoploop[i] = MAX_PATTERN_LENGTH - 1;
pat->loop[i * 2 + 0] = MAX_PATTERN_LENGTH - 1;
pat->loop[i * 2 + 1] = MAX_PATTERN_LENGTH - 1;
pat->nloop[i] = 0;
}

View File

@ -49,12 +49,6 @@
// shaper)
#define _CSR_C15pre 14 // negative polarity
#define CSR_invpol_MSK (0x1 << CSR_invpol)
#define CSR_dpulse_MSK (0x1 << CSR_dpulse)
#define CSR_interp_MSK (0x1 << CSR_interp)
#define CSR_pumprobe_MSK (0x1 << CSR_pumprobe)
#define CSR_apulse_MSK (0x1 << CSR_apulse)
#define CSR_default (1 << _CSR_C10pre) | (1 << CSR_C30sh)
#define GAIN_MASK \
@ -64,20 +58,15 @@
int setBit(int ibit, int patword);
int clearBit(int ibit, int patword);
int getChipStatusRegister();
int gainCapsToCsr(int caps);
int csrToGainCaps(int csr);
patternParameters *setChipStatusRegisterPattern(int csr);
patternParameters *setChannelRegisterChip(int ichip, int *mask, int *trimbits);
int getGainCaps();
int M3SetGainCaps(int caps);
int getInterpolation();
int M3SetInterpolation(int enable);
int getPumpProbe();
int M3SetPumpProbe(int enable);
int getDigitalPulsing();
int M3SetDigitalPulsing(int enable);
int getAnalogPulsing();
int M3SetAnalogPulsing(int enable);
int getNegativePolarity();
int M3SetNegativePolarity(int enable);
patternParameters *setInterpolation(int mask);
patternParameters *setPumpProbe(int mask);
patternParameters *setDigitalPulsing(int mask);
patternParameters *setAnalogPulsing(int mask);
patternParameters *setNegativePolarity(int mask);
#endif

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