mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-19 16:27:13 +02:00
Compare commits
41 Commits
Author | SHA1 | Date | |
---|---|---|---|
dbb1e1de56 | |||
ac6433a59b | |||
8fcec81a67 | |||
5be50785fb | |||
3d3e70c718 | |||
f1051246ad | |||
0fc76a81b0 | |||
b6db097800 | |||
c414d92b86 | |||
0358838dfb | |||
aa93aed4ed | |||
5490daa0a1 | |||
8ca8185d41 | |||
89aa0760c6 | |||
3cee36a3db | |||
364e0c6268 | |||
728cb35c37 | |||
1fb90ab98c | |||
25b5b02302 | |||
365ac835eb | |||
d61741c28b | |||
8656eeec25 | |||
f5745fcf18 | |||
c7ba79644a | |||
70aed474dc | |||
f3edd4dc56 | |||
a4bd2f1be7 | |||
73a45e1b5c | |||
4259363169 | |||
fcc7f7aef8 | |||
9808376207 | |||
be617577c9 | |||
e30ee445a1 | |||
8d6b8d66cc | |||
88649a00b6 | |||
b122c2fbdf | |||
7d574375b4 | |||
466d431081 | |||
cd4520b051 | |||
0129c2c686 | |||
f55bdd6eae |
16
RELEASE.txt
16
RELEASE.txt
@ -59,16 +59,30 @@ This document describes the differences between v7.0.0 and v6.x.x
|
||||
- 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
|
||||
>>>>>>> developer
|
||||
- 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
|
||||
==================
|
||||
|
118
cmk.sh
118
cmk.sh
@ -18,6 +18,7 @@ CTBGUI=0
|
||||
MANUALS=0
|
||||
MANUALS_ONLY_RST=0
|
||||
MOENCHZMQ=0
|
||||
ZMQ_HINT_DIR=""
|
||||
|
||||
|
||||
CLEAN=0
|
||||
@ -26,25 +27,26 @@ CMAKE_PRE=""
|
||||
CMAKE_POST=""
|
||||
|
||||
usage() { echo -e "
|
||||
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>]
|
||||
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]
|
||||
-[no option]: only make
|
||||
-c: Clean
|
||||
-b: Builds/Rebuilds CMake files normal mode
|
||||
-p: Builds/Rebuilds Python API
|
||||
-h: Builds/Rebuilds Cmake files with HDF5 package
|
||||
-c: Clean
|
||||
-d: HDF5 Custom Directory
|
||||
-e: Debug mode
|
||||
-g: Build/Rebuilds only gui
|
||||
-h: Builds/Rebuilds Cmake files with HDF5 package
|
||||
-i: Builds tests
|
||||
-j: Number of threads to compile through
|
||||
-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:
|
||||
@ -81,68 +83,49 @@ For rebuilding only certain sections
|
||||
|
||||
" ; exit 1; }
|
||||
|
||||
while getopts ":bpchd:k:l:j:trgeisumnz" opt ; do
|
||||
while getopts ":bcd:eghij:k:l:mnpq:rstuz" 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
|
||||
;;
|
||||
h)
|
||||
echo "Building of CMake files with HDF5 option Required"
|
||||
HDF5=1
|
||||
REBUILD=1
|
||||
;;
|
||||
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
|
||||
e)
|
||||
echo "Compiling Options: Debug"
|
||||
DEBUG=1
|
||||
;;
|
||||
g)
|
||||
echo "Compiling Options: GUI"
|
||||
GUI=1
|
||||
REBUILD=1
|
||||
;;
|
||||
e)
|
||||
echo "Compiling Options: Debug"
|
||||
DEBUG=1
|
||||
h)
|
||||
echo "Building of CMake files with HDF5 option Required"
|
||||
HDF5=1
|
||||
REBUILD=1
|
||||
;;
|
||||
i)
|
||||
echo "Compiling Options: Tests"
|
||||
TESTS=1
|
||||
;;
|
||||
s)
|
||||
echo "Compiling Options: Simulator"
|
||||
SIMULATOR=1
|
||||
j)
|
||||
echo "Number of compiler threads: $OPTARG"
|
||||
COMPILERTHREADS=$OPTARG
|
||||
;;
|
||||
k)
|
||||
echo "CMake command: $OPTARG"
|
||||
CMAKE="$OPTARG"
|
||||
;;
|
||||
l)
|
||||
echo "CMake install directory: $OPTARG"
|
||||
INSTALLDIR="$OPTARG"
|
||||
;;
|
||||
m)
|
||||
echo "Compiling Manuals"
|
||||
@ -152,14 +135,37 @@ while getopts ":bpchd:k:l:j:trgeisumnz" opt ; do
|
||||
echo "Compiling Manuals (Only RST)"
|
||||
MANUALS_ONLY_RST=1
|
||||
;;
|
||||
z)
|
||||
echo "Compiling Moench Zmq Processor"
|
||||
MOENCHZMQ=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
|
||||
;;
|
||||
u)
|
||||
echo "Compiling Options: Chip Test Gui"
|
||||
CTBGUI=1
|
||||
;;
|
||||
z)
|
||||
echo "Compiling Moench Zmq Processor"
|
||||
MOENCHZMQ=1
|
||||
;;
|
||||
\?)
|
||||
echo "Invalid option: -$OPTARG"
|
||||
usage
|
||||
@ -254,6 +260,12 @@ 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
|
||||
|
@ -2,18 +2,17 @@
|
||||
# Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||
|
||||
mkdir build
|
||||
|
||||
mkdir install
|
||||
cd build
|
||||
cmake .. \
|
||||
-DCMAKE_PREFIX_PATH=$CONDA_PREFIX \
|
||||
-DCMAKE_INSTALL_PREFIX=$PREFIX \
|
||||
-DCMAKE_INSTALL_PREFIX=install \
|
||||
-DSLS_USE_TEXTCLIENT=ON \
|
||||
-DSLS_USE_RECEIVER=ON \
|
||||
-DSLS_USE_GUI=OFF \
|
||||
-DSLS_USE_MOENCH=OFF\
|
||||
-DSLS_USE_GUI=ON \
|
||||
-DSLS_USE_MOENCH=ON\
|
||||
-DSLS_USE_TESTS=ON \
|
||||
-DSLS_USE_PYTHON=OFF \
|
||||
-DSLS_DEVEL_HEADERS=ON \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DSLS_USE_HDF5=OFF\
|
||||
|
||||
@ -23,7 +22,3 @@ cmake --build . -- -j${NCORES}
|
||||
cmake --build . --target install
|
||||
|
||||
CTEST_OUTPUT_ON_FAILURE=1 ctest -j 2
|
||||
|
||||
#Clean up for the next build
|
||||
# cd ..
|
||||
# rm -rf build
|
2
conda-recipes/slsdet/build.sh → conda-recepie/build_pylib.sh
Normal file → Executable file
2
conda-recipes/slsdet/build.sh → conda-recepie/build_pylib.sh
Normal file → Executable file
@ -2,7 +2,5 @@
|
||||
# Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||
|
||||
echo "|<-------- starting python build"
|
||||
echo $PWD
|
||||
cd python
|
||||
echo "folder: $PWD"
|
||||
${PYTHON} setup.py install
|
9
conda-recepie/conda_build_config.yaml
Normal file
9
conda-recepie/conda_build_config.yaml
Normal file
@ -0,0 +1,9 @@
|
||||
python:
|
||||
- 3.6
|
||||
- 3.7
|
||||
- 3.8
|
||||
- 3.9
|
||||
- 3.10
|
||||
|
||||
numpy:
|
||||
- 1.17
|
11
conda-recepie/copy_ctbgui.sh
Normal file
11
conda-recepie/copy_ctbgui.sh
Normal file
@ -0,0 +1,11 @@
|
||||
# SPDX-License-Identifier: LGPL-3.0-or-other
|
||||
# Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||
mkdir $PREFIX/lib
|
||||
mkdir $PREFIX/bin
|
||||
mkdir $PREFIX/include
|
||||
|
||||
|
||||
|
||||
cp build/bin/ctbGui $PREFIX/bin/.
|
||||
cp build/bin/libctbRootLib.so $PREFIX/lib/.
|
||||
|
5
conda-recepie/copy_gui.sh
Executable file
5
conda-recepie/copy_gui.sh
Executable file
@ -0,0 +1,5 @@
|
||||
# SPDX-License-Identifier: LGPL-3.0-or-other
|
||||
# Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||
#Copy the GUI
|
||||
mkdir -p $PREFIX/bin
|
||||
cp build/install/bin/slsDetectorGui $PREFIX/bin/.
|
22
conda-recepie/copy_lib.sh
Executable file
22
conda-recepie/copy_lib.sh
Executable file
@ -0,0 +1,22 @@
|
||||
# SPDX-License-Identifier: LGPL-3.0-or-other
|
||||
# Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||
|
||||
mkdir -p $PREFIX/lib
|
||||
mkdir -p $PREFIX/bin
|
||||
mkdir -p $PREFIX/include/sls
|
||||
# mkdir $PREFIX/include/slsDetectorPackage
|
||||
|
||||
#Shared and static libraries
|
||||
cp build/install/lib/* $PREFIX/lib/
|
||||
|
||||
#Binaries
|
||||
cp build/install/bin/sls_detector_acquire $PREFIX/bin/.
|
||||
cp build/install/bin/sls_detector_get $PREFIX/bin/.
|
||||
cp build/install/bin/sls_detector_put $PREFIX/bin/.
|
||||
cp build/install/bin/sls_detector_help $PREFIX/bin/.
|
||||
cp build/install/bin/slsReceiver $PREFIX/bin/.
|
||||
cp build/install/bin/slsMultiReceiver $PREFIX/bin/.
|
||||
|
||||
|
||||
cp build/install/include/sls/* $PREFIX/include/sls
|
||||
cp -rv build/install/share $PREFIX
|
6
conda-recepie/copy_moench.sh
Normal file
6
conda-recepie/copy_moench.sh
Normal file
@ -0,0 +1,6 @@
|
||||
# SPDX-License-Identifier: LGPL-3.0-or-other
|
||||
# Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||
|
||||
#Copy the Moench executables
|
||||
mkdir -p $PREFIX/bin
|
||||
cp build/install/bin/moench* $PREFIX/bin/.
|
134
conda-recepie/meta.yaml
Executable file
134
conda-recepie/meta.yaml
Executable file
@ -0,0 +1,134 @@
|
||||
|
||||
package:
|
||||
name: sls_detector_software
|
||||
version: {{ environ.get('GIT_DESCRIBE_TAG', '') }}
|
||||
|
||||
source:
|
||||
- path: ..
|
||||
|
||||
build:
|
||||
number: 0
|
||||
binary_relocation: True
|
||||
rpaths:
|
||||
- lib/
|
||||
|
||||
requirements:
|
||||
build:
|
||||
- {{ compiler('c') }}
|
||||
- {{compiler('cxx')}}
|
||||
- cmake
|
||||
- qwt 6.*
|
||||
- qt 4.8.*
|
||||
- zeromq
|
||||
- xorg-libx11
|
||||
- xorg-libice
|
||||
- xorg-libxext
|
||||
- xorg-libsm
|
||||
- xorg-libxau
|
||||
- xorg-libxrender
|
||||
- xorg-libxfixes
|
||||
- {{ cdt('mesa-libgl-devel') }} # [linux]
|
||||
- {{ cdt('mesa-libegl-devel') }} # [linux]
|
||||
- {{ cdt('mesa-dri-drivers') }} # [linux]
|
||||
- {{ cdt('libselinux') }} # [linux]
|
||||
- {{ cdt('libxdamage') }} # [linux]
|
||||
- {{ cdt('libxxf86vm') }} # [linux]
|
||||
- expat
|
||||
|
||||
host:
|
||||
- libstdcxx-ng
|
||||
- libgcc-ng
|
||||
- zeromq
|
||||
- xorg-libx11
|
||||
- xorg-libice
|
||||
- xorg-libxext
|
||||
- xorg-libsm
|
||||
- xorg-libxau
|
||||
- xorg-libxrender
|
||||
- xorg-libxfixes
|
||||
- expat
|
||||
|
||||
run:
|
||||
- zeromq
|
||||
- libstdcxx-ng
|
||||
- libgcc-ng
|
||||
|
||||
|
||||
outputs:
|
||||
- name: slsdetlib
|
||||
script: copy_lib.sh
|
||||
|
||||
requirements:
|
||||
build:
|
||||
- {{ compiler('c') }}
|
||||
- {{compiler('cxx')}}
|
||||
- libstdcxx-ng
|
||||
- libgcc-ng
|
||||
- zeromq
|
||||
|
||||
host:
|
||||
- zeromq
|
||||
|
||||
run:
|
||||
- libstdcxx-ng
|
||||
- libgcc-ng
|
||||
- zeromq
|
||||
|
||||
- name: slsdet
|
||||
|
||||
script: build_pylib.sh
|
||||
|
||||
requirements:
|
||||
build:
|
||||
- python
|
||||
- {{ compiler('c') }}
|
||||
- {{compiler('cxx')}}
|
||||
- {{ pin_subpackage('slsdetlib', exact=True) }}
|
||||
- setuptools
|
||||
|
||||
host:
|
||||
- python
|
||||
- {{ pin_subpackage('slsdetlib', exact=True) }}
|
||||
|
||||
|
||||
run:
|
||||
- libstdcxx-ng
|
||||
- libgcc-ng
|
||||
- python
|
||||
- numpy
|
||||
- {{ pin_subpackage('slsdetlib', exact=True) }}
|
||||
|
||||
|
||||
test:
|
||||
imports:
|
||||
- slsdet
|
||||
|
||||
- name: slsdetgui
|
||||
script: copy_gui.sh
|
||||
requirements:
|
||||
|
||||
build:
|
||||
- {{ compiler('c') }}
|
||||
- {{compiler('cxx')}}
|
||||
- {{ pin_subpackage('slsdetlib', exact=True) }}
|
||||
- qwt 6.*
|
||||
|
||||
run:
|
||||
- {{ pin_subpackage('slsdetlib', exact=True) }}
|
||||
- qwt 6.*
|
||||
- qt 4.8.*
|
||||
- expat
|
||||
|
||||
- name: moenchzmq
|
||||
script: copy_moench.sh
|
||||
requirements:
|
||||
|
||||
build:
|
||||
- {{ compiler('c') }}
|
||||
- {{compiler('cxx')}}
|
||||
- {{ pin_subpackage('slsdetlib', exact=True) }}
|
||||
|
||||
|
||||
run:
|
||||
- {{ pin_subpackage('slsdetlib', exact=True) }}
|
||||
- expat
|
3
conda-recepie/run_test.sh
Executable file
3
conda-recepie/run_test.sh
Executable file
@ -0,0 +1,3 @@
|
||||
# SPDX-License-Identifier: LGPL-3.0-or-other
|
||||
# Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||
ctest -j2
|
@ -1,24 +0,0 @@
|
||||
# SPDX-License-Identifier: LGPL-3.0-or-other
|
||||
# Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||
|
||||
mkdir build
|
||||
|
||||
cd build
|
||||
cmake .. \
|
||||
-DCMAKE_PREFIX_PATH=$CONDA_PREFIX \
|
||||
-DCMAKE_INSTALL_PREFIX=$PREFIX \
|
||||
-DSLS_USE_CTBGUI=ON \
|
||||
-DSLS_EXT_BUILD=ON\
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DSLS_USE_HDF5=OFF\
|
||||
|
||||
NCORES=$(getconf _NPROCESSORS_ONLN)
|
||||
echo "Building using: ${NCORES} cores"
|
||||
cmake --build . -- -j${NCORES}
|
||||
cmake --build . --target install
|
||||
|
||||
CTEST_OUTPUT_ON_FAILURE=1 ctest -j 2
|
||||
|
||||
#Clean up for the next build
|
||||
# cd ..
|
||||
# rm -rf build
|
@ -1,94 +0,0 @@
|
||||
package:
|
||||
name: ctbgui
|
||||
version: {{ environ.get('GIT_DESCRIBE_TAG', '') }}
|
||||
|
||||
source:
|
||||
- path: ../..
|
||||
|
||||
build:
|
||||
number: 0
|
||||
binary_relocation: True
|
||||
rpaths:
|
||||
- lib/
|
||||
|
||||
requirements:
|
||||
build:
|
||||
- {{ compiler('c') }}
|
||||
- {{compiler('cxx')}}
|
||||
- slsdetlib {{ environ.get('GIT_DESCRIBE_TAG', '') }}
|
||||
- cmake
|
||||
- root
|
||||
# - qwt 6.*
|
||||
# - qt 4.8.*
|
||||
# - zeromq
|
||||
# - xorg-libx11
|
||||
# - xorg-libice
|
||||
# - xorg-libxext
|
||||
# - xorg-libsm
|
||||
# - xorg-libxau
|
||||
# - xorg-libxrender
|
||||
# - xorg-libxfixes
|
||||
# - {{ cdt('mesa-libgl-devel') }} # [linux]
|
||||
# - {{ cdt('mesa-libegl-devel') }} # [linux]
|
||||
# - {{ cdt('mesa-dri-drivers') }} # [linux]
|
||||
# - {{ cdt('libselinux') }} # [linux]
|
||||
# - {{ cdt('libxdamage') }} # [linux]
|
||||
# - {{ cdt('libxxf86vm') }} # [linux]
|
||||
# - expat
|
||||
|
||||
host:
|
||||
- libstdcxx-ng
|
||||
- libgcc-ng
|
||||
- root
|
||||
- slsdetlib {{ environ.get('GIT_DESCRIBE_TAG', '') }}
|
||||
# - zeromq
|
||||
# - xorg-libx11
|
||||
# - xorg-libice
|
||||
# - xorg-libxext
|
||||
# - xorg-libsm
|
||||
# - xorg-libxau
|
||||
# - xorg-libxrender
|
||||
# - xorg-libxfixes
|
||||
# - expat
|
||||
|
||||
run:
|
||||
# - zeromq
|
||||
- libstdcxx-ng
|
||||
- libgcc-ng
|
||||
- root
|
||||
# - slsdetlib {{ environ.get('GIT_DESCRIBE_TAG', '') }}
|
||||
# - qwt 6.*
|
||||
# - qt 4.8.*
|
||||
# - expat
|
||||
|
||||
|
||||
|
||||
# - name: slsdetgui
|
||||
# script: copy_gui.sh
|
||||
# requirements:
|
||||
|
||||
# build:
|
||||
# - {{ compiler('c') }}
|
||||
# - {{compiler('cxx')}}
|
||||
# - {{ pin_subpackage('slsdetlib', exact=True) }}
|
||||
# - qwt 6.*
|
||||
|
||||
# run:
|
||||
# - {{ pin_subpackage('slsdetlib', exact=True) }}
|
||||
# - qwt 6.*
|
||||
# - qt 4.8.*
|
||||
# - expat
|
||||
|
||||
# - name: moenchzmq
|
||||
# script: copy_moench.sh
|
||||
# requirements:
|
||||
|
||||
# build:
|
||||
# - {{ compiler('c') }}
|
||||
# - {{compiler('cxx')}}
|
||||
# - {{ pin_subpackage('slsdetlib', exact=True) }}
|
||||
|
||||
|
||||
# run:
|
||||
# - {{ pin_subpackage('slsdetlib', exact=True) }}
|
||||
# - expat
|
@ -1,25 +0,0 @@
|
||||
# SPDX-License-Identifier: LGPL-3.0-or-other
|
||||
# Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||
|
||||
mkdir build
|
||||
|
||||
cd build
|
||||
cmake .. \
|
||||
-DCMAKE_PREFIX_PATH=$CONDA_PREFIX \
|
||||
-DCMAKE_INSTALL_PREFIX=$PREFIX \
|
||||
-DSLS_USE_MOENCH=ON\
|
||||
-DSLS_USE_TESTS=ON \
|
||||
-DSLS_EXT_BUILD=ON \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DSLS_USE_HDF5=OFF\
|
||||
|
||||
NCORES=$(getconf _NPROCESSORS_ONLN)
|
||||
echo "Building using: ${NCORES} cores"
|
||||
cmake --build . -- -j${NCORES}
|
||||
cmake --build . --target install
|
||||
|
||||
CTEST_OUTPUT_ON_FAILURE=1 ctest -j 2
|
||||
|
||||
#Clean up for the next build
|
||||
# cd ..
|
||||
# rm -rf build
|
@ -1,36 +0,0 @@
|
||||
|
||||
package:
|
||||
name: moenchzmq
|
||||
version: {{ environ.get('GIT_DESCRIBE_TAG', '') }}
|
||||
|
||||
source:
|
||||
- path: ../..
|
||||
|
||||
build:
|
||||
number: 0
|
||||
binary_relocation: True
|
||||
rpaths:
|
||||
- lib/
|
||||
|
||||
requirements:
|
||||
build:
|
||||
- {{ compiler('c') }}
|
||||
- {{compiler('cxx')}}
|
||||
- cmake
|
||||
- libstdcxx-ng
|
||||
- libgcc-ng
|
||||
- zeromq
|
||||
- libtiff
|
||||
- slsdetlib {{ environ.get('GIT_DESCRIBE_TAG', '') }}
|
||||
|
||||
host:
|
||||
- zeromq
|
||||
- libtiff
|
||||
- slsdetlib {{ environ.get('GIT_DESCRIBE_TAG', '') }}
|
||||
|
||||
run:
|
||||
- libstdcxx-ng
|
||||
- libgcc-ng
|
||||
- zeromq
|
||||
- libtiff
|
||||
- slsdetlib {{ environ.get('GIT_DESCRIBE_TAG', '') }}
|
@ -1,2 +0,0 @@
|
||||
python:
|
||||
- 3.9
|
@ -1,34 +0,0 @@
|
||||
|
||||
package:
|
||||
name: slsdet
|
||||
version: {{ environ.get('GIT_DESCRIBE_TAG', '') }}
|
||||
|
||||
source:
|
||||
- path: ../..
|
||||
|
||||
build:
|
||||
number: 0
|
||||
binary_relocation: True
|
||||
rpaths:
|
||||
- lib/
|
||||
|
||||
requirements:
|
||||
build:
|
||||
- python
|
||||
- {{ compiler('c') }}
|
||||
- {{compiler('cxx')}}
|
||||
- cmake
|
||||
- slsdetlib {{ environ.get('GIT_DESCRIBE_TAG', '') }}
|
||||
- setuptools
|
||||
|
||||
host:
|
||||
- python
|
||||
- slsdetlib {{ environ.get('GIT_DESCRIBE_TAG', '') }}
|
||||
|
||||
|
||||
run:
|
||||
- libstdcxx-ng
|
||||
- libgcc-ng
|
||||
- python
|
||||
- numpy
|
||||
- slsdetlib {{ environ.get('GIT_DESCRIBE_TAG', '') }}
|
@ -1,24 +0,0 @@
|
||||
# SPDX-License-Identifier: LGPL-3.0-or-other
|
||||
# Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||
|
||||
mkdir build
|
||||
|
||||
cd build
|
||||
cmake .. \
|
||||
-DCMAKE_PREFIX_PATH=$CONDA_PREFIX \
|
||||
-DCMAKE_INSTALL_PREFIX=$PREFIX \
|
||||
-DSLS_USE_GUI=ON \
|
||||
-DSLS_EXT_BUILD=ON\
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DSLS_USE_HDF5=OFF\
|
||||
|
||||
NCORES=$(getconf _NPROCESSORS_ONLN)
|
||||
echo "Building using: ${NCORES} cores"
|
||||
cmake --build . -- -j${NCORES}
|
||||
cmake --build . --target install
|
||||
|
||||
CTEST_OUTPUT_ON_FAILURE=1 ctest -j 2
|
||||
|
||||
#Clean up for the next build
|
||||
# cd ..
|
||||
# rm -rf build
|
@ -1,91 +0,0 @@
|
||||
package:
|
||||
name: slsdetgui
|
||||
version: {{ environ.get('GIT_DESCRIBE_TAG', '') }}
|
||||
|
||||
source:
|
||||
- path: ../..
|
||||
|
||||
build:
|
||||
number: 0
|
||||
binary_relocation: True
|
||||
rpaths:
|
||||
- lib/
|
||||
|
||||
requirements:
|
||||
build:
|
||||
- {{ compiler('c') }}
|
||||
- {{compiler('cxx')}}
|
||||
- slsdetlib {{ environ.get('GIT_DESCRIBE_TAG', '') }}
|
||||
- cmake
|
||||
- qwt 6.*
|
||||
- qt 4.8.*
|
||||
- zeromq
|
||||
- xorg-libx11
|
||||
- xorg-libice
|
||||
- xorg-libxext
|
||||
- xorg-libsm
|
||||
- xorg-libxau
|
||||
- xorg-libxrender
|
||||
- xorg-libxfixes
|
||||
- {{ cdt('mesa-libgl-devel') }} # [linux]
|
||||
- {{ cdt('mesa-libegl-devel') }} # [linux]
|
||||
- {{ cdt('mesa-dri-drivers') }} # [linux]
|
||||
- {{ cdt('libselinux') }} # [linux]
|
||||
- {{ cdt('libxdamage') }} # [linux]
|
||||
- {{ cdt('libxxf86vm') }} # [linux]
|
||||
- expat
|
||||
|
||||
host:
|
||||
- libstdcxx-ng
|
||||
- libgcc-ng
|
||||
- slsdetlib {{ environ.get('GIT_DESCRIBE_TAG', '') }}
|
||||
- zeromq
|
||||
- xorg-libx11
|
||||
- xorg-libice
|
||||
- xorg-libxext
|
||||
- xorg-libsm
|
||||
- xorg-libxau
|
||||
- xorg-libxrender
|
||||
- xorg-libxfixes
|
||||
- expat
|
||||
|
||||
run:
|
||||
- zeromq
|
||||
- libstdcxx-ng
|
||||
- libgcc-ng
|
||||
- slsdetlib {{ environ.get('GIT_DESCRIBE_TAG', '') }}
|
||||
- qwt 6.*
|
||||
- qt 4.8.*
|
||||
- expat
|
||||
|
||||
|
||||
|
||||
# - name: slsdetgui
|
||||
# script: copy_gui.sh
|
||||
# requirements:
|
||||
|
||||
# build:
|
||||
# - {{ compiler('c') }}
|
||||
# - {{compiler('cxx')}}
|
||||
# - {{ pin_subpackage('slsdetlib', exact=True) }}
|
||||
# - qwt 6.*
|
||||
|
||||
# run:
|
||||
# - {{ pin_subpackage('slsdetlib', exact=True) }}
|
||||
# - qwt 6.*
|
||||
# - qt 4.8.*
|
||||
# - expat
|
||||
|
||||
# - name: moenchzmq
|
||||
# script: copy_moench.sh
|
||||
# requirements:
|
||||
|
||||
# build:
|
||||
# - {{ compiler('c') }}
|
||||
# - {{compiler('cxx')}}
|
||||
# - {{ pin_subpackage('slsdetlib', exact=True) }}
|
||||
|
||||
|
||||
# run:
|
||||
# - {{ pin_subpackage('slsdetlib', exact=True) }}
|
||||
# - expat
|
@ -1,90 +0,0 @@
|
||||
|
||||
package:
|
||||
name: slsdetlib
|
||||
version: {{ environ.get('GIT_DESCRIBE_TAG', '') }}
|
||||
|
||||
source:
|
||||
- path: ../..
|
||||
|
||||
build:
|
||||
number: 0
|
||||
binary_relocation: True
|
||||
rpaths:
|
||||
- lib/
|
||||
|
||||
requirements:
|
||||
build:
|
||||
- {{ compiler('c') }}
|
||||
- {{compiler('cxx')}}
|
||||
- cmake
|
||||
- libstdcxx-ng
|
||||
- libgcc-ng
|
||||
- zeromq
|
||||
|
||||
host:
|
||||
- zeromq
|
||||
|
||||
run:
|
||||
- libstdcxx-ng
|
||||
- libgcc-ng
|
||||
- zeromq
|
||||
|
||||
|
||||
# outputs:
|
||||
# - name: slsdetlib
|
||||
# script: build_lib.sh
|
||||
|
||||
# requirements:
|
||||
# build:
|
||||
# - {{ compiler('c') }}
|
||||
# - {{compiler('cxx')}}
|
||||
# - libstdcxx-ng
|
||||
# - libgcc-ng
|
||||
# - zeromq
|
||||
|
||||
# host:
|
||||
# - zeromq
|
||||
|
||||
# run:
|
||||
# - libstdcxx-ng
|
||||
# - libgcc-ng
|
||||
# - zeromq
|
||||
|
||||
# - name: slsdet
|
||||
# script: build_py.sh
|
||||
|
||||
# requirements:
|
||||
# build:
|
||||
# - python
|
||||
# - {{ compiler('c') }}
|
||||
# - {{compiler('cxx')}}
|
||||
# - {{ pin_subpackage('slsdetlib', exact=True) }}
|
||||
# - setuptools
|
||||
|
||||
# host:
|
||||
# - python
|
||||
# - {{ pin_subpackage('slsdetlib', exact=True) }}
|
||||
|
||||
|
||||
# run:
|
||||
# - libstdcxx-ng
|
||||
# - libgcc-ng
|
||||
# - python
|
||||
# - numpy
|
||||
# - {{ pin_subpackage('slsdetlib', exact=True) }}
|
||||
|
||||
# - name: slsdetgui
|
||||
# script: build_gui.sh
|
||||
# requirements:
|
||||
|
||||
# build:
|
||||
# - {{ compiler('c') }}
|
||||
# - {{compiler('cxx')}}
|
||||
# - {{ pin_subpackage('slsdetlib', exact=True) }}
|
||||
# - qwt 6.*
|
||||
|
||||
# run:
|
||||
# - {{ pin_subpackage('slsdetlib', exact=True) }}
|
||||
# - qwt 6.*
|
||||
# - qt 4.8.*
|
||||
# - expat
|
@ -83,12 +83,8 @@ target_link_libraries(ctbGui PUBLIC
|
||||
${TIFF_LIBRARIES}
|
||||
)
|
||||
|
||||
#set_target_properties(ctbGui PROPERTIES
|
||||
# RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
||||
#
|
||||
#)
|
||||
set_target_properties(ctbGui PROPERTIES
|
||||
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
||||
|
||||
install(TARGETS ctbGui ctbRootLib
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
)
|
||||
|
||||
|
@ -828,14 +828,14 @@ void ctbAcquisition::setCanvas(TCanvas* c) {
|
||||
myCanvas->AddExec("dynamic",Form("((ctbAcquisition*)%p)->canvasClicked()",this));
|
||||
// myCanvas->AddExec("ex","canvasClicked()");
|
||||
}
|
||||
void ctbAcquisition::dataCallback(detectorData *data, long unsigned int index, unsigned int dum, void* pArgs) {
|
||||
void ctbAcquisition::dataCallback(sls::detectorData *data, long unsigned int index, unsigned int dum, void* pArgs) {
|
||||
|
||||
// return
|
||||
((ctbAcquisition*)pArgs)->plotData(data,index);
|
||||
}
|
||||
|
||||
|
||||
int ctbAcquisition::plotData(detectorData *data, int index) {
|
||||
int ctbAcquisition::plotData(sls::detectorData *data, int index) {
|
||||
|
||||
/*
|
||||
******************************************************************
|
||||
|
@ -28,8 +28,8 @@ class TGTextButton;
|
||||
namespace sls
|
||||
{
|
||||
class Detector;
|
||||
};
|
||||
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(detectorData*, long unsigned int, unsigned int, void*);
|
||||
static void dataCallback(sls::detectorData*, long unsigned int, unsigned int, void*);
|
||||
int StopFlag;
|
||||
|
||||
int plotData(detectorData*, int);
|
||||
int plotData(sls::detectorData*, int);
|
||||
|
||||
void setPatternFile(const char* t);
|
||||
|
||||
|
@ -6,6 +6,8 @@
|
||||
#include "tests/globals.h"
|
||||
#include <iostream>
|
||||
|
||||
namespace sls {
|
||||
|
||||
class MultiDetectorFixture {
|
||||
protected:
|
||||
DetectorImpl d;
|
||||
@ -136,7 +138,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 = sls::split(hn, '+');
|
||||
auto hostnames = split(hn, '+');
|
||||
CHECK(hostnames.size() == d.getNumberOfDetectors());
|
||||
for (int i = 0; i != d.getNumberOfDetectors(); ++i) {
|
||||
CHECK(d.getId(defs::DETECTOR_SERIAL_NUMBER, 0) ==
|
||||
@ -198,3 +200,5 @@ TEST_CASE_METHOD(MultiDetectorFixture, "rate correction",
|
||||
d.setRateCorrection(200);
|
||||
CHECK(d.getRateCorrection() == 200);
|
||||
}
|
||||
|
||||
} // namespace sls
|
||||
|
@ -24,6 +24,8 @@
|
||||
// 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);
|
||||
@ -283,14 +285,14 @@ TEST_CASE(
|
||||
CHECK(m.getRateCorrection() == ratecorr);
|
||||
|
||||
// ratecorr fail with dr 4 or 8
|
||||
CHECK_THROWS_AS(m.setDynamicRange(8), sls::RuntimeError);
|
||||
CHECK_THROWS_AS(m.setDynamicRange(8), 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), sls::RuntimeError);
|
||||
CHECK_THROWS_AS(m.setDynamicRange(4), RuntimeError);
|
||||
CHECK(m.getRateCorrection() == 0);
|
||||
}
|
||||
|
||||
@ -329,11 +331,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), sls::RuntimeError);
|
||||
CHECK_THROWS_AS(m.setPatternWord(addr, word), RuntimeError);
|
||||
CHECK_THROWS_WITH(m.setPatternWord(addr, word),
|
||||
Catch::Matchers::Contains("be between 0 and"));
|
||||
addr = -1;
|
||||
CHECK_THROWS_AS(m.setPatternWord(addr, word), sls::RuntimeError);
|
||||
CHECK_THROWS_AS(m.setPatternWord(addr, word), RuntimeError);
|
||||
CHECK_THROWS_WITH(m.setPatternWord(addr, word),
|
||||
Catch::Matchers::Contains("be between 0 and"));
|
||||
|
||||
@ -408,7 +410,7 @@ TEST_CASE("Chiptestboard Dbit offset, list, sampling, advinvert",
|
||||
CHECK(m.getReceiverDbitList().size() == 10);
|
||||
|
||||
list.push_back(64);
|
||||
CHECK_THROWS_AS(m.setReceiverDbitList(list), sls::RuntimeError);
|
||||
CHECK_THROWS_AS(m.setReceiverDbitList(list), RuntimeError);
|
||||
CHECK_THROWS_WITH(m.setReceiverDbitList(list),
|
||||
Catch::Matchers::Contains("be between 0 and 63"));
|
||||
|
||||
@ -476,7 +478,7 @@ TEST_CASE("Eiger or Jungfrau nextframenumber",
|
||||
CHECK(m.acquire() == slsDetectorDefs::OK);
|
||||
CHECK(m.getReceiverCurrentFrameIndex() == val);
|
||||
|
||||
CHECK_THROWS_AS(m.setNextFrameNumber(0), sls::RuntimeError);
|
||||
CHECK_THROWS_AS(m.setNextFrameNumber(0), RuntimeError);
|
||||
|
||||
if (m.getDetectorTypeAsString() == "Eiger") {
|
||||
val = 281474976710655;
|
||||
@ -511,8 +513,10 @@ TEST_CASE("Eiger partialread", "[.eigerintegration][partialread]") {
|
||||
m.setDynamicRange(8);
|
||||
m.setPartialReadout(256);
|
||||
CHECK(m.getPartialReadout() == 256);
|
||||
CHECK_THROWS_AS(m.setPartialReadout(1), sls::RuntimeError);
|
||||
CHECK_THROWS_AS(m.setPartialReadout(1), RuntimeError);
|
||||
CHECK(m.getPartialReadout() == 256);
|
||||
CHECK_THROWS_AS(m.setPartialReadout(0), sls::RuntimeError);
|
||||
CHECK_THROWS_AS(m.setPartialReadout(0), RuntimeError);
|
||||
m.setPartialReadout(256);
|
||||
}
|
||||
|
||||
} // namespace sls
|
||||
|
@ -6,10 +6,12 @@
|
||||
#include "tests/globals.h"
|
||||
#include <iostream>
|
||||
|
||||
namespace sls {
|
||||
|
||||
using namespace Catch::literals;
|
||||
|
||||
TEST_CASE("Initialize a multi detector", "[.integration][.multi]") {
|
||||
auto hostnames = sls::split(test::hostname, '+');
|
||||
auto hostnames = split(test::hostname, '+');
|
||||
|
||||
DetectorImpl d(0, true, true);
|
||||
d.setHostname(test::hostname.c_str());
|
||||
@ -102,3 +104,6 @@ TEST_CASE("Set and read timers", "[.integration][.multi]") {
|
||||
|
||||
d.freeSharedMemory();
|
||||
}
|
||||
|
||||
} // namespace sls
|
||||
|
||||
|
@ -29,6 +29,7 @@ set( PYTHON_FILES
|
||||
decorators.py
|
||||
detector_property.py
|
||||
detector.py
|
||||
defines.py
|
||||
eiger.py
|
||||
enums.py
|
||||
errors.py
|
||||
|
@ -11,7 +11,7 @@ enums.cpp
|
||||
import re
|
||||
import subprocess
|
||||
|
||||
from parse import remove_comments
|
||||
from parse import remove_comments, remove_ifdefs
|
||||
|
||||
|
||||
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:
|
||||
|
30
python/scripts/generate_pydef.py
Normal file
30
python/scripts/generate_pydef.py
Normal file
@ -0,0 +1,30 @@
|
||||
|
||||
|
||||
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')
|
@ -25,7 +25,25 @@ 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
|
||||
|
@ -17,8 +17,9 @@ 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
|
||||
|
31
python/slsdet/defines.py
Normal file
31
python/slsdet/defines.py
Normal file
@ -0,0 +1,31 @@
|
||||
#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
|
@ -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
|
||||
from .proxy import JsonProxy, SlowAdcProxy, ClkDivProxy, MaxPhaseProxy, ClkFreqProxy, PatLoopProxy, PatNLoopProxy, PatWaitProxy, PatWaitTimeProxy
|
||||
from .registers import Register, Adc_register
|
||||
import datetime as dt
|
||||
|
||||
@ -1442,20 +1442,21 @@ class Detector(CppDetectorApi):
|
||||
@property
|
||||
def trimbits(self):
|
||||
"""
|
||||
[Eiger][Mythen3] Loads custom trimbit file to detector.
|
||||
[Eiger][Mythen3] Loads/Saves custom trimbit file to detector.
|
||||
|
||||
Note
|
||||
-----
|
||||
If no extension specified, serial number of each module is attached.
|
||||
|
||||
:getter: Not implemented
|
||||
:setter: Loads the trimbit file to detector
|
||||
:getter: Saves the trimbits from the detector to file. Not implemented with 'trimbits'. Use saveTrimbits().
|
||||
|
||||
Example
|
||||
-------
|
||||
>>> d.trimbits = '/path_to_file/noise'
|
||||
- 14:53:27.931 INFO: Settings file loaded: /path_to_file/noise.sn000
|
||||
"""
|
||||
return NotImplementedError("trimbits are set only")
|
||||
raise NotImplementedError('trimbits is set only. Use saveTrimbits()')
|
||||
|
||||
@trimbits.setter
|
||||
def trimbits(self, fname):
|
||||
@ -1833,13 +1834,13 @@ class Detector(CppDetectorApi):
|
||||
@property
|
||||
@element
|
||||
def threshold(self):
|
||||
"""[Eiger] Threshold in eV
|
||||
"""[Eiger][Mythen3] Threshold in eV
|
||||
|
||||
Note
|
||||
----
|
||||
To change settings as well or set threshold without trimbits, use setThresholdEnergy.
|
||||
|
||||
:setter: It loads trim files from settingspath.
|
||||
:setter: It loads trim files from settingspath.\n [Mythen3] An energy of -1 will pick up values from detector.
|
||||
"""
|
||||
if self.type == detectorType.MYTHEN3:
|
||||
return self.getAllThresholdEnergy()
|
||||
@ -2617,7 +2618,7 @@ class Detector(CppDetectorApi):
|
||||
-------
|
||||
>>> d.vetophoton = (2, 24, 2560, '/tmp/bla.txt')
|
||||
"""
|
||||
raise NotImplementedError('vetofile is set only')
|
||||
raise NotImplementedError('vetophoton is set only')
|
||||
|
||||
@vetophoton.setter
|
||||
def vetophoton(self, args):
|
||||
@ -3097,6 +3098,24 @@ 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):
|
||||
@ -3157,6 +3176,23 @@ 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):
|
||||
@ -3191,6 +3227,23 @@ 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):
|
||||
@ -3253,6 +3306,24 @@ 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):
|
||||
@ -3515,7 +3586,7 @@ class Detector(CppDetectorApi):
|
||||
@property
|
||||
@element
|
||||
def interpolation(self):
|
||||
"""[Mythen3] Enable or disable interpolation. Enabling also enables all counters """
|
||||
"""[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
|
||||
@ -3525,7 +3596,7 @@ class Detector(CppDetectorApi):
|
||||
@property
|
||||
@element
|
||||
def pumpprobe(self):
|
||||
"""[Mythen3] Enable or disable pump probe mode. """
|
||||
"""[Mythen3] Enable or disable pump probe mode. Pump probe mode only enables vth2. Disabling sets back to previous value """
|
||||
return self.getPumpProbe()
|
||||
|
||||
@pumpprobe.setter
|
||||
|
@ -2,15 +2,25 @@
|
||||
# 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):
|
||||
def set_proxy_using_dict(func, key, value, unpack = False):
|
||||
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])
|
||||
else:
|
||||
if unpack:
|
||||
func(key, *value)
|
||||
else:
|
||||
func(key, value)
|
||||
|
||||
|
||||
class JsonProxy:
|
||||
"""
|
||||
Proxy class to allow for intuitive setting and getting of rx_jsonpara
|
||||
@ -128,3 +138,117 @@ class ClkFreqProxy:
|
||||
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')
|
||||
|
@ -144,6 +144,10 @@ 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,
|
||||
@ -187,10 +191,10 @@ void init_det(py::module &m) {
|
||||
(void (Detector::*)(void (*)(double, int, void *), void *)) &
|
||||
Detector::registerAcquisitionFinishedCallback,
|
||||
py::arg(), py::arg())
|
||||
.def(
|
||||
"registerDataCallback",
|
||||
.def("registerDataCallback",
|
||||
(void (Detector::*)(
|
||||
void (*)(detectorData *, uint64_t, uint32_t, void *), void *)) &
|
||||
void (*)(sls::detectorData *, uint64_t, uint32_t, void *),
|
||||
void *)) &
|
||||
Detector::registerDataCallback,
|
||||
py::arg(), py::arg())
|
||||
.def("getNumberOfFrames",
|
||||
@ -786,6 +790,15 @@ 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,
|
||||
@ -1602,11 +1615,6 @@ 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)) &
|
||||
|
@ -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, loop, nloop, wait,
|
||||
PYBIND11_NUMPY_DTYPE(pat, word, ioctrl, limits, startloop, stoploop, nloop, wait,
|
||||
waittime);
|
||||
|
||||
patternParameters.def(py::init());
|
||||
|
@ -235,6 +235,7 @@
|
||||
</property>
|
||||
<addaction name="actionLoadConfiguration"/>
|
||||
<addaction name="actionLoadTrimbits"/>
|
||||
<addaction name="actionSaveTrimbits"/>
|
||||
<addaction name="actionLoadParameters"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuModes">
|
||||
@ -419,6 +420,11 @@ p, li { white-space: pre-wrap; }
|
||||
<string>&About</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionSaveTrimbits">
|
||||
<property name="text">
|
||||
<string>Save Trimbits</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../include/icons.qrc"/>
|
||||
|
@ -20,7 +20,105 @@
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="2" column="0" colspan="4">
|
||||
<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">
|
||||
<widget class="QWidget" name="widgetStatistics" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
@ -212,104 +310,6 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="4">
|
||||
<widget class="QGroupBox" name="boxPlot">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Sans Serif</family>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Sample Plot</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="plotLayout">
|
||||
<property name="margin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QLabel" name="lblInCompleteImage">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="palette">
|
||||
<palette>
|
||||
<active>
|
||||
<colorrole role="WindowText">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>255</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
</active>
|
||||
<inactive>
|
||||
<colorrole role="WindowText">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>255</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
</inactive>
|
||||
<disabled>
|
||||
<colorrole role="WindowText">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>139</red>
|
||||
<green>142</green>
|
||||
<blue>142</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
</disabled>
|
||||
</palette>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Missing Packets</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="lblCompleteImage">
|
||||
<property name="sizePolicy">
|
||||
@ -320,7 +320,7 @@
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<width>120</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
@ -375,6 +375,71 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QLabel" name="lblInCompleteImage">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>110</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="palette">
|
||||
<palette>
|
||||
<active>
|
||||
<colorrole role="WindowText">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>255</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
</active>
|
||||
<inactive>
|
||||
<colorrole role="WindowText">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>255</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
</inactive>
|
||||
<disabled>
|
||||
<colorrole role="WindowText">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>139</red>
|
||||
<green>142</green>
|
||||
<blue>142</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
</disabled>
|
||||
</palette>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Missing Packets</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
|
@ -32,17 +32,29 @@
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lblReadout">
|
||||
<item row="1" column="0" colspan="3">
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>5</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Readout: </string>
|
||||
<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>
|
||||
<item row="0" column="1">
|
||||
@ -77,145 +89,19 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lblComboHV">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lblReadout">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>High Voltage</p><p> #highvoltage#</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>High Voltage: </string>
|
||||
<string>Readout: </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><html><head/><body><p>High Voltage</p><p> #highvoltage#</p></body></html></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><html><head/><body><p>High Voltage. Range: 60 - 200V. Swich off high voltage by setting to 0.</p><p>-1 corresponds to different values from detectors.</p><p>#highvoltage#</p></body></html></string>
|
||||
</property>
|
||||
<property name="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><html><head/><body><p>High Voltage. Range: 60 - 200V. Swich off high voltage by setting to 0.</p><p>-1 corresponds to different values from detectors.</p><p>#highvoltage#</p></body></html></string>
|
||||
</property>
|
||||
<property name="keyboardTracking">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
<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>
|
||||
</widget>
|
||||
<resources>
|
||||
|
@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>775</width>
|
||||
<height>380</height>
|
||||
<height>400</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@ -32,314 +32,77 @@
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="4" 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="4" column="4">
|
||||
<widget class="QCheckBox" name="chkCounter3">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>3</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<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::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="2" column="8">
|
||||
<widget class="QPushButton" name="btnSetThreshold">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<item row="0" column="2" colspan="5">
|
||||
<widget class="QComboBox" name="comboHV">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>30</height>
|
||||
<width>140</width>
|
||||
<height>28</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 name="toolTip">
|
||||
<string><html><head/><body><p>High Voltage</p><p> #highvoltage#</p></body></html></string>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Set</string>
|
||||
<string>0</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../include/icons.qrc">
|
||||
<normaloff>:/icons/images/rightArrow.png</normaloff>:/icons/images/rightArrow.png</iconset>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>90</string>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
</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="lblSettings">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
<widget class="QLabel" name="lblComboHV">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</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 name="toolTip">
|
||||
<string><html><head/><body><p>High Voltage</p><p> #highvoltage#</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Settings:</string>
|
||||
<string>High Voltage: </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<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">
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="lblThreshold">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
@ -361,44 +124,26 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="5">
|
||||
<widget class="QSpinBox" name="spinThreshold2">
|
||||
<item row="6" column="4">
|
||||
<widget class="QCheckBox" name="chkCounter3">
|
||||
<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>
|
||||
<width>50</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="keyboardTracking">
|
||||
<bool>false</bool>
|
||||
<property name="text">
|
||||
<string>3</string>
|
||||
</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 name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="9">
|
||||
<item row="4" column="14">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
@ -414,10 +159,10 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="lblCounter">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="lblSettings">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
@ -432,11 +177,11 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Counters:</string>
|
||||
<string>Settings:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<item row="6" column="2">
|
||||
<widget class="QCheckBox" name="chkCounter1">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
@ -455,7 +200,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2" colspan="3">
|
||||
<item row="2" column="2" colspan="9">
|
||||
<widget class="QComboBox" name="comboSettings">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
@ -469,7 +214,7 @@
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>140</width>
|
||||
<height>25</height>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
@ -594,7 +339,269 @@
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<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">
|
||||
<widget class="QLabel" name="lblGainMode">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
@ -616,7 +623,70 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<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">
|
||||
<widget class="QComboBox" name="comboGainMode">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
@ -630,7 +700,7 @@
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>140</width>
|
||||
<height>25</height>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
@ -674,6 +744,50 @@
|
||||
</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><html><head/><body><p>High Voltage. Range: 60 - 200V. Swich off high voltage by setting to 0.</p><p>-1 corresponds to different values from detectors.</p><p>#highvoltage#</p></body></html></string>
|
||||
</property>
|
||||
<property name="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><html><head/><body><p>High Voltage. Range: 60 - 200V. Swich off high voltage by setting to 0.</p><p>-1 corresponds to different values from detectors.</p><p>#highvoltage#</p></body></html></string>
|
||||
</property>
|
||||
<property name="keyboardTracking">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>200</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
|
@ -5,6 +5,8 @@
|
||||
#include <QMainWindow>
|
||||
#include <QString>
|
||||
|
||||
namespace sls {
|
||||
|
||||
class SlsQtH1D;
|
||||
class SlsQt1DPlot;
|
||||
class SlsQt2DPlot;
|
||||
@ -43,3 +45,5 @@ class qCloneWidget : public QMainWindow, private Ui::ClonePlotObject {
|
||||
|
||||
static int NumClones;
|
||||
};
|
||||
|
||||
} // namespace sls
|
||||
|
@ -6,11 +6,13 @@
|
||||
#include "ui_form_dac.h"
|
||||
#include <string>
|
||||
|
||||
namespace sls {
|
||||
|
||||
class qDacWidget : public QWidget, private Ui::WidgetDacObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
qDacWidget(QWidget *parent, sls::Detector *detector, bool d, std::string n,
|
||||
qDacWidget(QWidget *parent, Detector *detector, bool d, std::string n,
|
||||
slsDetectorDefs::dacIndex i);
|
||||
~qDacWidget();
|
||||
void SetDetectorIndex(int id);
|
||||
@ -25,8 +27,10 @@ class qDacWidget : public QWidget, private Ui::WidgetDacObject {
|
||||
void GetAdc();
|
||||
void Refresh();
|
||||
|
||||
sls::Detector *det;
|
||||
Detector *det;
|
||||
bool isDac{true};
|
||||
slsDetectorDefs::dacIndex index;
|
||||
int detectorIndex{-1};
|
||||
};
|
||||
|
||||
} // namespace sls
|
||||
|
@ -14,6 +14,8 @@
|
||||
#include <ostream>
|
||||
#include <string>
|
||||
|
||||
namespace sls {
|
||||
|
||||
using std::chrono::duration;
|
||||
using std::chrono::duration_cast;
|
||||
using std::chrono::hours;
|
||||
@ -47,9 +49,9 @@ class qDefs : public QWidget {
|
||||
static void DisplayExceptions(std::string emsg, std::string src) {
|
||||
try {
|
||||
throw;
|
||||
} catch (const sls::SocketError &e) {
|
||||
} catch (const SocketError &e) {
|
||||
throw;
|
||||
} catch (const sls::SharedMemoryError &e) {
|
||||
} catch (const SharedMemoryError &e) {
|
||||
throw;
|
||||
} catch (const std::exception &e) {
|
||||
ExceptionMessage(emsg, e.what(), src);
|
||||
@ -63,9 +65,9 @@ class qDefs : public QWidget {
|
||||
typename NonDeduced<CT>::type... Args) {
|
||||
try {
|
||||
throw;
|
||||
} catch (const sls::SocketError &e) {
|
||||
} catch (const SocketError &e) {
|
||||
throw;
|
||||
} catch (const sls::SharedMemoryError &e) {
|
||||
} catch (const SharedMemoryError &e) {
|
||||
throw;
|
||||
} catch (const std::exception &e) {
|
||||
ExceptionMessage(emsg, e.what(), src);
|
||||
@ -329,3 +331,5 @@ class qDefs : public QWidget {
|
||||
source);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace sls
|
||||
|
@ -6,6 +6,11 @@
|
||||
#include "ui_form_detectormain.h"
|
||||
#include <QTabWidget>
|
||||
|
||||
class QScrollArea;
|
||||
class QResizeEvent;
|
||||
|
||||
namespace sls {
|
||||
|
||||
class qDrawPlot;
|
||||
class qTabMeasurement;
|
||||
class qTabDataOutput;
|
||||
@ -15,8 +20,6 @@ class qTabSettings;
|
||||
class qTabDebugging;
|
||||
class qTabDeveloper;
|
||||
class qTabMessages;
|
||||
class QScrollArea;
|
||||
class QResizeEvent;
|
||||
|
||||
/** To Over-ride the QTabWidget class to get the tabBar protected
|
||||
* methodTabWidget */
|
||||
@ -70,7 +73,7 @@ class qDetectorMain : public QMainWindow, private Ui::DetectorMainObject {
|
||||
NumberOfTabs
|
||||
};
|
||||
slsDetectorDefs::detectorType detType;
|
||||
std::unique_ptr<sls::Detector> det;
|
||||
std::unique_ptr<Detector> det;
|
||||
qDrawPlot *plot;
|
||||
MyTabWidget *tabs;
|
||||
QScrollArea *scroll[NumberOfTabs];
|
||||
@ -88,3 +91,5 @@ class qDetectorMain : public QMainWindow, private Ui::DetectorMainObject {
|
||||
QString zoomToolTip;
|
||||
QColor defaultTabColor;
|
||||
};
|
||||
|
||||
} // namespace sls
|
||||
|
@ -6,18 +6,21 @@
|
||||
#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, sls::Detector *detector);
|
||||
qDrawPlot(QWidget *parent, Detector *detector);
|
||||
~qDrawPlot();
|
||||
bool GetIsRunning();
|
||||
void SetRunning(bool enable);
|
||||
@ -55,6 +58,7 @@ 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,7 +99,7 @@ class qDrawPlot : public QWidget, private Ui::PlotObject {
|
||||
|
||||
static const int NUM_PEDESTAL_FRAMES = 20;
|
||||
static const int NUM_GOTTHARD25_CHANS = 1280;
|
||||
sls::Detector *det;
|
||||
Detector *det;
|
||||
slsDetectorDefs::detectorType detType;
|
||||
|
||||
SlsQt1DPlot *plot1d{nullptr};
|
||||
@ -160,6 +164,9 @@ 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};
|
||||
@ -168,3 +175,5 @@ class qDrawPlot : public QWidget, private Ui::PlotObject {
|
||||
int gainOffset{0};
|
||||
bool gotthard25;
|
||||
};
|
||||
|
||||
} // namespace sls
|
||||
|
@ -4,13 +4,15 @@
|
||||
#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, sls::Detector *detector, qDrawPlot *p);
|
||||
qTabAdvanced(QWidget *parent, Detector *detector, qDrawPlot *p);
|
||||
~qTabAdvanced();
|
||||
|
||||
public slots:
|
||||
@ -74,6 +76,8 @@ class qTabAdvanced : public QWidget, private Ui::TabAdvancedObject {
|
||||
void GetExposureTime();
|
||||
void GetGateDelay();
|
||||
|
||||
sls::Detector *det;
|
||||
Detector *det;
|
||||
qDrawPlot *plot;
|
||||
};
|
||||
|
||||
} // namespace sls
|
||||
|
@ -4,11 +4,13 @@
|
||||
#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, sls::Detector *detector);
|
||||
qTabDataOutput(QWidget *parent, Detector *detector);
|
||||
~qTabDataOutput();
|
||||
void Refresh();
|
||||
|
||||
@ -39,7 +41,9 @@ class qTabDataOutput : public QWidget, private Ui::TabDataOutputObject {
|
||||
void GetSpeed();
|
||||
void GetParallel();
|
||||
|
||||
sls::Detector *det;
|
||||
Detector *det;
|
||||
// Button group for radiobuttons for rate
|
||||
QButtonGroup *btnGroupRate;
|
||||
};
|
||||
|
||||
} // namespace sls
|
||||
|
@ -7,11 +7,13 @@
|
||||
class QTreeWidget;
|
||||
class QTreeWidgetItem;
|
||||
|
||||
namespace sls {
|
||||
|
||||
class qTabDebugging : public QWidget, private Ui::TabDebuggingObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
qTabDebugging(QWidget *parent, sls::Detector *detector);
|
||||
qTabDebugging(QWidget *parent, Detector *detector);
|
||||
~qTabDebugging();
|
||||
void Refresh();
|
||||
|
||||
@ -26,10 +28,12 @@ class qTabDebugging : public QWidget, private Ui::TabDebuggingObject {
|
||||
void Initialization();
|
||||
void PopulateDetectors();
|
||||
|
||||
sls::Detector *det;
|
||||
Detector *det;
|
||||
/** Tree Widget displaying the detectors, modules */
|
||||
QTreeWidget *treeDet;
|
||||
QLabel *lblDetectorHostname;
|
||||
QLabel *lblDetectorFirmware;
|
||||
QLabel *lblDetectorSoftware;
|
||||
};
|
||||
|
||||
} // namespace sls
|
||||
|
@ -6,35 +6,30 @@
|
||||
#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, sls::Detector *detector);
|
||||
qTabDeveloper(QWidget *parent, 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);
|
||||
|
||||
sls::Detector *det;
|
||||
Detector *det;
|
||||
std::vector<qDacWidget *> dacWidgets;
|
||||
std::vector<qDacWidget *> adcWidgets;
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
} // namespace sls
|
||||
|
@ -4,14 +4,17 @@
|
||||
#include "sls/Detector.h"
|
||||
#include "ui_form_tab_measurement.h"
|
||||
|
||||
class qDrawPlot;
|
||||
class QStandardItemModel;
|
||||
|
||||
namespace sls {
|
||||
|
||||
class qDrawPlot;
|
||||
|
||||
class qTabMeasurement : public QWidget, private Ui::TabMeasurementObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
qTabMeasurement(QWidget *parent, sls::Detector *detector, qDrawPlot *p);
|
||||
qTabMeasurement(QWidget *parent, Detector *detector, qDrawPlot *p);
|
||||
~qTabMeasurement();
|
||||
|
||||
void Refresh();
|
||||
@ -81,7 +84,7 @@ class qTabMeasurement : public QWidget, private Ui::TabMeasurementObject {
|
||||
void FileNameChangedSignal(QString);
|
||||
|
||||
private:
|
||||
sls::Detector *det;
|
||||
Detector *det;
|
||||
qDrawPlot *plot;
|
||||
// enum for the timing mode
|
||||
enum { AUTO, TRIGGER, GATED, BURST_TRIGGER, TRIGGER_GATED, NUMTIMINGMODES };
|
||||
@ -98,3 +101,5 @@ class qTabMeasurement : public QWidget, private Ui::TabMeasurementObject {
|
||||
int numMeasurements{1};
|
||||
int currentMeasurement{0};
|
||||
};
|
||||
|
||||
} // namespace sls
|
||||
|
@ -6,6 +6,8 @@
|
||||
class QProcess;
|
||||
class QKeyEvent;
|
||||
|
||||
namespace sls {
|
||||
|
||||
class qTabMessages : public QWidget, private Ui::TabMessagesObject {
|
||||
Q_OBJECT
|
||||
|
||||
@ -34,3 +36,5 @@ class qTabMessages : public QWidget, private Ui::TabMessagesObject {
|
||||
QProcess *process;
|
||||
QStringList lastCommand;
|
||||
};
|
||||
|
||||
} // namespace sls
|
||||
|
@ -4,13 +4,15 @@
|
||||
#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, sls::Detector *detector, qDrawPlot *p);
|
||||
qTabPlot(QWidget *parent, Detector *detector, qDrawPlot *p);
|
||||
~qTabPlot();
|
||||
void SetScanArgument();
|
||||
void Refresh();
|
||||
@ -53,7 +55,7 @@ class qTabPlot : public QWidget, private Ui::TabPlotObject {
|
||||
void SetXYRange();
|
||||
void MaintainAspectRatio(int dimension);
|
||||
|
||||
sls::Detector *det;
|
||||
Detector *det;
|
||||
qDrawPlot *plot;
|
||||
bool is1d;
|
||||
|
||||
@ -65,3 +67,5 @@ class qTabPlot : public QWidget, private Ui::TabPlotObject {
|
||||
static QString defaultImageYAxisTitle;
|
||||
static QString defaultImageZAxisTitle;
|
||||
};
|
||||
|
||||
} // namespace sls
|
||||
|
@ -5,17 +5,20 @@
|
||||
#include "ui_form_tab_settings.h"
|
||||
#include <QCheckBox>
|
||||
|
||||
namespace sls {
|
||||
|
||||
class qTabSettings : public QWidget, private Ui::TabSettingsObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
qTabSettings(QWidget *parent, sls::Detector *detector);
|
||||
qTabSettings(QWidget *parent, 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);
|
||||
@ -30,6 +33,7 @@ class qTabSettings : public QWidget, private Ui::TabSettingsObject {
|
||||
void ShowFixG0(bool expertMode);
|
||||
void Initialization();
|
||||
|
||||
void GetHighVoltage();
|
||||
void GetSettings();
|
||||
void GetGainMode();
|
||||
void GetDynamicRange();
|
||||
@ -37,9 +41,15 @@ class qTabSettings : public QWidget, private Ui::TabSettingsObject {
|
||||
void GetThresholdEnergies();
|
||||
void GetCounterMask();
|
||||
|
||||
sls::Detector *det;
|
||||
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,
|
||||
@ -77,3 +87,5 @@ class qTabSettings : public QWidget, private Ui::TabSettingsObject {
|
||||
DYNAMICRANGE_4
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace sls
|
||||
|
@ -9,11 +9,15 @@
|
||||
#include <qwt_plot_curve.h>
|
||||
#include <qwt_plot_marker.h>
|
||||
#include <qwt_scale_div.h>
|
||||
#include <qwt_plot_shapeitem.h>
|
||||
|
||||
class QPen;
|
||||
class SlsQt1DPlot;
|
||||
class QwtSymbol;
|
||||
|
||||
namespace sls {
|
||||
|
||||
class SlsQt1DPlot;
|
||||
|
||||
class SlsQtH1D : public QwtPlotCurve {
|
||||
|
||||
public:
|
||||
@ -136,6 +140,9 @@ 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};
|
||||
@ -159,9 +166,15 @@ 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
|
||||
|
||||
|
||||
|
@ -8,6 +8,8 @@
|
||||
#include <qwt_plot_panner.h>
|
||||
#include <qwt_plot_zoomer.h>
|
||||
|
||||
namespace sls {
|
||||
|
||||
class SlsQtH1D;
|
||||
|
||||
class SlsQt1DZoomer : public QwtPlotZoomer {
|
||||
@ -51,4 +53,6 @@ class SlsQt1DZoomer : public QwtPlotZoomer {
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace sls
|
||||
|
||||
#endif
|
||||
|
@ -9,6 +9,8 @@
|
||||
#include <qwt_scale_draw.h>
|
||||
#include <qwt_scale_widget.h>
|
||||
|
||||
namespace sls {
|
||||
|
||||
class SlsQt2DHist : public QwtRasterData {
|
||||
|
||||
private:
|
||||
@ -125,4 +127,6 @@ class SlsQt2DHist : public QwtRasterData {
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace sls
|
||||
|
||||
#endif
|
||||
|
@ -6,11 +6,14 @@
|
||||
#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
|
||||
|
||||
@ -67,6 +70,8 @@ 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);
|
||||
@ -86,4 +91,7 @@ class SlsQt2DPlot : public QwtPlot {
|
||||
QList<double> contourLevelsLog;
|
||||
bool disableZoom{false};
|
||||
int isLog;
|
||||
QwtPlotShapeItem *roiBox{nullptr};
|
||||
};
|
||||
|
||||
} // namespace sls
|
||||
|
@ -7,6 +7,8 @@
|
||||
#include <qwt_plot_panner.h>
|
||||
#include <qwt_plot_zoomer.h>
|
||||
|
||||
namespace sls {
|
||||
|
||||
class SlsQt2DZoomer : public QwtPlotZoomer {
|
||||
private:
|
||||
SlsQt2DHist *hist;
|
||||
@ -40,4 +42,6 @@ class SlsQt2DZoomer : public QwtPlotZoomer {
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace sls
|
||||
|
||||
#endif
|
||||
|
@ -15,6 +15,10 @@
|
||||
#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)
|
||||
@ -442,6 +446,28 @@ 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());
|
||||
@ -580,3 +606,5 @@ void SlsQt1DPlot::DisableZoom(bool disable) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace sls
|
||||
|
@ -7,6 +7,8 @@
|
||||
#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
|
||||
@ -93,3 +95,5 @@ void SlsQt1DZoomer::ExtendZoomBase(SlsQtH1D *h) {
|
||||
|
||||
ResetZoomBase();
|
||||
}
|
||||
|
||||
} // namespace sls
|
||||
|
@ -9,6 +9,8 @@
|
||||
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)
|
||||
@ -143,3 +145,5 @@ double SlsQt2DHist::SetMinimumToFirstGreaterThanZero() {
|
||||
|
||||
return z_min;
|
||||
}
|
||||
|
||||
} // namespace sls
|
||||
|
@ -2,6 +2,7 @@
|
||||
// Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||
#include "SlsQt2DPlot.h"
|
||||
// #include "sls/ansi.h"
|
||||
#include <array>
|
||||
|
||||
#include <qlist.h>
|
||||
#include <qprinter.h>
|
||||
@ -18,6 +19,8 @@
|
||||
#include <cmath>
|
||||
#include <iostream>
|
||||
|
||||
namespace sls {
|
||||
|
||||
SlsQt2DPlot::SlsQt2DPlot(QWidget *parent) : QwtPlot(parent) {
|
||||
isLog = 0;
|
||||
axisScaleEngine(QwtPlot::yLeft)->setAttribute(QwtScaleEngine::Floating);
|
||||
@ -290,3 +293,26 @@ void SlsQt2DPlot::showSpectrogram(bool 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
|
||||
|
@ -11,6 +11,8 @@
|
||||
#include <QPainter>
|
||||
#include <qwt_text.h>
|
||||
|
||||
namespace sls {
|
||||
|
||||
int qCloneWidget::NumClones{0};
|
||||
|
||||
qCloneWidget::qCloneWidget(QWidget *parent, SlsQt1DPlot *p1, SlsQt2DPlot *p2,
|
||||
@ -44,7 +46,7 @@ qCloneWidget::~qCloneWidget() {
|
||||
void qCloneWidget::SetupWidgetWindow(QString title) {
|
||||
|
||||
std::string winTitle = std::string("Snapshot:") + std::to_string(id) +
|
||||
std::string(" - ") + sls::Logger::Timestamp();
|
||||
std::string(" - ") + Logger::Timestamp();
|
||||
setWindowTitle(QString(winTitle.c_str()));
|
||||
|
||||
boxPlot->setFont(QFont("Sans Serif", qDefs::Q_FONT_SIZE, QFont::Normal));
|
||||
@ -147,3 +149,5 @@ void qCloneWidget::resizeEvent(QResizeEvent *event) {
|
||||
}
|
||||
event->accept();
|
||||
}
|
||||
|
||||
} // namespace sls
|
||||
|
@ -3,7 +3,9 @@
|
||||
#include "qDacWidget.h"
|
||||
#include "qDefs.h"
|
||||
|
||||
qDacWidget::qDacWidget(QWidget *parent, sls::Detector *detector, bool d,
|
||||
namespace sls {
|
||||
|
||||
qDacWidget::qDacWidget(QWidget *parent, Detector *detector, bool d,
|
||||
std::string n, slsDetectorDefs::dacIndex i)
|
||||
: QWidget(parent), det(detector), isDac(d), index(i) {
|
||||
setupUi(this);
|
||||
@ -94,3 +96,5 @@ void qDacWidget::Refresh() {
|
||||
GetAdc();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace sls
|
||||
|
@ -59,7 +59,7 @@ int main(int argc, char **argv) {
|
||||
|
||||
case 'f':
|
||||
fname = optarg;
|
||||
LOG(logDEBUG) << long_options[option_index].name << " " << optarg;
|
||||
LOG(sls::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(logINFO) << "SLS Detector GUI " << GITBRANCH << " (0x"
|
||||
LOG(sls::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(logERROR) << help_message;
|
||||
LOG(sls::logERROR) << help_message;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -96,16 +96,18 @@ int main(int argc, char **argv) {
|
||||
QApplication app(argc, argv);
|
||||
app.setStyle(new QPlastiqueStyle); // style is deleted by QApplication
|
||||
try {
|
||||
qDetectorMain det(multiId, fname, isDeveloper);
|
||||
sls::qDetectorMain det(multiId, fname, isDeveloper);
|
||||
det.show();
|
||||
app.exec();
|
||||
} catch (const std::exception &e) {
|
||||
qDefs::Message(qDefs::CRITICAL,
|
||||
sls::qDefs::Message(sls::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),
|
||||
@ -195,6 +197,7 @@ void qDetectorMain::SetUpWidgetWindow() {
|
||||
tabs->setTabEnabled(ADVANCED, false);
|
||||
tabs->setTabEnabled(DEVELOPER, isDeveloper);
|
||||
actionLoadTrimbits->setVisible(false);
|
||||
actionSaveTrimbits->setVisible(false);
|
||||
|
||||
dockWidgetPlot->setFloating(false);
|
||||
dockWidgetPlot->setFeatures(QDockWidget::NoDockWidgetFeatures);
|
||||
@ -212,7 +215,7 @@ void qDetectorMain::SetUpWidgetWindow() {
|
||||
void qDetectorMain::SetUpDetector(const std::string &config_file, int multiID) {
|
||||
|
||||
// instantiate detector and set window title
|
||||
det = sls::make_unique<sls::Detector>(multiID);
|
||||
det = make_unique<Detector>(multiID);
|
||||
|
||||
// create messages tab to capture config file loading logs
|
||||
tabMessages = new qTabMessages(this);
|
||||
@ -225,10 +228,12 @@ 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:
|
||||
@ -238,15 +243,15 @@ void qDetectorMain::SetUpDetector(const std::string &config_file, int multiID) {
|
||||
default:
|
||||
std::ostringstream os;
|
||||
os << det->getHostname() << " has "
|
||||
<< sls::ToString(det->getDetectorType().squash())
|
||||
<< ToString(det->getDetectorType().squash())
|
||||
<< " detector type (" << std::to_string(detType)
|
||||
<< "). Exiting GUI.";
|
||||
std::string errorMess = os.str();
|
||||
throw sls::RuntimeError(errorMess.c_str());
|
||||
throw RuntimeError(errorMess.c_str());
|
||||
}
|
||||
std::ostringstream os;
|
||||
os << "SLS Detector GUI : "
|
||||
<< sls::ToString(det->getDetectorType().squash()) << " - "
|
||||
<< ToString(det->getDetectorType().squash()) << " - "
|
||||
<< det->getHostname();
|
||||
std::string title = os.str();
|
||||
LOG(logINFO) << title;
|
||||
@ -339,9 +344,9 @@ void qDetectorMain::EnableModes(QAction *action) {
|
||||
enable = actionExpert->isChecked();
|
||||
|
||||
tabs->setTabEnabled(ADVANCED, enable);
|
||||
actionLoadTrimbits->setVisible(enable &&
|
||||
(detType == slsDetectorDefs::EIGER ||
|
||||
detType == slsDetectorDefs::MYTHEN3));
|
||||
bool visible = enable && (detType == slsDetectorDefs::EIGER || detType == slsDetectorDefs::MYTHEN3);
|
||||
actionLoadTrimbits->setVisible(visible);
|
||||
actionSaveTrimbits->setVisible(visible);
|
||||
tabSettings->SetExportMode(enable);
|
||||
LOG(logINFO) << "Expert Mode: " << qDefs::stringEnable(enable);
|
||||
}
|
||||
@ -417,6 +422,22 @@ 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")
|
||||
@ -441,10 +462,10 @@ void qDetectorMain::ExecuteHelp(QAction *action) {
|
||||
LOG(logINFO) << "About Common GUI for Jungfrau, Eiger, Mythen3, "
|
||||
"Gotthard, Gotthard2 and Moench detectors";
|
||||
|
||||
std::string guiVersion = sls::ToStringHex(APIGUI);
|
||||
std::string guiVersion = ToStringHex(APIGUI);
|
||||
std::string clientVersion = "unknown";
|
||||
try {
|
||||
clientVersion = sls::ToStringHex(det->getClientVersion());
|
||||
clientVersion = ToStringHex(det->getClientVersion());
|
||||
}
|
||||
CATCH_DISPLAY("Could not get client version.",
|
||||
"qDetectorMain::ExecuteHelp")
|
||||
@ -577,6 +598,8 @@ 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
|
||||
@ -609,3 +632,5 @@ void qDetectorMain::SetZoomToolTip(bool disable) {
|
||||
else
|
||||
dockWidgetPlot->setToolTip(zoomToolTip);
|
||||
}
|
||||
|
||||
} // namespace sls
|
||||
|
@ -14,7 +14,9 @@
|
||||
#include <QResizeEvent>
|
||||
#include <QtConcurrentRun>
|
||||
|
||||
qDrawPlot::qDrawPlot(QWidget *parent, sls::Detector *detector)
|
||||
namespace sls {
|
||||
|
||||
qDrawPlot::qDrawPlot(QWidget *parent, Detector *detector)
|
||||
: QWidget(parent), det(detector) {
|
||||
setupUi(this);
|
||||
SetupWidgetWindow();
|
||||
@ -278,11 +280,13 @@ 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;
|
||||
@ -292,6 +296,7 @@ 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;
|
||||
@ -301,6 +306,7 @@ 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;
|
||||
}
|
||||
@ -318,6 +324,7 @@ 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);
|
||||
}
|
||||
@ -351,6 +358,7 @@ 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 {
|
||||
@ -369,6 +377,7 @@ 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;
|
||||
@ -377,6 +386,7 @@ 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;
|
||||
}
|
||||
@ -458,17 +468,20 @@ 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;
|
||||
}
|
||||
@ -609,6 +622,13 @@ 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;
|
||||
@ -642,6 +662,7 @@ 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) {
|
||||
@ -709,7 +730,7 @@ void qDrawPlot::AcquisitionFinished(double currentProgress,
|
||||
int detectorStatus) {
|
||||
progress = currentProgress;
|
||||
std::string status =
|
||||
sls::ToString(static_cast<slsDetectorDefs::runStatus>(detectorStatus));
|
||||
ToString(static_cast<slsDetectorDefs::runStatus>(detectorStatus));
|
||||
|
||||
if (detectorStatus == slsDetectorDefs::ERROR) {
|
||||
qDefs::Message(qDefs::WARNING,
|
||||
@ -742,6 +763,7 @@ 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;
|
||||
@ -749,6 +771,22 @@ 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) {
|
||||
@ -987,6 +1025,26 @@ 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() {
|
||||
@ -1015,6 +1073,22 @@ 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() {
|
||||
@ -1200,3 +1274,5 @@ void qDrawPlot::UpdatePlot() {
|
||||
|
||||
LOG(logDEBUG) << "End of Update Plot";
|
||||
}
|
||||
|
||||
} // namespace sls
|
||||
|
@ -5,7 +5,9 @@
|
||||
#include "qDrawPlot.h"
|
||||
#include "sls/network_utils.h"
|
||||
|
||||
qTabAdvanced::qTabAdvanced(QWidget *parent, sls::Detector *detector,
|
||||
namespace sls {
|
||||
|
||||
qTabAdvanced::qTabAdvanced(QWidget *parent, Detector *detector,
|
||||
qDrawPlot *p)
|
||||
: QWidget(parent), det(detector), plot(p) {
|
||||
setupUi(this);
|
||||
@ -443,7 +445,7 @@ void qTabAdvanced::SetDetectorUDPIP(bool force) {
|
||||
std::string s = dispDetectorUDPIP->text().toAscii().constData();
|
||||
LOG(logINFO) << "Setting Detector UDP IP:" << s;
|
||||
try {
|
||||
det->setSourceUDPIP(sls::IpAddr{s},
|
||||
det->setSourceUDPIP(IpAddr{s},
|
||||
{comboDetector->currentIndex()});
|
||||
}
|
||||
CATCH_HANDLE("Could not set Detector UDP IP.",
|
||||
@ -461,7 +463,7 @@ void qTabAdvanced::SetDetectorUDPMAC(bool force) {
|
||||
std::string s = dispDetectorUDPMAC->text().toAscii().constData();
|
||||
LOG(logINFO) << "Setting Detector UDP MAC:" << s;
|
||||
try {
|
||||
det->setSourceUDPMAC(sls::MacAddr{s},
|
||||
det->setSourceUDPMAC(MacAddr{s},
|
||||
{comboDetector->currentIndex()});
|
||||
}
|
||||
CATCH_HANDLE("Could not set Detector UDP MAC.",
|
||||
@ -489,7 +491,7 @@ void qTabAdvanced::SetCltZMQIP(bool force) {
|
||||
std::string s = dispZMQIP->text().toAscii().constData();
|
||||
LOG(logINFO) << "Setting Client ZMQ IP:" << s;
|
||||
try {
|
||||
det->setClientZmqIp(sls::IpAddr{s},
|
||||
det->setClientZmqIp(IpAddr{s},
|
||||
{comboDetector->currentIndex()});
|
||||
}
|
||||
CATCH_HANDLE("Could not set Client ZMQ IP.",
|
||||
@ -547,7 +549,7 @@ void qTabAdvanced::SetRxrUDPIP(bool force) {
|
||||
std::string s = dispRxrUDPIP->text().toAscii().constData();
|
||||
LOG(logINFO) << "Setting Receiver UDP IP:" << s;
|
||||
try {
|
||||
det->setDestinationUDPIP(sls::IpAddr{s},
|
||||
det->setDestinationUDPIP(IpAddr{s},
|
||||
{comboDetector->currentIndex()});
|
||||
}
|
||||
CATCH_HANDLE("Could not set Receiver UDP IP.",
|
||||
@ -565,7 +567,7 @@ void qTabAdvanced::SetRxrUDPMAC(bool force) {
|
||||
std::string s = dispRxrUDPMAC->text().toAscii().constData();
|
||||
LOG(logINFO) << "Setting Receiver UDP MAC:" << s;
|
||||
try {
|
||||
det->setDestinationUDPMAC(sls::MacAddr{s},
|
||||
det->setDestinationUDPMAC(MacAddr{s},
|
||||
{comboDetector->currentIndex()});
|
||||
}
|
||||
CATCH_HANDLE("Could not set Receiver UDP MAC.",
|
||||
@ -593,7 +595,7 @@ void qTabAdvanced::SetRxrZMQIP(bool force) {
|
||||
std::string s = dispRxrZMQIP->text().toAscii().constData();
|
||||
LOG(logINFO) << "Setting Receiver ZMQ IP:" << s;
|
||||
try {
|
||||
det->setRxZmqIP(sls::IpAddr{s}, {comboDetector->currentIndex()});
|
||||
det->setRxZmqIP(IpAddr{s}, {comboDetector->currentIndex()});
|
||||
}
|
||||
CATCH_HANDLE("Could not set Receiver ZMQ IP.",
|
||||
"qTabAdvanced::SetRxrZMQIP", this,
|
||||
@ -891,3 +893,5 @@ void qTabAdvanced::Refresh() {
|
||||
}
|
||||
LOG(logDEBUG) << "**Updated Advanced Tab";
|
||||
}
|
||||
|
||||
} // namespace sls
|
||||
|
@ -11,7 +11,9 @@
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
qTabDataOutput::qTabDataOutput(QWidget *parent, sls::Detector *detector)
|
||||
namespace sls {
|
||||
|
||||
qTabDataOutput::qTabDataOutput(QWidget *parent, Detector *detector)
|
||||
: QWidget(parent), det(detector), btnGroupRate(nullptr) {
|
||||
setupUi(this);
|
||||
SetupWidgetWindow();
|
||||
@ -232,7 +234,7 @@ void qTabDataOutput::GetFileFormat() {
|
||||
comboFileFormat->setCurrentIndex(static_cast<int>(retval));
|
||||
break;
|
||||
default:
|
||||
throw sls::RuntimeError(std::string("Unknown file format: ") +
|
||||
throw RuntimeError(std::string("Unknown file format: ") +
|
||||
std::to_string(static_cast<int>(retval)));
|
||||
}
|
||||
}
|
||||
@ -339,7 +341,7 @@ void qTabDataOutput::EnableRateCorrection() {
|
||||
LOG(logINFO) << "Disabling Rate correction";
|
||||
// disable
|
||||
try {
|
||||
det->setRateCorrection(sls::ns(0));
|
||||
det->setRateCorrection(ns(0));
|
||||
}
|
||||
CATCH_HANDLE("Could not switch off rate correction.",
|
||||
"qTabDataOutput::EnableRateCorrection", this,
|
||||
@ -357,7 +359,7 @@ void qTabDataOutput::SetRateCorrection() {
|
||||
int64_t deadtime = spinCustomDeadTime->value();
|
||||
LOG(logINFO) << "Setting Rate Correction with custom dead time: "
|
||||
<< deadtime;
|
||||
det->setRateCorrection(sls::ns(deadtime));
|
||||
det->setRateCorrection(ns(deadtime));
|
||||
}
|
||||
// default dead time
|
||||
else {
|
||||
@ -442,3 +444,5 @@ void qTabDataOutput::Refresh() {
|
||||
|
||||
LOG(logDEBUG) << "**Updated DataOutput Tab";
|
||||
}
|
||||
|
||||
} // namespace sls
|
||||
|
@ -7,7 +7,9 @@
|
||||
#include <QGridLayout>
|
||||
#include <QTreeWidget>
|
||||
|
||||
qTabDebugging::qTabDebugging(QWidget *parent, sls::Detector *detector)
|
||||
namespace sls {
|
||||
|
||||
qTabDebugging::qTabDebugging(QWidget *parent, Detector *detector)
|
||||
: QWidget(parent), det(detector), treeDet(nullptr),
|
||||
lblDetectorHostname(nullptr), lblDetectorFirmware(nullptr),
|
||||
lblDetectorSoftware(nullptr) {
|
||||
@ -62,7 +64,7 @@ void qTabDebugging::GetDetectorStatus() {
|
||||
LOG(logDEBUG) << "Getting Status";
|
||||
|
||||
try {
|
||||
std::string status = sls::ToString(
|
||||
std::string status = ToString(
|
||||
det->getDetectorStatus({comboDetector->currentIndex()})[0]);
|
||||
lblStatus->setText(QString(status.c_str()).toUpper());
|
||||
}
|
||||
@ -88,7 +90,7 @@ void qTabDebugging::GetInfo() {
|
||||
lblDetectorFirmware->setFixedWidth(100);
|
||||
layout->addWidget(dispFrame, 0, 1);
|
||||
QString detName =
|
||||
QString(sls::ToString(det->getDetectorType().squash()).c_str());
|
||||
QString(ToString(det->getDetectorType().squash()).c_str());
|
||||
|
||||
switch (det->getDetectorType().squash()) {
|
||||
|
||||
@ -241,3 +243,5 @@ void qTabDebugging::Refresh() {
|
||||
GetDetectorStatus();
|
||||
LOG(logDEBUG) << "**Updated Debugging Tab";
|
||||
}
|
||||
|
||||
} // namespace sls
|
||||
|
@ -4,7 +4,9 @@
|
||||
#include "qDacWidget.h"
|
||||
#include "qDefs.h"
|
||||
|
||||
qTabDeveloper::qTabDeveloper(QWidget *parent, sls::Detector *detector)
|
||||
namespace sls {
|
||||
|
||||
qTabDeveloper::qTabDeveloper(QWidget *parent, Detector *detector)
|
||||
: QWidget(parent), det(detector) {
|
||||
setupUi(this);
|
||||
SetupWidgetWindow();
|
||||
@ -16,12 +18,6 @@ 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) {
|
||||
@ -82,8 +78,6 @@ void qTabDeveloper::SetupWidgetWindow() {
|
||||
break;
|
||||
|
||||
case slsDetectorDefs::GOTTHARD:
|
||||
comboHV->show();
|
||||
lblComboHV->show();
|
||||
dacWidgets.push_back(new qDacWidget(
|
||||
this, det, true,
|
||||
"v Reference: ", getSLSIndex(detType, tempid++)));
|
||||
@ -117,8 +111,6 @@ 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++)));
|
||||
@ -148,8 +140,6 @@ void qTabDeveloper::SetupWidgetWindow() {
|
||||
break;
|
||||
|
||||
case slsDetectorDefs::MOENCH:
|
||||
lblSpinHV->show();
|
||||
spinHV->show();
|
||||
dacWidgets.push_back(
|
||||
new qDacWidget(this, det, true,
|
||||
"vbp_colbuf: ", getSLSIndex(detType, tempid++)));
|
||||
@ -173,9 +163,6 @@ 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(
|
||||
@ -216,9 +203,6 @@ 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++)));
|
||||
@ -290,9 +274,6 @@ 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() {
|
||||
@ -309,75 +290,6 @@ 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) {
|
||||
@ -431,7 +343,7 @@ qTabDeveloper::getSLSIndex(slsDetectorDefs::detectorType detType, int index) {
|
||||
case 22:
|
||||
return slsDetectorDefs::TEMPERATURE_FPGA;
|
||||
default:
|
||||
throw sls::RuntimeError(std::string("Unknown dac/adc index") +
|
||||
throw RuntimeError(std::string("Unknown dac/adc index") +
|
||||
std::to_string(index));
|
||||
}
|
||||
break;
|
||||
@ -458,7 +370,7 @@ qTabDeveloper::getSLSIndex(slsDetectorDefs::detectorType detType, int index) {
|
||||
case 9:
|
||||
return slsDetectorDefs::TEMPERATURE_FPGA;
|
||||
default:
|
||||
throw sls::RuntimeError(std::string("Unknown dac/adc index") +
|
||||
throw RuntimeError(std::string("Unknown dac/adc index") +
|
||||
std::to_string(index));
|
||||
}
|
||||
break;
|
||||
@ -484,7 +396,7 @@ qTabDeveloper::getSLSIndex(slsDetectorDefs::detectorType detType, int index) {
|
||||
case 8:
|
||||
return slsDetectorDefs::TEMPERATURE_ADC;
|
||||
default:
|
||||
throw sls::RuntimeError(std::string("Unknown dac/adc index") +
|
||||
throw RuntimeError(std::string("Unknown dac/adc index") +
|
||||
std::to_string(index));
|
||||
}
|
||||
break;
|
||||
@ -508,7 +420,7 @@ qTabDeveloper::getSLSIndex(slsDetectorDefs::detectorType detType, int index) {
|
||||
case 7:
|
||||
return slsDetectorDefs::IBIAS_SFP;
|
||||
default:
|
||||
throw sls::RuntimeError(std::string("Unknown dac/adc index") +
|
||||
throw RuntimeError(std::string("Unknown dac/adc index") +
|
||||
std::to_string(index));
|
||||
}
|
||||
break;
|
||||
@ -550,7 +462,7 @@ qTabDeveloper::getSLSIndex(slsDetectorDefs::detectorType detType, int index) {
|
||||
case 16:
|
||||
return slsDetectorDefs::VTHRESHOLD;
|
||||
default:
|
||||
throw sls::RuntimeError(std::string("Unknown dac/adc index") +
|
||||
throw RuntimeError(std::string("Unknown dac/adc index") +
|
||||
std::to_string(index));
|
||||
}
|
||||
break;
|
||||
@ -586,13 +498,13 @@ qTabDeveloper::getSLSIndex(slsDetectorDefs::detectorType detType, int index) {
|
||||
case 13:
|
||||
return slsDetectorDefs::VCOM_ADC2;
|
||||
default:
|
||||
throw sls::RuntimeError(std::string("Unknown dac/adc index") +
|
||||
throw RuntimeError(std::string("Unknown dac/adc index") +
|
||||
std::to_string(index));
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
throw sls::RuntimeError(std::string("Unknown detector type"));
|
||||
throw RuntimeError(std::string("Unknown detector type"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -604,6 +516,7 @@ void qTabDeveloper::Refresh() {
|
||||
for (const auto &it : adcWidgets) {
|
||||
it->SetDetectorIndex(comboDetector->currentIndex() - 1);
|
||||
}
|
||||
GetHighVoltage();
|
||||
LOG(logDEBUG) << "**Updated Developer Tab";
|
||||
}
|
||||
|
||||
} // namespace sls
|
||||
|
@ -7,7 +7,9 @@
|
||||
#include <QStandardItemModel>
|
||||
#include <QTimer>
|
||||
|
||||
qTabMeasurement::qTabMeasurement(QWidget *parent, sls::Detector *detector,
|
||||
namespace sls {
|
||||
|
||||
qTabMeasurement::qTabMeasurement(QWidget *parent, Detector *detector,
|
||||
qDrawPlot *p)
|
||||
: QWidget(parent), det(detector), plot(p), progressTimer(nullptr) {
|
||||
setupUi(this);
|
||||
@ -337,9 +339,26 @@ void qTabMeasurement::GetTimingMode() {
|
||||
disconnect(comboTimingMode, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetTimingMode(int)));
|
||||
try {
|
||||
auto oldMode = comboTimingMode->currentIndex();
|
||||
auto retval = det->getTimingMode().tsquash(
|
||||
|
||||
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();
|
||||
switch (retval) {
|
||||
case slsDetectorDefs::AUTO_TIMING:
|
||||
case slsDetectorDefs::TRIGGER_EXPOSURE:
|
||||
@ -353,7 +372,7 @@ void qTabMeasurement::GetTimingMode() {
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw sls::RuntimeError(std::string("Unknown timing mode: ") +
|
||||
throw RuntimeError(std::string("Unknown timing mode: ") +
|
||||
std::to_string(retval));
|
||||
}
|
||||
}
|
||||
@ -390,7 +409,7 @@ void qTabMeasurement::GetBurstMode() {
|
||||
ShowTriggerDelay();
|
||||
break;
|
||||
default:
|
||||
throw sls::RuntimeError(std::string("Unknown burst mode: ") +
|
||||
throw RuntimeError(std::string("Unknown burst mode: ") +
|
||||
std::to_string(retval));
|
||||
}
|
||||
}
|
||||
@ -1000,3 +1019,5 @@ void qTabMeasurement::Refresh() {
|
||||
|
||||
LOG(logDEBUG) << "**Updated Measurement Tab";
|
||||
}
|
||||
|
||||
} // namespace sls
|
||||
|
@ -11,6 +11,8 @@
|
||||
#include <QTextStream>
|
||||
#include <string>
|
||||
|
||||
namespace sls {
|
||||
|
||||
qTabMessages::qTabMessages(QWidget *parent) : QWidget(parent) {
|
||||
setupUi(this);
|
||||
SetupWidgetWindow();
|
||||
@ -142,3 +144,5 @@ void qTabMessages::Refresh() {
|
||||
dispCommand->clear();
|
||||
dispCommand->setFocus();
|
||||
}
|
||||
|
||||
} // namespace sls
|
||||
|
@ -6,6 +6,8 @@
|
||||
#include <QStackedLayout>
|
||||
#include <QStandardItemModel>
|
||||
|
||||
namespace sls {
|
||||
|
||||
QString qTabPlot::defaultPlotTitle("");
|
||||
QString qTabPlot::defaultHistXAxisTitle("Channel Number");
|
||||
QString qTabPlot::defaultHistYAxisTitle("Counts");
|
||||
@ -13,7 +15,7 @@ QString qTabPlot::defaultImageXAxisTitle("Pixel");
|
||||
QString qTabPlot::defaultImageYAxisTitle("Pixel");
|
||||
QString qTabPlot::defaultImageZAxisTitle("Intensity");
|
||||
|
||||
qTabPlot::qTabPlot(QWidget *parent, sls::Detector *detector, qDrawPlot *p)
|
||||
qTabPlot::qTabPlot(QWidget *parent, Detector *detector, qDrawPlot *p)
|
||||
: QWidget(parent), det(detector), plot(p), is1d(false) {
|
||||
setupUi(this);
|
||||
SetupWidgetWindow();
|
||||
@ -74,6 +76,10 @@ 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() {
|
||||
@ -327,6 +333,7 @@ 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)
|
||||
@ -792,3 +799,5 @@ void qTabPlot::Refresh() {
|
||||
|
||||
LOG(logDEBUG) << "**Updated Plot Tab";
|
||||
}
|
||||
|
||||
} // namespace sls
|
||||
|
@ -6,7 +6,9 @@
|
||||
#include "sls/bit_utils.h"
|
||||
#include <QStandardItemModel>
|
||||
|
||||
qTabSettings::qTabSettings(QWidget *parent, sls::Detector *detector)
|
||||
namespace sls {
|
||||
|
||||
qTabSettings::qTabSettings(QWidget *parent, Detector *detector)
|
||||
: QWidget(parent), det(detector) {
|
||||
setupUi(this);
|
||||
SetupWidgetWindow();
|
||||
@ -17,6 +19,12 @@ 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();
|
||||
@ -35,6 +43,9 @@ 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);
|
||||
|
||||
@ -75,13 +86,28 @@ 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
|
||||
@ -163,6 +189,11 @@ 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,
|
||||
@ -199,6 +230,91 @@ 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,
|
||||
@ -215,7 +331,7 @@ void qTabSettings::GetSettings() {
|
||||
break;
|
||||
default:
|
||||
if ((int)retval < -1 || (int)retval >= comboSettings->count()) {
|
||||
throw sls::RuntimeError(std::string("Unknown settings: ") +
|
||||
throw RuntimeError(std::string("Unknown settings: ") +
|
||||
std::to_string(retval));
|
||||
}
|
||||
comboSettings->setCurrentIndex(retval);
|
||||
@ -231,7 +347,7 @@ void qTabSettings::SetSettings(int index) {
|
||||
// settings
|
||||
auto val = static_cast<slsDetectorDefs::detectorSettings>(index);
|
||||
try {
|
||||
LOG(logINFO) << "Setting Settings to " << sls::ToString(val);
|
||||
LOG(logINFO) << "Setting Settings to " << ToString(val);
|
||||
det->setSettings(val);
|
||||
}
|
||||
CATCH_HANDLE("Could not set settings.", "qTabSettings::SetSettings", this,
|
||||
@ -250,7 +366,7 @@ void qTabSettings::GetGainMode() {
|
||||
auto retval = det->getGainMode().tsquash(
|
||||
"Inconsistent gain mode for all detectors.");
|
||||
if ((int)retval < 0 || (int)retval >= comboGainMode->count()) {
|
||||
throw sls::RuntimeError(std::string("Unknown gain mode: ") +
|
||||
throw RuntimeError(std::string("Unknown gain mode: ") +
|
||||
std::to_string(retval));
|
||||
}
|
||||
// warning when using fix_g0 and not in export mode
|
||||
@ -321,7 +437,7 @@ void qTabSettings::GetDynamicRange() {
|
||||
comboDynamicRange->setCurrentIndex(DYNAMICRANGE_4);
|
||||
break;
|
||||
default:
|
||||
throw sls::RuntimeError(std::string("Unknown dynamic range: ") +
|
||||
throw RuntimeError(std::string("Unknown dynamic range: ") +
|
||||
std::to_string(retval));
|
||||
}
|
||||
}
|
||||
@ -352,7 +468,7 @@ void qTabSettings::SetDynamicRange(int index) {
|
||||
det->setDynamicRange(4);
|
||||
break;
|
||||
default:
|
||||
throw sls::RuntimeError(std::string("Unknown dynamic range: ") +
|
||||
throw RuntimeError(std::string("Unknown dynamic range: ") +
|
||||
std::to_string(index));
|
||||
}
|
||||
}
|
||||
@ -399,7 +515,7 @@ void qTabSettings::SetThresholdEnergies() {
|
||||
slsDetectorDefs::detectorSettings sett =
|
||||
static_cast<slsDetectorDefs::detectorSettings>(
|
||||
comboSettings->currentIndex());
|
||||
LOG(logINFO) << "Setting Threshold Energies to " << sls::ToString(eV)
|
||||
LOG(logINFO) << "Setting Threshold Energies to " << ToString(eV)
|
||||
<< " (eV)";
|
||||
try {
|
||||
det->setThresholdEnergy(eV, sett);
|
||||
@ -430,7 +546,7 @@ void qTabSettings::GetCounterMask() {
|
||||
disconnect(chkCounter3, SIGNAL(toggled(bool)), this,
|
||||
SLOT(SetCounterMask()));
|
||||
try {
|
||||
auto retval = sls::getSetBits(det->getCounterMask().tsquash(
|
||||
auto retval = getSetBits(det->getCounterMask().tsquash(
|
||||
"Counter mask is inconsistent for all detectors."));
|
||||
// default to unchecked
|
||||
for (auto p : counters) {
|
||||
@ -439,7 +555,7 @@ void qTabSettings::GetCounterMask() {
|
||||
// if retval[i] = 2, chkCounter2 is checked
|
||||
for (auto i : retval) {
|
||||
if (i > 3) {
|
||||
throw sls::RuntimeError(
|
||||
throw RuntimeError(
|
||||
std::string("Unknown counter index : ") +
|
||||
std::to_string(static_cast<int>(i)));
|
||||
}
|
||||
@ -470,6 +586,8 @@ void qTabSettings::SetCounterMask() {
|
||||
void qTabSettings::Refresh() {
|
||||
LOG(logDEBUG) << "**Updating Settings Tab";
|
||||
|
||||
GetHighVoltage();
|
||||
|
||||
if (comboSettings->isEnabled()) {
|
||||
GetSettings();
|
||||
}
|
||||
@ -496,3 +614,5 @@ void qTabSettings::Refresh() {
|
||||
|
||||
LOG(logDEBUG) << "**Updated Settings Tab";
|
||||
}
|
||||
|
||||
} // namespace sls
|
||||
|
@ -568,6 +568,72 @@
|
||||
#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)
|
||||
|
Binary file not shown.
@ -5,7 +5,7 @@
|
||||
#include "sls/sls_detector_defs.h"
|
||||
|
||||
#define MIN_REQRD_VRSN_T_RD_API 0x181130
|
||||
#define REQRD_FRMWR_VRSN 0x201005
|
||||
#define REQRD_FRMWR_VRSN 0x220714
|
||||
|
||||
#define LINKED_SERVER_NAME "ctbDetectorServer"
|
||||
|
||||
|
Binary file not shown.
@ -57,7 +57,6 @@ 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;
|
||||
@ -682,17 +681,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] = 0;
|
||||
(detectorModules)->eV[1] = 0;
|
||||
(detectorModules)->eV[2] = 0;
|
||||
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;
|
||||
thisSettings = UNINITIALIZED;
|
||||
|
||||
// if trimval requested, should return -1 to acknowledge unknown
|
||||
@ -732,9 +731,8 @@ void setupDetector() {
|
||||
getSubExpTime(DEFAULT_SUBFRAME_DEADTIME);
|
||||
setPeriod(DEFAULT_PERIOD);
|
||||
setNumTriggers(DEFAULT_NUM_CYCLES);
|
||||
eiger_dynamicrange = DEFAULT_DYNAMIC_RANGE;
|
||||
setDynamicRange(DEFAULT_DYNAMIC_RANGE);
|
||||
eiger_photonenergy = DEFAULT_PHOTON_ENERGY;
|
||||
detectorModules->eV[0] = DEFAULT_PHOTON_ENERGY;
|
||||
setParallelMode(DEFAULT_PARALLEL_MODE);
|
||||
setOverFlowMode(DEFAULT_READOUT_OVERFLOW32_MODE);
|
||||
setReadoutSpeed(DEFAULT_CLK_SPEED);
|
||||
@ -1127,24 +1125,42 @@ 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));
|
||||
|
||||
// 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");
|
||||
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));
|
||||
setSettings(UNDEFINED);
|
||||
LOG(logERROR, ("Settings has been changed to undefined\n"));
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
// serial number (pointless)
|
||||
detectorModules->serialnumber = myMod.serialnumber;
|
||||
|
||||
// settings
|
||||
setSettings((enum detectorSettings)myMod.reg);
|
||||
|
||||
// iodelay
|
||||
if (setIODelay(myMod.iodelay) != myMod.iodelay) {
|
||||
@ -1178,60 +1194,15 @@ int setModule(sls_detector_module myMod, char *mess) {
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef VIRTUAL
|
||||
// trimbits
|
||||
#ifndef VIRTUAL
|
||||
if (myMod.nchan == 0) {
|
||||
LOG(logINFO, ("Setting module without trimbits\n"));
|
||||
} else {
|
||||
LOG(logINFO, ("Setting module with trimbits\n"));
|
||||
// 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();
|
||||
if (setTrimbits(myMod.chanregs, mess) == FAIL) {
|
||||
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
|
||||
|
||||
@ -1284,6 +1255,7 @@ enum detectorSettings setSettings(enum detectorSettings sett) {
|
||||
return thisSettings;
|
||||
}
|
||||
thisSettings = sett;
|
||||
detectorModules->reg = sett;
|
||||
LOG(logINFO, ("Settings: %d\n", thisSettings));
|
||||
return thisSettings;
|
||||
}
|
||||
@ -1294,13 +1266,14 @@ enum detectorSettings getSettings() { return thisSettings; }
|
||||
|
||||
int getThresholdEnergy() {
|
||||
LOG(logDEBUG1, ("Getting Threshold energy\n"));
|
||||
return eiger_photonenergy;
|
||||
return detectorModules->eV[0];
|
||||
}
|
||||
|
||||
int setThresholdEnergy(int ev) {
|
||||
LOG(logINFO, ("Setting threshold energy:%d\n", ev));
|
||||
if (ev >= 0)
|
||||
eiger_photonenergy = ev;
|
||||
if (ev >= 0) {
|
||||
detectorModules->eV[0] = ev;
|
||||
}
|
||||
return getThresholdEnergy();
|
||||
}
|
||||
|
||||
@ -1910,6 +1883,7 @@ int setIODelay(int val) {
|
||||
#else
|
||||
eiger_iodelay = val;
|
||||
#endif
|
||||
detectorModules->iodelay = val;
|
||||
}
|
||||
return eiger_iodelay;
|
||||
}
|
||||
@ -2153,7 +2127,6 @@ void setDefaultSettingsTau_in_nsec(int t) {
|
||||
int64_t getCurrentTau() {
|
||||
if (!getRateCorrectionEnable()) {
|
||||
eiger_tau_ns = 0;
|
||||
return 0;
|
||||
} else {
|
||||
#ifndef VIRTUAL
|
||||
sharedMemory_lockLocalLink();
|
||||
@ -2162,8 +2135,9 @@ 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[]) {
|
||||
@ -2184,6 +2158,68 @@ 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
|
||||
@ -2195,6 +2231,8 @@ int setAllTrimbits(int val) {
|
||||
}
|
||||
sharedMemory_unlockLocalLink();
|
||||
#endif
|
||||
|
||||
// copying trimbits locally
|
||||
if (detectorModules) {
|
||||
for (int ichan = 0; ichan < (detectorModules->nchan); ichan++) {
|
||||
*((detectorModules->chanregs) + ichan) = val;
|
||||
@ -2906,53 +2944,6 @@ 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;
|
||||
|
Binary file not shown.
@ -2297,6 +2297,24 @@ 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;
|
||||
}
|
||||
|
||||
@ -2798,13 +2816,10 @@ 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));
|
||||
|
Binary file not shown.
@ -432,6 +432,8 @@ 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();
|
||||
|
||||
@ -857,8 +859,10 @@ 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)\n", arg.xmin, arg.xmax));
|
||||
LOG(logINFO, ("Setting ROI:(%d, %d, %d, %d)\n", arg.xmin, arg.xmax, arg.ymin, arg.ymax));
|
||||
// validation
|
||||
// xmin divisible by 256 and less than 1280
|
||||
if (((arg.xmin % NCHAN_PER_ADC) != 0) ||
|
||||
@ -892,7 +896,7 @@ ROI getROI() {
|
||||
if (rois.xmin == -1) {
|
||||
LOG(logINFO, ("\tROI: None\n"));
|
||||
} else {
|
||||
LOG(logINFO, ("ROI: (%d,%d)\n", rois.xmin, rois.xmax));
|
||||
LOG(logINFO, ("ROI: (%d,%d,%d,%d)\n", rois.xmin, rois.xmax, rois.ymin, rois.ymax));
|
||||
}
|
||||
return rois;
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ target_include_directories(jungfrauDetectorServer_virtual
|
||||
)
|
||||
|
||||
target_compile_definitions(jungfrauDetectorServer_virtual
|
||||
PUBLIC JUNGFRAUD VIRTUAL STOP_SERVER
|
||||
PUBLIC JUNGFRAUD VIRTUAL STOP_SERVER #TEST_MOD_GEOMETRY
|
||||
)
|
||||
|
||||
target_link_libraries(jungfrauDetectorServer_virtual
|
||||
|
Binary file not shown.
@ -286,3 +286,16 @@ patwait1 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
|
||||
|
@ -572,5 +572,72 @@
|
||||
#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)
|
||||
|
@ -286,3 +286,16 @@ patwait1 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
|
||||
|
Binary file not shown.
@ -5,7 +5,7 @@
|
||||
#include "sls/sls_detector_defs.h"
|
||||
|
||||
#define MIN_REQRD_VRSN_T_RD_API 0x180314
|
||||
#define REQRD_FRMWR_VRSN 0x201005
|
||||
#define REQRD_FRMWR_VRSN 0x220714
|
||||
|
||||
#define LINKED_SERVER_NAME "moenchDetectorServer"
|
||||
|
||||
|
Binary file not shown.
@ -73,13 +73,13 @@ patternParameters *setChipStatusRegisterPattern(int csr) {
|
||||
error = 1;
|
||||
}
|
||||
// set pattern wait address
|
||||
for (int i = 0; i <= 2; i++)
|
||||
for (int i = 0; i < M3_MAX_PATTERN_LEVELS; i++)
|
||||
pat->wait[i] = MAX_PATTERN_LENGTH - 1;
|
||||
// pattern loop
|
||||
for (int i = 0; i <= 2; i++) {
|
||||
for (int i = 0; i < M3_MAX_PATTERN_LEVELS; i++) {
|
||||
// int stop = MAX_PATTERN_LENGTH - 1, nloop = 0;
|
||||
pat->loop[i * 2 + 0] = MAX_PATTERN_LENGTH - 1;
|
||||
pat->loop[i * 2 + 1] = MAX_PATTERN_LENGTH - 1;
|
||||
pat->startloop[i] = MAX_PATTERN_LENGTH - 1;
|
||||
pat->stoploop[i] = MAX_PATTERN_LENGTH - 1;
|
||||
pat->nloop[i] = 0;
|
||||
}
|
||||
|
||||
@ -349,13 +349,13 @@ patternParameters *setChannelRegisterChip(int ichip, int *mask, int *trimbits) {
|
||||
error = 1;
|
||||
}
|
||||
// set pattern wait address
|
||||
for (int i = 0; i <= 2; i++)
|
||||
for (int i = 0; i < M3_MAX_PATTERN_LEVELS; i++)
|
||||
pat->wait[i] = MAX_PATTERN_LENGTH - 1;
|
||||
// pattern loop
|
||||
for (int i = 0; i <= 2; i++) {
|
||||
for (int i = 0; i < M3_MAX_PATTERN_LEVELS; i++) {
|
||||
// int stop = MAX_PATTERN_LENGTH - 1, nloop = 0;
|
||||
pat->loop[i * 2 + 0] = MAX_PATTERN_LENGTH - 1;
|
||||
pat->loop[i * 2 + 1] = MAX_PATTERN_LENGTH - 1;
|
||||
pat->startloop[i] = MAX_PATTERN_LENGTH - 1;
|
||||
pat->stoploop[i] = MAX_PATTERN_LENGTH - 1;
|
||||
pat->nloop[i] = 0;
|
||||
}
|
||||
|
||||
|
@ -68,6 +68,7 @@ int64_t exptimeReg[NCOUNTERS] = {0, 0, 0};
|
||||
int64_t gateDelayReg[NCOUNTERS] = {0, 0, 0};
|
||||
int vthEnabledVals[NCOUNTERS] = {0, 0, 0};
|
||||
int detID = 0;
|
||||
int counterMask = 0x0;
|
||||
|
||||
int isInitCheckDone() { return initCheckDone; }
|
||||
|
||||
@ -421,7 +422,7 @@ void allocateDetectorStructureMemory() {
|
||||
detectorDacs[idac] = 0;
|
||||
}
|
||||
|
||||
// trimbits start at 0 //TODO: restart server will not have 0 always
|
||||
// trimbits start at 0
|
||||
for (int ichan = 0; ichan < (detectorModules->nchan); ichan++) {
|
||||
*((detectorModules->chanregs) + ichan) = 0;
|
||||
}
|
||||
@ -474,17 +475,19 @@ void setupDetector() {
|
||||
|
||||
// defaults
|
||||
setHighVoltage(DEFAULT_HIGH_VOLTAGE);
|
||||
resetToDefaultDacs(0);
|
||||
setASICDefaults();
|
||||
setADIFDefaults();
|
||||
|
||||
// enable all counters before setting dacs (vthx)
|
||||
setCounterMask(MAX_COUNTER_MSK);
|
||||
resetToDefaultDacs(0);
|
||||
|
||||
// set trigger flow for m3 (for all timing modes)
|
||||
bus_w(FLOW_TRIGGER_REG, bus_r(FLOW_TRIGGER_REG) | FLOW_TRIGGER_MSK);
|
||||
|
||||
// dynamic range
|
||||
setDynamicRange(DEFAULT_DYNAMIC_RANGE);
|
||||
// enable all counters
|
||||
setCounterMask(MAX_COUNTER_MSK);
|
||||
|
||||
|
||||
// Initialization of acquistion parameters
|
||||
setNumFrames(DEFAULT_NUM_FRAMES);
|
||||
@ -596,8 +599,8 @@ int resetToDefaultDacs(int hardReset) {
|
||||
}
|
||||
}
|
||||
|
||||
// set to defualt
|
||||
setDAC((enum DACINDEX)i, value, 0);
|
||||
// set to default (last arg to ensure counter check)
|
||||
setDAC((enum DACINDEX)i, value, 0, 1);
|
||||
if (detectorDacs[i] != value) {
|
||||
LOG(logERROR, ("Setting dac %d failed, wrote %d, read %d\n", i,
|
||||
value, detectorDacs[i]));
|
||||
@ -1087,12 +1090,44 @@ int64_t getGateDelay(int gateIndex) {
|
||||
return retval / (1E-9 * getFrequency(SYSTEM_C0));
|
||||
}
|
||||
|
||||
void updateVthAndCounterMask() {
|
||||
LOG(logINFO, ("\tUpdating Vth and countermask\n"));
|
||||
int interpolation = getInterpolation();
|
||||
int pumpProbe = getPumpProbe();
|
||||
|
||||
if (interpolation) {
|
||||
// enable all counters
|
||||
setCounterMaskWithUpdateFlag(MAX_COUNTER_MSK, 0);
|
||||
// disable vth3
|
||||
setVthDac(2, 0);
|
||||
} else {
|
||||
// previous counter values
|
||||
setCounterMaskWithUpdateFlag(counterMask, 0);
|
||||
}
|
||||
if (pumpProbe) {
|
||||
// enable only vth2
|
||||
setVthDac(0, 0);
|
||||
setVthDac(1, 1);
|
||||
setVthDac(2, 0);
|
||||
} else {
|
||||
setVthDac(0, (counterMask & (1 << 0)));
|
||||
setVthDac(1, (counterMask & (1 << 1)));
|
||||
}
|
||||
if (!interpolation && !pumpProbe) {
|
||||
setVthDac(2, (counterMask & (1 << 2)));
|
||||
}
|
||||
}
|
||||
|
||||
void setCounterMask(uint32_t arg) {
|
||||
setCounterMaskWithUpdateFlag(arg, 1);
|
||||
updateVthAndCounterMask();
|
||||
}
|
||||
|
||||
void setCounterMaskWithUpdateFlag(uint32_t arg, int updateMaskFlag) {
|
||||
if (arg == 0 || arg > MAX_COUNTER_MSK) {
|
||||
return;
|
||||
}
|
||||
uint32_t oldmask = getCounterMask();
|
||||
LOG(logINFO, ("Setting counter mask to 0x%x\n", arg));
|
||||
LOG(logINFO, ("\tSetting counter mask to 0x%x\n", arg));
|
||||
uint32_t addr = CONFIG_REG;
|
||||
bus_w(addr, bus_r(addr) & ~CONFIG_COUNTERS_ENA_MSK);
|
||||
bus_w(addr, bus_r(addr) | ((arg << CONFIG_COUNTERS_ENA_OFST) &
|
||||
@ -1108,19 +1143,8 @@ void setCounterMask(uint32_t arg) {
|
||||
setGateDelay(i, ns);
|
||||
}
|
||||
|
||||
LOG(logINFO, ("\tUpdating Vth dacs\n"));
|
||||
enum DACINDEX vthdacs[] = {M_VTH1, M_VTH2, M_VTH3};
|
||||
for (int i = 0; i < NCOUNTERS; ++i) {
|
||||
// if change in enable
|
||||
if ((arg & (1 << i)) ^ (oldmask & (1 << i))) {
|
||||
// disable, disable value
|
||||
int value = DEFAULT_COUNTER_DISABLED_VTH_VAL;
|
||||
// enable, set saved values
|
||||
if (arg & (1 << i)) {
|
||||
value = vthEnabledVals[i];
|
||||
}
|
||||
setGeneralDAC(vthdacs[i], value, 0);
|
||||
}
|
||||
if (updateMaskFlag) {
|
||||
counterMask = arg;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1241,7 +1265,8 @@ int64_t getMeasurementTime() {
|
||||
int setDACS(int *dacs) {
|
||||
for (int i = 0; i < NDAC; ++i) {
|
||||
if (dacs[i] != -1) {
|
||||
setDAC((enum DACINDEX)i, dacs[i], 0);
|
||||
// set to default (last arg to ensure counter check)
|
||||
setDAC((enum DACINDEX)i, dacs[i], 0, 1);
|
||||
if (dacs[i] != detectorDacs[i]) {
|
||||
// dont complain if that counter was disabled
|
||||
if ((i == M_VTH1 || i == M_VTH2 || i == M_VTH3) &&
|
||||
@ -1255,21 +1280,55 @@ int setDACS(int *dacs) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
void getModule(sls_detector_module* myMod) {
|
||||
// serial number
|
||||
myMod->serialnumber = detectorModules->serialnumber;
|
||||
// csr reg
|
||||
myMod->reg = detectorModules->reg;
|
||||
// eV
|
||||
myMod->eV[0] = detectorModules->eV[0];
|
||||
myMod->eV[1] = detectorModules->eV[1];
|
||||
myMod->eV[2] = detectorModules->eV[2];
|
||||
// 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\n"));
|
||||
|
||||
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;
|
||||
|
||||
// csr reg
|
||||
if (setChipStatusRegister(myMod.reg)) {
|
||||
sprintf(mess, "Could not CSR from module\n");
|
||||
LOG(logERROR, (mess));
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
// dacs
|
||||
if (setDACS(myMod.dacs)) {
|
||||
sprintf(mess, "Could not set dacs\n");
|
||||
LOG(logERROR, (mess));
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
// update vth and countermask
|
||||
updateVthAndCounterMask();
|
||||
|
||||
// threshold energy
|
||||
for (int i = 0; i < NCOUNTERS; ++i) {
|
||||
if (myMod.eV[i] >= 0) {
|
||||
setThresholdEnergy(i, myMod.eV[i]);
|
||||
@ -1300,7 +1359,7 @@ int setTrimbits(int *trimbits) {
|
||||
uint32_t prevRunClk = clkDivider[SYSTEM_C0];
|
||||
|
||||
// set to trimming clock
|
||||
if (setClockDivider(SYSTEM_C0, DEFAULT_TRIMMING_RUN_CLKDIV) == FAIL) {
|
||||
if (setClockDividerWithTimeUpdateOption(SYSTEM_C0, DEFAULT_TRIMMING_RUN_CLKDIV, 0) == FAIL) {
|
||||
LOG(logERROR,
|
||||
("Could not start trimming. Could not set to trimming clock\n"));
|
||||
return FAIL;
|
||||
@ -1333,11 +1392,17 @@ int setTrimbits(int *trimbits) {
|
||||
}
|
||||
|
||||
// set back to previous clock
|
||||
if (setClockDivider(SYSTEM_C0, prevRunClk) == FAIL) {
|
||||
if (setClockDividerWithTimeUpdateOption(SYSTEM_C0, prevRunClk, 0) == FAIL) {
|
||||
LOG(logERROR, ("Could not set to previous run clock after trimming\n"));
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
// copying trimbits locally (if tirmbit value > -1)
|
||||
for (int ichan = 0; ichan < (detectorModules->nchan); ichan++) {
|
||||
if (*(trimbits + ichan) >= 0)
|
||||
*((detectorModules->chanregs) + ichan) = *(trimbits + ichan);
|
||||
}
|
||||
|
||||
return (error ? FAIL : OK);
|
||||
}
|
||||
|
||||
@ -1403,7 +1468,8 @@ enum detectorSettings setSettings(enum detectorSettings sett) {
|
||||
// set special dacs
|
||||
const int specialDacs[] = SPECIALDACINDEX;
|
||||
for (int i = 0; i < NSPECIALDACS; ++i) {
|
||||
setDAC(specialDacs[i], dacVals[i], 0);
|
||||
// set to default (last arg to ensure counter check)
|
||||
setDAC(specialDacs[i], dacVals[i], 0, 1);
|
||||
}
|
||||
|
||||
LOG(logINFO, ("Settings: %d\n", thisSettings));
|
||||
@ -1411,6 +1477,9 @@ enum detectorSettings setSettings(enum detectorSettings sett) {
|
||||
}
|
||||
|
||||
void validateSettings() {
|
||||
LOG(logWARNING, ("Not validating dac settings temporarily"));
|
||||
return;
|
||||
|
||||
// if any special dac value is changed individually => undefined
|
||||
const int specialDacs[NSPECIALDACS] = SPECIALDACINDEX;
|
||||
int *specialDacValues[] = {defaultDacValue_standard, defaultDacValue_fast,
|
||||
@ -1460,7 +1529,8 @@ void setThresholdEnergy(int counterIndex, int eV) {
|
||||
}
|
||||
|
||||
/* parameters - dac, hv */
|
||||
void setDAC(enum DACINDEX ind, int val, int mV) {
|
||||
// counterEnableCheck false only if setDAC called directly
|
||||
void setDAC(enum DACINDEX ind, int val, int mV, int counterEnableCheck) {
|
||||
// invalid value
|
||||
if (val < 0) {
|
||||
return;
|
||||
@ -1471,7 +1541,10 @@ void setDAC(enum DACINDEX ind, int val, int mV) {
|
||||
return;
|
||||
}
|
||||
|
||||
// threshold dacs (remember value, vthreshold: skip disabled)
|
||||
// threshold dacs
|
||||
// remember value, vthreshold: skip disabled,
|
||||
// others: disable or enable dac if counter mask
|
||||
// setDAC called directly: will set independent of counter enable
|
||||
if (ind == M_VTHRESHOLD || ind == M_VTH1 || ind == M_VTH2 ||
|
||||
ind == M_VTH3) {
|
||||
char *dac_names[] = {DAC_NAMES};
|
||||
@ -1482,7 +1555,6 @@ void setDAC(enum DACINDEX ind, int val, int mV) {
|
||||
int dacval = val;
|
||||
// if not disabled value, remember value
|
||||
if (dacval != DEFAULT_COUNTER_DISABLED_VTH_VAL) {
|
||||
// convert mv to dac
|
||||
if (mV) {
|
||||
if (LTC2620_D_VoltageToDac(val, &dacval) == FAIL) {
|
||||
return;
|
||||
@ -1492,10 +1564,17 @@ void setDAC(enum DACINDEX ind, int val, int mV) {
|
||||
LOG(logINFO,
|
||||
("Remembering %s [%d]\n", dac_names[ind], dacval));
|
||||
}
|
||||
// if vthreshold,skip for disabled counters
|
||||
if ((ind == M_VTHRESHOLD) && (!(counters & (1 << i)))) {
|
||||
// disabled counter
|
||||
if (!(counters & (1 << i))) {
|
||||
// skip setting vthx dac (value remembered anyway)
|
||||
if (ind == M_VTHRESHOLD) {
|
||||
continue;
|
||||
}
|
||||
// disable dac (except when setting dac directly)
|
||||
if (counterEnableCheck) {
|
||||
val = DEFAULT_COUNTER_DISABLED_VTH_VAL;
|
||||
}
|
||||
}
|
||||
setGeneralDAC(vthdacs[i], val, mV);
|
||||
}
|
||||
}
|
||||
@ -1535,6 +1614,19 @@ void setGeneralDAC(enum DACINDEX ind, int val, int mV) {
|
||||
}
|
||||
}
|
||||
|
||||
void setVthDac(int index, int enable) {
|
||||
LOG(logINFO, ("\t%s vth%d\n", (enable ? "Enabling" : "Disabing"), index));
|
||||
// enables (from remembered values) or disables vthx
|
||||
enum DACINDEX vthdacs[] = {M_VTH1, M_VTH2, M_VTH3};
|
||||
// disable value
|
||||
int value = DEFAULT_COUNTER_DISABLED_VTH_VAL;
|
||||
// enable, set saved values
|
||||
if (enable) {
|
||||
value = vthEnabledVals[index];
|
||||
}
|
||||
setGeneralDAC(vthdacs[index], value, 0);
|
||||
}
|
||||
|
||||
int getDAC(enum DACINDEX ind, int mV) {
|
||||
if (ind == M_VTHRESHOLD) {
|
||||
int ret = -1, ret1 = -1;
|
||||
@ -1698,23 +1790,24 @@ int setGainCaps(int caps) {
|
||||
int setInterpolation(int enable) {
|
||||
LOG(logINFO,
|
||||
("%s Interpolation\n", enable == 0 ? "Disabling" : "Enabling"));
|
||||
if (enable) {
|
||||
setCounterMask(MAX_COUNTER_MSK);
|
||||
if (getCounterMask() != MAX_COUNTER_MSK) {
|
||||
LOG(logERROR,
|
||||
("Could not set interpolation. Could not enable all counters"));
|
||||
return FAIL;
|
||||
}
|
||||
LOG(logINFO, ("\tEnabled all counters\n"));
|
||||
}
|
||||
|
||||
int csr = M3SetInterpolation(enable);
|
||||
return setChipStatusRegister(csr);
|
||||
int ret = setChipStatusRegister(csr);
|
||||
if (ret == OK) {
|
||||
updateVthAndCounterMask();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int setPumpProbe(int enable) {
|
||||
LOG(logINFO, ("%s Pump Probe\n", enable == 0 ? "Disabling" : "Enabling"));
|
||||
|
||||
int csr = M3SetPumpProbe(enable);
|
||||
return setChipStatusRegister(csr);
|
||||
int ret = setChipStatusRegister(csr);
|
||||
if (ret == OK) {
|
||||
updateVthAndCounterMask();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int setDigitalPulsing(int enable) {
|
||||
@ -2175,6 +2268,10 @@ int getVCOFrequency(enum CLKINDEX ind) {
|
||||
int getMaxClockDivider() { return ALTERA_PLL_C10_GetMaxClockDivider(); }
|
||||
|
||||
int setClockDivider(enum CLKINDEX ind, int val) {
|
||||
return setClockDividerWithTimeUpdateOption(ind, val, 1);
|
||||
}
|
||||
|
||||
int setClockDividerWithTimeUpdateOption(enum CLKINDEX ind, int val, int timeUpdate) {
|
||||
if (ind < 0 || ind >= NUM_CLOCKS) {
|
||||
LOG(logERROR, ("Unknown clock index %d to set clock divider\n", ind));
|
||||
return FAIL;
|
||||
@ -2199,6 +2296,32 @@ int setClockDivider(enum CLKINDEX ind, int val) {
|
||||
int pllIndex = (int)(ind >= SYSTEM_C0 ? SYSTEM_PLL : READOUT_PLL);
|
||||
int clkIndex = (int)(ind >= SYSTEM_C0 ? ind - SYSTEM_C0 : ind);
|
||||
ALTERA_PLL_C10_SetOuputClockDivider(pllIndex, clkIndex, val);
|
||||
|
||||
// Update time settings that depend on system frequency
|
||||
// timeUpdate = 0 for setChipRegister/setTrimbits etc
|
||||
// as clk reverted back again
|
||||
if (timeUpdate && ind == SYSTEM_C0) {
|
||||
LOG(logINFO, ("\tUpdating time settings (sys freq change)\n"));
|
||||
int64_t exptime[3] = {0, 0, 0};
|
||||
int64_t gateDelay[3] = {0, 0, 0};
|
||||
for (int i = 0; i != 3; ++i) {
|
||||
exptime[i] = getExpTime(i);
|
||||
gateDelay[i] = getGateDelay(i);
|
||||
}
|
||||
int64_t period = getPeriod();
|
||||
int64_t delayAfterTrigger = getDelayAfterTrigger();
|
||||
|
||||
clkDivider[ind] = val;
|
||||
|
||||
for (int i = 0; i != 3; ++i) {
|
||||
setExpTime(i, exptime[i]);
|
||||
setGateDelay(i, gateDelay[i]);
|
||||
}
|
||||
setPeriod(period);
|
||||
setDelayAfterTrigger(delayAfterTrigger);
|
||||
LOG(logINFO, ("\tDone updating time settings\n"));
|
||||
}
|
||||
|
||||
clkDivider[ind] = val;
|
||||
LOG(logINFO, ("\t%s clock (%d) divider set to %d\n", clock_names[ind], ind,
|
||||
clkDivider[ind]));
|
||||
@ -2314,6 +2437,7 @@ void *start_timer(void *arg) {
|
||||
if (dr == 32 && ncounters > 1) {
|
||||
packetsPerFrame = 2;
|
||||
}
|
||||
dataSize = imageSize / packetsPerFrame;
|
||||
}
|
||||
// 1g
|
||||
else {
|
||||
@ -2332,36 +2456,58 @@ void *start_timer(void *arg) {
|
||||
// Generate data
|
||||
char imageData[imageSize];
|
||||
memset(imageData, 0, imageSize);
|
||||
// {
|
||||
// const int nchannels = NCHAN_1_COUNTER * NCHIP * ncounters;
|
||||
|
||||
// for (int i = 0; i < nchannels; ++i) {
|
||||
// int j = rand();
|
||||
// switch (dr) {
|
||||
// //case 1: // TODO: Not implemented in firmware yet
|
||||
// // break;
|
||||
|
||||
// case 8:
|
||||
// *((uint8_t *)(imageData + i)) = (uint8_t)j;
|
||||
// break;
|
||||
// case 16:
|
||||
// *((uint16_t *)(imageData + i * sizeof(uint16_t))) = (uint16_t)j;
|
||||
// break;
|
||||
// case 32:
|
||||
// *((uint32_t *)(imageData + i * sizeof(uint32_t))) = ((uint32_t)j & 0xFFFFFF); // 24 bit
|
||||
// break;
|
||||
// default:
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// Send data
|
||||
// loop over number of frames
|
||||
for (int frameNr = 0; frameNr != numFrames; ++frameNr) {
|
||||
|
||||
{
|
||||
const int nchannels = NCHAN_1_COUNTER * NCHIP * ncounters;
|
||||
|
||||
switch (dr) {
|
||||
/*case 1: // TODO: Not implemented in firmware yet
|
||||
break;*/
|
||||
case 8:
|
||||
for (int i = 0; i < nchannels; ++i) {
|
||||
*((uint8_t *)(imageData + i)) = (uint8_t)i;
|
||||
}
|
||||
int j = rand();
|
||||
switch (dr) {
|
||||
//case 1: // TODO: Not implemented in firmware yet
|
||||
// break;
|
||||
|
||||
case 8:
|
||||
*((uint8_t *)(imageData + i)) = (uint8_t)j;
|
||||
break;
|
||||
case 16:
|
||||
for (int i = 0; i < nchannels; ++i) {
|
||||
*((uint16_t *)(imageData + i * sizeof(uint16_t))) = (uint16_t)i;
|
||||
}
|
||||
*((uint16_t *)(imageData + i * sizeof(uint16_t))) = (uint16_t)j;
|
||||
break;
|
||||
case 32:
|
||||
for (int i = 0; i < nchannels; ++i) {
|
||||
*((uint32_t *)(imageData + i * sizeof(uint32_t))) =
|
||||
((uint32_t)i & 0xFFFFFF); // 24 bit
|
||||
}
|
||||
*((uint32_t *)(imageData + i * sizeof(uint32_t))) = ((uint32_t)j & 0xFFFFFF); // 24 bit
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Send data
|
||||
// loop over number of frames
|
||||
for (int frameNr = 0; frameNr != numFrames; ++frameNr) {
|
||||
|
||||
// check if manual stop
|
||||
if (sharedMemory_getStop() == 1) {
|
||||
@ -2373,6 +2519,7 @@ void *start_timer(void *arg) {
|
||||
clock_gettime(CLOCK_REALTIME, &begin);
|
||||
usleep(expUs);
|
||||
|
||||
|
||||
int srcOffset = 0;
|
||||
// loop packet
|
||||
for (int i = 0; i != packetsPerFrame; ++i) {
|
||||
@ -2393,7 +2540,6 @@ void *start_timer(void *arg) {
|
||||
memcpy(packetData + sizeof(sls_detector_header),
|
||||
imageData + srcOffset, dataSize);
|
||||
srcOffset += dataSize;
|
||||
|
||||
sendUDPPacket(0, 0, packetData, packetSize);
|
||||
}
|
||||
LOG(logINFO, ("Sent frame: %d [%lld]\n", frameNr,
|
||||
@ -2573,56 +2719,6 @@ u_int32_t runBusy() {
|
||||
|
||||
/* 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;
|
||||
*/
|
||||
for (int i = 0; i < NCOUNTERS; ++i) {
|
||||
if (srcMod->eV[i] >= 0)
|
||||
destMod->eV[i] = srcMod->eV[i];
|
||||
}
|
||||
|
||||
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++) {
|
||||
*((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() {
|
||||
int numCounters = __builtin_popcount(getCounterMask());
|
||||
int dr = 0;
|
||||
@ -2643,7 +2739,7 @@ int setChipStatusRegister(int csr) {
|
||||
uint32_t prevRunClk = clkDivider[SYSTEM_C0];
|
||||
|
||||
// set to trimming clock
|
||||
if (setClockDivider(SYSTEM_C0, DEFAULT_TRIMMING_RUN_CLKDIV) == FAIL) {
|
||||
if (setClockDividerWithTimeUpdateOption(SYSTEM_C0, DEFAULT_TRIMMING_RUN_CLKDIV, 0) == FAIL) {
|
||||
LOG(logERROR,
|
||||
("Could not set to trimming clock in order to change CSR\n"));
|
||||
return FAIL;
|
||||
@ -2665,11 +2761,12 @@ int setChipStatusRegister(int csr) {
|
||||
}
|
||||
|
||||
// set back to previous clock
|
||||
if (setClockDivider(SYSTEM_C0, prevRunClk) == FAIL) {
|
||||
if (setClockDividerWithTimeUpdateOption(SYSTEM_C0, prevRunClk, 0) == FAIL) {
|
||||
LOG(logERROR,
|
||||
("Could not set to previous run clock after changing CSR\n"));
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
detectorModules->reg = csr;
|
||||
return iret;
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ enum DACINDEX {
|
||||
1220, /* vIpreOut */ \
|
||||
2800, /* Vth3 */ \
|
||||
2800, /* Vth1 */ \
|
||||
1708, /* vIcin */ \
|
||||
800, /* vIcin */ \
|
||||
1800, /* cas */ \
|
||||
1100, /* Vrpreamp */ \
|
||||
1100, /* Vcal_n */ \
|
||||
|
@ -26,6 +26,7 @@ int receiveData(int file_des, void *buf, int length, intType itype);
|
||||
int sendDataOnly(int file_des, void *buf, int length);
|
||||
int receiveDataOnly(int file_des, void *buf, int length);
|
||||
|
||||
int sendModule(int file_des, sls_detector_module *myMod);
|
||||
int receiveModule(int file_des, sls_detector_module *myMod);
|
||||
|
||||
/**
|
||||
|
@ -11,8 +11,8 @@
|
||||
#define BLACKFIN_DEFINED
|
||||
|
||||
int defineGPIOpins(char *mess);
|
||||
int FPGAdontTouchFlash(char *mess);
|
||||
int FPGATouchFlash(char *mess);
|
||||
int FPGAdontTouchFlash(char *mess, int programming);
|
||||
int FPGATouchFlash(char *mess, int programming);
|
||||
int resetFPGA(char *mess);
|
||||
|
||||
int emptyTempFolder(char *mess);
|
||||
|
@ -281,6 +281,7 @@ int getNumDigitalSamples();
|
||||
#endif
|
||||
#ifdef MYTHEN3D
|
||||
void setCounterMask(uint32_t arg);
|
||||
void setCounterMaskWithUpdateFlag(uint32_t arg, int updateMaskFlag);
|
||||
uint32_t getCounterMask();
|
||||
void updatePacketizing();
|
||||
#endif
|
||||
@ -308,9 +309,16 @@ int64_t getMeasurementTime();
|
||||
#endif
|
||||
|
||||
// parameters - module, settings
|
||||
#if defined(MYTHEN3D) || defined(EIGERD)
|
||||
void getModule(sls_detector_module* myMod);
|
||||
#endif
|
||||
#if (!defined(CHIPTESTBOARDD)) && (!defined(MOENCHD)) && (!defined(GOTTHARD2D))
|
||||
int setModule(sls_detector_module myMod, char *mess);
|
||||
#endif
|
||||
|
||||
#ifdef EIGERD
|
||||
int setTrimbits(int* chanregs, char* mess);
|
||||
#endif
|
||||
#ifdef MYTHEN3D
|
||||
int setTrimbits(int *trimbits);
|
||||
int setAllTrimbits(int val);
|
||||
@ -340,9 +348,12 @@ void setThresholdEnergy(int counterIndex, int eV);
|
||||
int setOnChipDAC(enum ONCHIP_DACINDEX ind, int chipIndex, int val);
|
||||
int getOnChipDAC(enum ONCHIP_DACINDEX ind, int chipIndex);
|
||||
#endif
|
||||
void setDAC(enum DACINDEX ind, int val, int mV);
|
||||
#ifdef MYTHEN3D
|
||||
void setDAC(enum DACINDEX ind, int val, int mV, int counterEnableCheck);
|
||||
void setGeneralDAC(enum DACINDEX ind, int val, int mV);
|
||||
void setVthDac(int index, int enable);
|
||||
#else
|
||||
void setDAC(enum DACINDEX ind, int val, int mV);
|
||||
#endif
|
||||
int getDAC(enum DACINDEX ind, int mV);
|
||||
int getMaxDacSteps();
|
||||
@ -558,6 +569,7 @@ int getFrequency(enum CLKINDEX ind);
|
||||
int getVCOFrequency(enum CLKINDEX ind);
|
||||
int getMaxClockDivider();
|
||||
int setClockDivider(enum CLKINDEX ind, int val);
|
||||
int setClockDividerWithTimeUpdateOption(enum CLKINDEX ind, int val, int timeUpdate);
|
||||
int getClockDivider(enum CLKINDEX ind);
|
||||
|
||||
#elif GOTTHARD2D
|
||||
@ -662,9 +674,6 @@ u_int32_t runState(enum TLogLevel lev);
|
||||
#endif
|
||||
|
||||
// common
|
||||
#if defined(EIGERD) || defined(MYTHEN3D)
|
||||
int copyModule(sls_detector_module *destMod, sls_detector_module *srcMod);
|
||||
#endif
|
||||
int calculateDataBytes();
|
||||
int getTotalNumberOfChannels();
|
||||
#if defined(MOENCHD) || defined(CHIPTESTBOARDD)
|
||||
|
@ -303,3 +303,4 @@ int get_analog_pulsing(int);
|
||||
int set_analog_pulsing(int);
|
||||
int get_digital_pulsing(int);
|
||||
int set_digital_pulsing(int);
|
||||
int get_module(int);
|
||||
|
@ -406,66 +406,139 @@ int receiveDataOnly(int file_des, void *buf, int length) {
|
||||
return total_received;
|
||||
}
|
||||
|
||||
int sendModule(int file_des, sls_detector_module *myMod) {
|
||||
enum TLogLevel level = logDEBUG1;
|
||||
LOG(level, ("Sending Module\n"));
|
||||
int ts = 0, n = 0;
|
||||
|
||||
n = sendData(file_des, &(myMod->serialnumber),
|
||||
sizeof(myMod->serialnumber), INT32);
|
||||
if (!n) {
|
||||
return -1;
|
||||
}
|
||||
ts += n;
|
||||
LOG(level, ("serialno sent %d bytes. serialno: %d\n", n,
|
||||
myMod->serialnumber));
|
||||
n = sendData(file_des, &(myMod->nchan), sizeof(myMod->nchan), INT32);
|
||||
if (!n) {
|
||||
return -1;
|
||||
}
|
||||
ts += n;
|
||||
LOG(level, ("nchan sent %d bytes. nchan: %d\n", n, myMod->nchan));
|
||||
n = sendData(file_des, &(myMod->nchip), sizeof(myMod->nchip), INT32);
|
||||
if (!n) {
|
||||
return -1;
|
||||
}
|
||||
ts += n;
|
||||
LOG(level, ("nchip sent %d bytes. nchip: %d\n", n, myMod->nchip));
|
||||
n = sendData(file_des, &(myMod->ndac), sizeof(myMod->ndac), INT32);
|
||||
if (!n) {
|
||||
return -1;
|
||||
}
|
||||
ts += n;
|
||||
LOG(level, ("ndac sent %d bytes. ndac: %d\n", n, myMod->ndac));
|
||||
n = sendData(file_des, &(myMod->reg), sizeof(myMod->reg), INT32);
|
||||
if (!n) {
|
||||
return -1;
|
||||
}
|
||||
ts += n;
|
||||
LOG(level, ("reg sent %d bytes. reg: %d\n", n, myMod->reg));
|
||||
n = sendData(file_des, &(myMod->iodelay), sizeof(myMod->iodelay), INT32);
|
||||
if (!n) {
|
||||
return -1;
|
||||
}
|
||||
ts += n;
|
||||
LOG(level,
|
||||
("iodelay sent %d bytes. iodelay: %d\n", n, myMod->iodelay));
|
||||
n = sendData(file_des, &(myMod->tau), sizeof(myMod->tau), INT32);
|
||||
if (!n) {
|
||||
return -1;
|
||||
}
|
||||
ts += n;
|
||||
LOG(level, ("tau sent %d bytes. tau: %d\n", n, myMod->tau));
|
||||
n = sendData(file_des, myMod->eV, sizeof(myMod->eV), INT32);
|
||||
if (!n) {
|
||||
return -1;
|
||||
}
|
||||
ts += n;
|
||||
LOG(level, ("eV sent %d bytes. eV: %d\n", n, myMod->eV[0]));
|
||||
// dacs
|
||||
n = sendData(file_des, myMod->dacs, sizeof(int) * (myMod->ndac), INT32);
|
||||
if (!n) {
|
||||
return -1;
|
||||
}
|
||||
ts += n;
|
||||
LOG(level, ("dacs sent %d bytes.\n", n));
|
||||
// channels
|
||||
n = sendData(file_des, myMod->chanregs, sizeof(int) * (myMod->nchan),
|
||||
INT32);
|
||||
LOG(level, ("chanregs sent %d bytes.\n", n));
|
||||
if (!n) {
|
||||
return -1;
|
||||
}
|
||||
ts += n;
|
||||
LOG(level, ("received module of size %d register %x\n", ts, myMod->reg));
|
||||
return ts;
|
||||
}
|
||||
|
||||
int receiveModule(int file_des, sls_detector_module *myMod) {
|
||||
enum TLogLevel level = logDEBUG1;
|
||||
LOG(level, ("Receiving Module\n"));
|
||||
int ts = 0, n = 0;
|
||||
int nDacs = myMod->ndac;
|
||||
#if defined(EIGERD) || defined(MYTHEN3D)
|
||||
int nChans = myMod->nchan; // can be zero for no trimbits
|
||||
LOG(level, ("nChans: %d\n", nChans));
|
||||
#endif
|
||||
n = receiveData(file_des, &(myMod->serialnumber),
|
||||
sizeof(myMod->serialnumber), INT32);
|
||||
if (!n) {
|
||||
return -1;
|
||||
}
|
||||
ts += n;
|
||||
LOG(level, ("serialno received. %d bytes. serialno: %d\n", n,
|
||||
LOG(level, ("serialno received %d bytes. serialno: %d\n", n,
|
||||
myMod->serialnumber));
|
||||
n = receiveData(file_des, &(myMod->nchan), sizeof(myMod->nchan), INT32);
|
||||
if (!n) {
|
||||
return -1;
|
||||
}
|
||||
ts += n;
|
||||
LOG(level, ("nchan received. %d bytes. nchan: %d\n", n, myMod->nchan));
|
||||
LOG(level, ("nchan received %d bytes. nchan: %d\n", n, myMod->nchan));
|
||||
n = receiveData(file_des, &(myMod->nchip), sizeof(myMod->nchip), INT32);
|
||||
if (!n) {
|
||||
return -1;
|
||||
}
|
||||
ts += n;
|
||||
LOG(level, ("nchip received. %d bytes. nchip: %d\n", n, myMod->nchip));
|
||||
LOG(level, ("nchip received %d bytes. nchip: %d\n", n, myMod->nchip));
|
||||
n = receiveData(file_des, &(myMod->ndac), sizeof(myMod->ndac), INT32);
|
||||
if (!n) {
|
||||
return -1;
|
||||
}
|
||||
ts += n;
|
||||
LOG(level, ("ndac received. %d bytes. ndac: %d\n", n, myMod->ndac));
|
||||
LOG(level, ("ndac received %d bytes. ndac: %d\n", n, myMod->ndac));
|
||||
n = receiveData(file_des, &(myMod->reg), sizeof(myMod->reg), INT32);
|
||||
if (!n) {
|
||||
return -1;
|
||||
}
|
||||
ts += n;
|
||||
LOG(level, ("reg received. %d bytes. reg: %d\n", n, myMod->reg));
|
||||
LOG(level, ("reg received %d bytes. reg: %d\n", n, myMod->reg));
|
||||
n = receiveData(file_des, &(myMod->iodelay), sizeof(myMod->iodelay), INT32);
|
||||
if (!n) {
|
||||
return -1;
|
||||
}
|
||||
ts += n;
|
||||
LOG(level,
|
||||
("iodelay received. %d bytes. iodelay: %d\n", n, myMod->iodelay));
|
||||
("iodelay received %d bytes. iodelay: %d\n", n, myMod->iodelay));
|
||||
n = receiveData(file_des, &(myMod->tau), sizeof(myMod->tau), INT32);
|
||||
if (!n) {
|
||||
return -1;
|
||||
}
|
||||
ts += n;
|
||||
LOG(level, ("tau received. %d bytes. tau: %d\n", n, myMod->tau));
|
||||
LOG(level, ("tau received %d bytes. tau: %d\n", n, myMod->tau));
|
||||
n = receiveData(file_des, myMod->eV, sizeof(myMod->eV), INT32);
|
||||
if (!n) {
|
||||
return -1;
|
||||
}
|
||||
ts += n;
|
||||
LOG(level, ("eV received. %d bytes. eV: %d\n", n, myMod->eV[0]));
|
||||
LOG(level, ("eV received %d bytes. eV: %d\n", n, myMod->eV[0]));
|
||||
// dacs
|
||||
if (nDacs != (myMod->ndac)) {
|
||||
LOG(logERROR, ("received wrong number of dacs. "
|
||||
@ -478,24 +551,22 @@ int receiveModule(int file_des, sls_detector_module *myMod) {
|
||||
return -1;
|
||||
}
|
||||
ts += n;
|
||||
LOG(level, ("dacs received. %d bytes.\n", n));
|
||||
LOG(level, ("dacs received %d bytes.\n", n));
|
||||
// channels
|
||||
#if defined(EIGERD) || defined(MYTHEN3D)
|
||||
if (((myMod->nchan) != 0) && // no trimbits
|
||||
(nChans != (myMod->nchan))) { // with trimbits
|
||||
LOG(logERROR, ("received wrong number of channels. "
|
||||
"Expected %d, got %d\n",
|
||||
nChans, (myMod->nchan)));
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
n = receiveData(file_des, myMod->chanregs, sizeof(int) * (myMod->nchan),
|
||||
INT32);
|
||||
LOG(level, ("chanregs received. %d bytes.\n", n));
|
||||
LOG(level, ("chanregs received %d bytes.\n", n));
|
||||
if (!n && myMod->nchan != 0) {
|
||||
return -1;
|
||||
}
|
||||
ts += n;
|
||||
#endif
|
||||
LOG(level, ("received module of size %d register %x\n", ts, myMod->reg));
|
||||
return ts;
|
||||
}
|
||||
|
@ -24,6 +24,12 @@ extern u_int32_t bus_r(u_int32_t offset);
|
||||
extern int64_t get64BitReg(int aLSB, int aMSB);
|
||||
extern int64_t set64BitReg(int64_t value, int aLSB, int aMSB);
|
||||
|
||||
#ifdef MYTHEN3D
|
||||
#define MAX_LEVELS M3_MAX_PATTERN_LEVELS
|
||||
#else
|
||||
#define MAX_LEVELS MAX_PATTERN_LEVELS
|
||||
#endif
|
||||
|
||||
#if defined(CHIPTESTBOARDD) || defined(MOENCHD)
|
||||
#ifdef VIRTUAL
|
||||
void initializePatternWord() {
|
||||
@ -157,9 +163,9 @@ void writePatternWord(int addr, uint64_t word) {
|
||||
|
||||
int validate_getPatternWaitAddresses(char *message, int level, int *addr) {
|
||||
// validate input
|
||||
if (level < 0 || level > 2) {
|
||||
if (level < 0 || level >= MAX_LEVELS) {
|
||||
sprintf(message,
|
||||
"Cannot get patwait address. Level must be between 0 and 2.\n");
|
||||
"Cannot get patwait address. Level %d must be between 0 and %d.\n", level, MAX_LEVELS - 1);
|
||||
LOG(logERROR, (message));
|
||||
return FAIL;
|
||||
}
|
||||
@ -178,6 +184,17 @@ int getPatternWaitAddress(int level) {
|
||||
case 2:
|
||||
return ((bus_r(PATTERN_WAIT_2_ADDR_REG) & PATTERN_WAIT_2_ADDR_MSK) >>
|
||||
PATTERN_WAIT_2_ADDR_OFST);
|
||||
#ifndef MYTHEN3D
|
||||
case 3:
|
||||
return ((bus_r(PATTERN_WAIT_3_ADDR_REG) & PATTERN_WAIT_3_ADDR_MSK) >>
|
||||
PATTERN_WAIT_3_ADDR_OFST);
|
||||
case 4:
|
||||
return ((bus_r(PATTERN_WAIT_4_ADDR_REG) & PATTERN_WAIT_4_ADDR_MSK) >>
|
||||
PATTERN_WAIT_4_ADDR_OFST);
|
||||
case 5:
|
||||
return ((bus_r(PATTERN_WAIT_5_ADDR_REG) & PATTERN_WAIT_5_ADDR_MSK) >>
|
||||
PATTERN_WAIT_5_ADDR_OFST);
|
||||
#endif
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
@ -185,9 +202,9 @@ int getPatternWaitAddress(int level) {
|
||||
|
||||
int validate_setPatternWaitAddresses(char *message, int level, int addr) {
|
||||
// validate input
|
||||
if (level < 0 || level > 2) {
|
||||
if (level < 0 || level >= MAX_LEVELS) {
|
||||
sprintf(message,
|
||||
"Cannot set patwait address. Level must be between 0 and 2.\n");
|
||||
"Cannot set patwait address. Level %d must be between 0 and %d.\n", level, MAX_LEVELS - 1);
|
||||
LOG(logERROR, (message));
|
||||
return FAIL;
|
||||
}
|
||||
@ -234,6 +251,20 @@ void setPatternWaitAddress(int level, int addr) {
|
||||
bus_w(PATTERN_WAIT_2_ADDR_REG,
|
||||
((addr << PATTERN_WAIT_2_ADDR_OFST) & PATTERN_WAIT_2_ADDR_MSK));
|
||||
break;
|
||||
#ifndef MYTHEN3D
|
||||
case 3:
|
||||
bus_w(PATTERN_WAIT_3_ADDR_REG,
|
||||
((addr << PATTERN_WAIT_3_ADDR_OFST) & PATTERN_WAIT_3_ADDR_MSK));
|
||||
break;
|
||||
case 4:
|
||||
bus_w(PATTERN_WAIT_4_ADDR_REG,
|
||||
((addr << PATTERN_WAIT_4_ADDR_OFST) & PATTERN_WAIT_4_ADDR_MSK));
|
||||
break;
|
||||
case 5:
|
||||
bus_w(PATTERN_WAIT_5_ADDR_REG,
|
||||
((addr << PATTERN_WAIT_5_ADDR_OFST) & PATTERN_WAIT_5_ADDR_MSK));
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
return;
|
||||
}
|
||||
@ -241,9 +272,9 @@ void setPatternWaitAddress(int level, int addr) {
|
||||
|
||||
int validate_getPatternWaitTime(char *message, int level, uint64_t *waittime) {
|
||||
// validate input
|
||||
if (level < 0 || level > 2) {
|
||||
if (level < 0 || level >= MAX_LEVELS) {
|
||||
sprintf(message,
|
||||
"Cannot get patwaittime. Level must be between 0 and 2.\n");
|
||||
"Cannot get patwaittime. Level %d must be between 0 and %d.\n", level, MAX_LEVELS - 1);
|
||||
LOG(logERROR, (message));
|
||||
return FAIL;
|
||||
}
|
||||
@ -262,6 +293,17 @@ uint64_t getPatternWaitTime(int level) {
|
||||
case 2:
|
||||
return get64BitReg(PATTERN_WAIT_TIMER_2_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_2_MSB_REG);
|
||||
#ifndef MYTHEN3D
|
||||
case 3:
|
||||
return get64BitReg(PATTERN_WAIT_TIMER_3_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_3_MSB_REG);
|
||||
case 4:
|
||||
return get64BitReg(PATTERN_WAIT_TIMER_4_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_4_MSB_REG);
|
||||
case 5:
|
||||
return get64BitReg(PATTERN_WAIT_TIMER_5_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_5_MSB_REG);
|
||||
#endif
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
@ -269,9 +311,9 @@ uint64_t getPatternWaitTime(int level) {
|
||||
|
||||
int validate_setPatternWaitTime(char *message, int level, uint64_t waittime) {
|
||||
// validate input
|
||||
if (level < 0 || level > 2) {
|
||||
if (level < 0 || level >= MAX_LEVELS) {
|
||||
sprintf(message,
|
||||
"Cannot set patwaittime. Level must be between 0 and 2.\n");
|
||||
"Cannot set patwaittime. Level %d must be between 0 and %d.\n", level, MAX_LEVELS - 1);
|
||||
LOG(logERROR, (message));
|
||||
return FAIL;
|
||||
}
|
||||
@ -311,6 +353,20 @@ void setPatternWaitTime(int level, uint64_t t) {
|
||||
set64BitReg(t, PATTERN_WAIT_TIMER_2_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_2_MSB_REG);
|
||||
break;
|
||||
#ifndef MYTHEN3D
|
||||
case 3:
|
||||
set64BitReg(t, PATTERN_WAIT_TIMER_3_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_3_MSB_REG);
|
||||
break;
|
||||
case 4:
|
||||
set64BitReg(t, PATTERN_WAIT_TIMER_4_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_4_MSB_REG);
|
||||
break;
|
||||
case 5:
|
||||
set64BitReg(t, PATTERN_WAIT_TIMER_5_LSB_REG,
|
||||
PATTERN_WAIT_TIMER_5_MSB_REG);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
return;
|
||||
}
|
||||
@ -318,9 +374,9 @@ void setPatternWaitTime(int level, uint64_t t) {
|
||||
|
||||
int validate_getPatternLoopCycles(char *message, int level, int *numLoops) {
|
||||
// validate input
|
||||
if (level < 0 || level > 2) {
|
||||
if (level < 0 || level >= MAX_LEVELS) {
|
||||
sprintf(message,
|
||||
"Cannot get patnloop. Level must be between 0 and 2.\n");
|
||||
"Cannot get patnloop. Level %d must be between 0 and %d.\n", level, MAX_LEVELS - 1);
|
||||
LOG(logERROR, (message));
|
||||
return FAIL;
|
||||
}
|
||||
@ -336,6 +392,14 @@ int getPatternLoopCycles(int level) {
|
||||
return bus_r(PATTERN_LOOP_1_ITERATION_REG);
|
||||
case 2:
|
||||
return bus_r(PATTERN_LOOP_2_ITERATION_REG);
|
||||
#ifndef MYTHEN3D
|
||||
case 3:
|
||||
return bus_r(PATTERN_LOOP_3_ITERATION_REG);
|
||||
case 4:
|
||||
return bus_r(PATTERN_LOOP_4_ITERATION_REG);
|
||||
case 5:
|
||||
return bus_r(PATTERN_LOOP_5_ITERATION_REG);
|
||||
#endif
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
@ -343,9 +407,9 @@ int getPatternLoopCycles(int level) {
|
||||
|
||||
int validate_setPatternLoopCycles(char *message, int level, int numLoops) {
|
||||
// validate input
|
||||
if (level < 0 || level > 2) {
|
||||
if (level < 0 || level >= MAX_LEVELS) {
|
||||
sprintf(message,
|
||||
"Cannot set patnloop. Level must be between 0 and 2.\n");
|
||||
"Cannot set patnloop. Level %d must be between 0 and %d.\n", level, MAX_LEVELS);
|
||||
LOG(logERROR, (message));
|
||||
return FAIL;
|
||||
}
|
||||
@ -385,6 +449,17 @@ void setPatternLoopCycles(int level, int nLoop) {
|
||||
case 2:
|
||||
bus_w(PATTERN_LOOP_2_ITERATION_REG, nLoop);
|
||||
break;
|
||||
#ifndef MYTHEN3D
|
||||
case 3:
|
||||
bus_w(PATTERN_LOOP_3_ITERATION_REG, nLoop);
|
||||
break;
|
||||
case 4:
|
||||
bus_w(PATTERN_LOOP_4_ITERATION_REG, nLoop);
|
||||
break;
|
||||
case 5:
|
||||
bus_w(PATTERN_LOOP_5_ITERATION_REG, nLoop);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
return;
|
||||
}
|
||||
@ -443,10 +518,10 @@ void setPatternLoopLimits(int startAddr, int stopAddr) {
|
||||
int validate_getPatternLoopAddresses(char *message, int level, int *startAddr,
|
||||
int *stopAddr) {
|
||||
// validate input
|
||||
if (level < 0 || level > 2) {
|
||||
if (level < 0 || level >= MAX_LEVELS) {
|
||||
sprintf(
|
||||
message,
|
||||
"Cannot get patloop addresses. Level must be between 0 and 2.\n");
|
||||
"Cannot get patloop addresses. Level %d must be between 0 and %d.\n", level, MAX_LEVELS - 1);
|
||||
LOG(logERROR, (message));
|
||||
return FAIL;
|
||||
}
|
||||
@ -481,6 +556,32 @@ void getPatternLoopAddresses(int level, int *startAddr, int *stopAddr) {
|
||||
((bus_r(PATTERN_LOOP_2_ADDR_REG) & PATTERN_LOOP_2_ADDR_STP_MSK) >>
|
||||
PATTERN_LOOP_2_ADDR_STP_OFST);
|
||||
break;
|
||||
#ifndef MYTHEN3D
|
||||
case 3:
|
||||
*startAddr =
|
||||
((bus_r(PATTERN_LOOP_3_ADDR_REG) & PATTERN_LOOP_3_ADDR_STRT_MSK) >>
|
||||
PATTERN_LOOP_3_ADDR_STRT_OFST);
|
||||
*stopAddr =
|
||||
((bus_r(PATTERN_LOOP_3_ADDR_REG) & PATTERN_LOOP_3_ADDR_STP_MSK) >>
|
||||
PATTERN_LOOP_3_ADDR_STP_OFST);
|
||||
break;
|
||||
case 4:
|
||||
*startAddr =
|
||||
((bus_r(PATTERN_LOOP_4_ADDR_REG) & PATTERN_LOOP_4_ADDR_STRT_MSK) >>
|
||||
PATTERN_LOOP_4_ADDR_STRT_OFST);
|
||||
*stopAddr =
|
||||
((bus_r(PATTERN_LOOP_4_ADDR_REG) & PATTERN_LOOP_4_ADDR_STP_MSK) >>
|
||||
PATTERN_LOOP_4_ADDR_STP_OFST);
|
||||
break;
|
||||
case 5:
|
||||
*startAddr =
|
||||
((bus_r(PATTERN_LOOP_5_ADDR_REG) & PATTERN_LOOP_5_ADDR_STRT_MSK) >>
|
||||
PATTERN_LOOP_5_ADDR_STRT_OFST);
|
||||
*stopAddr =
|
||||
((bus_r(PATTERN_LOOP_5_ADDR_REG) & PATTERN_LOOP_5_ADDR_STP_MSK) >>
|
||||
PATTERN_LOOP_5_ADDR_STP_OFST);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
return;
|
||||
}
|
||||
@ -489,10 +590,10 @@ void getPatternLoopAddresses(int level, int *startAddr, int *stopAddr) {
|
||||
int validate_setPatternLoopAddresses(char *message, int level, int startAddr,
|
||||
int stopAddr) {
|
||||
// validate input
|
||||
if (level < 0 || level > 2) {
|
||||
if (level < 0 || level >= MAX_LEVELS) {
|
||||
sprintf(
|
||||
message,
|
||||
"Cannot set patloop addresses. Level must be between 0 and 2.\n");
|
||||
"Cannot set patloop addresses. Level %d must be between 0 and %d.\n", level, MAX_LEVELS - 1);
|
||||
LOG(logERROR, (message));
|
||||
return FAIL;
|
||||
}
|
||||
@ -559,6 +660,29 @@ void setPatternLoopAddresses(int level, int startAddr, int stopAddr) {
|
||||
((stopAddr << PATTERN_LOOP_2_ADDR_STP_OFST) &
|
||||
PATTERN_LOOP_2_ADDR_STP_MSK));
|
||||
break;
|
||||
#ifndef MYTHEN3D
|
||||
case 3:
|
||||
bus_w(PATTERN_LOOP_3_ADDR_REG,
|
||||
((startAddr << PATTERN_LOOP_3_ADDR_STRT_OFST) &
|
||||
PATTERN_LOOP_3_ADDR_STRT_MSK) |
|
||||
((stopAddr << PATTERN_LOOP_3_ADDR_STP_OFST) &
|
||||
PATTERN_LOOP_3_ADDR_STP_MSK));
|
||||
break;
|
||||
case 4:
|
||||
bus_w(PATTERN_LOOP_4_ADDR_REG,
|
||||
((startAddr << PATTERN_LOOP_4_ADDR_STRT_OFST) &
|
||||
PATTERN_LOOP_4_ADDR_STRT_MSK) |
|
||||
((stopAddr << PATTERN_LOOP_4_ADDR_STP_OFST) &
|
||||
PATTERN_LOOP_4_ADDR_STP_MSK));
|
||||
break;
|
||||
case 5:
|
||||
bus_w(PATTERN_LOOP_5_ADDR_REG,
|
||||
((startAddr << PATTERN_LOOP_5_ADDR_STRT_OFST) &
|
||||
PATTERN_LOOP_5_ADDR_STRT_MSK) |
|
||||
((stopAddr << PATTERN_LOOP_5_ADDR_STP_OFST) &
|
||||
PATTERN_LOOP_5_ADDR_STP_MSK));
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
return;
|
||||
}
|
||||
@ -625,10 +749,10 @@ int loadPattern(char *message, enum TLogLevel printLevel,
|
||||
}
|
||||
|
||||
if (ret == OK) {
|
||||
for (int i = 0; i <= 2; ++i) {
|
||||
for (int i = 0; i < MAX_LEVELS; ++i) {
|
||||
// loop addr
|
||||
ret = validate_setPatternLoopAddresses(
|
||||
message, i, pat->loop[i * 2 + 0], pat->loop[i * 2 + 1]);
|
||||
message, i, pat->startloop[i], pat->stoploop[i]);
|
||||
if (ret == FAIL) {
|
||||
break;
|
||||
}
|
||||
@ -685,15 +809,15 @@ int getPattern(char *message, patternParameters *pat) {
|
||||
pat->limits[1] = retval2;
|
||||
}
|
||||
if (ret == OK) {
|
||||
for (int i = 0; i <= 2; ++i) {
|
||||
for (int i = 0; i < MAX_LEVELS; ++i) {
|
||||
// loop addr
|
||||
ret = validate_getPatternLoopAddresses(message, i, &retval1,
|
||||
&retval2);
|
||||
if (ret == FAIL) {
|
||||
break;
|
||||
}
|
||||
pat->loop[i * 2 + 0] = retval1;
|
||||
pat->loop[i * 2 + 1] = retval2;
|
||||
pat->startloop[i] = retval1;
|
||||
pat->stoploop[i] = retval2;
|
||||
|
||||
// num loops
|
||||
ret = validate_getPatternLoopCycles(message, i, &retval1);
|
||||
@ -846,26 +970,14 @@ int loadPatternFile(char *patFname, char *errMessage) {
|
||||
}
|
||||
|
||||
// patloop
|
||||
if ((!strncmp(line, "patloop0", strlen("patloop0"))) ||
|
||||
(!strncmp(line, "patloop1", strlen("patloop1"))) ||
|
||||
(!strncmp(line, "patloop2", strlen("patloop2")))) {
|
||||
|
||||
// level
|
||||
if (!strncmp(line, "patloop", strlen("patloop"))){
|
||||
int level = -1;
|
||||
if (!strncmp(line, "patloop0", strlen("patloop0"))) {
|
||||
level = 0;
|
||||
} else if (!strncmp(line, "patloop1", strlen("patloop1"))) {
|
||||
level = 1;
|
||||
} else {
|
||||
level = 2;
|
||||
}
|
||||
|
||||
int startAddr = 0;
|
||||
int stopAddr = 0;
|
||||
// cannot scan values
|
||||
if (sscanf(line, "%s 0x%x 0x%x", command, &startAddr, &stopAddr) !=
|
||||
3) {
|
||||
sprintf(temp, "Could not scan patloop%d arguments.\n", level);
|
||||
if (sscanf(line, "%s %d 0x%x 0x%x", command, &level, &startAddr, &stopAddr) !=
|
||||
4) {
|
||||
strcpy(temp, "Could not scan patloop arguments.\n");
|
||||
break;
|
||||
}
|
||||
|
||||
@ -876,24 +988,12 @@ int loadPatternFile(char *patFname, char *errMessage) {
|
||||
}
|
||||
|
||||
// patnloop
|
||||
if ((!strncmp(line, "patnloop0", strlen("patnloop0"))) ||
|
||||
(!strncmp(line, "patnloop1", strlen("patnloop1"))) ||
|
||||
(!strncmp(line, "patnloop2", strlen("patnloop2")))) {
|
||||
|
||||
// level
|
||||
if (!strncmp(line, "patnloop", strlen("patnloop"))) {
|
||||
int level = -1;
|
||||
if (!strncmp(line, "patnloop0", strlen("patnloop0"))) {
|
||||
level = 0;
|
||||
} else if (!strncmp(line, "patnloop1", strlen("patnloop1"))) {
|
||||
level = 1;
|
||||
} else {
|
||||
level = 2;
|
||||
}
|
||||
|
||||
int numLoops = -1;
|
||||
// cannot scan values
|
||||
if (sscanf(line, "%s %d", command, &numLoops) != 2) {
|
||||
sprintf(temp, "Could not scan patnloop %d arguments.\n", level);
|
||||
if (sscanf(line, "%s %d %d", command, &level, &numLoops) != 3) {
|
||||
strcpy(temp, "Could not scan patnloop arguments.\n");
|
||||
break;
|
||||
}
|
||||
|
||||
@ -903,24 +1003,12 @@ int loadPatternFile(char *patFname, char *errMessage) {
|
||||
}
|
||||
|
||||
// patwait
|
||||
if ((!strncmp(line, "patwait0", strlen("patwait0"))) ||
|
||||
(!strncmp(line, "patwait1", strlen("patwait1"))) ||
|
||||
(!strncmp(line, "patwait2", strlen("patwait2")))) {
|
||||
|
||||
// level
|
||||
if (!strncmp(line, "patwait ", strlen("patwait "))) {
|
||||
int level = -1;
|
||||
if (!strncmp(line, "patwait0", strlen("patwait0"))) {
|
||||
level = 0;
|
||||
} else if (!strncmp(line, "patwait1", strlen("patwait1"))) {
|
||||
level = 1;
|
||||
} else {
|
||||
level = 2;
|
||||
}
|
||||
|
||||
int addr = 0;
|
||||
// cannot scan values
|
||||
if (sscanf(line, "%s 0x%x", command, &addr) != 2) {
|
||||
sprintf(temp, "Could not scan patwait%d arguments.\n", level);
|
||||
if (sscanf(line, "%s %d 0x%x", command, &level, &addr) != 3) {
|
||||
strcpy(temp, "Could not scan patwait arguments.\n");
|
||||
break;
|
||||
}
|
||||
|
||||
@ -930,27 +1018,15 @@ int loadPatternFile(char *patFname, char *errMessage) {
|
||||
}
|
||||
|
||||
// patwaittime
|
||||
if ((!strncmp(line, "patwaittime0", strlen("patwaittime0"))) ||
|
||||
(!strncmp(line, "patwaittime1", strlen("patwaittime1"))) ||
|
||||
(!strncmp(line, "patwaittime2", strlen("patwaittime2")))) {
|
||||
|
||||
// level
|
||||
if (!strncmp(line, "patwaittime", strlen("patwaittime"))) {
|
||||
int level = -1;
|
||||
if (!strncmp(line, "patwaittime0", strlen("patwaittime0"))) {
|
||||
level = 0;
|
||||
} else if (!strncmp(line, "patwaittime1", strlen("patwaittime1"))) {
|
||||
level = 1;
|
||||
} else {
|
||||
level = 2;
|
||||
}
|
||||
|
||||
uint64_t waittime = 0;
|
||||
|
||||
// cannot scan values
|
||||
#ifdef VIRTUAL
|
||||
if (sscanf(line, "%s %ld", command, &waittime) != 2) {
|
||||
if (sscanf(line, "%s %d %ld", command, &level, &waittime) != 3) {
|
||||
#else
|
||||
if (sscanf(line, "%s %lld", command, &waittime) != 2) {
|
||||
if (sscanf(line, "%s %d %lld", command, &level, &waittime) != 3) {
|
||||
#endif
|
||||
sprintf(temp, "Could not scan patwaittime%d arguments.\n",
|
||||
level);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user