mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-17 07:17:13 +02:00
Compare commits
153 Commits
2020.08.12
...
2020.09.09
Author | SHA1 | Date | |
---|---|---|---|
8bdfe7527f | |||
b33fdf4462 | |||
70386633f6 | |||
6c8443f09e | |||
bf52ec10da | |||
bdac4d133e | |||
e8156d412e | |||
8e09b50c5e | |||
aecde086a0 | |||
311cebcd00 | |||
8496f5715f | |||
f26d8e514b | |||
0b9ff70244 | |||
e82e531fb1 | |||
503f83e8e3 | |||
1a90c58d9e | |||
c467bd677e | |||
f280d033b9 | |||
c9cf845c9a | |||
63bbbfb438 | |||
5540f16116 | |||
a77833b4c7 | |||
9ee67f2cfa | |||
cf3758f155 | |||
b20720686e | |||
1edb1e8816 | |||
30e06c6386 | |||
ea601fe1f7 | |||
f0c576c779 | |||
fb8842e048 | |||
5b182469a1 | |||
a1b88d3a62 | |||
514346c3ba | |||
9218ef5a95 | |||
b124cea67b | |||
497eff6f04 | |||
92635c5bd3 | |||
a00231dab6 | |||
35c7e46d60 | |||
47da2540af | |||
891b8dbd2c | |||
89f0479318 | |||
7048a75808 | |||
a081fbbdaa | |||
22f14cacb0 | |||
6b7dee2631 | |||
6d1856daa2 | |||
7bb9696151 | |||
44335f9cf4 | |||
d62d5ef804 | |||
dbaab61ea2 | |||
180c7b7191 | |||
050f0ff8a0 | |||
658a804cca | |||
73530ddd6f | |||
abe34d573c | |||
05d5652532 | |||
38e0351068 | |||
e192cad1f2 | |||
b8350b070e | |||
3ddeea3c2b | |||
42b5ff3a62 | |||
00978a52c8 | |||
8400c686b5 | |||
adb6171e35 | |||
973b8f7106 | |||
2f81c233f5 | |||
e4274e3f95 | |||
b92f9af025 | |||
7ca1609c58 | |||
4cd81437ab | |||
7e202b6c26 | |||
e0df9fcd99 | |||
30307220e3 | |||
6a74851e0c | |||
ac30717083 | |||
bfed02b41e | |||
b5669dc921 | |||
97ee2d269d | |||
bc5cc3fa29 | |||
abd2808924 | |||
786b14e88b | |||
f19799343e | |||
2e4783f296 | |||
3954913661 | |||
7eafceb0f9 | |||
a1e06ca7a9 | |||
27c1916d63 | |||
64075c0e75 | |||
9505c51404 | |||
6d8168722a | |||
f9261c0f32 | |||
d44388a44e | |||
6a18a214ba | |||
83baf18490 | |||
ddf2085b4b | |||
508ec150f5 | |||
5eda75ebdd | |||
0253933271 | |||
0f80079d16 | |||
fd601128b7 | |||
bc09b8bfb9 | |||
e85326d415 | |||
396685e6a9 | |||
cf6a48d7a9 | |||
4f45110cda | |||
3aa75ce167 | |||
5b364b9ad8 | |||
550ab51f34 | |||
e782fcce62 | |||
a2ec86006d | |||
6399d1bdfb | |||
6cd8bbcb12 | |||
678967bfe1 | |||
ffd694eda1 | |||
ab2f929e83 | |||
4540eddd68 | |||
534c7105f4 | |||
c8a39d1d9e | |||
bd6d212f99 | |||
c4f0052ac9 | |||
5bfbc83a04 | |||
429eb8da53 | |||
f6cde374c4 | |||
1f811dfabd | |||
8ef6f32be6 | |||
a7cc2b38d8 | |||
9b26f5a6c8 | |||
c4fde7f7bc | |||
5f23a664fa | |||
209c97f44c | |||
d631fda2c7 | |||
caff89a040 | |||
42067b3de3 | |||
a287ce46b1 | |||
7212a0d433 | |||
9bae97ec4c | |||
096b0c424d | |||
39c2ab4743 | |||
57e0fd805e | |||
071a1c9f98 | |||
0cb418a89b | |||
4e9c99d65d | |||
dd918fb326 | |||
7ea86dec43 | |||
eeb386fef5 | |||
afabc9a503 | |||
1d8f9a5aed | |||
d4e11e56ea | |||
de69e666a9 | |||
28ffad223d | |||
f0d0e9ab1f | |||
854d8d4ae2 |
@ -63,17 +63,18 @@ find_package(ClangFormat)
|
||||
check_ipo_supported(RESULT SLS_LTO_AVAILABLE)
|
||||
|
||||
|
||||
# Use ld.gold if it is available and isn't disabled explicitly
|
||||
option(SLS_USE_LD_GOLD "Use GNU gold linker" ON)
|
||||
if (SLS_USE_LD_GOLD)
|
||||
execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
|
||||
if ("${LD_VERSION}" MATCHES "GNU gold")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fuse-ld=gold")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=gold")
|
||||
else ()
|
||||
message(WARNING "GNU gold linker isn't available, using the default system linker.")
|
||||
endif ()
|
||||
endif ()
|
||||
# # Use ld.gold if it is available and isn't disabled explicitly
|
||||
# option(SLS_USE_LD_GOLD "Use GNU gold linker" ON)
|
||||
# if (SLS_USE_LD_GOLD)
|
||||
# execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
|
||||
# if ("${LD_VERSION}" MATCHES "GNU gold")
|
||||
# set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
|
||||
# set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
|
||||
# set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
|
||||
# else ()
|
||||
# message(WARNING "GNU gold linker isn't available, using the default system linker.")
|
||||
# endif ()
|
||||
# endif ()
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||
@ -240,7 +241,7 @@ if(SLS_MASTER_PROJECT)
|
||||
# Set install dir CMake packages
|
||||
set(CMAKE_INSTALL_DIR "share/cmake/${PROJECT_NAME}")
|
||||
# Set the list of exported targets
|
||||
set(PROJECT_LIBRARIES slsSupportLib slsDetectorShared slsReceiverShared)
|
||||
set(PROJECT_LIBRARIES slsSupportShared slsDetectorShared slsReceiverShared)
|
||||
# Generate and install package config file and version
|
||||
include(cmake/package_config.cmake)
|
||||
endif()
|
||||
|
@ -1,6 +1,6 @@
|
||||
#Look for an executable called sphinx-build
|
||||
find_program(SPHINX_EXECUTABLE
|
||||
NAMES sphinx-build
|
||||
NAMES sphinx-build sphinx-build-3.6
|
||||
DOC "Path to sphinx-build executable")
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
@ -33,6 +33,7 @@ requirements:
|
||||
- {{ cdt('libselinux') }} # [linux]
|
||||
- {{ cdt('libxdamage') }} # [linux]
|
||||
- {{ cdt('libxxf86vm') }} # [linux]
|
||||
- expat
|
||||
|
||||
host:
|
||||
- libstdcxx-ng
|
||||
@ -45,6 +46,7 @@ requirements:
|
||||
- xorg-libxau
|
||||
- xorg-libxrender
|
||||
- xorg-libxfixes
|
||||
- expat
|
||||
|
||||
run:
|
||||
- zeromq
|
||||
@ -96,3 +98,4 @@ outputs:
|
||||
- {{ pin_subpackage('slsdetlib', exact=True) }}
|
||||
- qwt 6.*
|
||||
- qt 4.8.*
|
||||
- expat
|
||||
|
@ -59,14 +59,13 @@ set( HEADERS
|
||||
#set(ROOT_INCLUDE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
# ROOT dictionary generation
|
||||
include("${ROOT_DIR}/modules/RootNewMacros.cmake")
|
||||
include("${ROOT_DIR}/RootMacros.cmake")
|
||||
root_generate_dictionary(ctbDict ${HEADERS} LINKDEF ctbLinkDef.h)
|
||||
add_library(ctbRootLib SHARED ctbDict.cxx)
|
||||
target_include_directories(ctbRootLib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(ctbRootLib PUBLIC
|
||||
ROOT::Core
|
||||
slsDetectorShared
|
||||
slsSupportLib
|
||||
${ROOT_LIBRARIES}
|
||||
${ROOT_EXE_LINKER_FLAGS}
|
||||
)
|
||||
@ -78,7 +77,6 @@ set_target_properties(
|
||||
|
||||
target_link_libraries(ctbGui PUBLIC
|
||||
slsDetectorShared
|
||||
slsSupportLib
|
||||
ctbRootLib
|
||||
${TIFF_LIBRARIES}
|
||||
)
|
||||
|
@ -43,6 +43,7 @@ set(SPHINX_SOURCE_FILES
|
||||
src/type_traits.rst
|
||||
src/ToString.rst
|
||||
src/examples.rst
|
||||
src/pygettingstarted.rst
|
||||
|
||||
)
|
||||
|
||||
|
@ -48,7 +48,7 @@ int main() {
|
||||
auto tmp = os.str().erase(0, cmd.size());
|
||||
auto usage = tmp.substr(0, tmp.find_first_of('\n'));
|
||||
tmp.erase(0, usage.size());
|
||||
auto help = replace_all(tmp, "\n\t", "\n\t\t");
|
||||
auto help = replace_all(tmp, "\n\t", "\n\t\t| ");
|
||||
fs << '\t' << cmd << usage << help << "\n";
|
||||
}
|
||||
}
|
@ -32,6 +32,7 @@ Welcome to slsDetectorPackage's documentation!
|
||||
:caption: Python API
|
||||
:maxdepth: 2
|
||||
|
||||
pygettingstarted
|
||||
pydetector
|
||||
pyenums
|
||||
pyexamples
|
||||
|
@ -7,3 +7,4 @@ Detector
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
:inherited-members:
|
@ -4,6 +4,31 @@ Enums
|
||||
These enums are defined in slsDetectorDefs in the C++ package and
|
||||
exposed to Python through pybind11.
|
||||
|
||||
|
||||
::
|
||||
|
||||
# Most settings are represented as enums that can be
|
||||
# explicitly imported
|
||||
|
||||
from slsdet import Detector, fileFormat
|
||||
d = Detector()
|
||||
d.fformat = fileFormat.BINARY
|
||||
|
||||
# Altough not recommended for convenience all enums
|
||||
# and some other things can be impored using *
|
||||
|
||||
from slsdet import *
|
||||
d.speed = speedLevel.FULL_SPEED
|
||||
|
||||
# To list the available enums, use dir()
|
||||
|
||||
import slsdet.enums
|
||||
for enum in dir(slsdet.enums):
|
||||
# filter out special memebers
|
||||
if not enum.startswith('_'):
|
||||
print(enum)
|
||||
|
||||
|
||||
.. py:currentmodule:: slsdet
|
||||
|
||||
.. autoclass:: runStatus
|
||||
|
@ -1,7 +1,73 @@
|
||||
Examples
|
||||
================
|
||||
|
||||
Some short hints on how to use the detector
|
||||
Some short examples on how to use slsdet. If something is missing don't hesitate to
|
||||
open an issue in our our `github repo
|
||||
<https://github.com/slsdetectorgroup/slsDetectorPackage>`_.
|
||||
|
||||
|
||||
------------------------------------
|
||||
Setting exposure time
|
||||
------------------------------------
|
||||
|
||||
Setting and reading back exposure time can be done either using a Python datetime.timedelta
|
||||
or by setting the time in seconds.
|
||||
|
||||
::
|
||||
|
||||
# Set exposure time to 1.2 seconds
|
||||
>>> d.exptime = 1.2
|
||||
|
||||
# Setting exposure time using timedelta
|
||||
import datetime as dt
|
||||
>>> d.exptime = dt.timedelta(seconds = 1.2)
|
||||
|
||||
# With timedelta any arbitrary combination of units can be used
|
||||
>>> t = dt.timedelta(microseconds = 100, seconds = 5.3, minutes = .3)
|
||||
|
||||
# To set exposure time for individual detector one have to resort
|
||||
# to the C++ style API.
|
||||
# Sets exposure time to 1.2 seconds for module 0, 6 and 12
|
||||
>>> d.setExptime(1.2, [0, 6, 12])
|
||||
>>> d.setExptime(dt.timedelta(seconds = 1.2), [0, 6, 12])
|
||||
|
||||
|
||||
|
||||
------------------------------------
|
||||
Converting numbers to hex
|
||||
------------------------------------
|
||||
|
||||
Python support entering numbers in format by using the 0x prefix. However, when reading
|
||||
back you will get a normal integer. This can then be converted to a hex string representation
|
||||
using the built in hex() function.
|
||||
|
||||
.. code-block :: python
|
||||
|
||||
from slsdet import Detector
|
||||
>>> d = Detector()
|
||||
>>> d.patwait0 = 0xaa
|
||||
>>> d.patwait0
|
||||
170
|
||||
|
||||
# Convert to string
|
||||
>>> hex(d.patwait0)
|
||||
'0xaa'
|
||||
|
||||
For multiple values one can use a list comprehension to loop over the values.
|
||||
|
||||
.. code-block :: python
|
||||
|
||||
>>> values = [1,2,3,4,5]
|
||||
>>> [(v) for v in values]
|
||||
['0x1', '0x2', '0x3', '0x4', '0x5']
|
||||
|
||||
# or to a single string by passing the list to .join
|
||||
>>> ', '.join([hex(v) for v in values])
|
||||
'0x1, 0x2, 0x3, 0x4, 0x5'
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
------------------------
|
||||
Simple threshold scan
|
||||
@ -74,37 +140,39 @@ But lets start looking at the at the manual way:
|
||||
::
|
||||
|
||||
import time
|
||||
from slsdet import Eiger
|
||||
d = Eiger()
|
||||
from slsdet import Detector, runStatus
|
||||
|
||||
n = 10
|
||||
t = 1
|
||||
|
||||
d.exposure_time = t
|
||||
d.n_frames = n
|
||||
d.reset_frames_caught()
|
||||
n_frames = 10
|
||||
t_exp = 1
|
||||
|
||||
#Start the measurement
|
||||
# Set exposure time and number of frames
|
||||
d = Detector()
|
||||
d.exptime = t_exp
|
||||
d.frames = n_frames
|
||||
|
||||
# Start the measurement
|
||||
t0 = time.time()
|
||||
d.start_receiver()
|
||||
d.start_detector()
|
||||
d.startDetector()
|
||||
d.startReceiver()
|
||||
|
||||
#Wait for the detector to be ready or do other important stuff
|
||||
time.sleep(t*n)
|
||||
# Wait for the detector to be ready or do other important stuff
|
||||
time.sleep(t_exp * n_frames)
|
||||
|
||||
#check if the detector is ready otherwise wait a bit longer
|
||||
while d.status != 'idle':
|
||||
# check if the detector is ready otherwise wait a bit longer
|
||||
while d.status != runStatus.IDLE:
|
||||
time.sleep(0.1)
|
||||
|
||||
#Stop the receiver after we got the frames
|
||||
#Detector is already idle so we don't need to stop it
|
||||
d.stop_receiver()
|
||||
# Stop the receiver after we got the frames
|
||||
# Detector is already idle so we don't need to stop it
|
||||
d.stopReceiver()
|
||||
|
||||
lost = d.rx_framescaught - n_frames
|
||||
print(
|
||||
f"{n_frames} frames of {t_exp}s took {time.time()-t0:{.3}}s with {lost} frames lost "
|
||||
)
|
||||
|
||||
lost = d.frames_caught - n
|
||||
print(f'{n} frames of {t}s took {time.time()-t0:{.3}}s with {lost} frames lost ')
|
||||
|
||||
#Reset to not interfere with a potential next measurement
|
||||
d.reset_frames_caught()
|
||||
|
||||
Instead launching d.acq() from a different process is a bit easier since the control of receiver and detector
|
||||
is handled in the acq call. However, you need to join the process used otherwise a lot of zombie processes would
|
||||
@ -114,30 +182,104 @@ hang around until the main process exits.
|
||||
|
||||
import time
|
||||
from multiprocessing import Process
|
||||
from slsdet import Eiger
|
||||
from slsdet import Detector, runStatus
|
||||
|
||||
def acquire():
|
||||
"""
|
||||
Create a new Eiger object that still referes to the same actual detector
|
||||
and same shared memory. Then launch acq.
|
||||
"""
|
||||
detector = Eiger()
|
||||
detector.acq()
|
||||
|
||||
#This is the detector we use throughout the session
|
||||
d = Eiger()
|
||||
d = Detector()
|
||||
|
||||
#Process to run acquire
|
||||
p = Process(target=acquire)
|
||||
#Create a separate process to run acquire in
|
||||
p = Process(target=d.acquire)
|
||||
|
||||
#Start the thread and short sleep to allow the acq to start
|
||||
p.start()
|
||||
time.sleep(0.01)
|
||||
|
||||
#Do some other work
|
||||
while d.busy is True:
|
||||
print(d.busy)
|
||||
while d.status != runStatus.IDLE:
|
||||
print("Working")
|
||||
time.sleep(0.1)
|
||||
|
||||
#Join the process
|
||||
p.join()
|
||||
|
||||
|
||||
------------------------------
|
||||
Setting and getting times
|
||||
------------------------------
|
||||
|
||||
::
|
||||
|
||||
import datetime as dt
|
||||
from slsdet import Detector
|
||||
from slsdet.utils import element_if_equal
|
||||
|
||||
d = Detector()
|
||||
|
||||
# The simplest way is to set the exposure time in
|
||||
# seconds by using the exptime property
|
||||
# This sets the exposure time for all modules
|
||||
d.exptime = 0.5
|
||||
|
||||
# exptime also accepts a python datetime.timedelta
|
||||
# which can be used to set the time in almost any unit
|
||||
t = dt.timedelta(milliseconds = 2.3)
|
||||
d.exptime = t
|
||||
|
||||
# or combination of units
|
||||
t = dt.timedelta(minutes = 3, seconds = 1.23)
|
||||
d.exptime = t
|
||||
|
||||
# exptime however always returns the time in seconds
|
||||
>>> d.exptime
|
||||
181.23
|
||||
|
||||
# To get back the exposure time for each module
|
||||
# it's possible to use getExptime, this also returns
|
||||
# the values as datetime.timedelta
|
||||
|
||||
>>> d.getExptime()
|
||||
[datetime.timedelta(seconds=181, microseconds=230000), datetime.timedelta(seconds=181, microseconds=230000)]
|
||||
|
||||
# In case the values are the same it's possible to use the
|
||||
# element_if_equal function to reduce the values to a single
|
||||
# value
|
||||
|
||||
>>> t = d.getExptime()
|
||||
>>> element_if_equal(t)
|
||||
datetime.timedelta(seconds=1)
|
||||
|
||||
--------------
|
||||
Reading dacs
|
||||
--------------
|
||||
|
||||
::
|
||||
|
||||
from slsdet import Detector, Eiger, dacIndex
|
||||
|
||||
#using the specialized class
|
||||
e = Eiger()
|
||||
>>> e.dacs
|
||||
========== DACS =========
|
||||
vsvp : 0 0
|
||||
vtrim : 2480 2480
|
||||
vrpreamp : 3300 3300
|
||||
vrshaper : 1400 1400
|
||||
vsvn : 4000 4000
|
||||
vtgstv : 2556 2556
|
||||
vcmp_ll : 1000 1000
|
||||
vcmp_lr : 1000 1000
|
||||
vcal : 0 0
|
||||
vcmp_rl : 1000 1000
|
||||
rxb_rb : 1100 1100
|
||||
rxb_lb : 1100 1100
|
||||
vcmp_rr : 1000 1000
|
||||
vcp : 1000 1000
|
||||
vcn : 2000 2000
|
||||
vishaper : 1550 1550
|
||||
iodelay : 650 650
|
||||
|
||||
# or using the general class and the list
|
||||
d = Detector()
|
||||
for dac in d.daclist:
|
||||
r = d.getDAC(dac, False)
|
||||
print(f'{dac.name:10s} {r}')
|
||||
|
228
docs/src/pygettingstarted.rst
Normal file
228
docs/src/pygettingstarted.rst
Normal file
@ -0,0 +1,228 @@
|
||||
Getting Started
|
||||
==================
|
||||
|
||||
|
||||
--------------------
|
||||
Which Python?
|
||||
--------------------
|
||||
|
||||
We require at lest Python 3.6 and strongly recommended that you don't use the system
|
||||
Python installation. The examples in this documentation uses `conda
|
||||
<https://docs.conda.io/en/latest/miniconda.html>`_ since it provides good support
|
||||
also for non Python packages but there are also other alternatives like, pyenv.
|
||||
|
||||
Using something like conda also allows you to quickly switch beteen different Python
|
||||
environments.
|
||||
|
||||
.. warning ::
|
||||
|
||||
If you use conda avoid also installing packages with pip.
|
||||
|
||||
---------------------
|
||||
PYTHONPATH
|
||||
---------------------
|
||||
|
||||
If you install slsdet using conda everything is set up and you can
|
||||
directly start using the Python bindings. However, if you build
|
||||
from source you need to tell Python where to find slsdet. This
|
||||
is be done by adding your build/bin directory to PYTHONPATH.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
export PYTHONPATH = /path/to/your/build/bin:$PYTHONPATH
|
||||
|
||||
.. note ::
|
||||
|
||||
Don't forget to compile with the option SLS_USE_PYTHON=ON to enable
|
||||
the Python bindings or if you use the cmk.sh script -p.
|
||||
|
||||
--------------------------------------
|
||||
Which detector class should I use?
|
||||
--------------------------------------
|
||||
|
||||
We provide a generic class called Detector and detector specific
|
||||
versions like, Eiger, Jungfrau etc. The most or all functionality
|
||||
is there in the base class except the convenient access to dacs
|
||||
and temperatures.
|
||||
|
||||
::
|
||||
|
||||
from slsdet import Detector, Eiger
|
||||
|
||||
d = Detector()
|
||||
e = Eiger()
|
||||
|
||||
# Both classes can be used to control an Eiger detector
|
||||
d.exptime = 0.5
|
||||
e.period = 1
|
||||
|
||||
# But Eiger gives a simpler interface to the dacs
|
||||
>>> e.dacs
|
||||
========== DACS =========
|
||||
vsvp : 0
|
||||
vtrim : 2480
|
||||
vrpreamp : 3300
|
||||
vrshaper : 1400
|
||||
vsvn : 4000
|
||||
vtgstv : 2556
|
||||
vcmp_ll : 1000
|
||||
vcmp_lr : 1000
|
||||
vcal : 0
|
||||
vcmp_rl : 1000
|
||||
rxb_rb : 1100
|
||||
rxb_lb : 1100
|
||||
vcmp_rr : 1000
|
||||
vcp : 1000
|
||||
vcn : 2000
|
||||
vishaper : 1550
|
||||
iodelay : 650
|
||||
|
||||
|
||||
.. note ::
|
||||
|
||||
Depending on user feedback we might move some detector specific
|
||||
functionality to the specialized classes.
|
||||
|
||||
|
||||
----------------------------------
|
||||
Hey, there seems to be two APIs?
|
||||
----------------------------------
|
||||
|
||||
To make the Python API approachable, both if you come from the command line
|
||||
or are using the C++ API, we provide two interfaces to the detector.
|
||||
One is property based and tries to stay as close to the command line syntax
|
||||
as is possible, and the other one directly maps the C++ API found in Detector.h.
|
||||
There is also an underlying design reason for the two APIs since we auto
|
||||
generate the bindings to the C++ code using a mix of pybind11 and clang-tools.
|
||||
The property based API covers most of the functionality but in some cases
|
||||
you have to reach for the C++ like interface.
|
||||
|
||||
|
||||
::
|
||||
|
||||
d = Detector()
|
||||
|
||||
# C++ like API
|
||||
d.setExptime(0.1)
|
||||
|
||||
# or a bit more pythonic
|
||||
d.exptime = 0.1
|
||||
|
||||
The c++ style API offers more control over access to individual modules
|
||||
in a large detector.
|
||||
|
||||
::
|
||||
|
||||
# Set exposure time for module 1, 5 and 7
|
||||
d.setExptime(0.1, [1,5,7])
|
||||
|
||||
--------------------
|
||||
Finding functions
|
||||
--------------------
|
||||
|
||||
To find out which properties and methods that a Python object have you
|
||||
can use dir()
|
||||
|
||||
::
|
||||
|
||||
>>> from slsdet import Detector
|
||||
>>> d = Detector()
|
||||
>>> dir(d)
|
||||
['__class__', '__delattr__', '__dict__', '__dir__', '__doc__',
|
||||
'__eq__', '__format__', '__ge__', '__getattribute__', '__gt__',
|
||||
'__hash__', '__init__', '__init_subclass__', '__le__', '__len__',
|
||||
'__lt__', '__module__', '__ne__', '__new__', '__reduce__',
|
||||
'__reduce_ex__', '__repr__', '__setattr__', '__sizeof__',
|
||||
'__str__', '__subclasshook__', '_adc_register', '_frozen',
|
||||
'_register', 'acquire', 'adcclk', 'adcphase', 'adcpipeline',
|
||||
'adcreg', 'asamples', 'auto_comp_disable', 'clearAcquiringFlag',
|
||||
'clearBit', 'clearROI', 'client_version', 'config', 'copyDetectorServer',
|
||||
'counters', 'daclist', 'dacvalues', 'dbitclk', 'dbitphase' ...
|
||||
|
||||
Since the list for Detector is rather long it's an good idea to filter it.
|
||||
The following example gives you properties and methods containing time in
|
||||
their name.
|
||||
|
||||
::
|
||||
|
||||
>>> [item for item in dir(d) if 'time' in item]
|
||||
['exptime', 'getExptime', 'getExptimeForAllGates', 'getExptimeLeft',
|
||||
'getSubExptime', 'patwaittime0', 'patwaittime1', 'patwaittime2',
|
||||
'setExptime', 'setSubExptime', 'subdeadtime', 'subexptime']
|
||||
|
||||
The above method works on any Python object but for convenience we also
|
||||
included two functions to find names. View prints the names one per line
|
||||
while find returns a list of names.
|
||||
|
||||
::
|
||||
|
||||
from slsdet.lookup import view, find
|
||||
|
||||
>>> view('exptime')
|
||||
exptime
|
||||
getExptime
|
||||
getExptimeForAllGates
|
||||
getExptimeLeft
|
||||
getSubExptime
|
||||
setExptime
|
||||
setSubExptime
|
||||
subexptime
|
||||
|
||||
>>> find('exptime')
|
||||
['exptime', 'getExptime', 'getExptimeForAllGates', 'getExptimeLeft',
|
||||
'getSubExptime', 'setExptime', 'setSubExptime', 'subexptime']
|
||||
|
||||
|
||||
------------------------------------
|
||||
Finding out what the function does
|
||||
------------------------------------
|
||||
|
||||
To access the documentation of a function directly from the Python prompt use help().
|
||||
|
||||
.. code-block :: python
|
||||
|
||||
>>> help(Detector.period)
|
||||
Help on property:
|
||||
|
||||
Period between frames, accepts either a value in seconds or datetime.timedelta
|
||||
|
||||
Note
|
||||
-----
|
||||
:getter: always returns in seconds. To get in datetime.delta, use getPeriod
|
||||
|
||||
Examples
|
||||
-----------
|
||||
>>> d.period = 1.05
|
||||
>>> d.period = datetime.timedelta(minutes = 3, seconds = 1.23)
|
||||
>>> d.period
|
||||
181.23
|
||||
>>> d.getPeriod()
|
||||
[datetime.timedelta(seconds=181, microseconds=230000)]
|
||||
|
||||
|
||||
----------------------
|
||||
Where are the ENUMs?
|
||||
----------------------
|
||||
|
||||
To set some of the detector settings like file format you have
|
||||
to pass in an enum.
|
||||
|
||||
::
|
||||
|
||||
>>> d.setFileFormat(fileFormat.BINARY)
|
||||
|
||||
The enums can be found in slsdet.enums
|
||||
|
||||
::
|
||||
|
||||
import slsdet
|
||||
>>> [e for e in dir(slsdet.enums) if not e.startswith('_')]
|
||||
['burstMode', 'clockIndex', 'dacIndex', 'detectorModeType',
|
||||
'detectorSettings', 'detectorType', 'dimension', 'externalSignalFlag',
|
||||
'fileFormat', 'frameDiscardPolicy', 'frameModeType', 'masterFlags',
|
||||
'readoutMode', 'runStatus', 'speedLevel', 'timingMode',
|
||||
'timingSourceType']
|
||||
|
||||
# Even though importing using * is not recommended one could
|
||||
# get all the enums like this:
|
||||
>>> from slsdet.enums import *
|
@ -11,7 +11,7 @@ pybind11_add_module(_slsdet
|
||||
target_link_libraries(_slsdet PUBLIC
|
||||
slsDetectorShared
|
||||
slsReceiverShared
|
||||
slsSupportLib
|
||||
slsSupportShared
|
||||
${ZeroMQ_LIBRARIES}
|
||||
)
|
||||
|
||||
@ -30,11 +30,17 @@ set( PYTHON_FILES
|
||||
detector_property.py
|
||||
detector.py
|
||||
eiger.py
|
||||
enums.py
|
||||
errors.py
|
||||
gotthard.py
|
||||
gotthard2.py
|
||||
moench.py
|
||||
jsonproxy.py
|
||||
ctb.py
|
||||
jungfrau.py
|
||||
mythen3.py
|
||||
registers.py
|
||||
temperature.py
|
||||
lookup.py
|
||||
utils.py
|
||||
|
||||
|
42
python/examples/exposure_time.py
Normal file
42
python/examples/exposure_time.py
Normal file
@ -0,0 +1,42 @@
|
||||
"""
|
||||
Example showing how to set and get exposure times
|
||||
"""
|
||||
|
||||
import datetime as dt
|
||||
from slsdet import Detector
|
||||
from slsdet.utils import element_if_equal
|
||||
|
||||
d = Detector()
|
||||
|
||||
# The simplest way is to set the exposure time in
|
||||
# seconds by using the exptime property
|
||||
# This sets the exposure time for all modules
|
||||
d.exptime = 0.5
|
||||
|
||||
# exptime also accepts a python datetime.timedelta
|
||||
# which can be used to set the time in almost any unit
|
||||
t = dt.timedelta(milliseconds = 2.3)
|
||||
d.exptime = t
|
||||
|
||||
# or combination of units
|
||||
t = dt.timedelta(minutes = 3, seconds = 1.23)
|
||||
d.exptime = t
|
||||
|
||||
#exptime however always returns the time in seconds
|
||||
# >>> d.exptime
|
||||
# 181.23
|
||||
|
||||
# To get back the exposure time for each module
|
||||
# it's possible to use getExptime, this also returns
|
||||
# the values as datetime.timedelta
|
||||
|
||||
# >>> d.getExptime()
|
||||
# [datetime.timedelta(seconds=181, microseconds=230000), datetime.timedelta(seconds=181, microseconds=230000)]
|
||||
|
||||
# In case the values are the same it's possible to use the
|
||||
# element_if_equal function to reduce the values to a single
|
||||
# value
|
||||
|
||||
# >>> t = d.getExptime()
|
||||
# >>> element_if_equal(t)
|
||||
# datetime.timedelta(seconds=1)
|
21
python/examples/non-blocking-acquire-process.py
Normal file
21
python/examples/non-blocking-acquire-process.py
Normal file
@ -0,0 +1,21 @@
|
||||
import time
|
||||
from multiprocessing import Process
|
||||
from slsdet import Detector, runStatus
|
||||
|
||||
|
||||
d = Detector()
|
||||
|
||||
#Create a separate process to run acquire in
|
||||
p = Process(target=d.acquire)
|
||||
|
||||
#Start the thread and short sleep to allow the acq to start
|
||||
p.start()
|
||||
time.sleep(0.01)
|
||||
|
||||
#Do some other work
|
||||
while d.status != runStatus.IDLE:
|
||||
print("Working")
|
||||
time.sleep(0.1)
|
||||
|
||||
#Join the process
|
||||
p.join()
|
33
python/examples/non-blocking-acquire.py
Normal file
33
python/examples/non-blocking-acquire.py
Normal file
@ -0,0 +1,33 @@
|
||||
import time
|
||||
from slsdet import Detector, runStatus
|
||||
|
||||
|
||||
n_frames = 10
|
||||
t_exp = 1
|
||||
|
||||
# Set exposure time and number of frames
|
||||
d = Detector()
|
||||
d.exptime = t_exp
|
||||
d.frames = n_frames
|
||||
|
||||
# Start the measurement
|
||||
t0 = time.time()
|
||||
d.startDetector()
|
||||
d.startReceiver()
|
||||
|
||||
# Wait for the detector to be ready or do other important stuff
|
||||
time.sleep(t_exp * n_frames)
|
||||
|
||||
# check if the detector is ready otherwise wait a bit longer
|
||||
while d.status != runStatus.IDLE:
|
||||
time.sleep(0.1)
|
||||
|
||||
# Stop the receiver after we got the frames
|
||||
# Detector is already idle so we don't need to stop it
|
||||
d.stopReceiver()
|
||||
|
||||
lost = d.rx_framescaught - n_frames
|
||||
print(
|
||||
f"{n_frames} frames of {t_exp}s took {time.time()-t0:{.3}}s with {lost} frames lost "
|
||||
)
|
||||
|
32
python/examples/reading_dacs.py
Normal file
32
python/examples/reading_dacs.py
Normal file
@ -0,0 +1,32 @@
|
||||
from slsdet import Detector, Eiger, dacIndex
|
||||
|
||||
|
||||
#using the specialized class
|
||||
|
||||
e = Eiger()
|
||||
e.dacs
|
||||
# >>> e.dacs
|
||||
# ========== DACS =========
|
||||
# vsvp : 0 0
|
||||
# vtrim : 2480 2480
|
||||
# vrpreamp : 3300 3300
|
||||
# vrshaper : 1400 1400
|
||||
# vsvn : 4000 4000
|
||||
# vtgstv : 2556 2556
|
||||
# vcmp_ll : 1000 1000
|
||||
# vcmp_lr : 1000 1000
|
||||
# vcal : 0 0
|
||||
# vcmp_rl : 1000 1000
|
||||
# rxb_rb : 1100 1100
|
||||
# rxb_lb : 1100 1100
|
||||
# vcmp_rr : 1000 1000
|
||||
# vcp : 1000 1000
|
||||
# vcn : 2000 2000
|
||||
# vishaper : 1550 1550
|
||||
# iodelay : 650 650
|
||||
|
||||
# or using the general class and the list
|
||||
d = Detector()
|
||||
for dac in d.daclist:
|
||||
r = d.getDAC(dac, False)
|
||||
print(f'{dac.name:10s} {r}')
|
45
python/examples/reading_temperature.py
Normal file
45
python/examples/reading_temperature.py
Normal file
@ -0,0 +1,45 @@
|
||||
from slsdet import Detector, Eiger, dacIndex
|
||||
|
||||
|
||||
|
||||
#Using the general detector class and calling with an index
|
||||
d = Detector()
|
||||
fpga_temp = d.getTemperature(dacIndex.TEMPERATURE_FPGA)
|
||||
print(f'fpga_temp: {fpga_temp}\n')
|
||||
|
||||
#Using the specialized detector class
|
||||
e = Eiger()
|
||||
print("All temperatures for Eiger\n")
|
||||
print(e.temp)
|
||||
# >>> e.temp
|
||||
# temp_fpga : 54°C 60°C
|
||||
# temp_fpgaext : 49°C 52°C
|
||||
# temp_10ge : 47°C 45°C
|
||||
# temp_dcdc : 52°C 53°C
|
||||
# temp_sodl : 51°C 53°C
|
||||
# temp_sodl : 51°C 51°C
|
||||
# temp_fpgafl : 45°C 49°C
|
||||
# temp_fpgafr : 39°C 42°C
|
||||
|
||||
# The temperatures can also be returned in a dictionary
|
||||
t = e.temp.to_dict()
|
||||
print(t)
|
||||
# >>> e.temp.to_dict()
|
||||
# {'fpga': array([55, 60]), 'fpgaext': array([49, 52]),
|
||||
# 't10ge': array([47, 45]), 'dcdc': array([52, 53]),
|
||||
# 'sodl': array([51, 53]), 'sodr': array([51, 51]), '
|
||||
# temp_fpgafl': array([45, 49]),
|
||||
# 'temp_fpgafr': array([39, 42])}
|
||||
|
||||
# or in a numpy array
|
||||
t = e.temp.to_array()
|
||||
print(t)
|
||||
# >>> e.temp.to_array()
|
||||
# array([[55, 60],
|
||||
# [49, 52],
|
||||
# [47, 45],
|
||||
# [52, 53],
|
||||
# [51, 53],
|
||||
# [51, 51],
|
||||
# [45, 49],
|
||||
# [40, 43]])
|
8
python/examples/threshold_scan.py
Normal file
8
python/examples/threshold_scan.py
Normal file
@ -0,0 +1,8 @@
|
||||
from slsdet import Eiger
|
||||
|
||||
d = Eiger()
|
||||
threshold = range(0, 2000, 200)
|
||||
for th in threshold:
|
||||
print(f'{th=}')
|
||||
d.vthreshold = th
|
||||
d.acquire()
|
20
python/examples/use_enum.py
Normal file
20
python/examples/use_enum.py
Normal file
@ -0,0 +1,20 @@
|
||||
# Most settings are represented as enums that can be
|
||||
# explicitly imported
|
||||
|
||||
from slsdet import Detector, fileFormat
|
||||
d = Detector()
|
||||
d.fformat = fileFormat.BINARY
|
||||
|
||||
# Altough not recommended for convenience all enums
|
||||
# and some other things can be impored using *
|
||||
|
||||
from slsdet import *
|
||||
d.speed = speedLevel.FULL_SPEED
|
||||
|
||||
# To list the available enums, use dir()
|
||||
|
||||
import slsdet.enums
|
||||
for enum in dir(slsdet.enums):
|
||||
# filter out special memebers
|
||||
if not enum.startswith('_'):
|
||||
print(enum)
|
@ -3,13 +3,15 @@ import sys
|
||||
import numpy as np
|
||||
sys.path.append(os.path.join(os.getcwd(), 'bin'))
|
||||
|
||||
from slsdet import Detector, Mythen3, Eiger, Jungfrau, DetectorDacs, Dac, Ctb
|
||||
from slsdet import Detector, Mythen3, Eiger, Jungfrau, DetectorDacs, Dac, Ctb, Gotthard2, Moench
|
||||
from slsdet import dacIndex, readoutMode
|
||||
from slsdet.lookup import view, find
|
||||
|
||||
d = Detector()
|
||||
# e = Eiger()
|
||||
e = Eiger()
|
||||
c = Ctb()
|
||||
g = Gotthard2()
|
||||
# j = Jungfrau()
|
||||
# m = Mythen3()
|
||||
m = Moench()
|
||||
|
||||
|
@ -15,8 +15,80 @@ pycmd += ['vrf', 'vtr', 'vrs', 'vtgstv', 'vsvn', 'vtrim',
|
||||
'vpreamp', 'vref_comp', 'vref_comp_fe vref_ds', 'vref_h_adc',
|
||||
'vref_l_adc', 'iodelay', 'list', 'vref_ds', 'vis', 'vpl',
|
||||
'vref_comp_fe', 'vph', 'vout_cm', 'vcp', 'vcn', 'vcmp_ll', 'vcmp_lr'
|
||||
, 'vcmp_rl', 'vcmp_rr', 'daclist', 'dacvalues', 'vcal', 'vcas']
|
||||
|
||||
]
|
||||
|
||||
|
||||
# dacs are in general not included in the python commands and we expect to
|
||||
# set them from the specialized class or using an enum
|
||||
dacs = [
|
||||
'vicin',
|
||||
'vcassh',
|
||||
'vcal_n',
|
||||
'vcal_p'
|
||||
'vipre_out',
|
||||
'vipre_cds',
|
||||
'vdd_prot',
|
||||
'vcmp_rl',
|
||||
'vcmp_rr',
|
||||
'vcal', 'vcas',
|
||||
'vipre',
|
||||
'vin_com',
|
||||
'vin_cm',
|
||||
'vrshaper',
|
||||
'vrshaper_n',
|
||||
'vrpreamp',
|
||||
'vishaper',
|
||||
'vipre_out',
|
||||
'vcom_adc1',
|
||||
'vcom_adc2',
|
||||
'vcom_cds',
|
||||
'vdcsh',
|
||||
'v_chip',
|
||||
'vb_comp',
|
||||
'vb_comp_adc',
|
||||
'vb_comp_fe',
|
||||
'vb_cs',
|
||||
'vb_ds',
|
||||
'vb_opa_1st',
|
||||
'vb_opa_fd',
|
||||
'vb_pixbuf',
|
||||
'vb_sda',
|
||||
'vbp_colbuf',
|
||||
'vcal_p',
|
||||
'vcasc_out',
|
||||
'vcasc_sfp',
|
||||
'vcascn_pb',
|
||||
'vcascp_pb',
|
||||
'vchip_comp_adc',
|
||||
'vchip_comp_fe',
|
||||
'vchip_cs',
|
||||
'vchip_opa_1st',
|
||||
'vchip_opa_fd',
|
||||
'vchip_ref_comp_fe',
|
||||
|
||||
]
|
||||
|
||||
intentionally_missing = [
|
||||
'temp_10ge', #temperatures already available from enum or specialized class
|
||||
'temp_adc',
|
||||
'temp_dcdc',
|
||||
'temp_fpga',
|
||||
'temp_fpgaext',
|
||||
'temp_fpgafl',
|
||||
'temp_fpgafr',
|
||||
'temp_slowadc',
|
||||
'temp_sodl',
|
||||
'temp_sodr',
|
||||
'trigger', #use sendSoftwareTrigger
|
||||
'update', #use updateServerAndFirmare
|
||||
'udp_validate', #use validateUdpConfiguration
|
||||
'udp_reconfigure', #use reconfigureUdpDestination
|
||||
'emin', #use rx_jsonpara
|
||||
]
|
||||
|
||||
pycmd += intentionally_missing
|
||||
pycmd += dacs
|
||||
missing = []
|
||||
for c in cmd:
|
||||
if c not in pycmd:
|
||||
|
@ -5,32 +5,34 @@ from .dacs import DetectorDacs, Dac
|
||||
from .detector import Detector
|
||||
from .jungfrau import Jungfrau
|
||||
from .mythen3 import Mythen3
|
||||
from .gotthard2 import Gotthard2
|
||||
from .gotthard import Gotthard
|
||||
from .moench import Moench
|
||||
# from .jungfrau_ctb import JungfrauCTB
|
||||
# from _slsdet import DetectorApi
|
||||
|
||||
import _slsdet
|
||||
|
||||
defs = _slsdet.slsDetectorDefs
|
||||
runStatus = _slsdet.slsDetectorDefs.runStatus
|
||||
speedLevel = _slsdet.slsDetectorDefs.speedLevel
|
||||
|
||||
|
||||
detectorType = _slsdet.slsDetectorDefs.detectorType
|
||||
frameDiscardPolicy = _slsdet.slsDetectorDefs.frameDiscardPolicy
|
||||
fileFormat = _slsdet.slsDetectorDefs.fileFormat
|
||||
dimension = _slsdet.slsDetectorDefs.dimension
|
||||
externalSignalFlag = _slsdet.slsDetectorDefs.externalSignalFlag
|
||||
timingMode = _slsdet.slsDetectorDefs.timingMode
|
||||
dacIndex = _slsdet.slsDetectorDefs.dacIndex
|
||||
detectorSettings = _slsdet.slsDetectorDefs.detectorSettings
|
||||
clockIndex = _slsdet.slsDetectorDefs.clockIndex
|
||||
readoutMode = _slsdet.slsDetectorDefs.readoutMode
|
||||
masterFlags = _slsdet.slsDetectorDefs.masterFlags
|
||||
|
||||
frameModeType = _slsdet.slsDetectorDefs.frameModeType
|
||||
detectorModeType = _slsdet.slsDetectorDefs.detectorModeType
|
||||
burstMode = _slsdet.slsDetectorDefs.burstMode
|
||||
timingSourceType = _slsdet.slsDetectorDefs.timingSourceType
|
||||
from .enums import *
|
||||
# runStatus = _slsdet.slsDetectorDefs.runStatus
|
||||
# speedLevel = _slsdet.slsDetectorDefs.speedLevel
|
||||
# detectorType = _slsdet.slsDetectorDefs.detectorType
|
||||
# frameDiscardPolicy = _slsdet.slsDetectorDefs.frameDiscardPolicy
|
||||
# fileFormat = _slsdet.slsDetectorDefs.fileFormat
|
||||
# dimension = _slsdet.slsDetectorDefs.dimension
|
||||
# externalSignalFlag = _slsdet.slsDetectorDefs.externalSignalFlag
|
||||
# timingMode = _slsdet.slsDetectorDefs.timingMode
|
||||
# dacIndex = _slsdet.slsDetectorDefs.dacIndex
|
||||
# detectorSettings = _slsdet.slsDetectorDefs.detectorSettings
|
||||
# clockIndex = _slsdet.slsDetectorDefs.clockIndex
|
||||
# readoutMode = _slsdet.slsDetectorDefs.readoutMode
|
||||
# masterFlags = _slsdet.slsDetectorDefs.masterFlags
|
||||
# frameModeType = _slsdet.slsDetectorDefs.frameModeType
|
||||
# detectorModeType = _slsdet.slsDetectorDefs.detectorModeType
|
||||
# burstMode = _slsdet.slsDetectorDefs.burstMode
|
||||
# timingSourceType = _slsdet.slsDetectorDefs.timingSourceType
|
||||
|
||||
|
||||
IpAddr = _slsdet.IpAddr
|
||||
|
@ -1,23 +1,33 @@
|
||||
from functools import partial
|
||||
class Adc:
|
||||
def __init__(self, name, detector):
|
||||
def __init__(self, name, enum, detector):
|
||||
self.name = name
|
||||
self.enum = enum
|
||||
self._detector = detector
|
||||
self.get_nmod = self._detector._api.getNumberOfDetectors
|
||||
self.get_nmod = self._detector.size
|
||||
# Bind functions to get and set the dac
|
||||
self.get = partial(self._detector._api.getAdc, self.name)
|
||||
self.get = partial(self._detector.getAdc, self.enum)
|
||||
|
||||
|
||||
def __getitem__(self, key):
|
||||
"""
|
||||
Get dacs either by slice, key or list
|
||||
"""
|
||||
if key == slice(None, None, None):
|
||||
return [self.get(i) / 1000 for i in range(self.get_nmod())]
|
||||
return self.get()
|
||||
elif isinstance(key, Iterable):
|
||||
return [self.get(k) / 1000 for k in key]
|
||||
return self.get(list(key))
|
||||
else:
|
||||
return self.get(key) / 1000
|
||||
return self.get([key])[0] #No list for single value
|
||||
|
||||
|
||||
# def __getitem__(self, key):
|
||||
# """
|
||||
# Get dacs either by slice, key or list
|
||||
# """
|
||||
# if key == slice(None, None, None):
|
||||
# return [self.get(i) / 1000 for i in range(self.get_nmod())]
|
||||
# elif isinstance(key, Iterable):
|
||||
# return [self.get(k) / 1000 for k in key]
|
||||
# else:
|
||||
# return self.get(key) / 1000
|
||||
|
||||
def __repr__(self):
|
||||
"""String representation for a single adc in all modules"""
|
||||
|
@ -32,10 +32,9 @@ class Dac(DetectorProperty):
|
||||
def __repr__(self):
|
||||
"""String representation for a single dac in all modules"""
|
||||
dacstr = ''.join([f'{item:5d}' for item in self.get()])
|
||||
return f'{self.__name__:10s}:{dacstr}'
|
||||
return f'{self.__name__:15s}:{dacstr}'
|
||||
|
||||
|
||||
# a = Dac('vrf', dacIndex.VRF, 0, 4000, 2500, d )
|
||||
# @freeze
|
||||
class DetectorDacs:
|
||||
_dacs = []
|
||||
_dacnames = [_d[0] for _d in _dacs]
|
||||
@ -93,6 +92,9 @@ class DetectorDacs:
|
||||
dac_array[i,:] = _d[:]
|
||||
return dac_array
|
||||
|
||||
def to_array(self):
|
||||
return self.get_asarray()
|
||||
|
||||
def set_from_array(self, dac_array):
|
||||
"""
|
||||
Set the dacs from an numpy array with dac values. [ndacs, nmodules]
|
||||
@ -101,6 +103,9 @@ class DetectorDacs:
|
||||
for i, _d in enumerate(self):
|
||||
_d[:] = dac_array[i]
|
||||
|
||||
def from_array(self, dac_array):
|
||||
self.set_from_array(dac_array)
|
||||
|
||||
def set_default(self):
|
||||
"""
|
||||
Set all dacs to their default values
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -6,22 +6,17 @@ Created on Wed Dec 6 11:51:18 2017
|
||||
@author: l_frojdh
|
||||
"""
|
||||
|
||||
|
||||
from .detector import Detector
|
||||
|
||||
# from .adcs import Adc, DetectorAdcs
|
||||
from .temperature import Temperature, DetectorTemperature
|
||||
from .dacs import DetectorDacs
|
||||
import _slsdet
|
||||
dacIndex = _slsdet.slsDetectorDefs.dacIndex
|
||||
from .detector_property import DetectorProperty
|
||||
# from .utils import element_if_equal
|
||||
# from sls_detector.errors import DetectorValueError, DetectorError
|
||||
|
||||
class EigerVcmp:
|
||||
"""
|
||||
Convenience class to be able to loop over vcmp for Eiger
|
||||
|
||||
|
||||
.. todo::
|
||||
|
||||
Support single assignment and perhaps unify with Dac class
|
||||
@ -79,58 +74,6 @@ class EigerDacs(DetectorDacs):
|
||||
('iodelay', dacIndex.IO_DELAY,0, 4000, 660)]
|
||||
_dacnames = [_d[0] for _d in _dacs]
|
||||
|
||||
# # noinspection PyProtectedMember
|
||||
# class DetectorDelays:
|
||||
# _delaynames = ['frame', 'left', 'right']
|
||||
|
||||
# def __init__(self, detector):
|
||||
# # We need to at least initially know which detector we are connected to
|
||||
# self._detector = detector
|
||||
|
||||
# setattr(self, '_frame', DetectorProperty(detector._api.getDelayFrame,
|
||||
# detector._api.setDelayFrame,
|
||||
# detector._api.getNumberOfDetectors,
|
||||
# 'frame'))
|
||||
|
||||
# setattr(self, '_left', DetectorProperty(detector._api.getDelayLeft,
|
||||
# detector._api.setDelayLeft,
|
||||
# detector._api.getNumberOfDetectors,
|
||||
# 'left'))
|
||||
|
||||
# setattr(self, '_right', DetectorProperty(detector._api.getDelayRight,
|
||||
# detector._api.setDelayRight,
|
||||
# detector._api.getNumberOfDetectors,
|
||||
# 'right'))
|
||||
# # Index to support iteration
|
||||
# self._current = 0
|
||||
|
||||
# def __getattr__(self, name):
|
||||
# return self.__getattribute__('_' + name)
|
||||
|
||||
# def __setattr__(self, name, value):
|
||||
# if name in self._delaynames:
|
||||
# return self.__getattribute__('_' + name).__setitem__(slice(None, None, None), value)
|
||||
# else:
|
||||
# super().__setattr__(name, value)
|
||||
|
||||
# def __next__(self):
|
||||
# if self._current >= len(self._delaynames):
|
||||
# self._current = 0
|
||||
# raise StopIteration
|
||||
# else:
|
||||
# self._current += 1
|
||||
# return self.__getattr__(self._delaynames[self._current-1])
|
||||
|
||||
# def __iter__(self):
|
||||
# return self
|
||||
|
||||
# def __repr__(self):
|
||||
# hn = self._detector.hostname
|
||||
# r_str = ['Transmission delay [ns]\n'
|
||||
# '{:11s}{:>8s}{:>8s}{:>8s}'.format('', 'left', 'right', 'frame')]
|
||||
# for i in range(self._detector.n_modules):
|
||||
# r_str.append('{:2d}:{:8s}{:>8d}{:>8d}{:>8d}'.format(i, hn[i], self.left[i], self.right[i], self.frame[i]))
|
||||
# return '\n'.join(r_str)
|
||||
|
||||
from .detector import freeze
|
||||
|
||||
@ -152,76 +95,18 @@ class Eiger(Detector):
|
||||
self._dacs = EigerDacs(self)
|
||||
self._vcmp = EigerVcmp(self)
|
||||
|
||||
# self._active = DetectorProperty(self.getActive,
|
||||
# self.setActive,
|
||||
# self.size,
|
||||
# 'active')
|
||||
# Eiger specific adcs
|
||||
self._temp = DetectorTemperature()
|
||||
self._temp.fpga = Temperature('temp_fpga', dacIndex.TEMPERATURE_FPGA, self)
|
||||
self._temp.fpgaext = Temperature('temp_fpgaext', dacIndex.TEMPERATURE_FPGAEXT, self)
|
||||
self._temp.t10ge = Temperature('temp_10ge', dacIndex.TEMPERATURE_10GE, self)
|
||||
self._temp.dcdc = Temperature('temp_dcdc', dacIndex.TEMPERATURE_DCDC, self)
|
||||
self._temp.sodl = Temperature('temp_sodl', dacIndex.TEMPERATURE_SODL, self)
|
||||
self._temp.sodr = Temperature('temp_sodl', dacIndex.TEMPERATURE_SODR, self)
|
||||
self._temp.temp_fpgafl = Temperature('temp_fpgafl', dacIndex.TEMPERATURE_FPGA2, self)
|
||||
self._temp.temp_fpgafr = Temperature('temp_fpgafr', dacIndex.TEMPERATURE_FPGA3, self)
|
||||
|
||||
# self._trimbit_limits = namedtuple('trimbit_limits', ['min', 'max'])(0, 63)
|
||||
# self._delay = DetectorDelays(self)
|
||||
|
||||
# # Eiger specific adcs
|
||||
# self._temp = DetectorAdcs()
|
||||
# self._temp.fpga = Adc('temp_fpga', self)
|
||||
# self._temp.fpgaext = Adc('temp_fpgaext', self)
|
||||
# self._temp.t10ge = Adc('temp_10ge', self)
|
||||
# self._temp.dcdc = Adc('temp_dcdc', self)
|
||||
# self._temp.sodl = Adc('temp_sodl', self)
|
||||
# self._temp.sodr = Adc('temp_sodr', self)
|
||||
# self._temp.fpgafl = Adc('temp_fpgafl', self)
|
||||
# self._temp.fpgafr = Adc('temp_fpgafr', self)
|
||||
|
||||
# @property
|
||||
# def active(self):
|
||||
# """
|
||||
# Is the detector active? Can be used to enable or disable a detector
|
||||
# module
|
||||
|
||||
# Examples
|
||||
# ----------
|
||||
|
||||
# ::
|
||||
|
||||
# d.active
|
||||
# >> active: [True, True]
|
||||
|
||||
# d.active[1] = False
|
||||
# >> active: [True, False]
|
||||
# """
|
||||
# return self._active
|
||||
|
||||
# @active.setter
|
||||
# def active(self, value):
|
||||
# self._active[:] = value
|
||||
|
||||
# @property
|
||||
# def measured_period(self):
|
||||
# return self._api.getMeasuredPeriod()
|
||||
|
||||
# @property
|
||||
# def measured_subperiod(self):
|
||||
# return self._api.getMeasuredSubPeriod()
|
||||
|
||||
# @property
|
||||
# def add_gappixels(self):
|
||||
# """Enable or disable the (virual) pixels between ASICs
|
||||
|
||||
# Examples
|
||||
# ----------
|
||||
|
||||
# ::
|
||||
|
||||
# d.add_gappixels = True
|
||||
|
||||
# d.add_gappixels
|
||||
# >> True
|
||||
|
||||
# """
|
||||
# return self._api.getGapPixels()
|
||||
|
||||
# @add_gappixels.setter
|
||||
# def add_gappixels(self, value):
|
||||
# self._api.setGapPixels(value)
|
||||
|
||||
@property
|
||||
def dacs(self):
|
||||
@ -284,68 +169,6 @@ class Eiger(Detector):
|
||||
"""
|
||||
return self._dacs
|
||||
|
||||
# @property
|
||||
# def tx_delay(self):
|
||||
# """
|
||||
# Transmission delay of the modules to allow running the detector
|
||||
# in a network not supporting the full speed of the detector.
|
||||
|
||||
|
||||
# ::
|
||||
|
||||
# d.tx_delay
|
||||
# >>
|
||||
# Transmission delay [ns]
|
||||
# left right frame
|
||||
# 0:beb048 0 15000 0
|
||||
# 1:beb049 100 190000 100
|
||||
|
||||
# d.tx_delay.left = [2000,5000]
|
||||
# """
|
||||
# return self._delay
|
||||
|
||||
# def pulse_all_pixels(self, n):
|
||||
# """
|
||||
# Pulse each pixel of the chip **n** times using the analog test pulses.
|
||||
# The pulse height is set using d.dacs.vcall with 4000 being 0 and 0 being
|
||||
# the highest pulse.
|
||||
|
||||
# ::
|
||||
|
||||
# #Pulse all pixels ten times
|
||||
# d.pulse_all_pixels(10)
|
||||
|
||||
# #Avoid resetting before acq
|
||||
# d.eiger_matrix_reset = False
|
||||
|
||||
# d.acq() #take frame
|
||||
|
||||
# #Restore normal behaviour
|
||||
# d.eiger_matrix_reset = True
|
||||
|
||||
|
||||
# """
|
||||
# self._api.pulseAllPixels(n)
|
||||
|
||||
|
||||
# def pulse_diagonal(self, n):
|
||||
# """
|
||||
# Pulse pixels in super colums in a diagonal fashion. Used for calibration
|
||||
# of vcall. Saves time compared to pulsing all pixels.
|
||||
# """
|
||||
# self._api.pulseDiagonal(n)
|
||||
|
||||
|
||||
# def pulse_chip(self, n):
|
||||
# """
|
||||
# Advance the counter by toggling enable. Gives 2*n+2 int the counter
|
||||
|
||||
# """
|
||||
# n = int(n)
|
||||
# if n >= -1:
|
||||
# self._api.pulseChip(n)
|
||||
# else:
|
||||
# raise ValueError('n must be equal or larger than -1')
|
||||
|
||||
@property
|
||||
def vcmp(self):
|
||||
@ -437,40 +260,33 @@ class Eiger(Detector):
|
||||
# else:
|
||||
# self._api.setReceiverStreamingPort(port, -1)
|
||||
|
||||
# @property
|
||||
# def temp(self):
|
||||
# """
|
||||
# An instance of DetectorAdcs used to read the temperature
|
||||
# of different components
|
||||
@property
|
||||
def temp(self):
|
||||
"""
|
||||
An instance of DetectorAdcs used to read the temperature
|
||||
of different components
|
||||
|
||||
# Examples
|
||||
# -----------
|
||||
Examples
|
||||
-----------
|
||||
|
||||
# ::
|
||||
::
|
||||
|
||||
# detector.temp
|
||||
# >>
|
||||
# temp_fpga : 36.90°C, 45.60°C
|
||||
# temp_fpgaext : 31.50°C, 32.50°C
|
||||
# temp_10ge : 0.00°C, 0.00°C
|
||||
# temp_dcdc : 36.00°C, 36.00°C
|
||||
# temp_sodl : 33.00°C, 34.50°C
|
||||
# temp_sodr : 33.50°C, 34.00°C
|
||||
# temp_fpgafl : 33.81°C, 30.93°C
|
||||
# temp_fpgafr : 27.88°C, 29.15°C
|
||||
detector.temp
|
||||
>>
|
||||
temp_fpga : 36.90°C, 45.60°C
|
||||
temp_fpgaext : 31.50°C, 32.50°C
|
||||
temp_10ge : 0.00°C, 0.00°C
|
||||
temp_dcdc : 36.00°C, 36.00°C
|
||||
temp_sodl : 33.00°C, 34.50°C
|
||||
temp_sodr : 33.50°C, 34.00°C
|
||||
temp_fpgafl : 33.81°C, 30.93°C
|
||||
temp_fpgafr : 27.88°C, 29.15°C
|
||||
|
||||
# a = detector.temp.fpga[:]
|
||||
# a
|
||||
# >> [36.568, 45.542]
|
||||
a = detector.temp.fpga[:]
|
||||
a
|
||||
>> [36.568, 45.542]
|
||||
|
||||
|
||||
# """
|
||||
# return self._temp
|
||||
|
||||
|
||||
|
||||
# def set_delays(self, delta):
|
||||
# self.tx_delay.left = [delta*(i*2) for i in range(self.n_modules)]
|
||||
# self.tx_delay.right = [delta*(i*2+1) for i in range(self.n_modules)]
|
||||
|
||||
"""
|
||||
return self._temp
|
||||
|
||||
|
19
python/slsdet/enums.py
Normal file
19
python/slsdet/enums.py
Normal file
@ -0,0 +1,19 @@
|
||||
|
||||
import _slsdet
|
||||
runStatus = _slsdet.slsDetectorDefs.runStatus
|
||||
speedLevel = _slsdet.slsDetectorDefs.speedLevel
|
||||
detectorType = _slsdet.slsDetectorDefs.detectorType
|
||||
frameDiscardPolicy = _slsdet.slsDetectorDefs.frameDiscardPolicy
|
||||
fileFormat = _slsdet.slsDetectorDefs.fileFormat
|
||||
dimension = _slsdet.slsDetectorDefs.dimension
|
||||
externalSignalFlag = _slsdet.slsDetectorDefs.externalSignalFlag
|
||||
timingMode = _slsdet.slsDetectorDefs.timingMode
|
||||
dacIndex = _slsdet.slsDetectorDefs.dacIndex
|
||||
detectorSettings = _slsdet.slsDetectorDefs.detectorSettings
|
||||
clockIndex = _slsdet.slsDetectorDefs.clockIndex
|
||||
readoutMode = _slsdet.slsDetectorDefs.readoutMode
|
||||
masterFlags = _slsdet.slsDetectorDefs.masterFlags
|
||||
frameModeType = _slsdet.slsDetectorDefs.frameModeType
|
||||
detectorModeType = _slsdet.slsDetectorDefs.detectorModeType
|
||||
burstMode = _slsdet.slsDetectorDefs.burstMode
|
||||
timingSourceType = _slsdet.slsDetectorDefs.timingSourceType
|
51
python/slsdet/gotthard.py
Normal file
51
python/slsdet/gotthard.py
Normal file
@ -0,0 +1,51 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
This file contains the specialization for the Moench detector
|
||||
"""
|
||||
|
||||
|
||||
from .detector import Detector, freeze
|
||||
from .dacs import DetectorDacs
|
||||
import _slsdet
|
||||
dacIndex = _slsdet.slsDetectorDefs.dacIndex
|
||||
from .detector_property import DetectorProperty
|
||||
|
||||
# @freeze
|
||||
|
||||
# vref_ds, vcascn_pb, vcascp_pb, vout_cm, vcasc_out, vin_cm, vref_comp, ib_test_c
|
||||
class GotthardDacs(DetectorDacs):
|
||||
_dacs = [('vref_ds', dacIndex.VREF_DS, 0, 4000, 660),
|
||||
('vcascn_pb', dacIndex.VCASCN_PB, 0, 4000, 650),
|
||||
('vcascp_pb,', dacIndex.VCASCP_PB, 0, 4000, 1480),
|
||||
('vout_cm', dacIndex.VOUT_CM, 0, 4000, 1520),
|
||||
('vcasc_out', dacIndex.VCASC_OUT, 0, 4000, 1320),
|
||||
('vin_cm', dacIndex.VIN_CM, 0, 4000, 1350),
|
||||
('vref_comp', dacIndex.VREF_COMP, 0, 4000, 350),
|
||||
('ib_test_c', dacIndex.IB_TESTC, 0, 4000, 2001),
|
||||
]
|
||||
_dacnames = [_d[0] for _d in _dacs]
|
||||
|
||||
#vthreshold??
|
||||
|
||||
|
||||
@freeze
|
||||
class Gotthard(Detector):
|
||||
"""
|
||||
Subclassing Detector to set up correct dacs and detector specific
|
||||
functions.
|
||||
"""
|
||||
_detector_dynamic_range = [16]
|
||||
|
||||
|
||||
_settings = ['standard', 'highgain', 'lowgain', 'veryhighgain', 'verylowgain']
|
||||
"""available settings for Eiger, note almost always standard"""
|
||||
|
||||
def __init__(self, id=0):
|
||||
super().__init__(id)
|
||||
self._frozen = False
|
||||
self._dacs = GotthardDacs(self)
|
||||
|
||||
@property
|
||||
def dacs(self):
|
||||
return self._dacs
|
61
python/slsdet/gotthard2.py
Normal file
61
python/slsdet/gotthard2.py
Normal file
@ -0,0 +1,61 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
This file contains the specialization for the Jungfrau detector
|
||||
"""
|
||||
|
||||
|
||||
from .detector import Detector, freeze
|
||||
|
||||
# from .adcs import Adc, DetectorAdcs
|
||||
from .dacs import DetectorDacs
|
||||
import _slsdet
|
||||
dacIndex = _slsdet.slsDetectorDefs.dacIndex
|
||||
from .detector_property import DetectorProperty
|
||||
|
||||
|
||||
# @freeze
|
||||
class Gotthard2Dacs(DetectorDacs):
|
||||
"""
|
||||
Gotthard2 specific DACs
|
||||
"""
|
||||
_dacs = [('vref_h_adc', dacIndex.VREF_H_ADC, 0, 4000, 2116),
|
||||
('vb_comp_fe', dacIndex.VB_COMP_FE, 0, 4000, 0),
|
||||
('vb_comp_adc', dacIndex.VB_COMP_ADC, 0, 4000, 0),
|
||||
('vcom_cds', dacIndex.VCOM_CDS, 0, 4000, 705),
|
||||
('vref_rstore', dacIndex.VREF_RSTORE, 0, 4000, 205),
|
||||
('vb_opa_1st', dacIndex.VB_OPA_1ST, 0, 4000, 0),
|
||||
('vref_comp_fe', dacIndex.VREF_COMP_FE, 0, 4000, 0),
|
||||
('vcom_adc1', dacIndex.VCOM_ADC1, 0, 4000, 705),
|
||||
('vref_prech', dacIndex.VREF_PRECH, 0, 4000, 900),
|
||||
('vref_l_adc', dacIndex.VREF_L_ADC, 0, 4000, 700),
|
||||
('vref_cds', dacIndex.VREF_CDS, 0, 4000, 600),
|
||||
('vb_cs', dacIndex.VB_CS, 0, 4000, 2799),
|
||||
('vb_opa_fd', dacIndex.VB_OPA_FD, 0, 4000, 0),
|
||||
('vcom_adc2', dacIndex.VCOM_ADC2, 0, 4000, 704),
|
||||
]
|
||||
_dacnames = [_d[0] for _d in _dacs]
|
||||
|
||||
|
||||
|
||||
|
||||
@freeze
|
||||
class Gotthard2(Detector):
|
||||
"""
|
||||
Subclassing Detector to set up correct dacs and detector specific
|
||||
functions.
|
||||
"""
|
||||
_detector_dynamic_range = [16]
|
||||
|
||||
|
||||
_settings = ['standard', 'highgain', 'lowgain', 'veryhighgain', 'verylowgain']
|
||||
"""available settings for Eiger, note almost always standard"""
|
||||
|
||||
def __init__(self, id=0):
|
||||
super().__init__(id)
|
||||
self._frozen = False
|
||||
self._dacs = Gotthard2Dacs(self)
|
||||
|
||||
@property
|
||||
def dacs(self):
|
||||
return self._dacs
|
30
python/slsdet/jsonproxy.py
Normal file
30
python/slsdet/jsonproxy.py
Normal file
@ -0,0 +1,30 @@
|
||||
from .utils import element_if_equal
|
||||
|
||||
class JsonProxy:
|
||||
"""
|
||||
Proxy class to allow for intuitive setting and getting of rx_jsonpara
|
||||
This class is returned by Detectr.rx_jsonpara
|
||||
"""
|
||||
def __init__(self, det):
|
||||
self.det = det
|
||||
|
||||
def __getitem__(self, key):
|
||||
return element_if_equal(self.det.getAdditionalJsonParameter(key))
|
||||
|
||||
def __setitem__(self, key, value):
|
||||
self.det.setAdditionalJsonParameter(key, str(value))
|
||||
|
||||
def __repr__(self):
|
||||
r = element_if_equal(self.det.getAdditionalJsonHeader())
|
||||
if isinstance(r, list):
|
||||
rstr = ''
|
||||
for i, list_item in enumerate(r):
|
||||
list_item = dict(list_item)
|
||||
rstr += ''.join([f'{i}:{key}: {value}\n' for key, value in list_item.items()])
|
||||
|
||||
return rstr.strip('\n')
|
||||
else:
|
||||
r = dict(r)
|
||||
return '\n'.join([f'{key}: {value}' for key, value in r.items()])
|
||||
|
||||
|
52
python/slsdet/moench.py
Normal file
52
python/slsdet/moench.py
Normal file
@ -0,0 +1,52 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
This file contains the specialization for the Moench detector
|
||||
"""
|
||||
|
||||
|
||||
from .detector import Detector, freeze
|
||||
from .dacs import DetectorDacs
|
||||
import _slsdet
|
||||
dacIndex = _slsdet.slsDetectorDefs.dacIndex
|
||||
from .detector_property import DetectorProperty
|
||||
|
||||
# @freeze
|
||||
class MoenchDacs(DetectorDacs):
|
||||
"""
|
||||
Jungfrau specific DACs
|
||||
"""
|
||||
_dacs = [('vbp_colbuf', dacIndex.VBP_COLBUF, 0, 4000, 1300),
|
||||
('vipre', dacIndex.VIPRE, 0, 4000, 1000),
|
||||
('vin_cm,', dacIndex.VIN_CM, 0, 4000, 1400),
|
||||
('vb_sda', dacIndex.VB_SDA, 0, 4000, 680),
|
||||
('vcasc_sfp', dacIndex.VCASC_SFP, 0, 4000, 1428),
|
||||
('vout_cm', dacIndex.VOUT_CM, 0, 4000, 1200),
|
||||
('vipre_cds', dacIndex.VIPRE_CDS, 0, 4000, 800),
|
||||
('ibias_sfp', dacIndex.IBIAS_SFP, 0, 4000, 900),
|
||||
]
|
||||
_dacnames = [_d[0] for _d in _dacs]
|
||||
|
||||
#vthreshold??
|
||||
|
||||
|
||||
@freeze
|
||||
class Moench(Detector):
|
||||
"""
|
||||
Subclassing Detector to set up correct dacs and detector specific
|
||||
functions.
|
||||
"""
|
||||
_detector_dynamic_range = [16]
|
||||
|
||||
|
||||
_settings = ['standard', 'highgain', 'lowgain', 'veryhighgain', 'verylowgain']
|
||||
"""available settings for Eiger, note almost always standard"""
|
||||
|
||||
def __init__(self, id=0):
|
||||
super().__init__(id)
|
||||
self._frozen = False
|
||||
self._dacs = MoenchDacs(self)
|
||||
|
||||
@property
|
||||
def dacs(self):
|
||||
return self._dacs
|
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
This file contains the specialization for the Jungfrau detector
|
||||
This file contains the specialization for the Mythen3 detector
|
||||
"""
|
||||
|
||||
|
||||
@ -19,22 +19,22 @@ class Mythen3Dacs(DetectorDacs):
|
||||
"""
|
||||
Jungfrau specific DACs
|
||||
"""
|
||||
_dacs = [('vcassh', dacIndex.VCASSH, 0, 4000, 1220),
|
||||
('vth2', dacIndex.VTH2, 0, 4000, 2800),
|
||||
('vrshaper', dacIndex.VRSHAPER, 0, 4000, 1280),
|
||||
('vrshaper_n', dacIndex.VRSHAPER_N, 0, 4000, 2800),
|
||||
('vipre_out', dacIndex.VIPRE_OUT, 0, 4000, 1220),
|
||||
('vth3', dacIndex.VTH3, 0, 4000, 2800),
|
||||
('vth1', dacIndex.VTH1, 0, 4000, 2800),
|
||||
('vicin', dacIndex.VICIN, 0, 4000, 1708),
|
||||
_dacs = [('vcassh', dacIndex.VCASSH, 0, 4000, 1220),
|
||||
('vth2', dacIndex.VTH2, 0, 4000, 2800),
|
||||
('vrshaper', dacIndex.VRSHAPER, 0, 4000, 1280),
|
||||
('vrshaper_n', dacIndex.VRSHAPER_N, 0, 4000, 2800),
|
||||
('vipre_out', dacIndex.VIPRE_OUT, 0, 4000, 1220),
|
||||
('vth3', dacIndex.VTH3, 0, 4000, 2800),
|
||||
('vth1', dacIndex.VTH1, 0, 4000, 2800),
|
||||
('vicin', dacIndex.VICIN, 0, 4000, 1708),
|
||||
('vcas', dacIndex.VCAS, 0, 4000, 1800),
|
||||
('vrpreamp', dacIndex.VRPREAMP, 0, 4000, 1100),
|
||||
('vcal_n', dacIndex.VCAL_N, 0, 4000, 1100),
|
||||
('vipre', dacIndex.VIPRE, 0, 4000, 2624),
|
||||
('vishaper', dacIndex.VISHAPER, 0, 4000, 1708),
|
||||
('vcal_p', dacIndex.VCAL_P, 0, 4000, 1712),
|
||||
('vtrim', dacIndex.VTRIM, 0, 4000, 2800),
|
||||
('vdcsh', dacIndex.VDCSH, 0, 4000, 800),
|
||||
('vrpreamp', dacIndex.VRPREAMP, 0, 4000, 1100),
|
||||
('vcal_n', dacIndex.VCAL_N, 0, 4000, 1100),
|
||||
('vipre', dacIndex.VIPRE, 0, 4000, 2624),
|
||||
('vishaper', dacIndex.VISHAPER, 0, 4000, 1708),
|
||||
('vcal_p', dacIndex.VCAL_P, 0, 4000, 1712),
|
||||
('vtrim', dacIndex.VTRIM, 0, 4000, 2800),
|
||||
('vdcsh', dacIndex.VDCSH, 0, 4000, 800),
|
||||
]
|
||||
_dacnames = [_d[0] for _d in _dacs]
|
||||
|
||||
|
50
python/slsdet/temperature.py
Normal file
50
python/slsdet/temperature.py
Normal file
@ -0,0 +1,50 @@
|
||||
from functools import partial
|
||||
from collections.abc import Iterable
|
||||
import numpy as np
|
||||
class Temperature:
|
||||
degree_sign = u"\N{DEGREE SIGN}"
|
||||
|
||||
def __init__(self, name, enum, detector):
|
||||
self.name = name
|
||||
self.enum = enum
|
||||
self._detector = detector
|
||||
self.get_nmod = self._detector.size
|
||||
# Bind functions to get and set the dac
|
||||
self.get = partial(self._detector.getTemperature, self.enum)
|
||||
|
||||
def __getitem__(self, key):
|
||||
if key == slice(None, None, None):
|
||||
return self.get()
|
||||
elif isinstance(key, Iterable):
|
||||
return self.get(list(key))
|
||||
else:
|
||||
return self.get([key])[0] # No list for single value
|
||||
|
||||
def __repr__(self):
|
||||
"""String representation for a single temperature in all modules"""
|
||||
|
||||
tempstr = ''.join([f'{item:5d}{self.degree_sign}C' for item in self.get()])
|
||||
return f'{self.name:15s}:{tempstr}'
|
||||
|
||||
class DetectorTemperature:
|
||||
"""
|
||||
Interface to temperatures on the readout board
|
||||
"""
|
||||
|
||||
def __iter__(self):
|
||||
for attr, value in self.__dict__.items():
|
||||
yield value
|
||||
|
||||
def __repr__(self):
|
||||
"""String representation of all temps all mods"""
|
||||
r_str = '\n'.join([repr(temp) for temp in self])
|
||||
return r_str
|
||||
|
||||
def to_dict(self):
|
||||
"""Get temperatures as a dictionary with numpy arrays"""
|
||||
return {attr:np.array(value.get()) for attr, value in self.__dict__.items()}
|
||||
|
||||
def to_array(self):
|
||||
"""Get all temperatures as a numpy array"""
|
||||
t = self.to_dict()
|
||||
return np.vstack([value for key, value in t.items()])
|
@ -8,6 +8,8 @@ from collections import namedtuple
|
||||
import _slsdet #C++ lib
|
||||
import functools
|
||||
import datetime as dt
|
||||
import pathlib
|
||||
import os
|
||||
|
||||
Geometry = namedtuple('Geometry', ['x', 'y'])
|
||||
|
||||
@ -77,6 +79,7 @@ def element(func):
|
||||
return element_if_equal(func(self, *args, **kwargs))
|
||||
return wrapper
|
||||
|
||||
|
||||
def eiger_register_to_time(register):
|
||||
"""
|
||||
Decode register value and return time in s. Values are stored in
|
||||
@ -93,3 +96,34 @@ def make_timedelta(t):
|
||||
return t
|
||||
else:
|
||||
return dt.timedelta(seconds=t)
|
||||
|
||||
def make_string_path(path):
|
||||
"""
|
||||
Accepts either a pathlib.Path or a string, expands ~ to user and convert
|
||||
Path to str
|
||||
"""
|
||||
if isinstance(path, pathlib.Path):
|
||||
return path.expanduser().as_posix()
|
||||
elif isinstance(path, str):
|
||||
return os.path.expanduser(path)
|
||||
else:
|
||||
raise ValueError("Cannot convert argument to posix path")
|
||||
|
||||
|
||||
def set_using_dict(func, args):
|
||||
if isinstance(args, dict):
|
||||
for key, value in args.items():
|
||||
func(value, [key])
|
||||
else:
|
||||
func(args)
|
||||
|
||||
def set_time_using_dict(func, args):
|
||||
if isinstance(args, dict):
|
||||
for key, value in args.items():
|
||||
if isinstance(value, int):
|
||||
value = float(value)
|
||||
func(value, [key])
|
||||
else:
|
||||
if isinstance(args, int):
|
||||
args = float(args)
|
||||
func(args)
|
@ -36,6 +36,10 @@ void init_det(py::module &m) {
|
||||
(void (Detector::*)(const std::string &)) &
|
||||
Detector::loadParameters,
|
||||
py::arg())
|
||||
.def("loadParameters",
|
||||
(void (Detector::*)(const std::vector<std::string> &)) &
|
||||
Detector::loadParameters,
|
||||
py::arg())
|
||||
.def("getHostname",
|
||||
(Result<std::string>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getHostname,
|
||||
@ -180,6 +184,14 @@ void init_det(py::module &m) {
|
||||
(Result<sls::ns>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getDelayAfterTriggerLeft,
|
||||
py::arg() = Positions{})
|
||||
.def("getDynamicRange",
|
||||
(Result<int>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getDynamicRange,
|
||||
py::arg() = Positions{})
|
||||
.def("setDynamicRange",
|
||||
(void (Detector::*)(int)) & Detector::setDynamicRange, py::arg())
|
||||
.def("getDynamicRangeList", (std::vector<int>(Detector::*)() const) &
|
||||
Detector::getDynamicRangeList)
|
||||
.def("getTimingMode",
|
||||
(Result<defs::timingMode>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getTimingMode,
|
||||
@ -188,6 +200,9 @@ void init_det(py::module &m) {
|
||||
(void (Detector::*)(defs::timingMode, sls::Positions)) &
|
||||
Detector::setTimingMode,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getTimingModeList",
|
||||
(std::vector<defs::timingMode>(Detector::*)() const) &
|
||||
Detector::getTimingModeList)
|
||||
.def("getSpeed",
|
||||
(Result<defs::speedLevel>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getSpeed,
|
||||
@ -294,6 +309,9 @@ void init_det(py::module &m) {
|
||||
(void (Detector::*)(const int, sls::Positions)) &
|
||||
Detector::setImageTestMode,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getTemperatureList",
|
||||
(std::vector<defs::dacIndex>(Detector::*)() const) &
|
||||
Detector::getTemperatureList)
|
||||
.def("getTemperature",
|
||||
(Result<int>(Detector::*)(defs::dacIndex, sls::Positions) const) &
|
||||
Detector::getTemperature,
|
||||
@ -364,6 +382,18 @@ void init_det(py::module &m) {
|
||||
(void (Detector::*)(sls::Positions)) &
|
||||
Detector::sendSoftwareTrigger,
|
||||
py::arg() = Positions{})
|
||||
.def("getScan",
|
||||
(Result<defs::scanParameters>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getScan,
|
||||
py::arg() = Positions{})
|
||||
.def("setScan",
|
||||
(void (Detector::*)(const defs::scanParameters)) &
|
||||
Detector::setScan,
|
||||
py::arg())
|
||||
.def("getScanErrorMessage",
|
||||
(Result<std::string>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getScanErrorMessage,
|
||||
py::arg() = Positions{})
|
||||
.def("getNumberofUDPInterfaces",
|
||||
(Result<int>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getNumberofUDPInterfaces,
|
||||
@ -458,6 +488,14 @@ void init_det(py::module &m) {
|
||||
.def("setDestinationUDPPort2",
|
||||
(void (Detector::*)(int, int)) & Detector::setDestinationUDPPort2,
|
||||
py::arg(), py::arg())
|
||||
.def("reconfigureUDPDestination",
|
||||
(void (Detector::*)(sls::Positions)) &
|
||||
Detector::reconfigureUDPDestination,
|
||||
py::arg() = Positions{})
|
||||
.def("validateUDPConfiguration",
|
||||
(void (Detector::*)(sls::Positions)) &
|
||||
Detector::validateUDPConfiguration,
|
||||
py::arg() = Positions{})
|
||||
.def("printRxConfiguration",
|
||||
(Result<std::string>(Detector::*)(sls::Positions) const) &
|
||||
Detector::printRxConfiguration,
|
||||
@ -670,6 +708,14 @@ void init_det(py::module &m) {
|
||||
(void (Detector::*)(int, sls::Positions)) &
|
||||
Detector::setRxZmqTimer,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getRxZmqStartingFrame",
|
||||
(Result<int>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getRxZmqStartingFrame,
|
||||
py::arg() = Positions{})
|
||||
.def("setRxZmqStartingFrame",
|
||||
(void (Detector::*)(int, sls::Positions)) &
|
||||
Detector::setRxZmqStartingFrame,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getRxZmqPort",
|
||||
(Result<int>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getRxZmqPort,
|
||||
@ -700,12 +746,6 @@ void init_det(py::module &m) {
|
||||
(void (Detector::*)(const sls::IpAddr, sls::Positions)) &
|
||||
Detector::setClientZmqIp,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getDynamicRange",
|
||||
(Result<int>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getDynamicRange,
|
||||
py::arg() = Positions{})
|
||||
.def("setDynamicRange",
|
||||
(void (Detector::*)(int)) & Detector::setDynamicRange, py::arg())
|
||||
.def("getSubExptime",
|
||||
(Result<sls::ns>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getSubExptime,
|
||||
@ -939,11 +979,11 @@ void init_det(py::module &m) {
|
||||
(void (Detector::*)(const int, const int, sls::Positions)) &
|
||||
Detector::setInjectChannel,
|
||||
py::arg(), py::arg(), py::arg() = Positions{})
|
||||
.def(
|
||||
"getVetoPhoton",
|
||||
(Result<std::vector<int>>(Detector::*)(const int, sls::Positions)) &
|
||||
Detector::getVetoPhoton,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getVetoPhoton",
|
||||
(void (Detector::*)(const int, const std::string &,
|
||||
sls::Positions)) &
|
||||
Detector::getVetoPhoton,
|
||||
py::arg(), py::arg(), py::arg() = Positions{})
|
||||
.def("setVetoPhoton",
|
||||
(void (Detector::*)(const int, const int, const int,
|
||||
const std::string &, sls::Positions)) &
|
||||
@ -954,6 +994,11 @@ void init_det(py::module &m) {
|
||||
(void (Detector::*)(const int, const int, sls::Positions)) &
|
||||
Detector::setVetoReference,
|
||||
py::arg(), py::arg(), py::arg() = Positions{})
|
||||
.def("setVetoFile",
|
||||
(void (Detector::*)(const int, const std::string &,
|
||||
sls::Positions)) &
|
||||
Detector::setVetoFile,
|
||||
py::arg(), py::arg(), py::arg() = Positions{})
|
||||
.def("getBurstMode",
|
||||
(Result<defs::burstMode>(Detector::*)(sls::Positions)) &
|
||||
Detector::getBurstMode,
|
||||
@ -962,6 +1007,20 @@ void init_det(py::module &m) {
|
||||
(void (Detector::*)(defs::burstMode, sls::Positions)) &
|
||||
Detector::setBurstMode,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getCDSGain",
|
||||
(Result<bool>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getCDSGain,
|
||||
py::arg() = Positions{})
|
||||
.def("setCDSGain",
|
||||
(void (Detector::*)(bool, sls::Positions)) & Detector::setCDSGain,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getFilter",
|
||||
(Result<int>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getFilter,
|
||||
py::arg() = Positions{})
|
||||
.def("setFilter",
|
||||
(void (Detector::*)(int, sls::Positions)) & Detector::setFilter,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getCurrentSource",
|
||||
(Result<bool>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getCurrentSource,
|
||||
@ -987,6 +1046,24 @@ void init_det(py::module &m) {
|
||||
(void (Detector::*)(const bool, sls::Positions)) &
|
||||
Detector::setVeto,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getADCConfiguration",
|
||||
(Result<int>(Detector::*)(const int, const int, sls::Positions)
|
||||
const) &
|
||||
Detector::getADCConfiguration,
|
||||
py::arg(), py::arg(), py::arg() = Positions{})
|
||||
.def("setADCConfiguration",
|
||||
(void (Detector::*)(const int, const int, const int,
|
||||
sls::Positions)) &
|
||||
Detector::setADCConfiguration,
|
||||
py::arg(), py::arg(), py::arg(), py::arg() = Positions{})
|
||||
.def("getBadChannels",
|
||||
(void (Detector::*)(const std::string &, sls::Positions) const) &
|
||||
Detector::getBadChannels,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("setBadChannels",
|
||||
(void (Detector::*)(const std::string &, sls::Positions)) &
|
||||
Detector::setBadChannels,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getCounterMask",
|
||||
(Result<uint32_t>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getCounterMask,
|
||||
|
@ -274,9 +274,12 @@ void init_enums(py::module &m) {
|
||||
.export_values();
|
||||
|
||||
py::enum_<slsDetectorDefs::burstMode>(Defs, "burstMode")
|
||||
.value("BURST_OFF", slsDetectorDefs::burstMode::BURST_OFF)
|
||||
.value("BURST_INTERNAL", slsDetectorDefs::burstMode::BURST_INTERNAL)
|
||||
.value("BURST_EXTERNAL", slsDetectorDefs::burstMode::BURST_EXTERNAL)
|
||||
.value("CONTINUOUS_INTERNAL",
|
||||
slsDetectorDefs::burstMode::CONTINUOUS_INTERNAL)
|
||||
.value("CONTINUOUS_EXTERNAL",
|
||||
slsDetectorDefs::burstMode::CONTINUOUS_EXTERNAL)
|
||||
.value("NUM_BURST_MODES", slsDetectorDefs::burstMode::NUM_BURST_MODES)
|
||||
.export_values();
|
||||
|
||||
|
@ -7,6 +7,7 @@ Testing functions from utils.py
|
||||
import pytest
|
||||
from slsdet.utils import *
|
||||
import datetime as dt
|
||||
import pathlib
|
||||
|
||||
def test_iterable():
|
||||
assert is_iterable(5) == False
|
||||
@ -94,3 +95,22 @@ def test_make_timedelta_from_timedelta():
|
||||
r = make_timedelta(t)
|
||||
assert 60 == r.total_seconds()
|
||||
assert r == dt.timedelta(minutes=1)
|
||||
|
||||
|
||||
def test_make_string_path_from_Path():
|
||||
pathstr = "/some/temp/path"
|
||||
p = pathlib.Path(pathstr)
|
||||
r = make_string_path(p)
|
||||
assert isinstance(r, str)
|
||||
assert r == p.as_posix()
|
||||
assert r == pathstr
|
||||
|
||||
def test_make_string_path_expand_user():
|
||||
pathstr = "~/tmp/virtual.config"
|
||||
home = pathlib.Path.home()
|
||||
expanded_str = pathstr.replace('~', home.as_posix())
|
||||
p = pathlib.Path(pathstr)
|
||||
rp = make_string_path(p)
|
||||
rs = make_string_path(pathstr)
|
||||
assert rp == expanded_str
|
||||
assert rs == expanded_str
|
@ -1,6 +1,6 @@
|
||||
add_executable(using_logger using_logger.cpp)
|
||||
target_link_libraries(using_logger
|
||||
slsSupportLib
|
||||
slsSupportShared
|
||||
pthread
|
||||
rt
|
||||
)
|
||||
@ -22,7 +22,7 @@ set_target_properties(using_logger PROPERTIES
|
||||
# add_executable(udp udp.cpp)
|
||||
# target_link_libraries(udp
|
||||
# slsDetectorShared
|
||||
# slsSupportLib
|
||||
# slsSupportShared
|
||||
# pthread
|
||||
# rt
|
||||
# fmt
|
||||
|
@ -23,7 +23,7 @@ foreach(exe ${MOENCH_EXECUTABLES})
|
||||
|
||||
target_link_libraries(${exe}
|
||||
PUBLIC
|
||||
slsSupportLib
|
||||
slsSupportShared
|
||||
${ZeroMQ_LIBRARIES}
|
||||
pthread
|
||||
tiff
|
||||
|
@ -241,7 +241,7 @@ int main(int argc, char *argv[]) {
|
||||
#endif
|
||||
if (zmqsocket->Connect()) {
|
||||
cprintf(RED, "Error: Could not connect to socket %s\n",
|
||||
zmqsocket->GetZmqServerAddress());
|
||||
(zmqsocket->GetZmqServerAddress()).c_str());
|
||||
delete zmqsocket;
|
||||
return EXIT_FAILURE;
|
||||
} else
|
||||
@ -281,12 +281,12 @@ int main(int argc, char *argv[]) {
|
||||
#endif
|
||||
if (zmqsocket2->Connect()) {
|
||||
cprintf(RED, "BBB Error: Could not connect to socket %s\n",
|
||||
zmqsocket2->GetZmqServerAddress());
|
||||
zmqsocket2->GetZmqServerAddress().c_str());
|
||||
// delete zmqsocket2;
|
||||
send = false;
|
||||
// return EXIT_FAILURE;
|
||||
} else
|
||||
printf("Zmq Client at %s\n", zmqsocket2->GetZmqServerAddress());
|
||||
printf("Zmq Client at %s\n", zmqsocket2->GetZmqServerAddress().c_str());
|
||||
|
||||
}
|
||||
|
||||
@ -388,6 +388,7 @@ int main(int argc, char *argv[]) {
|
||||
while (mt->isBusy()) {;}//wait until all data are processed from the queues
|
||||
|
||||
if (of) {
|
||||
mt->setFilePointer(NULL);
|
||||
fclose(of);
|
||||
of=NULL;
|
||||
}
|
||||
|
@ -602,12 +602,14 @@ int *getClusters(char *data, int *ph=NULL) {
|
||||
*/
|
||||
|
||||
static void writeClusters(FILE *f, single_photon_hit *cl, int nph, int fn=0){
|
||||
if (nph>0) {
|
||||
if (f) {
|
||||
if (nph>0) {
|
||||
#ifndef OLDFORMAT
|
||||
if (fwrite((void*)&fn, 1, sizeof(int), f))
|
||||
if (fwrite((void*)&nph, 1, sizeof(int), f))
|
||||
if (fwrite((void*)&fn, 1, sizeof(int), f))
|
||||
if (fwrite((void*)&nph, 1, sizeof(int), f))
|
||||
#endif
|
||||
for (int i=0; i<nph; i++) (cl+i)->write(f);
|
||||
for (int i=0; i<nph; i++) (cl+i)->write(f);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -88,6 +88,7 @@ target_include_directories(slsDetectorGui PUBLIC
|
||||
)
|
||||
|
||||
target_link_libraries(slsDetectorGui PUBLIC
|
||||
slsProjectOptions
|
||||
slsProjectWarnings
|
||||
slsDetectorShared
|
||||
${QT_QTCORE_LIBRARIES}
|
||||
@ -97,6 +98,7 @@ target_link_libraries(slsDetectorGui PUBLIC
|
||||
ZLIB::ZLIB
|
||||
Qt4::QtOpenGL
|
||||
Qt4::QtSvg
|
||||
expat
|
||||
)
|
||||
|
||||
set_target_properties(slsDetectorGui PROPERTIES
|
||||
@ -104,10 +106,10 @@ set_target_properties(slsDetectorGui PROPERTIES
|
||||
)
|
||||
|
||||
install(TARGETS slsDetectorGui
|
||||
# EXPORT "${TARGETS_EXPORT_NAME}"
|
||||
EXPORT "${TARGETS_EXPORT_NAME}"
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
# LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
# ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
# PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
)
|
||||
|
||||
|
@ -52,6 +52,9 @@
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="keyboardTracking">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-1.000000000000000</double>
|
||||
</property>
|
||||
|
@ -98,6 +98,9 @@
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="keyboardTracking">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
|
@ -413,249 +413,6 @@ Directory where one saves the data.
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QGroupBox" name="boxCorrection_2">
|
||||
<property name="title">
|
||||
<string>Options</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="1">
|
||||
<widget class="QRadioButton" name="radioDefaultDeadtime">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Default Dead Time</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="chkTenGiga">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><nobr>
|
||||
Compression using Root. Available only for Gotthard in Expert Mode.
|
||||
</nobr><br><nobr>
|
||||
#r_compression#
|
||||
</nobr></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>10GbE</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="4">
|
||||
<widget class="QSpinBox" name="spinCustomDeadTime">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string>ns</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>200000000</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="chkRate">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Rate:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>10</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QRadioButton" name="radioCustomDeadtime">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Custom Dead Time:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="5">
|
||||
<spacer name="horizontalSpacer_7">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>10</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="6">
|
||||
<widget class="QWidget" name="widgetEiger" native="true">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridEiger">
|
||||
<item row="0" column="1">
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>10</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QComboBox" name="comboEigerClkDivider">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Full Speed</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Half Speed</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Quarter Speed</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="4">
|
||||
<spacer name="horizontalSpacer_6">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>10</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lblEigerFlags">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>105</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Flags:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lblClkDivider">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>105</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Clock Divider:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QComboBox" name="comboEigerParallelFlag">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Parallel</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Non Parallel</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
@ -672,6 +429,232 @@ Compression using Root. Available only for Gotthard in Expert Mode.
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QGroupBox" name="boxCorrection_2">
|
||||
<property name="title">
|
||||
<string>Options</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="2" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="lblClkDivider">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>105</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Clock Divider:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>10</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboClkDivider">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Full Speed</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Half Speed</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Quarter Speed</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_8">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>10</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="chkParallel">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Parallel Readout</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QCheckBox" name="chkTenGiga">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><nobr>
|
||||
Compression using Root. Available only for Gotthard in Expert Mode.
|
||||
</nobr><br><nobr>
|
||||
#r_compression#
|
||||
</nobr></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>10GbE</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="chkRate">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Rate:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioDefaultDeadtime">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Default Dead Time</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>10</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioCustomDeadtime">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Custom Dead Time:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="spinCustomDeadTime">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="keyboardTracking">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string>ns</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>200000000</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_7">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>10</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
@ -680,12 +663,6 @@ Compression using Root. Available only for Gotthard in Expert Mode.
|
||||
<tabstop>btnOutputBrowse</tabstop>
|
||||
<tabstop>comboFileFormat</tabstop>
|
||||
<tabstop>chkOverwriteEnable</tabstop>
|
||||
<tabstop>chkTenGiga</tabstop>
|
||||
<tabstop>chkRate</tabstop>
|
||||
<tabstop>radioDefaultDeadtime</tabstop>
|
||||
<tabstop>radioCustomDeadtime</tabstop>
|
||||
<tabstop>spinCustomDeadTime</tabstop>
|
||||
<tabstop>comboEigerClkDivider</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="../include/icons.qrc"/>
|
||||
|
@ -180,6 +180,9 @@
|
||||
<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>
|
||||
|
@ -432,7 +432,7 @@
|
||||
<property name="verticalSpacing">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<item row="5" column="0">
|
||||
<item row="6" column="0">
|
||||
<widget class="QStackedWidget" name="stackedLblTriggerBurst">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
@ -503,7 +503,7 @@
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="3">
|
||||
<item row="5" column="3">
|
||||
<widget class="QComboBox" name="comboPeriodUnit">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
@ -572,7 +572,7 @@ Frame period between exposures.
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2" colspan="2">
|
||||
<item row="2" column="2" colspan="2">
|
||||
<widget class="QSpinBox" name="spinNumMeasurements">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
@ -616,7 +616,7 @@ Frame period between exposures.
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
@ -674,7 +674,7 @@ Frame period between exposures.
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<item row="4" column="2">
|
||||
<widget class="QDoubleSpinBox" name="spinExpTime">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
@ -718,7 +718,7 @@ Exposure Time of a frame.
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="lblPeriod">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
@ -735,7 +735,7 @@ Frame period between exposures.
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="lblNumFrames">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
@ -745,7 +745,7 @@ Frame period between exposures.
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="lblExpTime">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
@ -762,7 +762,7 @@ Exposure Time of a frame.
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2" colspan="2">
|
||||
<item row="3" column="2" colspan="2">
|
||||
<widget class="QSpinBox" name="spinNumFrames">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
@ -809,7 +809,7 @@ Exposure Time of a frame.
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="3">
|
||||
<item row="4" column="3">
|
||||
<widget class="QComboBox" name="comboExpUnit">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
@ -871,7 +871,7 @@ Exposure Time of a frame.
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<item row="5" column="2">
|
||||
<widget class="QDoubleSpinBox" name="spinPeriod">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
@ -931,7 +931,7 @@ Frame period between exposures.
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="5" column="2">
|
||||
<item row="6" column="2">
|
||||
<widget class="QStackedWidget" name="stackedSpinTriggerBurst">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
@ -1070,7 +1070,7 @@ Frame period between exposures.
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<item row="7" column="0">
|
||||
<widget class="QStackedWidget" name="stackedLblDelayBurstPeriod">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
@ -1141,7 +1141,7 @@ Frame period between exposures.
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="2">
|
||||
<item row="7" column="2">
|
||||
<widget class="QStackedWidget" name="stackedSpinDelayBurstPeriod">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
@ -1268,7 +1268,7 @@ Frame period between exposures.
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="3">
|
||||
<item row="7" column="3">
|
||||
<widget class="QStackedWidget" name="stackedComboDelayBurstPeriod">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
@ -1431,7 +1431,7 @@ Frame period between exposures.
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<item row="8" column="0">
|
||||
<widget class="QStackedWidget" name="stackedLblSamplesGates">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
@ -1502,7 +1502,7 @@ Frame period between exposures.
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="2">
|
||||
<item row="8" column="2">
|
||||
<widget class="QStackedWidget" name="stackedSpinSamplesGates">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
@ -1639,6 +1639,53 @@ Frame period between exposures.
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lblBurstMode">
|
||||
<property name="text">
|
||||
<string>Burst Mode:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2" colspan="2">
|
||||
<widget class="QComboBox" name="comboBurstMode">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Timing Mode of the detector.
|
||||
#timing#</string>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Burst Internal</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Burst External</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Continuous Internal</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Continuous External</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -2169,7 +2169,7 @@ Displays minimum, maximum and sum of values for each plot.
|
||||
<item row="0" column="2">
|
||||
<widget class="QStackedWidget" name="stackedTimeInterval">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<number>1</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="pageTimeGap">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_14">
|
||||
@ -2181,6 +2181,9 @@ Displays minimum, maximum and sum of values for each plot.
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="keyboardTracking">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>3</number>
|
||||
</property>
|
||||
@ -2249,6 +2252,9 @@ Displays minimum, maximum and sum of values for each plot.
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="keyboardTracking">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
|
@ -19,7 +19,7 @@ class qDrawPlot : public QWidget, private Ui::PlotObject {
|
||||
~qDrawPlot();
|
||||
bool GetIsRunning();
|
||||
void SetRunning(bool enable);
|
||||
int GetProgress();
|
||||
double GetProgress();
|
||||
int64_t GetCurrentFrameIndex();
|
||||
void Select1dPlot(bool enable);
|
||||
void SetPlotTitlePrefix(QString title);
|
||||
@ -152,7 +152,7 @@ class qDrawPlot : public QWidget, private Ui::PlotObject {
|
||||
bool disableZoom{false};
|
||||
int numDiscardBits{0};
|
||||
|
||||
int progress{0};
|
||||
double progress{0};
|
||||
int64_t currentFrame{0};
|
||||
mutable std::mutex mPlots;
|
||||
int64_t currentAcqIndex{0};
|
||||
|
@ -18,17 +18,24 @@ class qTabAdvanced : public QWidget, private Ui::TabAdvancedObject {
|
||||
void SetDetector();
|
||||
void SetControlPort(int port);
|
||||
void SetStopPort(int port);
|
||||
void SetDetectorUDPIP();
|
||||
void SetDetectorUDPMAC();
|
||||
void SetDetectorUDPIP(bool force = false);
|
||||
void ForceSetDetectorUDPIP();
|
||||
void SetDetectorUDPMAC(bool force = false);
|
||||
void ForceSetDetectorUDPMAC();
|
||||
void SetCltZMQPort(int port);
|
||||
void SetCltZMQIP();
|
||||
void SetRxrHostname();
|
||||
void SetCltZMQIP(bool force = false);
|
||||
void ForceSetCltZMQIP();
|
||||
void SetRxrHostname(bool force = false);
|
||||
void ForceSetRxrHostname();
|
||||
void SetRxrTCPPort(int port);
|
||||
void SetRxrUDPPort(int port);
|
||||
void SetRxrUDPIP();
|
||||
void SetRxrUDPMAC();
|
||||
void SetRxrUDPIP(bool force = false);
|
||||
void ForceSetRxrUDPIP();
|
||||
void SetRxrUDPMAC(bool force = false);
|
||||
void ForceSetRxrUDPMAC();
|
||||
void SetRxrZMQPort(int port);
|
||||
void SetRxrZMQIP();
|
||||
void SetRxrZMQIP(bool force = false);
|
||||
void ForceSetRxrZMQIP();
|
||||
void GetROI();
|
||||
void ClearROI();
|
||||
void SetROI();
|
||||
|
@ -13,14 +13,15 @@ class qTabDataOutput : public QWidget, private Ui::TabDataOutputObject {
|
||||
private slots:
|
||||
void GetOutputDir();
|
||||
void BrowseOutputDir();
|
||||
void SetOutputDir();
|
||||
void SetOutputDir(bool force = false);
|
||||
void ForceSetOutputDir();
|
||||
void SetFileFormat(int format);
|
||||
void SetOverwriteEnable(bool enable);
|
||||
void SetTenGigaEnable(bool enable);
|
||||
void EnableRateCorrection();
|
||||
void SetRateCorrection();
|
||||
void SetSpeed(int speed);
|
||||
void SetFlags();
|
||||
void SetParallel(bool enable);
|
||||
|
||||
private:
|
||||
void SetupWidgetWindow();
|
||||
@ -34,11 +35,9 @@ class qTabDataOutput : public QWidget, private Ui::TabDataOutputObject {
|
||||
void GetTenGigaEnable();
|
||||
void GetRateCorrection();
|
||||
void GetSpeed();
|
||||
void GetFlags();
|
||||
void GetParallel();
|
||||
|
||||
sls::Detector *det;
|
||||
// Button group for radiobuttons for rate
|
||||
QButtonGroup *btnGroupRate;
|
||||
// enum for the Eiger Parallel flag
|
||||
enum { PARALLEL, NONPARALLEL };
|
||||
};
|
||||
|
@ -20,6 +20,7 @@ class qTabMeasurement : public QWidget, private Ui::TabMeasurementObject {
|
||||
|
||||
private slots:
|
||||
void SetTimingMode(int val);
|
||||
void SetBurstMode(int val);
|
||||
void SetNumMeasurements(int val);
|
||||
void SetNumFrames(int val);
|
||||
void SetNumTriggers(int val);
|
||||
@ -31,7 +32,8 @@ class qTabMeasurement : public QWidget, private Ui::TabMeasurementObject {
|
||||
void SetDelay();
|
||||
void SetBurstPeriod();
|
||||
void SetFileWrite(bool val);
|
||||
void SetFileName();
|
||||
void SetFileName(bool force = false);
|
||||
void ForceSetFileName();
|
||||
void SetRunIndex(int val);
|
||||
void SetStartingFrameNumber(int val);
|
||||
void UpdateProgress();
|
||||
@ -51,6 +53,7 @@ class qTabMeasurement : public QWidget, private Ui::TabMeasurementObject {
|
||||
void EnableWidgetsforTimingMode();
|
||||
|
||||
void GetTimingMode();
|
||||
void GetBurstMode();
|
||||
void GetNumFrames();
|
||||
void GetNumTriggers();
|
||||
void GetNumBursts();
|
||||
|
@ -24,6 +24,12 @@ class qTabPlot : public QWidget, private Ui::TabPlotObject {
|
||||
void SetBinary();
|
||||
void SetGapPixels(bool enable);
|
||||
void SetTitles();
|
||||
void isXMinModified();
|
||||
void isXMaxModified();
|
||||
void isYMinModified();
|
||||
void isYMaxModified();
|
||||
void isZMinModified();
|
||||
void isZMaxModified();
|
||||
void SetXRange();
|
||||
void SetYRange();
|
||||
void CheckAspectRatio();
|
||||
|
@ -26,7 +26,7 @@ void qDacWidget::SetupWidgetWindow(std::string name) {
|
||||
|
||||
void qDacWidget::Initialization() {
|
||||
if (isDac) {
|
||||
connect(spinDac, SIGNAL(editingFinished()), this, SLOT(SetDac()));
|
||||
connect(spinDac, SIGNAL(valueChanged(double)), this, SLOT(SetDac()));
|
||||
}
|
||||
}
|
||||
|
||||
@ -38,7 +38,7 @@ void qDacWidget::SetDetectorIndex(int id) {
|
||||
void qDacWidget::GetDac() {
|
||||
LOG(logDEBUG) << "Getting Dac " << index;
|
||||
|
||||
disconnect(spinDac, SIGNAL(editingFinished()), this, SLOT(SetDac()));
|
||||
disconnect(spinDac, SIGNAL(valueChanged(double)), this, SLOT(SetDac()));
|
||||
try {
|
||||
// dac units
|
||||
auto retval = det->getDAC(index, 0, {detectorIndex}).squash(-1);
|
||||
@ -52,7 +52,7 @@ void qDacWidget::GetDac() {
|
||||
CATCH_DISPLAY(std::string("Could not get dac ") + std::to_string(index),
|
||||
"qDacWidget::GetDac")
|
||||
|
||||
connect(spinDac, SIGNAL(editingFinished()), this, SLOT(SetDac()));
|
||||
connect(spinDac, SIGNAL(valueChanged(double)), this, SLOT(SetDac()));
|
||||
}
|
||||
|
||||
void qDacWidget::SetDac() {
|
||||
|
@ -222,12 +222,12 @@ void qDetectorMain::SetUpDetector(const std::string &config_file, int multiID) {
|
||||
actionLoadTrimbits->setEnabled(false);
|
||||
switch (detType) {
|
||||
case slsDetectorDefs::EIGER:
|
||||
case slsDetectorDefs::MYTHEN3:
|
||||
actionLoadTrimbits->setEnabled(true);
|
||||
break;
|
||||
case slsDetectorDefs::GOTTHARD:
|
||||
case slsDetectorDefs::JUNGFRAU:
|
||||
case slsDetectorDefs::MOENCH:
|
||||
case slsDetectorDefs::MYTHEN3:
|
||||
case slsDetectorDefs::GOTTHARD2:
|
||||
break;
|
||||
default:
|
||||
@ -334,7 +334,8 @@ void qDetectorMain::EnableModes(QAction *action) {
|
||||
|
||||
tabs->setTabEnabled(ADVANCED, enable);
|
||||
actionLoadTrimbits->setVisible(enable &&
|
||||
detType == slsDetectorDefs::EIGER);
|
||||
(detType == slsDetectorDefs::EIGER ||
|
||||
detType == slsDetectorDefs::MYTHEN3));
|
||||
LOG(logINFO) << "Expert Mode: " << qDefs::stringEnable(enable);
|
||||
}
|
||||
|
||||
@ -400,11 +401,8 @@ void qDetectorMain::ExecuteUtilities(QAction *action) {
|
||||
this, tr("Load Detector Trimbits"), fName,
|
||||
tr("Trimbit files (*.trim noise.sn*);;All Files(*)"));
|
||||
fileDialog->setFileMode(QFileDialog::AnyFile);
|
||||
if (fileDialog->exec() == QDialog::Accepted)
|
||||
if (fileDialog->exec() == QDialog::Accepted) {
|
||||
fName = fileDialog->selectedFiles()[0];
|
||||
|
||||
// Gets called when cancelled as well
|
||||
if (!fName.isEmpty()) {
|
||||
det->loadTrimbits(std::string(fName.toAscii().constData()));
|
||||
qDefs::Message(qDefs::INFORMATION,
|
||||
"The Trimbits have been loaded successfully.",
|
||||
|
@ -248,7 +248,7 @@ bool qDrawPlot::GetIsRunning() { return isRunning; }
|
||||
|
||||
void qDrawPlot::SetRunning(bool enable) { isRunning = enable; }
|
||||
|
||||
int qDrawPlot::GetProgress() { return progress; }
|
||||
double qDrawPlot::GetProgress() { return progress; }
|
||||
|
||||
int64_t qDrawPlot::GetCurrentFrameIndex() { return currentFrame; }
|
||||
|
||||
@ -717,7 +717,7 @@ void qDrawPlot::AcquisitionFinished(double currentProgress,
|
||||
LOG(logERROR) << "Acquisition finished [Status: ERROR]";
|
||||
} else {
|
||||
LOG(logINFO) << "Acquisition finished [ Status:" << status
|
||||
<< ", Progress: " << currentProgress << " ]";
|
||||
<< ", Progress: " << currentProgress << "% ]";
|
||||
}
|
||||
emit AcquireFinishedSignal();
|
||||
}
|
||||
@ -741,10 +741,10 @@ void qDrawPlot::GetData(detectorData *data, uint64_t frameIndex,
|
||||
<< " \t complete image: " << data->completeImage << std::endl
|
||||
<< " ]";
|
||||
|
||||
progress = (int)data->progressIndex;
|
||||
progress = data->progressIndex;
|
||||
currentAcqIndex = data->fileIndex;
|
||||
currentFrame = frameIndex;
|
||||
LOG(logDEBUG) << "[ Progress:" << progress << ", Frame:" << currentFrame
|
||||
LOG(logDEBUG) << "[ Progress:" << progress << "%, Frame:" << currentFrame
|
||||
<< " ]";
|
||||
|
||||
// 1d check if npixelX has changed (m3 for different counters enabled)
|
||||
|
@ -29,6 +29,7 @@ void qTabAdvanced::SetupWidgetWindow() {
|
||||
tab_roi->setEnabled(true);
|
||||
break;
|
||||
case slsDetectorDefs::MYTHEN3:
|
||||
tab_trimming->setEnabled(true);
|
||||
lblDiscardBits->setEnabled(true);
|
||||
spinDiscardBits->setEnabled(true);
|
||||
lblGateIndex->setEnabled(true);
|
||||
@ -65,8 +66,7 @@ void qTabAdvanced::Initialization() {
|
||||
|
||||
// trimming
|
||||
if (tab_trimming->isEnabled()) {
|
||||
// editingFinished to not set trimbits for every character input
|
||||
connect(spinSetAllTrimbits, SIGNAL(editingFinished()), this,
|
||||
connect(spinSetAllTrimbits, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetAllTrimbits()));
|
||||
}
|
||||
|
||||
@ -79,23 +79,36 @@ void qTabAdvanced::Initialization() {
|
||||
SLOT(SetStopPort(int)));
|
||||
connect(dispDetectorUDPIP, SIGNAL(editingFinished()), this,
|
||||
SLOT(SetDetectorUDPIP()));
|
||||
connect(dispDetectorUDPIP, SIGNAL(returnPressed()), this,
|
||||
SLOT(ForceSetDetectorUDPIP()));
|
||||
connect(dispDetectorUDPMAC, SIGNAL(editingFinished()), this,
|
||||
SLOT(SetDetectorUDPMAC()));
|
||||
connect(dispDetectorUDPMAC, SIGNAL(returnPressed()), this,
|
||||
SLOT(ForceSetDetectorUDPMAC()));
|
||||
connect(spinZMQPort, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetCltZMQPort(int)));
|
||||
connect(dispZMQIP, SIGNAL(editingFinished()), this, SLOT(SetCltZMQIP()));
|
||||
connect(dispZMQIP, SIGNAL(returnPressed()), this, SLOT(ForceSetCltZMQIP()));
|
||||
connect(dispRxrHostname, SIGNAL(editingFinished()), this,
|
||||
SLOT(SetRxrHostname()));
|
||||
connect(dispRxrHostname, SIGNAL(returnPressed()), this,
|
||||
SLOT(ForceSetRxrHostname()));
|
||||
connect(spinRxrTCPPort, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetRxrTCPPort(int)));
|
||||
connect(spinRxrUDPPort, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetRxrUDPPort(int)));
|
||||
connect(dispRxrUDPIP, SIGNAL(editingFinished()), this, SLOT(SetRxrUDPIP()));
|
||||
connect(dispRxrUDPIP, SIGNAL(returnPressed()), this,
|
||||
SLOT(ForceSetRxrUDPIP()));
|
||||
connect(dispRxrUDPMAC, SIGNAL(editingFinished()), this,
|
||||
SLOT(SetRxrUDPMAC()));
|
||||
connect(dispRxrUDPMAC, SIGNAL(returnPressed()), this,
|
||||
SLOT(ForceSetRxrUDPMAC()));
|
||||
connect(spinRxrZMQPort, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetRxrZMQPort(int)));
|
||||
connect(dispRxrZMQIP, SIGNAL(editingFinished()), this, SLOT(SetRxrZMQIP()));
|
||||
connect(dispRxrZMQIP, SIGNAL(returnPressed()), this,
|
||||
SLOT(ForceSetRxrZMQIP()));
|
||||
|
||||
// roi
|
||||
if (tab_roi->isEnabled()) {
|
||||
@ -421,28 +434,42 @@ void qTabAdvanced::SetStopPort(int port) {
|
||||
&qTabAdvanced::GetStopPort)
|
||||
}
|
||||
|
||||
void qTabAdvanced::SetDetectorUDPIP() {
|
||||
std::string s = dispDetectorUDPIP->text().toAscii().constData();
|
||||
LOG(logINFO) << "Setting Detector UDP IP:" << s;
|
||||
try {
|
||||
det->setSourceUDPIP(sls::IpAddr{s}, {comboDetector->currentIndex()});
|
||||
void qTabAdvanced::SetDetectorUDPIP(bool force) {
|
||||
// return forces modification (inconsistency from command line)
|
||||
if (dispDetectorUDPIP->isModified() || force) {
|
||||
dispDetectorUDPIP->setModified(false);
|
||||
std::string s = dispDetectorUDPIP->text().toAscii().constData();
|
||||
LOG(logINFO) << "Setting Detector UDP IP:" << s;
|
||||
try {
|
||||
det->setSourceUDPIP(sls::IpAddr{s},
|
||||
{comboDetector->currentIndex()});
|
||||
}
|
||||
CATCH_HANDLE("Could not set Detector UDP IP.",
|
||||
"qTabAdvanced::SetDetectorUDPIP", this,
|
||||
&qTabAdvanced::GetDetectorUDPIP)
|
||||
}
|
||||
CATCH_HANDLE("Could not set Detector UDP IP.",
|
||||
"qTabAdvanced::SetDetectorUDPIP", this,
|
||||
&qTabAdvanced::GetDetectorUDPIP)
|
||||
}
|
||||
|
||||
void qTabAdvanced::SetDetectorUDPMAC() {
|
||||
std::string s = dispDetectorUDPMAC->text().toAscii().constData();
|
||||
LOG(logINFO) << "Setting Detector UDP MAC:" << s;
|
||||
try {
|
||||
det->setSourceUDPMAC(sls::MacAddr{s}, {comboDetector->currentIndex()});
|
||||
void qTabAdvanced::ForceSetDetectorUDPIP() { SetDetectorUDPIP(true); };
|
||||
|
||||
void qTabAdvanced::SetDetectorUDPMAC(bool force) {
|
||||
// return forces modification (inconsistency from command line)
|
||||
if (dispDetectorUDPMAC->isModified() || force) {
|
||||
dispDetectorUDPMAC->setModified(false);
|
||||
std::string s = dispDetectorUDPMAC->text().toAscii().constData();
|
||||
LOG(logINFO) << "Setting Detector UDP MAC:" << s;
|
||||
try {
|
||||
det->setSourceUDPMAC(sls::MacAddr{s},
|
||||
{comboDetector->currentIndex()});
|
||||
}
|
||||
CATCH_HANDLE("Could not set Detector UDP MAC.",
|
||||
"qTabAdvanced::SetDetectorUDPMAC", this,
|
||||
&qTabAdvanced::GetDetectorUDPMAC)
|
||||
}
|
||||
CATCH_HANDLE("Could not set Detector UDP MAC.",
|
||||
"qTabAdvanced::SetDetectorUDPMAC", this,
|
||||
&qTabAdvanced::GetDetectorUDPMAC)
|
||||
}
|
||||
|
||||
void qTabAdvanced::ForceSetDetectorUDPMAC() { SetDetectorUDPMAC(true); }
|
||||
|
||||
void qTabAdvanced::SetCltZMQPort(int port) {
|
||||
LOG(logINFO) << "Setting Client ZMQ Port:" << port;
|
||||
try {
|
||||
@ -453,29 +480,44 @@ void qTabAdvanced::SetCltZMQPort(int port) {
|
||||
&qTabAdvanced::GetCltZMQPort)
|
||||
}
|
||||
|
||||
void qTabAdvanced::SetCltZMQIP() {
|
||||
std::string s = dispZMQIP->text().toAscii().constData();
|
||||
LOG(logINFO) << "Setting Client ZMQ IP:" << s;
|
||||
try {
|
||||
det->setClientZmqIp(sls::IpAddr{s}, {comboDetector->currentIndex()});
|
||||
void qTabAdvanced::SetCltZMQIP(bool force) {
|
||||
// return forces modification (inconsistency from command line)
|
||||
if (dispZMQIP->isModified() || force) {
|
||||
dispZMQIP->setModified(false);
|
||||
std::string s = dispZMQIP->text().toAscii().constData();
|
||||
LOG(logINFO) << "Setting Client ZMQ IP:" << s;
|
||||
try {
|
||||
det->setClientZmqIp(sls::IpAddr{s},
|
||||
{comboDetector->currentIndex()});
|
||||
}
|
||||
CATCH_HANDLE("Could not set Client ZMQ IP.",
|
||||
"qTabAdvanced::SetCltZMQIP", this,
|
||||
&qTabAdvanced::GetCltZMQIP)
|
||||
}
|
||||
CATCH_HANDLE("Could not set Client ZMQ IP.", "qTabAdvanced::SetCltZMQIP",
|
||||
this, &qTabAdvanced::GetCltZMQIP)
|
||||
}
|
||||
|
||||
void qTabAdvanced::SetRxrHostname() {
|
||||
std::string s = dispZMQIP->text().toAscii().constData();
|
||||
LOG(logINFO) << "Setting Receiver Hostname:" << s;
|
||||
try {
|
||||
det->setRxHostname(s, {comboDetector->currentIndex()});
|
||||
}
|
||||
CATCH_HANDLE("Could not set Client ZMQ IP.", "qTabAdvanced::SetRxrHostname",
|
||||
this, &qTabAdvanced::GetRxrHostname)
|
||||
void qTabAdvanced::ForceSetCltZMQIP() { SetCltZMQIP(true); }
|
||||
|
||||
// update all network widgets (receiver mainly)
|
||||
SetDetector();
|
||||
void qTabAdvanced::SetRxrHostname(bool force) {
|
||||
// return forces modification (inconsistency from command line)
|
||||
if (dispRxrHostname->isModified() || force) {
|
||||
dispRxrHostname->setModified(false);
|
||||
std::string s = dispRxrHostname->text().toAscii().constData();
|
||||
LOG(logINFO) << "Setting Receiver Hostname:" << s;
|
||||
try {
|
||||
det->setRxHostname(s, {comboDetector->currentIndex()});
|
||||
}
|
||||
CATCH_HANDLE("Could not set Client ZMQ IP.",
|
||||
"qTabAdvanced::SetRxrHostname", this,
|
||||
&qTabAdvanced::GetRxrHostname)
|
||||
|
||||
// update all network widgets (receiver mainly)
|
||||
SetDetector();
|
||||
}
|
||||
}
|
||||
|
||||
void qTabAdvanced::ForceSetRxrHostname() { SetRxrHostname(true); }
|
||||
|
||||
void qTabAdvanced::SetRxrTCPPort(int port) {
|
||||
LOG(logINFO) << "Setting Receiver TCP Port:" << port;
|
||||
try {
|
||||
@ -496,29 +538,42 @@ void qTabAdvanced::SetRxrUDPPort(int port) {
|
||||
&qTabAdvanced::GetRxrUDPPort)
|
||||
}
|
||||
|
||||
void qTabAdvanced::SetRxrUDPIP() {
|
||||
std::string s = dispRxrUDPIP->text().toAscii().constData();
|
||||
LOG(logINFO) << "Setting Receiver UDP IP:" << s;
|
||||
try {
|
||||
det->setDestinationUDPIP(sls::IpAddr{s},
|
||||
{comboDetector->currentIndex()});
|
||||
void qTabAdvanced::SetRxrUDPIP(bool force) {
|
||||
// return forces modification (inconsistency from command line)
|
||||
if (dispRxrUDPIP->isModified() || force) {
|
||||
dispRxrUDPIP->setModified(false);
|
||||
std::string s = dispRxrUDPIP->text().toAscii().constData();
|
||||
LOG(logINFO) << "Setting Receiver UDP IP:" << s;
|
||||
try {
|
||||
det->setDestinationUDPIP(sls::IpAddr{s},
|
||||
{comboDetector->currentIndex()});
|
||||
}
|
||||
CATCH_HANDLE("Could not set Receiver UDP IP.",
|
||||
"qTabAdvanced::SetRxrUDPIP", this,
|
||||
&qTabAdvanced::GetRxrUDPIP)
|
||||
}
|
||||
CATCH_HANDLE("Could not set Receiver UDP IP.", "qTabAdvanced::SetRxrUDPIP",
|
||||
this, &qTabAdvanced::GetRxrUDPIP)
|
||||
}
|
||||
|
||||
void qTabAdvanced::SetRxrUDPMAC() {
|
||||
std::string s = dispRxrUDPMAC->text().toAscii().constData();
|
||||
LOG(logINFO) << "Setting Receiver UDP MAC:" << s;
|
||||
try {
|
||||
det->setDestinationUDPMAC(sls::MacAddr{s},
|
||||
{comboDetector->currentIndex()});
|
||||
void qTabAdvanced::ForceSetRxrUDPIP() { SetRxrUDPIP(true); }
|
||||
|
||||
void qTabAdvanced::SetRxrUDPMAC(bool force) {
|
||||
// return forces modification (inconsistency from command line)
|
||||
if (dispRxrUDPMAC->isModified() || force) {
|
||||
dispRxrUDPMAC->setModified(false);
|
||||
std::string s = dispRxrUDPMAC->text().toAscii().constData();
|
||||
LOG(logINFO) << "Setting Receiver UDP MAC:" << s;
|
||||
try {
|
||||
det->setDestinationUDPMAC(sls::MacAddr{s},
|
||||
{comboDetector->currentIndex()});
|
||||
}
|
||||
CATCH_HANDLE("Could not set Receiver UDP MAC.",
|
||||
"qTabAdvanced::SetRxrUDPMAC", this,
|
||||
&qTabAdvanced::GetRxrUDPMAC)
|
||||
}
|
||||
CATCH_HANDLE("Could not set Receiver UDP MAC.",
|
||||
"qTabAdvanced::SetRxrUDPMAC", this,
|
||||
&qTabAdvanced::GetRxrUDPMAC)
|
||||
}
|
||||
|
||||
void qTabAdvanced::ForceSetRxrUDPMAC() { SetRxrUDPMAC(true); }
|
||||
|
||||
void qTabAdvanced::SetRxrZMQPort(int port) {
|
||||
LOG(logINFO) << "Setting Receiver ZMQ Port:" << port;
|
||||
try {
|
||||
@ -529,16 +584,23 @@ void qTabAdvanced::SetRxrZMQPort(int port) {
|
||||
&qTabAdvanced::GetRxrZMQPort)
|
||||
}
|
||||
|
||||
void qTabAdvanced::SetRxrZMQIP() {
|
||||
std::string s = dispRxrZMQIP->text().toAscii().constData();
|
||||
LOG(logINFO) << "Setting Receiver ZMQ IP:" << s;
|
||||
try {
|
||||
det->setRxZmqIP(sls::IpAddr{s}, {comboDetector->currentIndex()});
|
||||
void qTabAdvanced::SetRxrZMQIP(bool force) {
|
||||
// return forces modification (inconsistency from command line)
|
||||
if (dispRxrZMQIP->isModified() || force) {
|
||||
dispRxrZMQIP->setModified(false);
|
||||
std::string s = dispRxrZMQIP->text().toAscii().constData();
|
||||
LOG(logINFO) << "Setting Receiver ZMQ IP:" << s;
|
||||
try {
|
||||
det->setRxZmqIP(sls::IpAddr{s}, {comboDetector->currentIndex()});
|
||||
}
|
||||
CATCH_HANDLE("Could not set Receiver ZMQ IP.",
|
||||
"qTabAdvanced::SetRxrZMQIP", this,
|
||||
&qTabAdvanced::GetRxrZMQIP)
|
||||
}
|
||||
CATCH_HANDLE("Could not set Receiver ZMQ IP.", "qTabAdvanced::SetRxrZMQIP",
|
||||
this, &qTabAdvanced::GetRxrZMQIP)
|
||||
}
|
||||
|
||||
void qTabAdvanced::ForceSetRxrZMQIP() { SetRxrZMQIP(true); }
|
||||
|
||||
void qTabAdvanced::GetROI() {
|
||||
LOG(logDEBUG) << "Getting ROI";
|
||||
try {
|
||||
@ -575,7 +637,7 @@ void qTabAdvanced::SetROI() {
|
||||
|
||||
void qTabAdvanced::GetAllTrimbits() {
|
||||
LOG(logDEBUG) << "Getting all trimbits value";
|
||||
disconnect(spinSetAllTrimbits, SIGNAL(editingFinished()), this,
|
||||
disconnect(spinSetAllTrimbits, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetAllTrimbits()));
|
||||
|
||||
try {
|
||||
@ -584,7 +646,7 @@ void qTabAdvanced::GetAllTrimbits() {
|
||||
}
|
||||
CATCH_DISPLAY("Could not get all trimbits.", "qTabAdvanced::GetAllTrimbits")
|
||||
|
||||
connect(spinSetAllTrimbits, SIGNAL(editingFinished()), this,
|
||||
connect(spinSetAllTrimbits, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetAllTrimbits()));
|
||||
}
|
||||
|
||||
|
@ -32,12 +32,20 @@ void qTabDataOutput::SetupWidgetWindow() {
|
||||
radioDefaultDeadtime->setEnabled(true);
|
||||
radioCustomDeadtime->setEnabled(true);
|
||||
// flags and speed
|
||||
widgetEiger->setVisible(true);
|
||||
widgetEiger->setEnabled(true);
|
||||
lblClkDivider->setEnabled(true);
|
||||
comboClkDivider->setEnabled(true);
|
||||
chkParallel->setEnabled(true);
|
||||
break;
|
||||
case slsDetectorDefs::MOENCH:
|
||||
chkTenGiga->setEnabled(true);
|
||||
break;
|
||||
case slsDetectorDefs::MYTHEN3:
|
||||
chkParallel->setEnabled(true);
|
||||
break;
|
||||
case slsDetectorDefs::JUNGFRAU:
|
||||
lblClkDivider->setEnabled(true);
|
||||
comboClkDivider->setEnabled(true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -54,6 +62,8 @@ void qTabDataOutput::Initialization() {
|
||||
SLOT(GetOutputDir()));
|
||||
connect(dispOutputDir, SIGNAL(editingFinished()), this,
|
||||
SLOT(SetOutputDir()));
|
||||
connect(dispOutputDir, SIGNAL(returnPressed()), this,
|
||||
SLOT(ForceSetOutputDir()));
|
||||
connect(btnOutputBrowse, SIGNAL(clicked()), this, SLOT(BrowseOutputDir()));
|
||||
connect(comboFileFormat, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetFileFormat(int)));
|
||||
@ -69,15 +79,18 @@ void qTabDataOutput::Initialization() {
|
||||
SLOT(EnableRateCorrection()));
|
||||
connect(btnGroupRate, SIGNAL(buttonClicked(int)), this,
|
||||
SLOT(SetRateCorrection()));
|
||||
connect(spinCustomDeadTime, SIGNAL(editingFinished()), this,
|
||||
connect(spinCustomDeadTime, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetRateCorrection()));
|
||||
}
|
||||
// flags, speed
|
||||
if (widgetEiger->isEnabled()) {
|
||||
connect(comboEigerClkDivider, SIGNAL(currentIndexChanged(int)), this,
|
||||
// parallel
|
||||
if (chkParallel->isEnabled()) {
|
||||
connect(chkParallel, SIGNAL(toggled(bool)), this,
|
||||
SLOT(SetParallel(bool)));
|
||||
}
|
||||
// speed
|
||||
if (comboClkDivider->isEnabled()) {
|
||||
connect(comboClkDivider, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetSpeed(int)));
|
||||
connect(comboEigerParallelFlag, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetFlags()));
|
||||
}
|
||||
}
|
||||
|
||||
@ -169,35 +182,41 @@ void qTabDataOutput::BrowseOutputDir() {
|
||||
dispOutputDir->setText(directory);
|
||||
}
|
||||
|
||||
void qTabDataOutput::SetOutputDir() {
|
||||
QString path = dispOutputDir->text();
|
||||
LOG(logDEBUG) << "Setting output directory to "
|
||||
<< path.toAscii().constData();
|
||||
void qTabDataOutput::SetOutputDir(bool force) {
|
||||
// return forces modification (inconsistency from command line)
|
||||
if (dispOutputDir->isModified() || force) {
|
||||
dispOutputDir->setModified(false);
|
||||
QString path = dispOutputDir->text();
|
||||
LOG(logDEBUG) << "Setting output directory to "
|
||||
<< path.toAscii().constData();
|
||||
|
||||
// empty
|
||||
if (path.isEmpty()) {
|
||||
qDefs::Message(qDefs::WARNING,
|
||||
"Invalid Output Path. Must not be empty.",
|
||||
"qTabDataOutput::SetOutputDir");
|
||||
LOG(logWARNING) << "Invalid Output Path. Must not be empty.";
|
||||
GetOutputDir();
|
||||
} else {
|
||||
// chop off trailing '/'
|
||||
if (path.endsWith('/')) {
|
||||
while (path.endsWith('/')) {
|
||||
path.chop(1);
|
||||
// empty
|
||||
if (path.isEmpty()) {
|
||||
qDefs::Message(qDefs::WARNING,
|
||||
"Invalid Output Path. Must not be empty.",
|
||||
"qTabDataOutput::SetOutputDir");
|
||||
LOG(logWARNING) << "Invalid Output Path. Must not be empty.";
|
||||
GetOutputDir();
|
||||
} else {
|
||||
// chop off trailing '/'
|
||||
if (path.endsWith('/')) {
|
||||
while (path.endsWith('/')) {
|
||||
path.chop(1);
|
||||
}
|
||||
}
|
||||
std::string spath = std::string(path.toAscii().constData());
|
||||
try {
|
||||
det->setFilePath(spath, {comboDetector->currentIndex() - 1});
|
||||
}
|
||||
CATCH_HANDLE("Could not set output file path.",
|
||||
"qTabDataOutput::SetOutputDir", this,
|
||||
&qTabDataOutput::GetOutputDir)
|
||||
}
|
||||
std::string spath = std::string(path.toAscii().constData());
|
||||
try {
|
||||
det->setFilePath(spath, {comboDetector->currentIndex() - 1});
|
||||
}
|
||||
CATCH_HANDLE("Could not set output file path.",
|
||||
"qTabDataOutput::SetOutputDir", this,
|
||||
&qTabDataOutput::GetOutputDir)
|
||||
}
|
||||
}
|
||||
|
||||
void qTabDataOutput::ForceSetOutputDir() { SetOutputDir(true); };
|
||||
|
||||
void qTabDataOutput::GetFileFormat() {
|
||||
LOG(logDEBUG) << "Getting File Format";
|
||||
disconnect(comboFileFormat, SIGNAL(currentIndexChanged(int)), this,
|
||||
@ -288,7 +307,7 @@ void qTabDataOutput::GetRateCorrection() {
|
||||
SLOT(EnableRateCorrection()));
|
||||
disconnect(btnGroupRate, SIGNAL(buttonClicked(int)), this,
|
||||
SLOT(SetRateCorrection()));
|
||||
disconnect(spinCustomDeadTime, SIGNAL(editingFinished()), this,
|
||||
disconnect(spinCustomDeadTime, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetRateCorrection()));
|
||||
try {
|
||||
spinCustomDeadTime->setValue(-1);
|
||||
@ -305,7 +324,7 @@ void qTabDataOutput::GetRateCorrection() {
|
||||
connect(chkRate, SIGNAL(toggled(bool)), this, SLOT(EnableRateCorrection()));
|
||||
connect(btnGroupRate, SIGNAL(buttonClicked(int)), this,
|
||||
SLOT(SetRateCorrection()));
|
||||
connect(spinCustomDeadTime, SIGNAL(editingFinished()), this,
|
||||
connect(spinCustomDeadTime, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetRateCorrection()));
|
||||
}
|
||||
|
||||
@ -351,22 +370,21 @@ void qTabDataOutput::SetRateCorrection() {
|
||||
|
||||
void qTabDataOutput::GetSpeed() {
|
||||
LOG(logDEBUG) << "Getting Speed";
|
||||
disconnect(comboEigerClkDivider, SIGNAL(currentIndexChanged(int)), this,
|
||||
disconnect(comboClkDivider, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetSpeed(int)));
|
||||
try {
|
||||
auto retval =
|
||||
det->getSpeed().tsquash("Speed is inconsistent for all detectors.");
|
||||
comboEigerClkDivider->setCurrentIndex(static_cast<int>(retval));
|
||||
comboClkDivider->setCurrentIndex(static_cast<int>(retval));
|
||||
}
|
||||
CATCH_DISPLAY("Could not get speed.", "qTabDataOutput::GetSpeed")
|
||||
connect(comboEigerClkDivider, SIGNAL(currentIndexChanged(int)), this,
|
||||
connect(comboClkDivider, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetSpeed(int)));
|
||||
}
|
||||
|
||||
void qTabDataOutput::SetSpeed(int speed) {
|
||||
LOG(logINFO) << "Setting Speed to "
|
||||
<< comboEigerClkDivider->currentText().toAscii().data();
|
||||
;
|
||||
<< comboClkDivider->currentText().toAscii().data();
|
||||
try {
|
||||
det->setSpeed(static_cast<slsDetectorDefs::speedLevel>(speed));
|
||||
}
|
||||
@ -374,34 +392,28 @@ void qTabDataOutput::SetSpeed(int speed) {
|
||||
&qTabDataOutput::GetSpeed)
|
||||
}
|
||||
|
||||
void qTabDataOutput::GetFlags() {
|
||||
LOG(logDEBUG) << "Getting readout flags";
|
||||
disconnect(comboEigerParallelFlag, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetFlags()));
|
||||
void qTabDataOutput::GetParallel() {
|
||||
LOG(logDEBUG) << "Getting parallel readout";
|
||||
disconnect(chkParallel, SIGNAL(toggled(bool)), this,
|
||||
SLOT(SetParallel(bool)));
|
||||
try {
|
||||
auto retval = det->getParallelMode().tsquash(
|
||||
"Parallel Flag is inconsistent for all detectors.");
|
||||
// parallel or non parallel
|
||||
if (retval)
|
||||
comboEigerParallelFlag->setCurrentIndex(PARALLEL);
|
||||
else
|
||||
comboEigerParallelFlag->setCurrentIndex(NONPARALLEL);
|
||||
chkParallel->setChecked(retval);
|
||||
}
|
||||
CATCH_DISPLAY("Could not get flags.", "qTabDataOutput::GetFlags")
|
||||
connect(comboEigerParallelFlag, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetFlags()));
|
||||
CATCH_DISPLAY("Could not get parallel readout.",
|
||||
"qTabDataOutput::GetParallel")
|
||||
connect(chkParallel, SIGNAL(toggled(bool)), this, SLOT(SetParallel(bool)));
|
||||
}
|
||||
|
||||
void qTabDataOutput::SetFlags() {
|
||||
auto mode =
|
||||
comboEigerParallelFlag->currentIndex() == PARALLEL ? true : false;
|
||||
void qTabDataOutput::SetParallel(bool enable) {
|
||||
LOG(logINFO) << "Setting PArallel readout to " << enable;
|
||||
try {
|
||||
LOG(logINFO) << "Setting Readout Flags to "
|
||||
<< comboEigerParallelFlag->currentText().toAscii().data();
|
||||
det->setParallelMode(mode);
|
||||
det->setParallelMode(enable);
|
||||
}
|
||||
CATCH_HANDLE("Could not set readout flags.", "qTabDataOutput::SetFlags",
|
||||
this, &qTabDataOutput::GetFlags)
|
||||
CATCH_HANDLE("Could not set parallel readout.",
|
||||
"qTabDataOutput::SetParallel", this,
|
||||
&qTabDataOutput::GetParallel)
|
||||
}
|
||||
|
||||
void qTabDataOutput::Refresh() {
|
||||
@ -419,9 +431,11 @@ void qTabDataOutput::Refresh() {
|
||||
if (chkTenGiga->isEnabled()) {
|
||||
GetTenGigaEnable();
|
||||
}
|
||||
if (widgetEiger->isEnabled()) {
|
||||
if (chkParallel->isEnabled()) {
|
||||
GetParallel();
|
||||
}
|
||||
if (comboClkDivider->isEnabled()) {
|
||||
GetSpeed();
|
||||
GetFlags();
|
||||
}
|
||||
|
||||
LOG(logDEBUG) << "**Updated DataOutput Tab";
|
||||
|
@ -290,7 +290,7 @@ void qTabDeveloper::Initialization() {
|
||||
SLOT(Refresh()));
|
||||
connect(comboHV, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetHighVoltage()));
|
||||
connect(spinHV, SIGNAL(editingFinished()), this, SLOT(SetHighVoltage()));
|
||||
connect(spinHV, SIGNAL(valueChanged(int)), this, SLOT(SetHighVoltage()));
|
||||
}
|
||||
|
||||
void qTabDeveloper::PopulateDetectors() {
|
||||
@ -312,7 +312,7 @@ void qTabDeveloper::GetHighVoltage() {
|
||||
if (!comboHV->isVisible() && !spinHV->isVisible())
|
||||
return;
|
||||
LOG(logDEBUG) << "Getting High Voltage";
|
||||
disconnect(spinHV, SIGNAL(editingFinished()), this, SLOT(SetHighVoltage()));
|
||||
disconnect(spinHV, SIGNAL(valueChanged(int)), this, SLOT(SetHighVoltage()));
|
||||
disconnect(comboHV, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetHighVoltage()));
|
||||
try {
|
||||
@ -359,7 +359,7 @@ void qTabDeveloper::GetHighVoltage() {
|
||||
}
|
||||
CATCH_DISPLAY("Could not get high voltage.",
|
||||
"qTabDeveloper::GetHighVoltage")
|
||||
connect(spinHV, SIGNAL(editingFinished()), this, SLOT(SetHighVoltage()));
|
||||
connect(spinHV, SIGNAL(valueChanged(int)), this, SLOT(SetHighVoltage()));
|
||||
connect(comboHV, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetHighVoltage()));
|
||||
}
|
||||
|
@ -46,6 +46,8 @@ void qTabMeasurement::SetupWidgetWindow() {
|
||||
ShowGates();
|
||||
|
||||
// enabling according to det type
|
||||
lblBurstMode->hide();
|
||||
comboBurstMode->hide();
|
||||
switch (det->getDetectorType().squash()) {
|
||||
case slsDetectorDefs::MOENCH:
|
||||
lblNumSamples->setEnabled(true);
|
||||
@ -64,6 +66,8 @@ void qTabMeasurement::SetupWidgetWindow() {
|
||||
startingFnumImplemented = true;
|
||||
break;
|
||||
case slsDetectorDefs::GOTTHARD2:
|
||||
lblBurstMode->show();
|
||||
comboBurstMode->show();
|
||||
lblNumBursts->setEnabled(true);
|
||||
spinNumBursts->setEnabled(true);
|
||||
lblBurstPeriod->setEnabled(true);
|
||||
@ -89,6 +93,10 @@ void qTabMeasurement::SetupWidgetWindow() {
|
||||
void qTabMeasurement::Initialization() {
|
||||
connect(comboTimingMode, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetTimingMode(int)));
|
||||
if (comboBurstMode->isVisible()) {
|
||||
connect(comboBurstMode, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetBurstMode(int)));
|
||||
}
|
||||
connect(spinNumMeasurements, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetNumMeasurements(int)));
|
||||
connect(spinNumFrames, SIGNAL(valueChanged(int)), this,
|
||||
@ -129,6 +137,8 @@ void qTabMeasurement::Initialization() {
|
||||
}
|
||||
connect(chkFile, SIGNAL(toggled(bool)), this, SLOT(SetFileWrite(bool)));
|
||||
connect(dispFileName, SIGNAL(editingFinished()), this, SLOT(SetFileName()));
|
||||
connect(dispFileName, SIGNAL(returnPressed()), this,
|
||||
SLOT(ForceSetFileName()));
|
||||
connect(spinIndex, SIGNAL(valueChanged(int)), this, SLOT(SetRunIndex(int)));
|
||||
if (startingFnumImplemented) {
|
||||
connect(spinStartingFrameNumber, SIGNAL(valueChanged(int)), this,
|
||||
@ -142,18 +152,15 @@ void qTabMeasurement::Initialization() {
|
||||
void qTabMeasurement::ShowTriggerDelay() {
|
||||
bool showTrigger = true;
|
||||
if (det->getDetectorType().squash() == slsDetectorDefs::GOTTHARD2) {
|
||||
try {
|
||||
LOG(logDEBUG) << "Getting burst mode";
|
||||
auto retval = det->getBurstMode().tsquash(
|
||||
"Inconsistent burst mode for all detectors.");
|
||||
// burst mode and auto timing mode
|
||||
if (retval != slsDetectorDefs::BURST_OFF &&
|
||||
comboTimingMode->currentIndex() == AUTO) {
|
||||
showTrigger = false;
|
||||
}
|
||||
// burst and auto
|
||||
if ((comboBurstMode->currentIndex() ==
|
||||
slsDetectorDefs::BURST_INTERNAL ||
|
||||
comboBurstMode->currentIndex() ==
|
||||
slsDetectorDefs::BURST_EXTERNAL) &&
|
||||
(comboTimingMode->currentIndex() == AUTO)) {
|
||||
// show burst, burstperiod, not trigger or delay
|
||||
showTrigger = false;
|
||||
}
|
||||
CATCH_DISPLAY("Could not get burst mode.",
|
||||
"qTabMeasurement::ShowTriggerDelay")
|
||||
}
|
||||
|
||||
if (showTrigger) {
|
||||
@ -246,7 +253,7 @@ void qTabMeasurement::EnableWidgetsforTimingMode() {
|
||||
spinPeriod->setEnabled(true);
|
||||
comboPeriodUnit->setEnabled(true);
|
||||
if (det->getDetectorType().squash() == slsDetectorDefs::GOTTHARD2) {
|
||||
ShowTriggerDelay();
|
||||
GetBurstMode(); // also decides to show trigger or burst mode
|
||||
}
|
||||
break;
|
||||
case TRIGGER:
|
||||
@ -270,7 +277,7 @@ void qTabMeasurement::EnableWidgetsforTimingMode() {
|
||||
spinDelay->setEnabled(true);
|
||||
comboDelayUnit->setEnabled(true);
|
||||
if (det->getDetectorType().squash() == slsDetectorDefs::GOTTHARD2) {
|
||||
ShowTriggerDelay();
|
||||
GetBurstMode(); // also decides to show trigger or burst mode
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -357,6 +364,42 @@ void qTabMeasurement::SetTimingMode(int val) {
|
||||
this, &qTabMeasurement::GetTimingMode)
|
||||
}
|
||||
|
||||
void qTabMeasurement::GetBurstMode() {
|
||||
LOG(logDEBUG) << "Getting burst mode";
|
||||
disconnect(comboBurstMode, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetBurstMode(int)));
|
||||
try {
|
||||
auto retval = det->getBurstMode().tsquash(
|
||||
"Inconsistent burst mode for all detectors.");
|
||||
switch (retval) {
|
||||
case slsDetectorDefs::BURST_INTERNAL:
|
||||
case slsDetectorDefs::BURST_EXTERNAL:
|
||||
case slsDetectorDefs::CONTINUOUS_INTERNAL:
|
||||
case slsDetectorDefs::CONTINUOUS_EXTERNAL:
|
||||
comboBurstMode->setCurrentIndex((int)retval);
|
||||
ShowTriggerDelay();
|
||||
break;
|
||||
default:
|
||||
throw sls::RuntimeError(std::string("Unknown burst mode: ") +
|
||||
std::to_string(retval));
|
||||
}
|
||||
}
|
||||
CATCH_DISPLAY("Could not get burst mode.", "qTabMeasurement::GetBurstMode")
|
||||
connect(comboBurstMode, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetBurstMode(int)));
|
||||
}
|
||||
|
||||
void qTabMeasurement::SetBurstMode(int val) {
|
||||
LOG(logINFO) << "Setting burst mode:"
|
||||
<< comboBurstMode->currentText().toAscii().data();
|
||||
try {
|
||||
det->setBurstMode(static_cast<slsDetectorDefs::burstMode>(val));
|
||||
ShowTriggerDelay();
|
||||
}
|
||||
CATCH_HANDLE("Could not set burst mode.", "qTabMeasurement::SetBurstMode",
|
||||
this, &qTabMeasurement::GetBurstMode)
|
||||
}
|
||||
|
||||
void qTabMeasurement::SetNumMeasurements(int val) {
|
||||
LOG(logINFO) << "Setting Number of Measurements to " << val;
|
||||
numMeasurements = val;
|
||||
@ -723,19 +766,26 @@ void qTabMeasurement::GetFileName() {
|
||||
connect(dispFileName, SIGNAL(editingFinished()), this, SLOT(SetFileName()));
|
||||
}
|
||||
|
||||
void qTabMeasurement::SetFileName() {
|
||||
std::string val = std::string(dispFileName->text().toAscii().constData());
|
||||
LOG(logINFO) << "Setting File Name Prefix:" << val;
|
||||
try {
|
||||
det->setFileNamePrefix(val);
|
||||
}
|
||||
CATCH_HANDLE("Could not set file name prefix.",
|
||||
"qTabMeasurement::SetFileName", this,
|
||||
&qTabMeasurement::GetFileName)
|
||||
void qTabMeasurement::SetFileName(bool force) {
|
||||
// return forces modification (inconsistency from command line)
|
||||
if (dispFileName->isModified() || force) {
|
||||
dispFileName->setModified(false);
|
||||
std::string val =
|
||||
std::string(dispFileName->text().toAscii().constData());
|
||||
LOG(logINFO) << "Setting File Name Prefix:" << val;
|
||||
try {
|
||||
det->setFileNamePrefix(val);
|
||||
}
|
||||
CATCH_HANDLE("Could not set file name prefix.",
|
||||
"qTabMeasurement::SetFileName", this,
|
||||
&qTabMeasurement::GetFileName)
|
||||
|
||||
emit FileNameChangedSignal(dispFileName->text());
|
||||
emit FileNameChangedSignal(dispFileName->text());
|
||||
}
|
||||
}
|
||||
|
||||
void qTabMeasurement::ForceSetFileName() { SetFileName(true); }
|
||||
|
||||
void qTabMeasurement::GetRunIndex() {
|
||||
LOG(logDEBUG) << "Getting Acquisition File index";
|
||||
disconnect(spinIndex, SIGNAL(valueChanged(int)), this,
|
||||
@ -904,6 +954,9 @@ void qTabMeasurement::Refresh() {
|
||||
|
||||
if (!plot->GetIsRunning()) {
|
||||
GetTimingMode();
|
||||
if (comboBurstMode->isVisible()) {
|
||||
GetBurstMode();
|
||||
}
|
||||
GetNumFrames();
|
||||
GetExposureTime();
|
||||
GetAcquisitionPeriod();
|
||||
|
@ -87,9 +87,9 @@ void qTabPlot::Initialization() {
|
||||
SLOT(SetStreamingFrequency()));
|
||||
connect(comboTimeGapUnit, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetStreamingFrequency()));
|
||||
connect(spinTimeGap, SIGNAL(editingFinished()), this,
|
||||
connect(spinTimeGap, SIGNAL(valueChanged(double)), this,
|
||||
SLOT(SetStreamingFrequency()));
|
||||
connect(spinNthFrame, SIGNAL(editingFinished()), this,
|
||||
connect(spinNthFrame, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetStreamingFrequency()));
|
||||
|
||||
// navigation buttons for options
|
||||
@ -174,17 +174,17 @@ void qTabPlot::Initialization() {
|
||||
connect(chkXMax, SIGNAL(toggled(bool)), this, SLOT(SetXRange()));
|
||||
connect(chkYMin, SIGNAL(toggled(bool)), this, SLOT(SetYRange()));
|
||||
connect(chkYMax, SIGNAL(toggled(bool)), this, SLOT(SetYRange()));
|
||||
connect(dispXMin, SIGNAL(editingFinished()), this, SLOT(SetXRange()));
|
||||
connect(dispXMax, SIGNAL(editingFinished()), this, SLOT(SetXRange()));
|
||||
connect(dispYMin, SIGNAL(editingFinished()), this, SLOT(SetYRange()));
|
||||
connect(dispYMax, SIGNAL(editingFinished()), this, SLOT(SetYRange()));
|
||||
connect(dispXMin, SIGNAL(editingFinished()), this, SLOT(isXMinModified()));
|
||||
connect(dispXMax, SIGNAL(editingFinished()), this, SLOT(isXMaxModified()));
|
||||
connect(dispYMin, SIGNAL(editingFinished()), this, SLOT(isYMinModified()));
|
||||
connect(dispYMax, SIGNAL(editingFinished()), this, SLOT(isYMaxModified()));
|
||||
connect(chkAspectRatio, SIGNAL(toggled(bool)), this,
|
||||
SLOT(CheckAspectRatio()));
|
||||
|
||||
connect(chkZMin, SIGNAL(toggled(bool)), this, SLOT(SetZRange()));
|
||||
connect(chkZMax, SIGNAL(toggled(bool)), this, SLOT(SetZRange()));
|
||||
connect(dispZMin, SIGNAL(editingFinished()), this, SLOT(SetZRange()));
|
||||
connect(dispZMax, SIGNAL(editingFinished()), this, SLOT(SetZRange()));
|
||||
connect(dispZMin, SIGNAL(editingFinished()), this, SLOT(isZMinModified()));
|
||||
connect(dispZMax, SIGNAL(editingFinished()), this, SLOT(isZMaxModified()));
|
||||
}
|
||||
|
||||
void qTabPlot::Select1DPlot(bool enable) {
|
||||
@ -389,6 +389,48 @@ void qTabPlot::SetTitles() {
|
||||
SLOT(SetTitles()));
|
||||
}
|
||||
|
||||
void qTabPlot::isXMinModified() {
|
||||
if (dispXMin->isModified()) {
|
||||
dispXMin->setModified(false);
|
||||
SetXRange();
|
||||
}
|
||||
}
|
||||
|
||||
void qTabPlot::isXMaxModified() {
|
||||
if (dispXMax->isModified()) {
|
||||
dispXMax->setModified(false);
|
||||
SetXRange();
|
||||
}
|
||||
}
|
||||
|
||||
void qTabPlot::isYMinModified() {
|
||||
if (dispYMin->isModified()) {
|
||||
dispYMin->setModified(false);
|
||||
SetYRange();
|
||||
}
|
||||
}
|
||||
|
||||
void qTabPlot::isYMaxModified() {
|
||||
if (dispYMax->isModified()) {
|
||||
dispYMax->setModified(false);
|
||||
SetYRange();
|
||||
}
|
||||
}
|
||||
|
||||
void qTabPlot::isZMinModified() {
|
||||
if (dispZMin->isModified()) {
|
||||
dispZMin->setModified(false);
|
||||
SetZRange();
|
||||
}
|
||||
}
|
||||
|
||||
void qTabPlot::isZMaxModified() {
|
||||
if (dispZMax->isModified()) {
|
||||
dispZMax->setModified(false);
|
||||
SetZRange();
|
||||
}
|
||||
}
|
||||
|
||||
void qTabPlot::SetXRange() {
|
||||
LOG(logDEBUG) << "Enable X axis range";
|
||||
|
||||
@ -452,10 +494,14 @@ void qTabPlot::MaintainAspectRatio(int dimension) {
|
||||
disconnect(chkXMax, SIGNAL(toggled(bool)), this, SLOT(SetXRange()));
|
||||
disconnect(chkYMin, SIGNAL(toggled(bool)), this, SLOT(SetYRange()));
|
||||
disconnect(chkYMax, SIGNAL(toggled(bool)), this, SLOT(SetYRange()));
|
||||
disconnect(dispXMin, SIGNAL(editingFinished()), this, SLOT(SetXRange()));
|
||||
disconnect(dispXMax, SIGNAL(editingFinished()), this, SLOT(SetXRange()));
|
||||
disconnect(dispYMin, SIGNAL(editingFinished()), this, SLOT(SetYRange()));
|
||||
disconnect(dispYMax, SIGNAL(editingFinished()), this, SLOT(SetYRange()));
|
||||
disconnect(dispXMin, SIGNAL(editingFinished()), this,
|
||||
SLOT(isXMinModified()));
|
||||
disconnect(dispXMax, SIGNAL(editingFinished()), this,
|
||||
SLOT(isXMaxModified()));
|
||||
disconnect(dispYMin, SIGNAL(editingFinished()), this,
|
||||
SLOT(isYMinModified()));
|
||||
disconnect(dispYMax, SIGNAL(editingFinished()), this,
|
||||
SLOT(isYMaxModified()));
|
||||
|
||||
// check all, fill all
|
||||
chkXMin->setChecked(true);
|
||||
@ -550,10 +596,10 @@ void qTabPlot::MaintainAspectRatio(int dimension) {
|
||||
connect(chkXMax, SIGNAL(toggled(bool)), this, SLOT(SetXRange()));
|
||||
connect(chkYMin, SIGNAL(toggled(bool)), this, SLOT(SetYRange()));
|
||||
connect(chkYMax, SIGNAL(toggled(bool)), this, SLOT(SetYRange()));
|
||||
connect(dispXMin, SIGNAL(editingFinished()), this, SLOT(SetXRange()));
|
||||
connect(dispXMax, SIGNAL(editingFinished()), this, SLOT(SetXRange()));
|
||||
connect(dispYMin, SIGNAL(editingFinished()), this, SLOT(SetYRange()));
|
||||
connect(dispYMax, SIGNAL(editingFinished()), this, SLOT(SetYRange()));
|
||||
connect(dispXMin, SIGNAL(editingFinished()), this, SLOT(isXMinModified()));
|
||||
connect(dispXMax, SIGNAL(editingFinished()), this, SLOT(isXMaxModified()));
|
||||
connect(dispYMin, SIGNAL(editingFinished()), this, SLOT(isYMinModified()));
|
||||
connect(dispYMax, SIGNAL(editingFinished()), this, SLOT(isYMaxModified()));
|
||||
|
||||
bool isRange[4]{true, true, true, true};
|
||||
plot->SetXYRangeChanged(true, ranges, isRange);
|
||||
@ -583,9 +629,9 @@ void qTabPlot::GetStreamingFrequency() {
|
||||
SLOT(SetStreamingFrequency()));
|
||||
disconnect(comboTimeGapUnit, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetStreamingFrequency()));
|
||||
disconnect(spinTimeGap, SIGNAL(editingFinished()), this,
|
||||
disconnect(spinTimeGap, SIGNAL(valueChanged(double)), this,
|
||||
SLOT(SetStreamingFrequency()));
|
||||
disconnect(spinNthFrame, SIGNAL(editingFinished()), this,
|
||||
disconnect(spinNthFrame, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetStreamingFrequency()));
|
||||
try {
|
||||
int freq = det->getRxZmqFrequency().tsquash(
|
||||
@ -621,9 +667,9 @@ void qTabPlot::GetStreamingFrequency() {
|
||||
SLOT(SetStreamingFrequency()));
|
||||
connect(comboTimeGapUnit, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetStreamingFrequency()));
|
||||
connect(spinTimeGap, SIGNAL(editingFinished()), this,
|
||||
connect(spinTimeGap, SIGNAL(valueChanged(double)), this,
|
||||
SLOT(SetStreamingFrequency()));
|
||||
connect(spinNthFrame, SIGNAL(editingFinished()), this,
|
||||
connect(spinNthFrame, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetStreamingFrequency()));
|
||||
}
|
||||
|
||||
|
Binary file not shown.
@ -2347,7 +2347,7 @@ int stopStateMachine() {
|
||||
sharedMemory_setStop(1);
|
||||
// read till status is idle
|
||||
while (sharedMemory_getStatus() == RUNNING)
|
||||
;
|
||||
usleep(500);
|
||||
sharedMemory_setStop(0);
|
||||
LOG(logINFO, ("Stopped State Machine\n"));
|
||||
return OK;
|
||||
|
@ -39,6 +39,10 @@ uint64_t Beb_deactivatedStartFrameNumber = 0;
|
||||
int Beb_quadEnable = 0;
|
||||
int Beb_positions[2] = {0, 0};
|
||||
int Beb_readNLines = MAX_ROWS_PER_READOUT;
|
||||
int Beb_deactivated_transmission_flowcontrol_10g = 0;
|
||||
int Beb_deactivated_transmission_delay_frame = 0;
|
||||
int Beb_deactivated_transmission_delay_left = 0;
|
||||
int Beb_deactivated_transmission_delay_right = 0;
|
||||
|
||||
void BebInfo_BebInfo(struct BebInfo *bebInfo, unsigned int beb_num) {
|
||||
bebInfo->beb_number = beb_num;
|
||||
@ -180,6 +184,11 @@ void Beb_GetModuleConfiguration(int *master, int *top, int *normal) {
|
||||
}
|
||||
|
||||
int Beb_IsTransmitting(int *retval, int tengiga, int waitForDelay) {
|
||||
if (!Beb_activated) {
|
||||
// not transmitting
|
||||
*retval = 0;
|
||||
return OK;
|
||||
}
|
||||
// mapping new memory
|
||||
u_int32_t *csp0base = 0;
|
||||
int addr_l_txndelaycounter = 0, addr_l_framedelaycounter = 0;
|
||||
@ -482,6 +491,9 @@ int Beb_Set32bitOverflow(int val) {
|
||||
}
|
||||
|
||||
int Beb_GetTenGigaFlowControl() {
|
||||
if (!Beb_activated)
|
||||
return Beb_deactivated_transmission_flowcontrol_10g;
|
||||
|
||||
u_int32_t offset = FLOW_REG_OFFSET;
|
||||
u_int32_t *csp0base = 0;
|
||||
int fd = Beb_open(&csp0base, XPAR_PLB_GPIO_SYS_BASEADDR);
|
||||
@ -501,6 +513,11 @@ int Beb_GetTenGigaFlowControl() {
|
||||
|
||||
int Beb_SetTenGigaFlowControl(int value) {
|
||||
LOG(logINFO, ("Setting ten giga flow control to %d\n", value));
|
||||
if (!Beb_activated) {
|
||||
Beb_deactivated_transmission_flowcontrol_10g = value;
|
||||
return 1;
|
||||
}
|
||||
|
||||
value = value == 0 ? 0 : 1;
|
||||
u_int32_t offset = FLOW_REG_OFFSET;
|
||||
u_int32_t *csp0base = 0;
|
||||
@ -521,12 +538,17 @@ int Beb_SetTenGigaFlowControl(int value) {
|
||||
retval | ((value << FLOW_REG_TXM_FLOW_CNTRL_10G_OFST) &
|
||||
FLOW_REG_TXM_FLOW_CNTRL_10G_MSK));
|
||||
|
||||
Beb_deactivated_transmission_flowcontrol_10g = value;
|
||||
Beb_close(fd, csp0base);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
int Beb_GetTransmissionDelayFrame() {
|
||||
if (!Beb_activated) {
|
||||
return Beb_deactivated_transmission_delay_frame;
|
||||
}
|
||||
|
||||
u_int32_t offset = TXM_DELAY_FRAME_OFFSET;
|
||||
u_int32_t *csp0base = 0;
|
||||
int fd = Beb_open(&csp0base, XPAR_PLB_GPIO_SYS_BASEADDR);
|
||||
@ -547,6 +569,10 @@ int Beb_SetTransmissionDelayFrame(int value) {
|
||||
LOG(logERROR, ("Invalid transmission delay frame value %d\n", value));
|
||||
return 0;
|
||||
}
|
||||
if (!Beb_activated) {
|
||||
Beb_deactivated_transmission_delay_frame = value;
|
||||
return 1;
|
||||
}
|
||||
u_int32_t offset = TXM_DELAY_FRAME_OFFSET;
|
||||
u_int32_t *csp0base = 0;
|
||||
int fd = Beb_open(&csp0base, XPAR_PLB_GPIO_SYS_BASEADDR);
|
||||
@ -556,12 +582,16 @@ int Beb_SetTransmissionDelayFrame(int value) {
|
||||
return 0;
|
||||
} else {
|
||||
Beb_Write32(csp0base, offset, value);
|
||||
Beb_deactivated_transmission_delay_frame = value;
|
||||
Beb_close(fd, csp0base);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
int Beb_GetTransmissionDelayLeft() {
|
||||
if (!Beb_activated) {
|
||||
return Beb_deactivated_transmission_delay_left;
|
||||
}
|
||||
u_int32_t offset = TXM_DELAY_LEFT_OFFSET;
|
||||
u_int32_t *csp0base = 0;
|
||||
int fd = Beb_open(&csp0base, XPAR_PLB_GPIO_SYS_BASEADDR);
|
||||
@ -582,6 +612,10 @@ int Beb_SetTransmissionDelayLeft(int value) {
|
||||
LOG(logERROR, ("Invalid transmission delay left value %d\n", value));
|
||||
return 0;
|
||||
}
|
||||
if (!Beb_activated) {
|
||||
Beb_deactivated_transmission_delay_left = value;
|
||||
return 1;
|
||||
}
|
||||
u_int32_t offset = TXM_DELAY_LEFT_OFFSET;
|
||||
u_int32_t *csp0base = 0;
|
||||
int fd = Beb_open(&csp0base, XPAR_PLB_GPIO_SYS_BASEADDR);
|
||||
@ -591,12 +625,17 @@ int Beb_SetTransmissionDelayLeft(int value) {
|
||||
return 0;
|
||||
} else {
|
||||
Beb_Write32(csp0base, offset, value);
|
||||
Beb_deactivated_transmission_delay_left = value;
|
||||
Beb_close(fd, csp0base);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
int Beb_GetTransmissionDelayRight() {
|
||||
if (!Beb_activated) {
|
||||
return Beb_deactivated_transmission_delay_right;
|
||||
}
|
||||
|
||||
u_int32_t offset = TXM_DELAY_RIGHT_OFFSET;
|
||||
u_int32_t *csp0base = 0;
|
||||
int fd = Beb_open(&csp0base, XPAR_PLB_GPIO_SYS_BASEADDR);
|
||||
@ -617,6 +656,10 @@ int Beb_SetTransmissionDelayRight(int value) {
|
||||
LOG(logERROR, ("Invalid transmission delay right value %d\n", value));
|
||||
return 0;
|
||||
}
|
||||
if (!Beb_activated) {
|
||||
Beb_deactivated_transmission_delay_right = value;
|
||||
return 1;
|
||||
}
|
||||
u_int32_t offset = TXM_DELAY_RIGHT_OFFSET;
|
||||
u_int32_t *csp0base = 0;
|
||||
int fd = Beb_open(&csp0base, XPAR_PLB_GPIO_SYS_BASEADDR);
|
||||
@ -626,57 +669,12 @@ int Beb_SetTransmissionDelayRight(int value) {
|
||||
return 0;
|
||||
} else {
|
||||
Beb_Write32(csp0base, offset, value);
|
||||
Beb_deactivated_transmission_delay_right = value;
|
||||
Beb_close(fd, csp0base);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
int Beb_SetNetworkParameter(enum NETWORKINDEX mode, int val) {
|
||||
|
||||
if (!Beb_activated)
|
||||
return val;
|
||||
|
||||
// mapping new memory
|
||||
u_int32_t *csp0base = 0;
|
||||
u_int32_t valueread = 0;
|
||||
u_int32_t offset = TXM_DELAY_LEFT_OFFSET;
|
||||
char modename[100] = "";
|
||||
|
||||
switch (mode) {
|
||||
case TXN_LEFT:
|
||||
offset = TXM_DELAY_LEFT_OFFSET;
|
||||
strcpy(modename, "Transmission Delay Left");
|
||||
break;
|
||||
case TXN_RIGHT:
|
||||
offset = TXM_DELAY_RIGHT_OFFSET;
|
||||
strcpy(modename, "Transmission Delay Right");
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG(logERROR, ("Unrecognized mode in network parameter: %d\n", mode));
|
||||
return -1;
|
||||
}
|
||||
// open file pointer
|
||||
int fd = Beb_open(&csp0base, XPAR_PLB_GPIO_SYS_BASEADDR);
|
||||
if (fd < 0) {
|
||||
LOG(logERROR,
|
||||
("Could not read register to set network parameter. FAIL\n"));
|
||||
return -1;
|
||||
} else {
|
||||
if (val > -1) {
|
||||
valueread = Beb_Read32(csp0base, offset);
|
||||
Beb_Write32(csp0base, offset, val);
|
||||
}
|
||||
|
||||
valueread = Beb_Read32(csp0base, offset);
|
||||
}
|
||||
// close file pointer
|
||||
if (fd > 0)
|
||||
Beb_close(fd, csp0base);
|
||||
|
||||
return valueread;
|
||||
}
|
||||
|
||||
u_int32_t Beb_GetFirmwareRevision() {
|
||||
// mapping new memory
|
||||
u_int32_t *csp0base = 0;
|
||||
|
@ -986,11 +986,16 @@ int Feb_Control_StartAcquisition() {
|
||||
int Feb_Control_StopAcquisition() { return Feb_Control_Reset(); }
|
||||
|
||||
int Feb_Control_SoftwareTrigger() {
|
||||
unsigned int orig_value = 0;
|
||||
Feb_Interface_ReadRegister(Feb_Control_AddressToAll(), DAQ_REG_CHIP_CMDS,
|
||||
&orig_value);
|
||||
unsigned int cmd = orig_value | DAQ_REG_CHIP_CMDS_INT_TRIGGER;
|
||||
if (Feb_Control_activated) {
|
||||
unsigned int orig_value = 0;
|
||||
if (!Feb_Interface_ReadRegister(Feb_Control_AddressToAll(),
|
||||
DAQ_REG_CHIP_CMDS, &orig_value)) {
|
||||
LOG(logERROR, ("Could not read DAQ_REG_CHIP_CMDS to send software "
|
||||
"trigger\n"));
|
||||
return 0;
|
||||
}
|
||||
unsigned int cmd = orig_value | DAQ_REG_CHIP_CMDS_INT_TRIGGER;
|
||||
|
||||
// set trigger bit
|
||||
LOG(logDEBUG1, ("Setting Trigger, Register:0x%x\n", cmd));
|
||||
if (!Feb_Interface_WriteRegister(Feb_Control_AddressToAll(),
|
||||
@ -1862,9 +1867,16 @@ int Feb_Control_PrintCorrectedValues() {
|
||||
// So if software says now 40.00 you neeed to convert to mdegrees 40000(call it
|
||||
// A1) and then A1/65536/0.00198421639-273.15
|
||||
int Feb_Control_GetLeftFPGATemp() {
|
||||
if (!Feb_Control_activated) {
|
||||
return 0;
|
||||
}
|
||||
unsigned int temperature = 0;
|
||||
Feb_Interface_ReadRegister(Feb_Control_leftAddress, FEB_REG_STATUS,
|
||||
&temperature);
|
||||
if (!Feb_Interface_ReadRegister(Feb_Control_leftAddress, FEB_REG_STATUS,
|
||||
&temperature)) {
|
||||
LOG(logERROR, ("Trouble reading FEB_REG_STATUS reg to get left feb "
|
||||
"temperature\n"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
temperature = temperature >> 16;
|
||||
temperature =
|
||||
@ -1875,9 +1887,16 @@ int Feb_Control_GetLeftFPGATemp() {
|
||||
}
|
||||
|
||||
int Feb_Control_GetRightFPGATemp() {
|
||||
if (!Feb_Control_activated) {
|
||||
return 0;
|
||||
}
|
||||
unsigned int temperature = 0;
|
||||
Feb_Interface_ReadRegister(Feb_Control_rightAddress, FEB_REG_STATUS,
|
||||
&temperature);
|
||||
if (!Feb_Interface_ReadRegister(Feb_Control_rightAddress, FEB_REG_STATUS,
|
||||
&temperature)) {
|
||||
LOG(logERROR, ("Trouble reading FEB_REG_STATUS reg to get right feb "
|
||||
"temperature\n"));
|
||||
return 0;
|
||||
}
|
||||
temperature = temperature >> 16;
|
||||
temperature =
|
||||
((((float)(temperature) / 65536.0f) / 0.00198421639f) - 273.15f) *
|
||||
@ -1887,15 +1906,29 @@ int Feb_Control_GetRightFPGATemp() {
|
||||
}
|
||||
|
||||
int64_t Feb_Control_GetMeasuredPeriod() {
|
||||
if (!Feb_Control_activated) {
|
||||
return 0;
|
||||
}
|
||||
unsigned int value = 0;
|
||||
Feb_Interface_ReadRegister(Feb_Control_leftAddress, MEAS_PERIOD_REG,
|
||||
&value);
|
||||
if (!Feb_Interface_ReadRegister(Feb_Control_leftAddress, MEAS_PERIOD_REG,
|
||||
&value)) {
|
||||
LOG(logERROR,
|
||||
("Trouble reading MEAS_PERIOD_REG reg to get measured period\n"));
|
||||
return 0;
|
||||
}
|
||||
return (int64_t)value * 10;
|
||||
}
|
||||
|
||||
int64_t Feb_Control_GetSubMeasuredPeriod() {
|
||||
if (!Feb_Control_activated) {
|
||||
return 0;
|
||||
}
|
||||
unsigned int value = 0;
|
||||
Feb_Interface_ReadRegister(Feb_Control_leftAddress, MEAS_SUBPERIOD_REG,
|
||||
&value);
|
||||
if (!Feb_Interface_ReadRegister(Feb_Control_leftAddress, MEAS_SUBPERIOD_REG,
|
||||
&value)) {
|
||||
LOG(logERROR, ("Trouble reading MEAS_SUBPERIOD_REG reg to get measured "
|
||||
"sub period\n"));
|
||||
return 0;
|
||||
}
|
||||
return (int64_t)value * 10;
|
||||
}
|
||||
|
Binary file not shown.
@ -2217,7 +2217,7 @@ int stopStateMachine() {
|
||||
sharedMemory_setStop(1);
|
||||
// read till status is idle
|
||||
while (sharedMemory_getStatus() == RUNNING)
|
||||
;
|
||||
usleep(500);
|
||||
sharedMemory_setStop(0);
|
||||
LOG(logINFO, ("Stopped State Machine\n"));
|
||||
return OK;
|
||||
|
@ -121,9 +121,10 @@
|
||||
|
||||
#define ASIC_CONFIG_RUN_MODE_OFST (0)
|
||||
#define ASIC_CONFIG_RUN_MODE_MSK (0x00000003 << ASIC_CONFIG_RUN_MODE_OFST)
|
||||
#define ASIC_CONFIG_RUN_MODE_INT_BURST_VAL ((0x1 << ASIC_CONFIG_RUN_MODE_OFST) & ASIC_CONFIG_RUN_MODE_MSK)
|
||||
#define ASIC_CONFIG_RUN_MODE_CONT_VAL ((0x2 << ASIC_CONFIG_RUN_MODE_OFST) & ASIC_CONFIG_RUN_MODE_MSK)
|
||||
#define ASIC_CONFIG_RUN_MODE_EXT_BURST_VAL ((0x3 << ASIC_CONFIG_RUN_MODE_OFST) & ASIC_CONFIG_RUN_MODE_MSK)
|
||||
#define ASIC_CONFIG_RUN_MODE_INT_BURST_VAL ((0x0 << ASIC_CONFIG_RUN_MODE_OFST) & ASIC_CONFIG_RUN_MODE_MSK)
|
||||
#define ASIC_CONFIG_RUN_MODE_EXT_BURST_VAL ((0x1 << ASIC_CONFIG_RUN_MODE_OFST) & ASIC_CONFIG_RUN_MODE_MSK)
|
||||
#define ASIC_CONFIG_RUN_MODE_INT_CONT_VAL ((0x2 << ASIC_CONFIG_RUN_MODE_OFST) & ASIC_CONFIG_RUN_MODE_MSK)
|
||||
#define ASIC_CONFIG_RUN_MODE_EXT_CONT_VAL ((0x3 << ASIC_CONFIG_RUN_MODE_OFST) & ASIC_CONFIG_RUN_MODE_MSK)
|
||||
#define ASIC_CONFIG_GAIN_OFST (4)
|
||||
#define ASIC_CONFIG_GAIN_MSK (0x00000003 << ASIC_CONFIG_GAIN_OFST)
|
||||
#define ASIC_CONFIG_DYNAMIC_GAIN_VAL ((0x0 << ASIC_CONFIG_GAIN_OFST) & ASIC_CONFIG_GAIN_MSK)
|
||||
|
Binary file not shown.
@ -809,11 +809,15 @@ int setDynamicRange(int dr) { return DYNAMIC_RANGE; }
|
||||
/* parameters - timer */
|
||||
void setNumFrames(int64_t val) {
|
||||
if (val > 0) {
|
||||
if (burstMode == BURST_OFF) {
|
||||
// continuous
|
||||
if (burstMode == CONTINUOUS_INTERNAL ||
|
||||
burstMode == CONTINUOUS_EXTERNAL) {
|
||||
LOG(logINFO,
|
||||
("Setting number of frames %lld [Continuous mode]\n", val));
|
||||
set64BitReg(val, SET_FRAMES_LSB_REG, SET_FRAMES_MSB_REG);
|
||||
} else {
|
||||
}
|
||||
// burst
|
||||
else {
|
||||
LOG(logINFO,
|
||||
("Setting number of frames %d [Burst mode]\n", (int)val));
|
||||
bus_w(ASIC_INT_FRAMES_REG,
|
||||
@ -826,9 +830,12 @@ void setNumFrames(int64_t val) {
|
||||
}
|
||||
|
||||
int64_t getNumFrames() {
|
||||
if (burstMode == BURST_OFF) {
|
||||
// continuous
|
||||
if (burstMode == CONTINUOUS_INTERNAL || burstMode == CONTINUOUS_EXTERNAL) {
|
||||
return get64BitReg(SET_FRAMES_LSB_REG, SET_FRAMES_MSB_REG);
|
||||
} else {
|
||||
}
|
||||
// burst
|
||||
else {
|
||||
return ((bus_r(ASIC_INT_FRAMES_REG) & ASIC_INT_FRAMES_MSK) >>
|
||||
ASIC_INT_FRAMES_OFST);
|
||||
}
|
||||
@ -856,9 +863,13 @@ int64_t getNumTriggers() {
|
||||
void setNumBursts(int64_t val) {
|
||||
if (val > 0) {
|
||||
LOG(logINFO, ("Setting number of bursts %lld\n", val));
|
||||
if (burstMode != BURST_OFF && getTiming() == AUTO_TIMING) {
|
||||
// burst and auto
|
||||
if ((burstMode == BURST_INTERNAL || burstMode == BURST_EXTERNAL) &&
|
||||
getTiming() == AUTO_TIMING) {
|
||||
set64BitReg(val, SET_FRAMES_LSB_REG, SET_FRAMES_MSB_REG);
|
||||
} else {
|
||||
}
|
||||
// burst-trigger or continuous
|
||||
else {
|
||||
LOG(logINFO,
|
||||
("\tNot (Burst and Auto mode): not writing to register\n"));
|
||||
numBurstsReg = val;
|
||||
@ -867,9 +878,12 @@ void setNumBursts(int64_t val) {
|
||||
}
|
||||
|
||||
int64_t getNumBursts() {
|
||||
if (burstMode != BURST_OFF && getTiming() == AUTO_TIMING) {
|
||||
// burst and auto
|
||||
if ((burstMode == BURST_INTERNAL || burstMode == BURST_EXTERNAL) &&
|
||||
getTiming() == AUTO_TIMING) {
|
||||
return get64BitReg(SET_FRAMES_LSB_REG, SET_FRAMES_MSB_REG);
|
||||
}
|
||||
// burst-trigger or continuous
|
||||
return numBurstsReg;
|
||||
}
|
||||
|
||||
@ -901,12 +915,16 @@ int setPeriod(int64_t val) {
|
||||
LOG(logERROR, ("Invalid period: %lld ns\n", val));
|
||||
return FAIL;
|
||||
}
|
||||
val *= (1E-9 * systemFrequency);
|
||||
if (burstMode == BURST_OFF) {
|
||||
// continuous
|
||||
if (burstMode == CONTINUOUS_INTERNAL || burstMode == CONTINUOUS_EXTERNAL) {
|
||||
LOG(logINFO, ("Setting period %lld ns [Continuous mode]\n", val));
|
||||
val *= (1E-9 * systemFrequency);
|
||||
set64BitReg(val, SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG);
|
||||
} else {
|
||||
}
|
||||
// burst
|
||||
else {
|
||||
LOG(logINFO, ("Setting period %lld ns [Burst mode]\n", val));
|
||||
val *= (1E-9 * systemFrequency);
|
||||
set64BitReg(val, ASIC_INT_PERIOD_LSB_REG, ASIC_INT_PERIOD_MSB_REG);
|
||||
}
|
||||
// validate for tolerance
|
||||
@ -919,10 +937,13 @@ int setPeriod(int64_t val) {
|
||||
}
|
||||
|
||||
int64_t getPeriod() {
|
||||
if (burstMode == BURST_OFF) {
|
||||
// continuous
|
||||
if (burstMode == CONTINUOUS_INTERNAL || burstMode == CONTINUOUS_EXTERNAL) {
|
||||
return get64BitReg(SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG) /
|
||||
(1E-9 * systemFrequency);
|
||||
} else {
|
||||
}
|
||||
// burst
|
||||
else {
|
||||
return get64BitReg(ASIC_INT_PERIOD_LSB_REG, ASIC_INT_PERIOD_MSB_REG) /
|
||||
(1E-9 * systemFrequency);
|
||||
}
|
||||
@ -965,9 +986,13 @@ int setBurstPeriod(int64_t val) {
|
||||
}
|
||||
LOG(logINFO, ("Setting burst period %lld ns\n", val));
|
||||
val *= (1E-9 * systemFrequency);
|
||||
if (burstMode != BURST_OFF && getTiming() == AUTO_TIMING) {
|
||||
// burst and auto
|
||||
if ((burstMode == BURST_INTERNAL || burstMode == BURST_EXTERNAL) &&
|
||||
getTiming() == AUTO_TIMING) {
|
||||
set64BitReg(val, SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG);
|
||||
} else {
|
||||
}
|
||||
// burst-trigger, continuous
|
||||
else {
|
||||
LOG(logINFO,
|
||||
("\tNot (Burst and Auto mode): not writing to register\n"));
|
||||
burstPeriodReg = val;
|
||||
@ -983,10 +1008,13 @@ int setBurstPeriod(int64_t val) {
|
||||
}
|
||||
|
||||
int64_t getBurstPeriod() {
|
||||
if (burstMode != BURST_OFF && getTiming() == AUTO_TIMING) {
|
||||
// burst and auto
|
||||
if ((burstMode == BURST_INTERNAL || burstMode == BURST_EXTERNAL) &&
|
||||
getTiming() == AUTO_TIMING) {
|
||||
return get64BitReg(SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG) /
|
||||
(1E-9 * systemFrequency);
|
||||
}
|
||||
// burst-trigger, continuous
|
||||
return burstPeriodReg / (1E-9 * systemFrequency);
|
||||
}
|
||||
|
||||
@ -1210,7 +1238,7 @@ void setTiming(enum timingMode arg) {
|
||||
get64BitReg(SET_TRIGGER_DELAY_LSB_REG, SET_TRIGGER_DELAY_MSB_REG);
|
||||
}
|
||||
// auto and burst
|
||||
else if (burstMode != BURST_OFF) {
|
||||
else if (burstMode == BURST_INTERNAL || burstMode == BURST_EXTERNAL) {
|
||||
numBurstsReg = get64BitReg(SET_FRAMES_LSB_REG, SET_FRAMES_MSB_REG);
|
||||
burstPeriodReg = get64BitReg(SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG);
|
||||
}
|
||||
@ -1237,7 +1265,7 @@ void setTiming(enum timingMode arg) {
|
||||
LOG(logINFO, ("\tTriggers reg: %lld, Delay reg: %lldns\n",
|
||||
getNumTriggers(), getDelayAfterTrigger()));
|
||||
// burst
|
||||
if (burstMode != BURST_OFF) {
|
||||
if (burstMode == BURST_INTERNAL || burstMode == BURST_EXTERNAL) {
|
||||
LOG(logINFO, ("\tFrame reg: 1, Period reg: 0\n"))
|
||||
set64BitReg(1, SET_FRAMES_LSB_REG, SET_FRAMES_MSB_REG);
|
||||
set64BitReg(0, SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG);
|
||||
@ -1249,7 +1277,7 @@ void setTiming(enum timingMode arg) {
|
||||
set64BitReg(1, SET_CYCLES_LSB_REG, SET_CYCLES_MSB_REG);
|
||||
set64BitReg(0, SET_TRIGGER_DELAY_LSB_REG, SET_TRIGGER_DELAY_MSB_REG);
|
||||
// burst
|
||||
if (burstMode != BURST_OFF) {
|
||||
if (burstMode == BURST_INTERNAL || burstMode == BURST_EXTERNAL) {
|
||||
set64BitReg(numBurstsReg, SET_FRAMES_LSB_REG, SET_FRAMES_MSB_REG);
|
||||
set64BitReg(burstPeriodReg, SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG);
|
||||
LOG(logINFO, ("\tFrames reg (bursts): %lld, Period reg(burst "
|
||||
@ -2052,15 +2080,18 @@ int setBurstModeinFPGA(enum burstMode value) {
|
||||
uint32_t addr = ASIC_CONFIG_REG;
|
||||
uint32_t runmode = 0;
|
||||
switch (value) {
|
||||
case BURST_OFF:
|
||||
runmode = ASIC_CONFIG_RUN_MODE_CONT_VAL;
|
||||
break;
|
||||
case BURST_INTERNAL:
|
||||
runmode = ASIC_CONFIG_RUN_MODE_INT_BURST_VAL;
|
||||
break;
|
||||
case BURST_EXTERNAL:
|
||||
runmode = ASIC_CONFIG_RUN_MODE_EXT_BURST_VAL;
|
||||
break;
|
||||
case CONTINUOUS_INTERNAL:
|
||||
runmode = ASIC_CONFIG_RUN_MODE_INT_CONT_VAL;
|
||||
break;
|
||||
case CONTINUOUS_EXTERNAL:
|
||||
runmode = ASIC_CONFIG_RUN_MODE_EXT_CONT_VAL;
|
||||
break;
|
||||
default:
|
||||
LOG(logERROR, ("Unknown burst mode %d\n", value));
|
||||
return FAIL;
|
||||
@ -2074,16 +2105,20 @@ int setBurstModeinFPGA(enum burstMode value) {
|
||||
}
|
||||
|
||||
int setBurstMode(enum burstMode burst) {
|
||||
LOG(logINFO, ("Setting burst mode to %s\n",
|
||||
burst == BURST_OFF
|
||||
? "off"
|
||||
: (burst == BURST_INTERNAL ? "internal" : "external")));
|
||||
LOG(logINFO,
|
||||
("Setting burst mode to %s\n",
|
||||
(burst == BURST_INTERNAL
|
||||
? "burst_internal"
|
||||
: (burst == BURST_EXTERNAL ? "burst external"
|
||||
: (burst == CONTINUOUS_INTERNAL
|
||||
? "continuous internal"
|
||||
: "continuous external")))));
|
||||
|
||||
// update
|
||||
int64_t framesReg = 0;
|
||||
int64_t periodReg = 0;
|
||||
// burst
|
||||
if (burstMode != BURST_OFF) {
|
||||
if (burstMode == BURST_INTERNAL || burstMode == BURST_EXTERNAL) {
|
||||
framesReg = ((bus_r(ASIC_INT_FRAMES_REG) & ASIC_INT_FRAMES_MSK) >>
|
||||
ASIC_INT_FRAMES_OFST);
|
||||
periodReg =
|
||||
@ -2107,7 +2142,7 @@ int setBurstMode(enum burstMode burst) {
|
||||
|
||||
LOG(logINFO, ("\tUpdating registers\n"));
|
||||
// continuous
|
||||
if (burstMode == BURST_OFF) {
|
||||
if (burstMode == CONTINUOUS_INTERNAL || burstMode == CONTINUOUS_EXTERNAL) {
|
||||
set64BitReg(framesReg, SET_FRAMES_LSB_REG, SET_FRAMES_MSB_REG);
|
||||
set64BitReg(periodReg, SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG);
|
||||
LOG(logINFO, ("\tFrames reg: %lld, Period reg: %lldns\n",
|
||||
@ -2157,14 +2192,17 @@ int configureASICGlobalSettings() {
|
||||
int value = ((filter << ASIC_FILTER_OFST) & ASIC_FILTER_MSK) |
|
||||
((cdsGain << ASIC_CDS_GAIN_OFST) & ASIC_CDS_GAIN_MSK);
|
||||
switch (burstMode) {
|
||||
case BURST_OFF:
|
||||
value |= (ASIC_CONT_MODE_MSK | ASIC_EXT_TIMING_MSK);
|
||||
break;
|
||||
case BURST_INTERNAL:
|
||||
break;
|
||||
case BURST_EXTERNAL:
|
||||
value |= ASIC_EXT_TIMING_MSK;
|
||||
break;
|
||||
case CONTINUOUS_INTERNAL:
|
||||
value |= ASIC_CONT_MODE_MSK;
|
||||
break;
|
||||
case CONTINUOUS_EXTERNAL:
|
||||
value |= (ASIC_CONT_MODE_MSK | ASIC_EXT_TIMING_MSK);
|
||||
break;
|
||||
}
|
||||
LOG(logINFO, ("\tSending Global Chip settings:0x%x (filter:%d, "
|
||||
"cdsgain:%d)\n",
|
||||
@ -2213,15 +2251,18 @@ enum burstMode getBurstMode() {
|
||||
uint32_t addr = ASIC_CONFIG_REG;
|
||||
int runmode = bus_r(addr) & ASIC_CONFIG_RUN_MODE_MSK;
|
||||
switch (runmode) {
|
||||
case ASIC_CONFIG_RUN_MODE_CONT_VAL:
|
||||
burstMode = BURST_OFF;
|
||||
break;
|
||||
case ASIC_CONFIG_RUN_MODE_INT_BURST_VAL:
|
||||
burstMode = BURST_INTERNAL;
|
||||
break;
|
||||
case ASIC_CONFIG_RUN_MODE_EXT_BURST_VAL:
|
||||
burstMode = BURST_EXTERNAL;
|
||||
break;
|
||||
case ASIC_CONFIG_RUN_MODE_INT_CONT_VAL:
|
||||
burstMode = CONTINUOUS_INTERNAL;
|
||||
break;
|
||||
case ASIC_CONFIG_RUN_MODE_EXT_CONT_VAL:
|
||||
burstMode = CONTINUOUS_EXTERNAL;
|
||||
break;
|
||||
default:
|
||||
LOG(logERROR, ("Unknown run mode read from FPGA %d\n", runmode));
|
||||
return -1;
|
||||
@ -2430,9 +2471,13 @@ void *start_timer(void *arg) {
|
||||
|
||||
int numRepeats = getNumTriggers();
|
||||
if (getTiming() == AUTO_TIMING) {
|
||||
if (burstMode == BURST_OFF) {
|
||||
// continuous
|
||||
if (burstMode == CONTINUOUS_INTERNAL ||
|
||||
burstMode == CONTINUOUS_EXTERNAL) {
|
||||
numRepeats = 1;
|
||||
} else {
|
||||
}
|
||||
// burst
|
||||
else {
|
||||
numRepeats = getNumBursts();
|
||||
}
|
||||
}
|
||||
@ -2510,8 +2555,8 @@ void *start_timer(void *arg) {
|
||||
sendUDPPacket(1, packetData2, vetopacketsize);
|
||||
}
|
||||
LOG(logINFO,
|
||||
("Sent frame: %d (bursts: %d) [%lld]\n", frameNr, repeatNr,
|
||||
(long long unsigned int)virtual_currentFrameNumber));
|
||||
("Sent frame: %d (bursts/ triggers: %d) [%lld]\n", frameNr,
|
||||
repeatNr, (long long unsigned int)virtual_currentFrameNumber));
|
||||
clock_gettime(CLOCK_REALTIME, &end);
|
||||
int64_t timeNs = ((end.tv_sec - begin.tv_sec) * 1E9 +
|
||||
(end.tv_nsec - begin.tv_nsec));
|
||||
@ -2556,7 +2601,7 @@ int stopStateMachine() {
|
||||
#ifdef VIRTUAL
|
||||
sharedMemory_setStop(1);
|
||||
while (sharedMemory_getStatus() == RUNNING)
|
||||
;
|
||||
usleep(500);
|
||||
sharedMemory_setStop(0);
|
||||
LOG(logINFO, ("Stopped State Machine\n"));
|
||||
return OK;
|
||||
|
@ -46,8 +46,8 @@
|
||||
#define DEFAULT_CURRENT_SOURCE (0)
|
||||
#define DEFAULT_TIMING_SOURCE (TIMING_INTERNAL)
|
||||
|
||||
#define DEFAULT_READOUT_C0 (8) //(108333336) // rdo_clk, 108 MHz
|
||||
#define DEFAULT_READOUT_C1 (8) //(108333336) // rdo_x2_clk, 108 MHz
|
||||
#define DEFAULT_READOUT_C0 (6) //(144444448) // rdo_clk, 144 MHz
|
||||
#define DEFAULT_READOUT_C1 (6) //(144444448) // rdo_x2_clk, 144 MHz
|
||||
#define DEFAULT_SYSTEM_C0 (5) //(144444448) // run_clk, 144 MHz
|
||||
#define DEFAULT_SYSTEM_C1 (10) //(72222224) // chip_clk, 72 MHz
|
||||
#define DEFAULT_SYSTEM_C2 (5) //(144444448) // sync_clk, 144 MHz
|
||||
|
Binary file not shown.
@ -1630,7 +1630,7 @@ int stopStateMachine() {
|
||||
sharedMemory_setStop(1);
|
||||
// read till status is idle
|
||||
while (sharedMemory_getStatus() == RUNNING)
|
||||
;
|
||||
usleep(500);
|
||||
sharedMemory_setStop(0);
|
||||
LOG(logINFO, ("Stopped State Machine\n"));
|
||||
}
|
||||
|
Binary file not shown.
@ -1818,7 +1818,7 @@ int stopStateMachine() {
|
||||
sharedMemory_setStop(1);
|
||||
// read till status is idle
|
||||
while (sharedMemory_getStatus() == RUNNING)
|
||||
;
|
||||
usleep(500);
|
||||
sharedMemory_setStop(0);
|
||||
LOG(logINFO, ("Stopped State Machine\n"));
|
||||
return OK;
|
||||
|
Binary file not shown.
@ -1980,7 +1980,7 @@ int stopStateMachine() {
|
||||
sharedMemory_setStop(1);
|
||||
// read till status is idle
|
||||
while (sharedMemory_getStatus() == RUNNING)
|
||||
;
|
||||
usleep(500);
|
||||
sharedMemory_setStop(0);
|
||||
LOG(logINFO, ("Stopped State Machine\n"));
|
||||
return OK;
|
||||
|
@ -49,6 +49,10 @@
|
||||
#define BASE_ASIC_RDO (0x00500) // 0x1806_0500 - 0x1806_050F
|
||||
// https://git.psi.ch/sls_detectors_firmware/mythen_III_mcb/blob/master/code/hdl/asic_rdo/asic_rdo.vhd
|
||||
|
||||
/** Dead time Free Controller */
|
||||
#define BASE_DEADTIME_FREE_CTRL (0x00580) // 0x1806_0580 - 0x1806_0587
|
||||
// https://git.psi.ch/sls_detectors_firmware/mythen_III_mcb/blob/master/code/hdl/DeadTimeFreeController/DeadTimeFreeCtrl.vhd
|
||||
|
||||
/* UDP datagram generator */
|
||||
#define BASE_UDP_RAM (0x01000) // 0x1806_1000 - 0x1806_1FFF
|
||||
|
||||
@ -140,6 +144,13 @@
|
||||
|
||||
#define DTA_OFFSET_REG (0x24 * REG_OFFSET + BASE_CONTROL)
|
||||
|
||||
/* Formatting for data core -----------------------------------------------*/
|
||||
#define FMT_CONFIG_REG (0x00 * REG_OFFSET + BASE_FMT)
|
||||
|
||||
#define FMT_CONFIG_TXN_DELAY_OFST (0)
|
||||
#define FMT_CONFIG_TXN_DELAY_MSK (0x00FFFFFF << FMT_CONFIG_TXN_DELAY_OFST)
|
||||
|
||||
|
||||
/* Packetizer -------------------------------------------------------------*/
|
||||
|
||||
/* Packetizer Config Register */
|
||||
@ -460,4 +471,15 @@
|
||||
#define ASICRDO_CNFG_RESSTRG_LNGTH_OFST (0)
|
||||
#define ASICRDO_CNFG_RESSTRG_LNGTH_MSK (0x000000FF << ASICRDO_CNFG_RESSTRG_LNGTH_OFST)
|
||||
|
||||
|
||||
/** Dead time Free Controller
|
||||
* --------------------------------------------------*/
|
||||
|
||||
#define DEADTIME_CONFIG_REG (0x00 * REG_OFFSET + BASE_DEADTIME_FREE_CTRL)
|
||||
|
||||
#define DEADTIME_FREE_MODE_ENBL_OFST (0)
|
||||
#define DEADTIME_FREE_MODE_ENBL_MSK (0x00000001 << DEADTIME_FREE_MODE_ENBL_OFST)
|
||||
#define DEADTIME_EARLY_EXP_FIN_ERR_OFST (4)
|
||||
#define DEADTIME_EARLY_EXP_FIN_ERR_MSK (0x00000001 << DEADTIME_EARLY_EXP_FIN_ERR_OFST)
|
||||
|
||||
// clang-format on
|
Binary file not shown.
@ -249,15 +249,15 @@ u_int16_t getHardwareVersionNumber() {
|
||||
#ifdef VIRTUAL
|
||||
return 0;
|
||||
#endif
|
||||
return bus_r(MCB_SERIAL_NO_REG);
|
||||
return ((bus_r(MCB_SERIAL_NO_REG) & MCB_SERIAL_NO_VRSN_MSK) >>
|
||||
MCB_SERIAL_NO_VRSN_OFST);
|
||||
}
|
||||
|
||||
u_int32_t getDetectorNumber() {
|
||||
#ifdef VIRTUAL
|
||||
return 0;
|
||||
#endif
|
||||
return ((bus_r(MCB_SERIAL_NO_REG) & MCB_SERIAL_NO_VRSN_MSK) >>
|
||||
MCB_SERIAL_NO_VRSN_OFST);
|
||||
return bus_r(MCB_SERIAL_NO_REG);
|
||||
}
|
||||
|
||||
u_int64_t getDetectorMAC() {
|
||||
@ -378,6 +378,7 @@ void setupDetector() {
|
||||
clkDivider[SYSTEM_C0] = DEFAULT_SYSTEM_C0;
|
||||
clkDivider[SYSTEM_C1] = DEFAULT_SYSTEM_C1;
|
||||
clkDivider[SYSTEM_C2] = DEFAULT_SYSTEM_C2;
|
||||
clkDivider[SYSTEM_C3] = DEFAULT_SYSTEM_C3;
|
||||
|
||||
highvoltage = 0;
|
||||
trimmingPrint = logINFO;
|
||||
@ -572,240 +573,28 @@ int setDynamicRange(int dr) {
|
||||
}
|
||||
}
|
||||
|
||||
/* parameters - module, speed, readout */
|
||||
/* set parameters - readout */
|
||||
|
||||
int setModule(sls_detector_module myMod, char *mess) {
|
||||
|
||||
LOG(logINFO, ("Setting module\n"));
|
||||
|
||||
/* future implementation
|
||||
// settings (not yet implemented)
|
||||
setSettings((enum detectorSettings)myMod.reg);
|
||||
if (myMod.reg >= 0) {
|
||||
detectorModules->reg = myMod.reg;
|
||||
}
|
||||
|
||||
// threshold
|
||||
if (myMod.eV >= 0)
|
||||
setThresholdEnergy(myMod.eV);
|
||||
else {
|
||||
// (loading a random trim file) (dont return fail)
|
||||
setSettings(UNDEFINED);
|
||||
LOG(logERROR,
|
||||
("Settings has been changed to undefined (random trim
|
||||
file)\n"));
|
||||
}
|
||||
*/
|
||||
|
||||
// dacs
|
||||
for (int i = 0; i < NDAC; ++i) {
|
||||
// ignore dacs with -1
|
||||
if (myMod.dacs[i] != -1) {
|
||||
setDAC((enum DACINDEX)i, myMod.dacs[i], 0);
|
||||
if (myMod.dacs[i] != detectorDacs[i]) {
|
||||
sprintf(mess, "Could not set module. Could not set dac %d\n",
|
||||
i);
|
||||
LOG(logERROR, (mess));
|
||||
// setSettings(UNDEFINED);
|
||||
// LOG(logERROR, ("Settings has been changed to undefined\n"));
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// trimbits
|
||||
if (myMod.nchan == 0) {
|
||||
LOG(logINFO, ("Setting module without trimbits\n"));
|
||||
} else {
|
||||
// set trimbits
|
||||
if (setTrimbits(myMod.chanregs) == FAIL) {
|
||||
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"));
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
int setBit(int ibit, int patword) { return patword |= (1 << ibit); }
|
||||
|
||||
int clearBit(int ibit, int patword) { return patword &= ~(1 << ibit); }
|
||||
|
||||
int setTrimbits(int *trimbits) {
|
||||
LOG(logINFOBLUE, ("Setting trimbits\n"));
|
||||
|
||||
// validate
|
||||
for (int ichan = 0; ichan < ((detectorModules)->nchan); ++ichan) {
|
||||
if (trimbits[ichan] < 0 || trimbits[ichan] > 63) {
|
||||
LOG(logERROR, ("Trimbit value (%d) for channel %d is invalid\n",
|
||||
trimbits[ichan], ichan));
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
LOG(logINFO, ("Trimbits validated\n"));
|
||||
trimmingPrint = logDEBUG5;
|
||||
|
||||
uint64_t patword = 0;
|
||||
int iaddr = 0;
|
||||
for (int ichip = 0; ichip < NCHIP; ichip++) {
|
||||
LOG(logDEBUG1, (" Chip %d\n", ichip));
|
||||
iaddr = 0;
|
||||
patword = 0;
|
||||
writePatternWord(iaddr++, patword);
|
||||
|
||||
// chip select
|
||||
patword = setBit(SIGNAL_TBLoad_1 + ichip, patword);
|
||||
writePatternWord(iaddr++, patword);
|
||||
|
||||
// reset trimbits
|
||||
patword = setBit(SIGNAL_resStorage, patword);
|
||||
patword = setBit(SIGNAL_resCounter, patword);
|
||||
writePatternWord(iaddr++, patword);
|
||||
writePatternWord(iaddr++, patword);
|
||||
patword = clearBit(SIGNAL_resStorage, patword);
|
||||
patword = clearBit(SIGNAL_resCounter, patword);
|
||||
writePatternWord(iaddr++, patword);
|
||||
writePatternWord(iaddr++, patword);
|
||||
|
||||
// select first channel
|
||||
patword = setBit(SIGNAL_CHSserialIN, patword);
|
||||
writePatternWord(iaddr++, patword);
|
||||
// 1 clk pulse
|
||||
patword = setBit(SIGNAL_CHSclk, patword);
|
||||
writePatternWord(iaddr++, patword);
|
||||
patword = clearBit(SIGNAL_CHSclk, patword);
|
||||
// clear 1st channel
|
||||
writePatternWord(iaddr++, patword);
|
||||
patword = clearBit(SIGNAL_CHSserialIN, patword);
|
||||
// 2 clk pulses
|
||||
for (int i = 0; i < 2; i++) {
|
||||
patword = setBit(SIGNAL_CHSclk, patword);
|
||||
writePatternWord(iaddr++, patword);
|
||||
patword = clearBit(SIGNAL_CHSclk, patword);
|
||||
writePatternWord(iaddr++, patword);
|
||||
}
|
||||
|
||||
// for each channel (all chips)
|
||||
for (int ich = 0; ich < NCHAN_1_COUNTER; ich++) {
|
||||
LOG(logDEBUG1, (" Chip %d, Channel %d\n", ichip, ich));
|
||||
int val = trimbits[ichip * NCHAN_1_COUNTER * NCOUNTERS +
|
||||
NCOUNTERS * ich] +
|
||||
trimbits[ichip * NCHAN_1_COUNTER * NCOUNTERS +
|
||||
NCOUNTERS * ich + 1] *
|
||||
64 +
|
||||
trimbits[ichip * NCHAN_1_COUNTER * NCOUNTERS +
|
||||
NCOUNTERS * ich + 2] *
|
||||
64 * 64;
|
||||
|
||||
// push 6 0 bits
|
||||
for (int i = 0; i < 6; i++) {
|
||||
patword = clearBit(SIGNAL_serialIN, patword);
|
||||
patword = clearBit(SIGNAL_clk, patword);
|
||||
writePatternWord(iaddr++, patword);
|
||||
patword = setBit(SIGNAL_clk, patword);
|
||||
writePatternWord(iaddr++, patword);
|
||||
}
|
||||
|
||||
// deserialize
|
||||
for (int i = 0; i < 18; i++) {
|
||||
if (val & (1 << i)) {
|
||||
patword = setBit(SIGNAL_serialIN, patword);
|
||||
} else {
|
||||
patword = clearBit(SIGNAL_serialIN, patword);
|
||||
}
|
||||
patword = clearBit(SIGNAL_clk, patword);
|
||||
writePatternWord(iaddr++, patword);
|
||||
|
||||
patword = setBit(SIGNAL_clk, patword);
|
||||
writePatternWord(iaddr++, patword);
|
||||
}
|
||||
writePatternWord(iaddr++, patword);
|
||||
writePatternWord(iaddr++, patword);
|
||||
|
||||
// move to next channel
|
||||
for (int i = 0; i < 3; i++) {
|
||||
patword = setBit(SIGNAL_CHSclk, patword);
|
||||
writePatternWord(iaddr++, patword);
|
||||
patword = clearBit(SIGNAL_CHSclk, patword);
|
||||
writePatternWord(iaddr++, patword);
|
||||
}
|
||||
}
|
||||
// chip unselect
|
||||
patword = clearBit(SIGNAL_TBLoad_1 + ichip, patword);
|
||||
writePatternWord(iaddr++, patword);
|
||||
|
||||
// last iaddr check
|
||||
if (iaddr >= MAX_PATTERN_LENGTH) {
|
||||
LOG(logERROR, ("Addr 0x%x is past max_address_length 0x%x!\n",
|
||||
iaddr, MAX_PATTERN_LENGTH));
|
||||
trimmingPrint = logINFO;
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
// set pattern wait address
|
||||
for (int i = 0; i <= 2; i++)
|
||||
setPatternWaitAddress(i, MAX_PATTERN_LENGTH - 1);
|
||||
|
||||
// pattern loop
|
||||
for (int i = 0; i <= 2; i++) {
|
||||
int stop = MAX_PATTERN_LENGTH - 1, nloop = 0;
|
||||
setPatternLoop(i, &stop, &stop, &nloop);
|
||||
}
|
||||
|
||||
// pattern limits
|
||||
{
|
||||
int start = 0, nloop = 0;
|
||||
setPatternLoop(-1, &start, &iaddr, &nloop);
|
||||
}
|
||||
// send pattern to the chips
|
||||
startPattern();
|
||||
}
|
||||
|
||||
// copy trimbits locally
|
||||
for (int ichan = 0; ichan < ((detectorModules)->nchan); ++ichan) {
|
||||
detectorChans[ichan] = trimbits[ichan];
|
||||
}
|
||||
trimmingPrint = logINFO;
|
||||
LOG(logINFO, ("All trimbits have been loaded\n"));
|
||||
return OK;
|
||||
}
|
||||
|
||||
int setAllTrimbits(int val) {
|
||||
int *trimbits = malloc(sizeof(int) * ((detectorModules)->nchan));
|
||||
for (int ichan = 0; ichan < ((detectorModules)->nchan); ++ichan) {
|
||||
trimbits[ichan] = val;
|
||||
}
|
||||
if (setTrimbits(trimbits) == FAIL) {
|
||||
LOG(logERROR, ("Could not set all trimbits to %d\n", val));
|
||||
free(trimbits);
|
||||
int setParallelMode(int mode) {
|
||||
if (mode < 0)
|
||||
return FAIL;
|
||||
LOG(logINFO, ("Setting %s mode\n", (mode ? "Parallel" : "Non Parallel")));
|
||||
uint32_t addr = DEADTIME_CONFIG_REG;
|
||||
if (mode) {
|
||||
bus_w(addr, bus_r(addr) | DEADTIME_FREE_MODE_ENBL_MSK);
|
||||
} else {
|
||||
bus_w(addr, bus_r(addr) & ~DEADTIME_FREE_MODE_ENBL_MSK);
|
||||
}
|
||||
// setSettings(UNDEFINED);
|
||||
// LOG(logERROR, ("Settings has been changed to undefined (random "
|
||||
// "trim file)\n"));
|
||||
LOG(logINFO, ("All trimbits have been set to %d\n", val));
|
||||
free(trimbits);
|
||||
return OK;
|
||||
}
|
||||
|
||||
int getAllTrimbits() {
|
||||
int value = detectorChans[0];
|
||||
if (detectorModules) {
|
||||
for (int ichan = 0; ichan < ((detectorModules)->nchan); ichan++) {
|
||||
if (detectorChans[ichan] != value) {
|
||||
value = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
LOG(logINFO, ("Value of all Trimbits: %d\n", value));
|
||||
return value;
|
||||
int getParallelMode() {
|
||||
return ((bus_r(DEADTIME_CONFIG_REG) & DEADTIME_FREE_MODE_ENBL_MSK) >>
|
||||
DEADTIME_FREE_MODE_ENBL_OFST);
|
||||
}
|
||||
|
||||
/* parameters - timer */
|
||||
|
||||
void setNumFrames(int64_t val) {
|
||||
if (val > 0) {
|
||||
LOG(logINFO, ("Setting number of frames %lld\n", (long long int)val));
|
||||
@ -1147,6 +936,240 @@ int64_t getMeasurementTime() {
|
||||
(1E-9 * FIXED_PLL_FREQUENCY);
|
||||
}
|
||||
|
||||
/* parameters - module, speed, readout */
|
||||
|
||||
int setModule(sls_detector_module myMod, char *mess) {
|
||||
|
||||
LOG(logINFO, ("Setting module\n"));
|
||||
|
||||
/* future implementation
|
||||
// settings (not yet implemented)
|
||||
setSettings((enum detectorSettings)myMod.reg);
|
||||
if (myMod.reg >= 0) {
|
||||
detectorModules->reg = myMod.reg;
|
||||
}
|
||||
|
||||
// threshold
|
||||
if (myMod.eV >= 0)
|
||||
setThresholdEnergy(myMod.eV);
|
||||
else {
|
||||
// (loading a random trim file) (dont return fail)
|
||||
setSettings(UNDEFINED);
|
||||
LOG(logERROR,
|
||||
("Settings has been changed to undefined (random trim
|
||||
file)\n"));
|
||||
}
|
||||
*/
|
||||
|
||||
// dacs
|
||||
for (int i = 0; i < NDAC; ++i) {
|
||||
// ignore dacs with -1
|
||||
if (myMod.dacs[i] != -1) {
|
||||
setDAC((enum DACINDEX)i, myMod.dacs[i], 0);
|
||||
if (myMod.dacs[i] != detectorDacs[i]) {
|
||||
sprintf(mess, "Could not set module. Could not set dac %d\n",
|
||||
i);
|
||||
LOG(logERROR, (mess));
|
||||
// setSettings(UNDEFINED);
|
||||
// LOG(logERROR, ("Settings has been changed to undefined\n"));
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// trimbits
|
||||
if (myMod.nchan == 0) {
|
||||
LOG(logINFO, ("Setting module without trimbits\n"));
|
||||
} else {
|
||||
// set trimbits
|
||||
if (setTrimbits(myMod.chanregs) == FAIL) {
|
||||
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"));
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
int setBit(int ibit, int patword) { return patword |= (1 << ibit); }
|
||||
|
||||
int clearBit(int ibit, int patword) { return patword &= ~(1 << ibit); }
|
||||
|
||||
int setTrimbits(int *trimbits) {
|
||||
LOG(logINFOBLUE, ("Setting trimbits\n"));
|
||||
|
||||
// validate
|
||||
for (int ichan = 0; ichan < ((detectorModules)->nchan); ++ichan) {
|
||||
if (trimbits[ichan] < 0 || trimbits[ichan] > 63) {
|
||||
LOG(logERROR, ("Trimbit value (%d) for channel %d is invalid\n",
|
||||
trimbits[ichan], ichan));
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
LOG(logINFO, ("Trimbits validated\n"));
|
||||
trimmingPrint = logDEBUG5;
|
||||
|
||||
uint64_t patword = 0;
|
||||
int iaddr = 0;
|
||||
for (int ichip = 0; ichip < NCHIP; ichip++) {
|
||||
LOG(logDEBUG1, (" Chip %d\n", ichip));
|
||||
iaddr = 0;
|
||||
patword = 0;
|
||||
writePatternWord(iaddr++, patword);
|
||||
|
||||
// chip select
|
||||
patword = setBit(SIGNAL_TBLoad_1 + ichip, patword);
|
||||
writePatternWord(iaddr++, patword);
|
||||
|
||||
// reset trimbits
|
||||
patword = setBit(SIGNAL_resStorage, patword);
|
||||
patword = setBit(SIGNAL_resCounter, patword);
|
||||
writePatternWord(iaddr++, patword);
|
||||
writePatternWord(iaddr++, patword);
|
||||
patword = clearBit(SIGNAL_resStorage, patword);
|
||||
patword = clearBit(SIGNAL_resCounter, patword);
|
||||
writePatternWord(iaddr++, patword);
|
||||
writePatternWord(iaddr++, patword);
|
||||
|
||||
// select first channel
|
||||
patword = setBit(SIGNAL_CHSserialIN, patword);
|
||||
writePatternWord(iaddr++, patword);
|
||||
// 1 clk pulse
|
||||
patword = setBit(SIGNAL_CHSclk, patword);
|
||||
writePatternWord(iaddr++, patword);
|
||||
patword = clearBit(SIGNAL_CHSclk, patword);
|
||||
// clear 1st channel
|
||||
writePatternWord(iaddr++, patword);
|
||||
patword = clearBit(SIGNAL_CHSserialIN, patword);
|
||||
// 2 clk pulses
|
||||
for (int i = 0; i < 2; i++) {
|
||||
patword = setBit(SIGNAL_CHSclk, patword);
|
||||
writePatternWord(iaddr++, patword);
|
||||
patword = clearBit(SIGNAL_CHSclk, patword);
|
||||
writePatternWord(iaddr++, patword);
|
||||
}
|
||||
|
||||
// for each channel (all chips)
|
||||
for (int ich = 0; ich < NCHAN_1_COUNTER; ich++) {
|
||||
LOG(logDEBUG1, (" Chip %d, Channel %d\n", ichip, ich));
|
||||
int val = trimbits[ichip * NCHAN_1_COUNTER * NCOUNTERS +
|
||||
NCOUNTERS * ich] +
|
||||
trimbits[ichip * NCHAN_1_COUNTER * NCOUNTERS +
|
||||
NCOUNTERS * ich + 1] *
|
||||
64 +
|
||||
trimbits[ichip * NCHAN_1_COUNTER * NCOUNTERS +
|
||||
NCOUNTERS * ich + 2] *
|
||||
64 * 64;
|
||||
|
||||
// push 6 0 bits
|
||||
for (int i = 0; i < 6; i++) {
|
||||
patword = clearBit(SIGNAL_serialIN, patword);
|
||||
patword = clearBit(SIGNAL_clk, patword);
|
||||
writePatternWord(iaddr++, patword);
|
||||
patword = setBit(SIGNAL_clk, patword);
|
||||
writePatternWord(iaddr++, patword);
|
||||
}
|
||||
|
||||
// deserialize
|
||||
for (int i = 0; i < 18; i++) {
|
||||
if (val & (1 << i)) {
|
||||
patword = setBit(SIGNAL_serialIN, patword);
|
||||
} else {
|
||||
patword = clearBit(SIGNAL_serialIN, patword);
|
||||
}
|
||||
patword = clearBit(SIGNAL_clk, patword);
|
||||
writePatternWord(iaddr++, patword);
|
||||
|
||||
patword = setBit(SIGNAL_clk, patword);
|
||||
writePatternWord(iaddr++, patword);
|
||||
}
|
||||
writePatternWord(iaddr++, patword);
|
||||
writePatternWord(iaddr++, patword);
|
||||
|
||||
// move to next channel
|
||||
for (int i = 0; i < 3; i++) {
|
||||
patword = setBit(SIGNAL_CHSclk, patword);
|
||||
writePatternWord(iaddr++, patword);
|
||||
patword = clearBit(SIGNAL_CHSclk, patword);
|
||||
writePatternWord(iaddr++, patword);
|
||||
}
|
||||
}
|
||||
// chip unselect
|
||||
patword = clearBit(SIGNAL_TBLoad_1 + ichip, patword);
|
||||
writePatternWord(iaddr++, patword);
|
||||
|
||||
// last iaddr check
|
||||
if (iaddr >= MAX_PATTERN_LENGTH) {
|
||||
LOG(logERROR, ("Addr 0x%x is past max_address_length 0x%x!\n",
|
||||
iaddr, MAX_PATTERN_LENGTH));
|
||||
trimmingPrint = logINFO;
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
// set pattern wait address
|
||||
for (int i = 0; i <= 2; i++)
|
||||
setPatternWaitAddress(i, MAX_PATTERN_LENGTH - 1);
|
||||
|
||||
// pattern loop
|
||||
for (int i = 0; i <= 2; i++) {
|
||||
int stop = MAX_PATTERN_LENGTH - 1, nloop = 0;
|
||||
setPatternLoop(i, &stop, &stop, &nloop);
|
||||
}
|
||||
|
||||
// pattern limits
|
||||
{
|
||||
int start = 0, nloop = 0;
|
||||
setPatternLoop(-1, &start, &iaddr, &nloop);
|
||||
}
|
||||
// send pattern to the chips
|
||||
startPattern();
|
||||
}
|
||||
|
||||
// copy trimbits locally
|
||||
for (int ichan = 0; ichan < ((detectorModules)->nchan); ++ichan) {
|
||||
detectorChans[ichan] = trimbits[ichan];
|
||||
}
|
||||
trimmingPrint = logINFO;
|
||||
LOG(logINFO, ("All trimbits have been loaded\n"));
|
||||
return OK;
|
||||
}
|
||||
|
||||
int setAllTrimbits(int val) {
|
||||
int *trimbits = malloc(sizeof(int) * ((detectorModules)->nchan));
|
||||
for (int ichan = 0; ichan < ((detectorModules)->nchan); ++ichan) {
|
||||
trimbits[ichan] = val;
|
||||
}
|
||||
if (setTrimbits(trimbits) == FAIL) {
|
||||
LOG(logERROR, ("Could not set all trimbits to %d\n", val));
|
||||
free(trimbits);
|
||||
return FAIL;
|
||||
}
|
||||
// setSettings(UNDEFINED);
|
||||
// LOG(logERROR, ("Settings has been changed to undefined (random "
|
||||
// "trim file)\n"));
|
||||
LOG(logINFO, ("All trimbits have been set to %d\n", val));
|
||||
free(trimbits);
|
||||
return OK;
|
||||
}
|
||||
|
||||
int getAllTrimbits() {
|
||||
int value = detectorChans[0];
|
||||
if (detectorModules) {
|
||||
for (int ichan = 0; ichan < ((detectorModules)->nchan); ichan++) {
|
||||
if (detectorChans[ichan] != value) {
|
||||
value = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
LOG(logINFO, ("Value of all Trimbits: %d\n", value));
|
||||
return value;
|
||||
}
|
||||
|
||||
/* parameters - dac, hv */
|
||||
void setDAC(enum DACINDEX ind, int val, int mV) {
|
||||
if (val < 0) {
|
||||
@ -2044,6 +2067,7 @@ int setClockDivider(enum CLKINDEX ind, int val) {
|
||||
clkPhase[SYSTEM_C0] = 0;
|
||||
clkPhase[SYSTEM_C1] = 0;
|
||||
clkPhase[SYSTEM_C2] = 0;
|
||||
clkPhase[SYSTEM_C3] = 0;
|
||||
}
|
||||
|
||||
// set the phase in degrees (reset by pll)
|
||||
@ -2067,6 +2091,28 @@ int getClockDivider(enum CLKINDEX ind) {
|
||||
return clkDivider[ind];
|
||||
}
|
||||
|
||||
int getTransmissionDelayFrame() {
|
||||
return ((bus_r(FMT_CONFIG_REG) & FMT_CONFIG_TXN_DELAY_MSK) >>
|
||||
FMT_CONFIG_TXN_DELAY_OFST);
|
||||
}
|
||||
|
||||
int setTransmissionDelayFrame(int value) {
|
||||
if (value < 0 || value > MAX_TIMESLOT_VAL) {
|
||||
LOG(logERROR, ("Transmission delay %d should be in range: 0 - %d\n",
|
||||
value, MAX_TIMESLOT_VAL));
|
||||
return FAIL;
|
||||
}
|
||||
LOG(logINFO, ("Setting transmission delay: %d\n", value));
|
||||
uint32_t addr = FMT_CONFIG_REG;
|
||||
bus_w(addr, bus_r(addr) & ~FMT_CONFIG_TXN_DELAY_MSK);
|
||||
bus_w(addr, (bus_r(addr) | ((value << FMT_CONFIG_TXN_DELAY_OFST) &
|
||||
FMT_CONFIG_TXN_DELAY_MSK)));
|
||||
LOG(logDEBUG1, ("Transmission delay read %d\n",
|
||||
((bus_r(addr) & FMT_CONFIG_TXN_DELAY_MSK) >>
|
||||
FMT_CONFIG_TXN_DELAY_OFST)));
|
||||
return OK;
|
||||
}
|
||||
|
||||
/* aquisition */
|
||||
|
||||
int startStateMachine() {
|
||||
@ -2239,7 +2285,7 @@ int stopStateMachine() {
|
||||
sharedMemory_setStop(1);
|
||||
// read till status is idle
|
||||
while (sharedMemory_getStatus() == RUNNING)
|
||||
;
|
||||
usleep(500);
|
||||
sharedMemory_setStop(0);
|
||||
LOG(logINFO, ("Stopped State Machine\n"));
|
||||
}
|
||||
@ -2294,8 +2340,17 @@ enum runStatus getRunStatus() {
|
||||
|
||||
// not running
|
||||
else {
|
||||
// error from too short exptime in parallel mode
|
||||
uint32_t deadtimeReg = bus_r(DEADTIME_CONFIG_REG);
|
||||
if ((deadtimeReg & DEADTIME_EARLY_EXP_FIN_ERR_MSK) >>
|
||||
DEADTIME_EARLY_EXP_FIN_ERR_OFST) {
|
||||
LOG(logERROR,
|
||||
("Status: ERROR in Dead Time Reg (too short exptime) %08x\n",
|
||||
deadtimeReg));
|
||||
s = ERROR;
|
||||
}
|
||||
// stopped or error
|
||||
if (retval & FLOW_STATUS_FIFO_FULL_MSK) {
|
||||
else if (retval & FLOW_STATUS_FIFO_FULL_MSK) {
|
||||
LOG(logINFOBLUE, ("Status: STOPPED\n")); // FIFO FULL??
|
||||
s = STOPPED;
|
||||
} else if (retval & FLOW_STATUS_CSM_BUSY_MSK) {
|
||||
|
@ -36,18 +36,20 @@
|
||||
#define DEFAULT_DELAY_AFTER_TRIGGER (0)
|
||||
#define DEFAULT_HIGH_VOLTAGE (0)
|
||||
#define DEFAULT_TIMING_MODE (AUTO_TIMING)
|
||||
#define DEFAULT_READOUT_C0 (10) //(125000000) // rdo_clk, 125 MHz
|
||||
#define DEFAULT_READOUT_C1 (10) //(125000000) // rdo_x2_clk, 125 MHz
|
||||
#define DEFAULT_READOUT_C0 (8) //(125000000) // rdo_clk, 125 MHz
|
||||
#define DEFAULT_READOUT_C1 (8) //(125000000) // rdo_x2_clk, 125 MHz
|
||||
#define DEFAULT_SYSTEM_C0 (4) //(250000000) // run_clk, 250 MHz
|
||||
#define DEFAULT_SYSTEM_C1 (8) //(125000000) // chip_clk, 125 MHz
|
||||
#define DEFAULT_SYSTEM_C2 (8) //(125000000) // sync_clk, 125 MHz
|
||||
#define DEFAULT_SYSTEM_C1 (8) //(125000000) // sync_clk, 125 MHz
|
||||
#define DEFAULT_SYSTEM_C2 (8) //(125000000) // str_clk, 125 MHz
|
||||
#define DEFAULT_SYSTEM_C3 (5) //(200000000) // smp_clk, 200 MHz (only for timing receiver)
|
||||
#define DEFAULT_ASIC_LATCHING_NUM_PULSES (10)
|
||||
#define DEFAULT_MSTR_OTPT_P1_NUM_PULSES (20)
|
||||
|
||||
/* Firmware Definitions */
|
||||
#define MAX_TIMESLOT_VAL (0xFFFFFF)
|
||||
#define IP_HEADER_SIZE (20)
|
||||
#define FIXED_PLL_FREQUENCY (020000000) // 20MHz
|
||||
#define READOUT_PLL_VCO_FREQ_HZ (1250000000) // 1.25GHz
|
||||
#define READOUT_PLL_VCO_FREQ_HZ (1000000000) // 1GHz
|
||||
#define SYSTEM_PLL_VCO_FREQ_HZ (1000000000) // 1GHz
|
||||
#define MAX_NUM_DESERIALIZERS (40)
|
||||
|
||||
@ -104,10 +106,11 @@ enum CLKINDEX {
|
||||
SYSTEM_C0,
|
||||
SYSTEM_C1,
|
||||
SYSTEM_C2,
|
||||
SYSTEM_C3,
|
||||
NUM_CLOCKS
|
||||
};
|
||||
#define CLK_NAMES \
|
||||
"READOUT_C0", "READOUT_C1", "SYSTEM_C0", "SYSTEM_C1", "SYSTEM_C2"
|
||||
"READOUT_C0", "READOUT_C1", "SYSTEM_C0", "SYSTEM_C1", "SYSTEM_C2", "SYSTEM_C3"
|
||||
enum PLLINDEX { READOUT_PLL, SYSTEM_PLL };
|
||||
|
||||
/* Struct Definitions */
|
||||
|
@ -179,9 +179,11 @@ int setExternalSampling(int val);
|
||||
#endif
|
||||
|
||||
// parameters - readout
|
||||
#ifdef EIGERD
|
||||
#if defined(EIGERD) || defined(MYTHEN3D)
|
||||
int setParallelMode(int mode);
|
||||
int getParallelMode();
|
||||
#endif
|
||||
#ifdef EIGERD
|
||||
int setOverFlowMode(int mode);
|
||||
int getOverFlowMode();
|
||||
#endif
|
||||
@ -277,9 +279,9 @@ int64_t getMeasurementTime();
|
||||
int setModule(sls_detector_module myMod, char *mess);
|
||||
#endif
|
||||
#ifdef MYTHEN3D
|
||||
int setTrimbits(int *trimbits);
|
||||
int setBit(int ibit, int patword);
|
||||
int clearBit(int ibit, int patword);
|
||||
int setTrimbits(int *trimbits);
|
||||
int setAllTrimbits(int val);
|
||||
int getAllTrimbits();
|
||||
#endif
|
||||
@ -531,6 +533,8 @@ int *getBadChannels(int *nch);
|
||||
#if defined(JUNGFRAUD) || defined(EIGERD)
|
||||
int getTenGigaFlowControl();
|
||||
int setTenGigaFlowControl(int value);
|
||||
#endif
|
||||
#if defined(JUNGFRAUD) || defined(EIGERD) || defined(MYTHEN3D)
|
||||
int getTransmissionDelayFrame();
|
||||
int setTransmissionDelayFrame(int value);
|
||||
#endif
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "sls_detector_defs.h"
|
||||
#include "versionAPI.h"
|
||||
|
||||
#include <getopt.h>
|
||||
#include <signal.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
@ -36,76 +37,129 @@ void sigInterruptHandler(int p) {
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
// print version
|
||||
if (argc > 1 && !strcasecmp(argv[1], "-version")) {
|
||||
int version = 0;
|
||||
#ifdef GOTTHARDD
|
||||
version = APIGOTTHARD;
|
||||
#elif EIGERD
|
||||
version = APIEIGER;
|
||||
#elif JUNGFRAUD
|
||||
version = APIJUNGFRAU;
|
||||
#elif CHIPTESTBOARDD
|
||||
version = APICTB;
|
||||
#elif MOENCHD
|
||||
version = APIMOENCH;
|
||||
#endif
|
||||
LOG(logINFO, ("SLS Detector Server %s (0x%x)\n", GITBRANCH, version));
|
||||
}
|
||||
|
||||
// options
|
||||
int portno = DEFAULT_PORTNO;
|
||||
isControlServer = 1;
|
||||
debugflag = 0;
|
||||
checkModuleFlag = 1;
|
||||
int version = 0;
|
||||
|
||||
// if socket crash, ignores SISPIPE, prevents global signal handler
|
||||
// subsequent read/write to socket gives error - must handle locally
|
||||
signal(SIGPIPE, SIG_IGN);
|
||||
// help message
|
||||
char helpMessage[MAX_STR_LENGTH];
|
||||
memset(helpMessage, 0, MAX_STR_LENGTH);
|
||||
sprintf(
|
||||
helpMessage,
|
||||
"Usage: %s [arguments]\n"
|
||||
"Possible arguments are:\n"
|
||||
"\t-v, --version : Software version\n"
|
||||
"\t-p, --port <port> : TCP communication port with client. \n"
|
||||
"\t-d, --devel : Developer mode. Skips firmware checks. \n"
|
||||
"\t-g, --nomodule : [Mythen3][Gotthard2] Generic or No "
|
||||
"Module mode. Skips detector type checks. \n"
|
||||
"\t-f, --phaseshift <value> : [Gotthard] only. Sets phase shift. \n"
|
||||
"\t-s, --stopserver : Stop server. Do not use as created by "
|
||||
"control server \n\n",
|
||||
argv[0]);
|
||||
|
||||
// circumvent the basic tests
|
||||
for (int i = 1; i < argc; ++i) {
|
||||
if (!strcasecmp(argv[i], "-stopserver")) {
|
||||
LOG(logINFO, ("Detected stop server\n"));
|
||||
isControlServer = 0;
|
||||
} else if (!strcasecmp(argv[i], "-devel")) {
|
||||
LOG(logINFO, ("Detected developer mode\n"));
|
||||
debugflag = 1;
|
||||
} else if (!strcasecmp(argv[i], "-nomodule")) {
|
||||
LOG(logINFO, ("Detected No Module mode\n"));
|
||||
checkModuleFlag = 0;
|
||||
} else if (!strcasecmp(argv[i], "-port")) {
|
||||
if ((i + 1) >= argc) {
|
||||
LOG(logERROR, ("no port value given. Exiting.\n"));
|
||||
return -1;
|
||||
}
|
||||
if (sscanf(argv[i + 1], "%d", &portno) == 0) {
|
||||
LOG(logERROR,
|
||||
("cannot decode port value %s. Exiting.\n", argv[i + 1]));
|
||||
return -1;
|
||||
// parse command line for config
|
||||
static struct option long_options[] = {
|
||||
// These options set a flag.
|
||||
// These options don’t set a flag. We distinguish them by their indices.
|
||||
{"help", no_argument, NULL, 'h'},
|
||||
{"version", no_argument, NULL, 'v'},
|
||||
{"port", required_argument, NULL, 'p'},
|
||||
{"devel", no_argument, NULL, 'd'},
|
||||
{"phaseshift", required_argument, NULL, 'f'},
|
||||
{"nomodule", no_argument, NULL, 'g'}, // generic
|
||||
{"stopserver", no_argument, NULL, 's'},
|
||||
{NULL, 0, NULL, 0}};
|
||||
|
||||
optind = 1;
|
||||
// getopt_long stores the option index here
|
||||
int option_index = 0;
|
||||
int c = 0;
|
||||
|
||||
while (c != -1) {
|
||||
c = getopt_long(argc, argv, "hvp:df:gs", long_options, &option_index);
|
||||
|
||||
// Detect the end of the options
|
||||
if (c == -1)
|
||||
break;
|
||||
|
||||
switch (c) {
|
||||
|
||||
case 'v':
|
||||
#ifdef GOTTHARDD
|
||||
version = APIGOTTHARD;
|
||||
#elif EIGERD
|
||||
version = APIEIGER;
|
||||
#elif JUNGFRAUD
|
||||
version = APIJUNGFRAU;
|
||||
#elif CHIPTESTBOARDD
|
||||
version = APICTB;
|
||||
#elif MOENCHD
|
||||
version = APIMOENCH;
|
||||
#elif MYTHEN3D
|
||||
version = APIMYTHEN3;
|
||||
#elif GOTTHARD2D
|
||||
version = APIGOTTHARD2;
|
||||
#endif
|
||||
LOG(logINFOBLUE, ("SLS Detector Server Version: %s (0x%x)\n",
|
||||
GITBRANCH, version));
|
||||
exit(EXIT_SUCCESS);
|
||||
|
||||
case 'p':
|
||||
if (sscanf(optarg, "%d", &portno) != 1) {
|
||||
LOG(logERROR, ("Cannot scan port argument\n%s", helpMessage));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
LOG(logINFO, ("Detected port: %d\n", portno));
|
||||
}
|
||||
#ifdef GOTTHARDD
|
||||
else if (!strcasecmp(argv[i], "-phaseshift")) {
|
||||
if ((i + 1) >= argc) {
|
||||
LOG(logERROR, ("no phase shift value given. Exiting.\n"));
|
||||
return -1;
|
||||
break;
|
||||
|
||||
case 'd':
|
||||
LOG(logINFO, ("Detected developer mode\n"));
|
||||
debugflag = 1;
|
||||
break;
|
||||
|
||||
case 'f':
|
||||
#ifndef GOTTHARDD
|
||||
LOG(logERROR,
|
||||
("Phase shift argument not implemented for this detector\n"));
|
||||
exit(EXIT_FAILURE);
|
||||
#else
|
||||
if (sscanf(optarg, "%d", &phaseShift) != 1) {
|
||||
LOG(logERROR,
|
||||
("Cannot scan phase shift argument\n%s", helpMessage));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (sscanf(argv[i + 1], "%d", &phaseShift) == 0) {
|
||||
LOG(logERROR, ("cannot decode phase shift value %s. Exiting.\n",
|
||||
argv[i + 1]));
|
||||
return -1;
|
||||
}
|
||||
LOG(logINFO, ("Detected phase shift of %d\n", phaseShift));
|
||||
}
|
||||
LOG(logINFO, ("Detected phase shift: %d\n", phaseShift));
|
||||
#endif
|
||||
break;
|
||||
|
||||
case 'g':
|
||||
LOG(logINFO, ("Detected generic mode (no module)\n"));
|
||||
checkModuleFlag = 0;
|
||||
break;
|
||||
|
||||
case 's':
|
||||
LOG(logINFO, ("Detected stop server\n"));
|
||||
isControlServer = 0;
|
||||
break;
|
||||
|
||||
case 'h':
|
||||
printf("%s", helpMessage);
|
||||
exit(EXIT_SUCCESS);
|
||||
default:
|
||||
printf("\n%s", helpMessage);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
// control server
|
||||
if (isControlServer) {
|
||||
LOG(logINFOBLUE, ("Control Server [%d]\n", portno));
|
||||
|
||||
// Catch signal SIGINT to destroy shm properly
|
||||
// Catch signal SIGINT (Ctrl + c) to destroy shm properly
|
||||
struct sigaction sa;
|
||||
sa.sa_flags = 0; // no flags
|
||||
sa.sa_handler = sigInterruptHandler; // handler function
|
||||
@ -122,9 +176,18 @@ int main(int argc, char *argv[]) {
|
||||
// start stop server process
|
||||
char cmd[MAX_STR_LENGTH];
|
||||
memset(cmd, 0, MAX_STR_LENGTH);
|
||||
char portCmd[256];
|
||||
memset(portCmd, 0, 256);
|
||||
sprintf(portCmd, "-p%d", portno);
|
||||
for (int i = 0; i < argc; ++i) {
|
||||
if (!strcasecmp(argv[i], "-port")) {
|
||||
i += 2;
|
||||
LOG(logINFOBLUE, ("i:%d argv[i]:%s\n", i, argv[i]));
|
||||
// remove port argument (--port) and [value]
|
||||
if (!strcasecmp(argv[i], "--port")) {
|
||||
++i;
|
||||
continue;
|
||||
}
|
||||
// remove port argument (-p[value])
|
||||
if (!strcasecmp(argv[i], portCmd)) {
|
||||
continue;
|
||||
}
|
||||
if (i > 0) {
|
||||
@ -134,7 +197,7 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
char temp[50];
|
||||
memset(temp, 0, sizeof(temp));
|
||||
sprintf(temp, " -stopserver -port %d &", portno + 1);
|
||||
sprintf(temp, " --stopserver --port %d &", portno + 1);
|
||||
strcat(cmd, temp);
|
||||
|
||||
LOG(logDEBUG1, ("Command to start stop server:%s\n", cmd));
|
||||
@ -149,6 +212,10 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
}
|
||||
|
||||
// if socket crash, ignores SISPIPE, prevents global signal handler
|
||||
// subsequent read/write to socket gives error - must handle locally
|
||||
signal(SIGPIPE, SIG_IGN);
|
||||
|
||||
init_detector();
|
||||
// bind socket
|
||||
sockfd = bindSocket(portno);
|
||||
|
@ -1940,7 +1940,9 @@ int set_num_frames(int file_des) {
|
||||
} else {
|
||||
#ifdef GOTTHARD2D
|
||||
// validate #frames in burst mode
|
||||
if (getBurstMode() != BURST_OFF && arg > MAX_FRAMES_IN_BURST_MODE) {
|
||||
enum burstMode mode = getBurstMode();
|
||||
if ((mode == BURST_INTERNAL || mode == BURST_EXTERNAL) &&
|
||||
arg > MAX_FRAMES_IN_BURST_MODE) {
|
||||
ret = FAIL;
|
||||
sprintf(mess,
|
||||
"Could not set number of frames %lld. Must be <= %d in "
|
||||
@ -3489,12 +3491,12 @@ int set_transmission_delay_frame(int file_des) {
|
||||
return printSocketReadError();
|
||||
LOG(logINFO, ("Setting transmission delay frame: %d\n", arg));
|
||||
|
||||
#if !defined(EIGERD) && !defined(JUNGFRAUD)
|
||||
#if !defined(EIGERD) && !defined(JUNGFRAUD) && !defined(MYTHEN3D)
|
||||
functionNotImplemented();
|
||||
#else
|
||||
// only set
|
||||
if (Server_VerifyLock() == OK) {
|
||||
#ifdef JUNGFRAUD
|
||||
#if defined(JUNGFRAUD) || defined(MYTHEN3D)
|
||||
if (arg > MAX_TIMESLOT_VAL) {
|
||||
ret = FAIL;
|
||||
sprintf(mess, "Transmission delay %d should be in range: 0 - %d\n",
|
||||
@ -3526,7 +3528,7 @@ int get_transmission_delay_frame(int file_des) {
|
||||
|
||||
LOG(logDEBUG1, ("Getting transmission delay frame\n"));
|
||||
|
||||
#if !defined(EIGERD) && !defined(JUNGFRAUD)
|
||||
#if !defined(EIGERD) && !defined(JUNGFRAUD) && !defined(MYTHEN3D)
|
||||
functionNotImplemented();
|
||||
#else
|
||||
// get only
|
||||
@ -5425,7 +5427,7 @@ int set_parallel_mode(int file_des) {
|
||||
return printSocketReadError();
|
||||
LOG(logINFO, ("Setting parallel mode: %u\n", arg));
|
||||
|
||||
#ifndef EIGERD
|
||||
#if !defined(EIGERD) && !defined(MYTHEN3D)
|
||||
functionNotImplemented();
|
||||
#else
|
||||
// only set
|
||||
@ -5456,7 +5458,7 @@ int get_parallel_mode(int file_des) {
|
||||
|
||||
LOG(logDEBUG1, ("Getting parallel mode\n"));
|
||||
|
||||
#ifndef EIGERD
|
||||
#if !defined(EIGERD) && !defined(MYTHEN3D)
|
||||
functionNotImplemented();
|
||||
#else
|
||||
// get only
|
||||
@ -6494,7 +6496,7 @@ int set_veto_reference(int file_des) {
|
||||
int set_burst_mode(int file_des) {
|
||||
ret = OK;
|
||||
memset(mess, 0, sizeof(mess));
|
||||
enum burstMode arg = BURST_OFF;
|
||||
enum burstMode arg = BURST_INTERNAL;
|
||||
|
||||
if (receiveData(file_des, &arg, sizeof(arg), INT32) < 0)
|
||||
return printSocketReadError();
|
||||
@ -6506,9 +6508,10 @@ int set_burst_mode(int file_des) {
|
||||
// only set
|
||||
if (Server_VerifyLock() == OK) {
|
||||
switch (arg) {
|
||||
case BURST_OFF:
|
||||
case BURST_INTERNAL:
|
||||
case BURST_EXTERNAL:
|
||||
case CONTINUOUS_INTERNAL:
|
||||
case CONTINUOUS_EXTERNAL:
|
||||
break;
|
||||
default:
|
||||
modeNotImplemented("Burst mode", (int)arg);
|
||||
@ -6533,7 +6536,7 @@ int set_burst_mode(int file_des) {
|
||||
int get_burst_mode(int file_des) {
|
||||
ret = OK;
|
||||
memset(mess, 0, sizeof(mess));
|
||||
enum burstMode retval = BURST_OFF;
|
||||
enum burstMode retval = BURST_INTERNAL;
|
||||
|
||||
LOG(logDEBUG1, ("Getting burst mode\n"));
|
||||
|
||||
@ -6938,6 +6941,16 @@ int get_receiver_parameters(int file_des) {
|
||||
if (n < 0)
|
||||
return printSocketReadError();
|
||||
|
||||
// additional storage cells
|
||||
#ifdef JUNGFRAUD
|
||||
i32 = getNumAdditionalStorageCells();
|
||||
#else
|
||||
i32 = 0;
|
||||
#endif
|
||||
n += sendData(file_des, &i32, sizeof(i32), INT32);
|
||||
if (n < 0)
|
||||
return printSocketReadError();
|
||||
|
||||
// analog samples
|
||||
#if defined(CHIPTESTBOARDD) || defined(MOENCHD)
|
||||
i32 = getNumAnalogSamples();
|
||||
@ -7015,6 +7028,26 @@ int get_receiver_parameters(int file_des) {
|
||||
if (n < 0)
|
||||
return printSocketReadError();
|
||||
|
||||
// readnlines
|
||||
#ifdef EIGERD
|
||||
i32 = getReadNLines();
|
||||
#else
|
||||
i32 = 0;
|
||||
#endif
|
||||
n += sendData(file_des, &i32, sizeof(i32), INT32);
|
||||
if (n < 0)
|
||||
return printSocketReadError();
|
||||
|
||||
// threshold ev
|
||||
#ifdef EIGERD
|
||||
i32 = getThresholdEnergy();
|
||||
#else
|
||||
i32 = 0;
|
||||
#endif
|
||||
n += sendData(file_des, &i32, sizeof(i32), INT32);
|
||||
if (n < 0)
|
||||
return printSocketReadError();
|
||||
|
||||
// dynamic range
|
||||
i32 = setDynamicRange(GET_FLAG);
|
||||
n += sendData(file_des, &i32, sizeof(i32), INT32);
|
||||
@ -7175,6 +7208,26 @@ int get_receiver_parameters(int file_des) {
|
||||
if (n < 0)
|
||||
return printSocketReadError();
|
||||
|
||||
// scan parameters
|
||||
// scan enable, dac, start, stop, step
|
||||
// scan dac settle time
|
||||
int i32s[5] = {0, 0, 0, 0, 0};
|
||||
i64 = 0;
|
||||
i32s[0] = scan;
|
||||
if (scan) {
|
||||
i32s[1] = scanGlobalIndex;
|
||||
i32s[2] = scanSteps[0];
|
||||
i32s[3] = scanSteps[numScanSteps - 1];
|
||||
i32s[4] = scanSteps[1] - scanSteps[0];
|
||||
i64 = scanSettleTime_ns;
|
||||
}
|
||||
n += sendData(file_des, i32s, sizeof(i32s), INT32);
|
||||
if (n < 0)
|
||||
return printSocketReadError();
|
||||
n += sendData(file_des, &i64, sizeof(i64), INT64);
|
||||
if (n < 0)
|
||||
return printSocketReadError();
|
||||
|
||||
LOG(logINFO, ("Sent %d bytes for receiver parameters\n", n));
|
||||
|
||||
return OK;
|
||||
|
@ -27,7 +27,7 @@ target_include_directories(slsDetectorShared PUBLIC
|
||||
|
||||
target_link_libraries(slsDetectorShared
|
||||
PUBLIC
|
||||
slsSupportLib
|
||||
slsSupportStatic
|
||||
pthread
|
||||
rt
|
||||
slsProjectOptions
|
||||
|
@ -46,14 +46,18 @@ class Detector {
|
||||
* belonging to it */
|
||||
void freeSharedMemory();
|
||||
|
||||
/** Frees shared memory before loading configuration file. Set up once
|
||||
* normally */
|
||||
void loadConfig(const std::string &fname);
|
||||
|
||||
/** Shared memory not freed prior. Set up per measurement. */
|
||||
void loadParameters(const std::string &fname);
|
||||
|
||||
void loadParameters(const std::vector<std::string> ¶meters);
|
||||
|
||||
Result<std::string> getHostname(Positions pos = {}) const;
|
||||
|
||||
/* Frees shared memory, adds detectors to the list
|
||||
* and updates local detector cache */
|
||||
/* Frees shared memory, adds detectors to the list */
|
||||
void setHostname(const std::vector<std::string> &hostname);
|
||||
|
||||
/** connects to n servers at local host starting at specific control port */
|
||||
@ -102,12 +106,14 @@ class Detector {
|
||||
/** [Jungfrau][Gotthard][Gotthard2] */
|
||||
Result<defs::detectorSettings> getSettings(Positions pos = {}) const;
|
||||
|
||||
/** [Jungfrau] Options:DYNAMICGAIN, DYNAMICHG0, FIXGAIN1, FIXGAIN2,
|
||||
* FORCESWITCHG1, FORCESWITCHG2 [Gotthard] Options: DYNAMICGAIN, HIGHGAIN,
|
||||
* LOWGAIN, MEDIUMGAIN, VERYHIGHGAIN [Gotthard2] Options: DYNAMICGAIN,
|
||||
* FIXGAIN1, FIXGAIN2 [Moench] Options: G1_HIGHGAIN, G1_LOWGAIN,
|
||||
/** [Jungfrau] DYNAMICGAIN, DYNAMICHG0, FIXGAIN1, FIXGAIN2,
|
||||
* FORCESWITCHG1, FORCESWITCHG2 [Gotthard] \n DYNAMICGAIN, HIGHGAIN,
|
||||
* LOWGAIN, MEDIUMGAIN, VERYHIGHGAIN [Gotthard2] \n DYNAMICGAIN,
|
||||
* FIXGAIN1, FIXGAIN2 [Moench] \n G1_HIGHGAIN, G1_LOWGAIN,
|
||||
* G2_HIGHCAP_HIGHGAIN, G2_HIGHCAP_LOWGAIN, G2_LOWCAP_HIGHGAIN,
|
||||
* G2_LOWCAP_LOWGAIN, G4_HIGHGAIN, G4_LOWGAIN
|
||||
* G2_LOWCAP_LOWGAIN, G4_HIGHGAIN, G4_LOWGAIN \n [Eiger] Use threshold
|
||||
* command \n [Eiger settings loaded from file found in
|
||||
* settingspath
|
||||
*/
|
||||
void setSettings(defs::detectorSettings value, Positions pos = {});
|
||||
|
||||
@ -125,8 +131,8 @@ class Detector {
|
||||
|
||||
/**
|
||||
* [Eiger][Jungfrau]
|
||||
* Only in client data call back
|
||||
* Fills in gap pixels in data
|
||||
* Include gap pixels in client data call back. Will not be in detector
|
||||
* streaming, receiver file or streaming. Default is disabled.
|
||||
*/
|
||||
void setGapPixelsinCallback(const bool enable);
|
||||
|
||||
@ -167,14 +173,21 @@ class Detector {
|
||||
|
||||
Result<int64_t> getNumberOfFrames(Positions pos = {}) const;
|
||||
|
||||
/** In trigger mode, number of frames per trigger. In scan mode, number of
|
||||
* frames is set to number of steps */
|
||||
void setNumberOfFrames(int64_t value);
|
||||
|
||||
Result<int64_t> getNumberOfTriggers(Positions pos = {}) const;
|
||||
|
||||
void setNumberOfTriggers(int64_t value);
|
||||
|
||||
/** [Gotthard][Jungfrau][Eiger][CTB][Moench][Gotthard2] \n
|
||||
* [Mythen3] use function with gate index **/
|
||||
Result<ns> getExptime(Positions pos = {}) const;
|
||||
|
||||
/** [Gotthard][Jungfrau][Eiger][CTB][Moench][Gotthard2] \n
|
||||
* [Mythen3] sets exptime for all gate signals. To specify gate index, use
|
||||
* function with gate index **/
|
||||
void setExptime(ns t, Positions pos = {});
|
||||
|
||||
Result<ns> getPeriod(Positions pos = {}) const;
|
||||
@ -206,13 +219,15 @@ class Detector {
|
||||
Result<int> getDynamicRange(Positions pos = {}) const;
|
||||
|
||||
/**
|
||||
* [Eiger] Options: 4, 8, 16, 32
|
||||
* [Mythen3] Options: 8, 16, 32
|
||||
* [Eiger] If i is 32, also sets clkdivider to 2, if 16, sets clkdivider to
|
||||
* 1
|
||||
* [Eiger] Options: 4, 8, 16, 32. If i is 32, also sets clkdivider to 2, if
|
||||
* 16, sets clkdivider to 1 \n [Mythen3] Options: 8, 16, 32 \n
|
||||
* [Jungfrau][Gotthard][Ctb][Moench][Mythen3][Gotthard2] 16
|
||||
*/
|
||||
void setDynamicRange(int value);
|
||||
|
||||
/** list of possible dynamic ranges for this detector */
|
||||
std::vector<int> getDynamicRangeList() const;
|
||||
|
||||
Result<defs::timingMode> getTimingMode(Positions pos = {}) const;
|
||||
|
||||
/**
|
||||
@ -223,17 +238,30 @@ class Detector {
|
||||
*/
|
||||
void setTimingMode(defs::timingMode value, Positions pos = {});
|
||||
|
||||
/** list of possible timing modes for this detector */
|
||||
std::vector<defs::timingMode> getTimingModeList() const;
|
||||
|
||||
/** [Eiger][Jungfrau] */
|
||||
Result<defs::speedLevel> getSpeed(Positions pos = {}) const;
|
||||
|
||||
/** [Eiger][Jungfrau]
|
||||
* Options: FULL_SPEED, HALF_SPEED, QUARTER_SPEED */
|
||||
* Options: FULL_SPEED, HALF_SPEED, QUARTER_SPEED \n
|
||||
* [Jungfrau] FULL_SPEED option only available from v2.0 boards and with
|
||||
* setting number of interfaces to 2. \n Also overwrites adcphase to
|
||||
* recommended default.
|
||||
*/
|
||||
void setSpeed(defs::speedLevel value, Positions pos = {});
|
||||
|
||||
/** [Gotthard][Jungfrau][CTB][Moench] */
|
||||
/** [Jungfrau][CTB][Moench] */
|
||||
Result<int> getADCPhase(Positions pos = {}) const;
|
||||
|
||||
/** [Gotthard][Jungfrau][CTB][Moench] */
|
||||
/** [Gotthard][Jungfrau][CTB][Moench]
|
||||
* [Jungfrau] Absolute phase shift. Changing Speed also resets adcphase to
|
||||
* recommended defaults. \n
|
||||
* [Ctb][Moench] Absolute phase shift. Changing adcclk also resets adcphase
|
||||
* and sets it to previous values. \n
|
||||
* [Gotthard] Relative phase shift
|
||||
*/
|
||||
void setADCPhase(int value, Positions pos = {});
|
||||
|
||||
/** [Jungfrau][CTB][Moench] */
|
||||
@ -242,13 +270,21 @@ class Detector {
|
||||
/** [Gotthard][Jungfrau][CTB][Moench] */
|
||||
Result<int> getADCPhaseInDegrees(Positions pos = {}) const;
|
||||
|
||||
/** [Gotthard][Jungfrau][CTB][Moench] */
|
||||
/** [Gotthard][Jungfrau][CTB][Moench]
|
||||
* [Jungfrau] Absolute phase shift. Changing Speed also resets adcphase to
|
||||
* recommended defaults. \n
|
||||
* [Ctb][Moench] Absolute phase shift. Changing adcclk also resets adcphase
|
||||
* and sets it to previous values. \n
|
||||
* [Gotthard] Relative phase shift
|
||||
*/
|
||||
void setADCPhaseInDegrees(int value, Positions pos = {});
|
||||
|
||||
/** [CTB][Jungfrau] */
|
||||
Result<int> getDBITPhase(Positions pos = {}) const;
|
||||
|
||||
/** [CTB][Jungfrau] */
|
||||
/** [CTB][Jungfrau] Absolute phase shift \n
|
||||
* [CTB] changing dbitclk also resets dbitphase and sets to previous values.
|
||||
*/
|
||||
void setDBITPhase(int value, Positions pos = {});
|
||||
|
||||
/** [CTB][Jungfrau] */
|
||||
@ -257,7 +293,9 @@ class Detector {
|
||||
/** [CTB][Jungfrau] */
|
||||
Result<int> getDBITPhaseInDegrees(Positions pos = {}) const;
|
||||
|
||||
/** [CTB][Jungfrau] */
|
||||
/** [CTB][Jungfrau] Absolute phase shift \n
|
||||
* [CTB] changing dbitclk also resets dbitphase and sets to previous values.
|
||||
*/
|
||||
void setDBITPhaseInDegrees(int value, Positions pos = {});
|
||||
|
||||
/** [Mythen3][Gotthard2] Hz */
|
||||
@ -311,6 +349,9 @@ class Detector {
|
||||
* Only for virtual servers */
|
||||
void setImageTestMode(const int value, Positions pos = {});
|
||||
|
||||
/** gets list of temperature indices for this detector */
|
||||
std::vector<defs::dacIndex> getTemperatureList() const;
|
||||
|
||||
/**
|
||||
* (Degrees)
|
||||
* [Gotthard] Options: TEMPERATURE_ADC, TEMPERATURE_FPGA
|
||||
@ -322,7 +363,7 @@ class Detector {
|
||||
*/
|
||||
Result<int> getTemperature(defs::dacIndex index, Positions pos = {}) const;
|
||||
|
||||
/** gets list of dac indices for this detector */
|
||||
/** gets list of dac enums for this detector */
|
||||
std::vector<defs::dacIndex> getDacList() const;
|
||||
|
||||
Result<int> getDAC(defs::dacIndex index, bool mV, Positions pos = {}) const;
|
||||
@ -352,6 +393,14 @@ class Detector {
|
||||
void setExternalSignalFlags(int signalIndex, defs::externalSignalFlag value,
|
||||
Positions pos = {});
|
||||
|
||||
/** [Eiger][Mythen3] */
|
||||
Result<bool> getParallelMode(Positions pos = {}) const;
|
||||
|
||||
/** [Eiger][Mythen3]
|
||||
* [Mythen3] If exposure time is too short, acquisition will return with an
|
||||
* ERROR and take fewer frames than expected */
|
||||
void setParallelMode(bool value, Positions pos = {});
|
||||
|
||||
/**************************************************
|
||||
* *
|
||||
* Acquisition *
|
||||
@ -373,32 +422,39 @@ class Detector {
|
||||
* acquisition */
|
||||
void clearAcquiringFlag();
|
||||
|
||||
/** Non Blocking: Start receiver listener*/
|
||||
/** Non Blocking: Start receiver listener and create data file if file write
|
||||
* enabled */
|
||||
void startReceiver();
|
||||
|
||||
/** Non Blocking: Stop receiver listener */
|
||||
/** Non Blocking: Stops receiver listener for detector data packets and
|
||||
closes current data file (if file write enabled). */
|
||||
void stopReceiver();
|
||||
|
||||
/** Non blocking: start detector acquisition
|
||||
* detector status changes from RUNNING to IDLE when finished */
|
||||
/** Non blocking: start detector acquisition. Status changes to RUNNING or
|
||||
* WAITING and automatically returns to idle at the end of acquisition. */
|
||||
void startDetector();
|
||||
|
||||
/** Non blocking: abort detector acquisition */
|
||||
/** Non blocking: Abort detector acquisition. Status changes to IDLE or
|
||||
* STOPPED */
|
||||
void stopDetector();
|
||||
|
||||
/** IDLE, ERROR, WAITING, RUN_FINISHED, TRANSMITTING, RUNNING, STOPPED */
|
||||
Result<defs::runStatus> getDetectorStatus(Positions pos = {}) const;
|
||||
|
||||
/** Options: IDLE, TRANSMITTING, RUNNING */
|
||||
Result<defs::runStatus> getReceiverStatus(Positions pos = {}) const;
|
||||
|
||||
Result<int64_t> getFramesCaught(Positions pos = {}) const;
|
||||
|
||||
/** Gets the number of missing packets for each port in receiver. */
|
||||
Result<std::vector<uint64_t>>
|
||||
getNumMissingPackets(Positions pos = {}) const;
|
||||
|
||||
/** [Eiger][Jungfrau] */
|
||||
Result<uint64_t> getStartingFrameNumber(Positions pos = {}) const;
|
||||
|
||||
/** [Eiger][Jungfrau] */
|
||||
/** [Eiger][Jungfrau] Stopping acquiistion might result in different frame
|
||||
* numbers for different modules.*/
|
||||
void setStartingFrameNumber(uint64_t value, Positions pos = {});
|
||||
|
||||
/** [Eiger] Sends an internal software trigger to the detector */
|
||||
@ -424,10 +480,13 @@ class Detector {
|
||||
/** [Jungfrau][Gotthard2] */
|
||||
Result<int> getNumberofUDPInterfaces(Positions pos = {}) const;
|
||||
|
||||
/** [Jungfrau][Gotthard2] Also restarts client and receiver zmq sockets
|
||||
* [Gotthard2] second interface enabled to send veto information via 10gbps
|
||||
* for debugging. By default it is sent via 2.5gbps if veto enabled
|
||||
* n can be 1 or 2 */
|
||||
/** [Jungfrau][Gotthard2] Number of udp interfaces to stream data from
|
||||
* detector. Default is 1. \n Also enables second interface in receiver for
|
||||
* listening (Writes a file per interface if writing enabled). \n Also
|
||||
* restarts client and receiver zmq sockets if zmq streaming enabled. \n
|
||||
* [Gotthard2] second interface enabled to send veto information via 10Gbps
|
||||
* for debugging. By default, if veto enabled, it is sent via 2.5 gbps
|
||||
* interface. */
|
||||
void setNumberofUDPInterfaces(int n, Positions pos = {});
|
||||
|
||||
/** [Jungfrau] */
|
||||
@ -521,13 +580,13 @@ class Detector {
|
||||
/** [Eiger][CTB][Moench][Mythen3] */
|
||||
void setTenGiga(bool value, Positions pos = {});
|
||||
|
||||
/** [Eiger, Jungfrau] */
|
||||
/** [Eiger][Jungfrau] */
|
||||
Result<bool> getTenGigaFlowControl(Positions pos = {}) const;
|
||||
|
||||
/** [Eiger, Jungfrau] */
|
||||
/** [Eiger][Jungfrau] */
|
||||
void setTenGigaFlowControl(bool enable, Positions pos = {});
|
||||
|
||||
/** [Eiger, Jungfrau] */
|
||||
/** [Eiger][Jungfrau][Mythen3] */
|
||||
Result<int> getTransmissionDelayFrame(Positions pos = {}) const;
|
||||
|
||||
/**
|
||||
@ -535,6 +594,8 @@ class Detector {
|
||||
* streamed out of the module. Options: 0 - 31, each value represenets 1 ms
|
||||
* [Eiger]: Sets the transmission delay of entire frame streamed out for
|
||||
* both left and right UDP ports. Options: //TODO possible values
|
||||
* [Mythen3] Options: [0-16777215] Each value represents 8 ns (125 MHz
|
||||
* clock), max is 134 ms.
|
||||
*/
|
||||
void setTransmissionDelayFrame(int value, Positions pos = {});
|
||||
|
||||
@ -570,22 +631,24 @@ class Detector {
|
||||
Result<std::string> getRxHostname(Positions pos = {}) const;
|
||||
|
||||
/**
|
||||
* Validates and sets the receiver.
|
||||
* Updates local receiver cache parameters
|
||||
* Configures the detector to the receiver as UDP destination
|
||||
* receiver is receiver hostname or IP address, can include tcp port eg.
|
||||
* hostname:port
|
||||
* Sets receiver hostname or IP address for each module. \n Used for TCP
|
||||
* control communication between client and receiver to configure receiver.
|
||||
* Also updates receiver with detector parameters. \n Also resets any prior
|
||||
* receiver property (not on detector). \n receiver is receiver hostname or
|
||||
* IP address, can include tcp port eg. hostname:port
|
||||
*/
|
||||
void setRxHostname(const std::string &receiver, Positions pos = {});
|
||||
|
||||
/** multiple rx hostnames (same as setRxHostname) */
|
||||
/** multiple rx hostnames. Single element will set it for all */
|
||||
void setRxHostname(const std::vector<std::string> &name);
|
||||
|
||||
Result<int> getRxPort(Positions pos = {}) const;
|
||||
|
||||
/** Receiver TCP port (for client communication with Receiver)
|
||||
* module_id is -1 for all detectors, ports for each module is calculated
|
||||
* (increments) */
|
||||
/** TCP port for client-receiver communication. \n
|
||||
* Default is 1954. \n Must be different if multiple receivers on same pc.
|
||||
* \n Must be first command to set a receiver parameter to be able to
|
||||
* communicate. \n Multi command will automatically increment port for
|
||||
* individual modules.*/
|
||||
void setRxPort(int port, int module_id = -1);
|
||||
|
||||
Result<int> getRxFifoDepth(Positions pos = {}) const;
|
||||
@ -595,15 +658,15 @@ class Detector {
|
||||
|
||||
Result<bool> getRxSilentMode(Positions pos = {}) const;
|
||||
|
||||
/** receiver prints hardly any information while acquiring */
|
||||
/** Switch on or off receiver text output during acquisition */
|
||||
void setRxSilentMode(bool value, Positions pos = {});
|
||||
|
||||
Result<defs::frameDiscardPolicy>
|
||||
getRxFrameDiscardPolicy(Positions pos = {}) const;
|
||||
|
||||
/**
|
||||
* default NO_DISCARD
|
||||
* Options: NO_DISCARD, DISCARD_EMPTY_FRAMES, DISCARD_PARTIAL_FRAMES
|
||||
* Default: NO_DISCARD
|
||||
* discard partial frames is the fastest
|
||||
*/
|
||||
void setRxFrameDiscardPolicy(defs::frameDiscardPolicy f,
|
||||
@ -611,22 +674,28 @@ class Detector {
|
||||
|
||||
Result<bool> getPartialFramesPadding(Positions pos = {}) const;
|
||||
|
||||
/** padding enabled. Disabling padding is the fastest */
|
||||
/** Default: padding enabled. Disabling padding is the fastest */
|
||||
void setPartialFramesPadding(bool value, Positions pos = {});
|
||||
|
||||
Result<int64_t> getRxUDPSocketBufferSize(Positions pos = {}) const;
|
||||
|
||||
/** UDP socket buffer size in receiver. Tune rmem_default and rmem_max
|
||||
* accordingly */
|
||||
void setRxUDPSocketBufferSize(int64_t udpsockbufsize, Positions pos = {});
|
||||
|
||||
/** TODO:
|
||||
* Linux kernel allocates twice the amount you set for bookkeeping purposes
|
||||
* Gets actual udp socket buffer size. Double the size of rx_udpsocksize due
|
||||
* to kernel bookkeeping.
|
||||
*/
|
||||
Result<int64_t> getRxRealUDPSocketBufferSize(Positions pos = {}) const;
|
||||
|
||||
Result<bool> getRxLock(Positions pos = {});
|
||||
|
||||
/** locks receiver server to client IP */
|
||||
/** Lock receiver to one client IP, 1 locks, 0 unlocks. Default is unlocked.
|
||||
*/
|
||||
void setRxLock(bool value, Positions pos = {});
|
||||
|
||||
/** Client IP Address that last communicated with the receiver */
|
||||
Result<sls::IpAddr> getRxLastClientIP(Positions pos = {}) const;
|
||||
|
||||
Result<std::array<pid_t, NUM_RX_THREAD_IDS>>
|
||||
@ -645,6 +714,7 @@ class Detector {
|
||||
|
||||
Result<std::string> getFilePath(Positions pos = {}) const;
|
||||
|
||||
/** If path does not exist, it will try to create it */
|
||||
void setFilePath(const std::string &fpath, Positions pos = {});
|
||||
|
||||
Result<std::string> getFileNamePrefix(Positions pos = {}) const;
|
||||
@ -657,16 +727,17 @@ class Detector {
|
||||
|
||||
Result<int64_t> getAcquisitionIndex(Positions pos = {}) const;
|
||||
|
||||
/** file or Acquisition index in receiver */
|
||||
void setAcquisitionIndex(int64_t i, Positions pos = {});
|
||||
|
||||
Result<bool> getFileWrite(Positions pos = {}) const;
|
||||
|
||||
/** default writes */
|
||||
/** default enabled */
|
||||
void setFileWrite(bool value, Positions pos = {});
|
||||
|
||||
Result<bool> getMasterFileWrite(Positions pos = {}) const;
|
||||
|
||||
/* default writes */
|
||||
/* default enabled */
|
||||
void setMasterFileWrite(bool value, Positions pos = {});
|
||||
|
||||
Result<bool> getFileOverWrite(Positions pos = {}) const;
|
||||
@ -676,7 +747,8 @@ class Detector {
|
||||
|
||||
Result<int> getFramesPerFile(Positions pos = {}) const;
|
||||
|
||||
/** 0 will set frames per file to unlimited */
|
||||
/** Default depends on detector type. \n 0 will set frames per file to
|
||||
* unlimited */
|
||||
void setFramesPerFile(int n, Positions pos = {});
|
||||
|
||||
/**************************************************
|
||||
@ -688,16 +760,22 @@ class Detector {
|
||||
|
||||
Result<bool> getRxZmqDataStream(Positions pos = {}) const;
|
||||
|
||||
/** Enable/ disable data streaming from receiver via zmq (eg. to GUI or to
|
||||
* another process for further processing). \n This creates/ destroys zmq
|
||||
* streamer threads in receiver. \n Switching to Gui automatically enables
|
||||
* data streaming in receiver. \n Switching back to command line or API
|
||||
* acquire will require disabling data streaming in receiver for fast
|
||||
* applications (if not needed for client data call backs).
|
||||
*/
|
||||
void setRxZmqDataStream(bool value, Positions pos = {});
|
||||
|
||||
Result<int> getRxZmqFrequency(Positions pos = {}) const;
|
||||
|
||||
/** freq is nth frame streamed out of receiver.
|
||||
* If 0, streaming timer is the timeout,
|
||||
* after which current frame sent out. Default is 0 at 200 ms.
|
||||
* Default is 1: send every frame.
|
||||
* If you want just to see some frames for gui purposes, set to 0 (200ms
|
||||
* default timer).
|
||||
/** Frequency of frames streamed out from receiver via zmq. \n Default: 1,
|
||||
* Means every frame is streamed out. \n If 2, every second frame is
|
||||
* streamed out. \n If 0, streaming timer is the timeout, after which
|
||||
* current frame is sent out. (default timeout is 200 ms). Usually used for
|
||||
* gui purposes.
|
||||
*/
|
||||
void setRxZmqFrequency(int freq, Positions pos = {});
|
||||
|
||||
@ -720,14 +798,21 @@ class Detector {
|
||||
|
||||
Result<int> getRxZmqPort(Positions pos = {}) const;
|
||||
|
||||
/**
|
||||
* module_id is -1 for all detectors, ports for each module is calculated
|
||||
* (increments) Restarts receiver zmq sockets only if it was already enabled
|
||||
/** Zmq port for data to be streamed out of the receiver. \n
|
||||
* Also restarts receiver zmq streaming if enabled. \n Default is 30001. \n
|
||||
* Modified only when using an intermediate process after receiver. \n Must
|
||||
* be different for every detector (and udp port). \n module_id is -1 for
|
||||
* all detectors, ports for each module is calculated (increments) Restarts
|
||||
* receiver zmq sockets only if it was already enabled
|
||||
*/
|
||||
void setRxZmqPort(int port, int module_id = -1);
|
||||
|
||||
Result<IpAddr> getRxZmqIP(Positions pos = {}) const;
|
||||
|
||||
/** Zmq Ip Address from which data is to be streamed out of the receiver. \n
|
||||
* Also restarts receiver zmq streaming if enabled. \n Default is from
|
||||
* rx_hostname. \n Modified only when using an intermediate process between
|
||||
* receiver. */
|
||||
void setRxZmqIP(const IpAddr ip, Positions pos = {});
|
||||
|
||||
Result<int> getClientZmqPort(Positions pos = {}) const;
|
||||
@ -773,19 +858,13 @@ class Detector {
|
||||
/** [Eiger] */
|
||||
Result<std::string> getSettingsPath(Positions pos = {}) const;
|
||||
|
||||
/** [Eiger] */
|
||||
/** [Eiger] Directory where settings files are loaded from/to */
|
||||
void setSettingsPath(const std::string &value, Positions pos = {});
|
||||
|
||||
/** [Eiger] */
|
||||
Result<bool> getParallelMode(Positions pos = {}) const;
|
||||
|
||||
/** [Eiger] */
|
||||
void setParallelMode(bool value, Positions pos = {});
|
||||
|
||||
/** [Eiger] */
|
||||
Result<bool> getOverFlowMode(Positions pos = {}) const;
|
||||
|
||||
/** [Eiger] */
|
||||
/** [Eiger] Overflow in 32 bit mode. Default is disabled.*/
|
||||
void setOverFlowMode(bool value, Positions pos = {});
|
||||
|
||||
/** [Eiger] */
|
||||
@ -824,7 +903,9 @@ class Detector {
|
||||
/** [Eiger] */
|
||||
Result<bool> getInterruptSubframe(Positions pos = {}) const;
|
||||
|
||||
/** [Eiger] when set, the last subframe is interrupted at end of acq */
|
||||
/** [Eiger] Enable last subframe interrupt at required exposure time.
|
||||
* Disabling will wait for last sub frame to finish exposing. Default is
|
||||
* disabled. */
|
||||
void setInterruptSubframe(const bool enable, Positions pos = {});
|
||||
|
||||
/** [Eiger] minimum two frames */
|
||||
@ -848,8 +929,7 @@ class Detector {
|
||||
/** [Eiger] Advanced */
|
||||
Result<bool> getPartialReset(Positions pos = {}) const;
|
||||
|
||||
/** [Eiger] Advanced
|
||||
* used for pulsing chips */
|
||||
/** [Eiger] Advanced used for pulsing chips. Default is Complete reset */
|
||||
void setPartialReset(bool value, Positions pos = {});
|
||||
|
||||
/** [Eiger] Advanced
|
||||
@ -909,28 +989,33 @@ class Detector {
|
||||
* //TODO naming
|
||||
* By default, the on-chip gain switching is active during the entire
|
||||
* exposure. This mode disables the on-chip gain switching comparator
|
||||
* automatically after 93.75% of exposure time (only for longer than 100us).
|
||||
* automatically after 93.75% of exposure time (only for longer than
|
||||
* 100us).\n
|
||||
* Default is false or this mode disabled(comparator enabled throughout).
|
||||
* true enables " "mode. 0 disables mode.
|
||||
*/
|
||||
void setAutoCompDisable(bool value, Positions pos = {});
|
||||
|
||||
/** [Jungfrau] Advanced TODO naming */
|
||||
Result<int> getNumberOfAdditionalStorageCells(Positions pos = {}) const;
|
||||
|
||||
/** [Jungfrau] Advanced */
|
||||
/** [Jungfrau] Advanced \n
|
||||
* Options: 0 - 15. Default: 0. \n
|
||||
* The #images = #frames x #triggers x (#storagecells + 1) */
|
||||
void setNumberOfAdditionalStorageCells(int value);
|
||||
|
||||
/** [Jungfrau] Advanced */
|
||||
Result<int> getStorageCellStart(Positions pos = {}) const;
|
||||
|
||||
/** [Jungfrau] Advanced. Sets the storage cell storing the first acquisition
|
||||
* of the series. Options: 0-15
|
||||
* of the series. Options: 0-15. Default: 15.
|
||||
*/
|
||||
void setStorageCellStart(int cell, Positions pos = {});
|
||||
|
||||
/** [Jungfrau] Advanced*/
|
||||
Result<ns> getStorageCellDelay(Positions pos = {}) const;
|
||||
|
||||
/** [Jungfrau] Advanced
|
||||
/** [Jungfrau] Advanced \n
|
||||
* Options: (0-1638375 ns (resolution of 25ns) */
|
||||
void setStorageCellDelay(ns value, Positions pos = {});
|
||||
|
||||
@ -1004,7 +1089,8 @@ class Detector {
|
||||
/** [Gotthard2] */
|
||||
Result<defs::burstMode> getBurstMode(Positions pos = {});
|
||||
|
||||
/** [Gotthard2] BURST_OFF, BURST_INTERNAL (default), BURST_EXTERNAL */
|
||||
/** [Gotthard2] BURST_INTERNAL (default), BURST_EXTERNAL,
|
||||
* CONTINUOUS_INTERNAL, CONTINUOUS_EXTERNAL */
|
||||
void setBurstMode(defs::burstMode value, Positions pos = {});
|
||||
|
||||
/** [Gotthard2] */
|
||||
@ -1059,7 +1145,7 @@ class Detector {
|
||||
/** [Mythen3] */
|
||||
Result<uint32_t> getCounterMask(Positions pos = {}) const;
|
||||
|
||||
/** [Mythen3] countermask bit set for each counter enabled */
|
||||
/** [Mythen3] countermask bit set for each counter index enabled */
|
||||
void setCounterMask(uint32_t countermask, Positions pos = {});
|
||||
|
||||
Result<int> getNumberOfGates(Positions pos = {}) const;
|
||||
@ -1088,7 +1174,7 @@ class Detector {
|
||||
* (internal gating). Gate index: 0-2, -1 for all */
|
||||
void setGateDelay(int gateIndex, ns t, Positions pos = {});
|
||||
|
||||
/** [Mythen3] gate delay for each gate signal in auto or trigger timing mode
|
||||
/** [Mythen3] gate delay for all gates in auto or trigger timing mode
|
||||
* (internal gating). Gate index: 0-2, -1 for all */
|
||||
Result<std::array<ns, 3>> getGateDelayForAllGates(Positions pos = {}) const;
|
||||
|
||||
@ -1162,7 +1248,7 @@ class Detector {
|
||||
/** [CTB] */
|
||||
Result<defs::readoutMode> getReadoutMode(Positions pos = {}) const;
|
||||
|
||||
/** [CTB] Options: ANALOG_ONLY = 0, DIGITAL_ONLY = 1, ANALOG_AND_DIGITAL */
|
||||
/** [CTB] Options: ANALOG_ONLY, DIGITAL_ONLY, ANALOG_AND_DIGITAL */
|
||||
void setReadoutMode(defs::readoutMode value, Positions pos = {});
|
||||
|
||||
/** [CTB] */
|
||||
@ -1207,7 +1293,8 @@ class Detector {
|
||||
/** [CTB] */
|
||||
Result<std::vector<int>> getRxDbitList(Positions pos = {}) const;
|
||||
|
||||
/** [CTB] list contains the set of bits (0-63) to save */
|
||||
/** [CTB] list contains the set of digital signal bits (0-63) to save, must
|
||||
* be non repetitive */
|
||||
void setRxDbitList(const std::vector<int> &list, Positions pos = {});
|
||||
|
||||
/** [CTB] */
|
||||
@ -1227,7 +1314,7 @@ class Detector {
|
||||
/** [CTB] */
|
||||
Result<bool> getLEDEnable(Positions pos = {}) const;
|
||||
|
||||
/** [CTB] */
|
||||
/** [CTB] Default is enabled. */
|
||||
void setLEDEnable(bool enable, Positions pos = {});
|
||||
|
||||
/**************************************************
|
||||
@ -1294,15 +1381,14 @@ class Detector {
|
||||
Result<uint64_t> getPatternMask(Positions pos = {});
|
||||
|
||||
/** [CTB][Moench][Mythen3] Sets the mask applied to every pattern to the
|
||||
* selected bit mask */
|
||||
* selected bits */
|
||||
void setPatternMask(uint64_t mask, Positions pos = {});
|
||||
|
||||
/** [CTB][Moench][Mythen3] */
|
||||
Result<uint64_t> getPatternBitMask(Positions pos = {}) const;
|
||||
|
||||
/** [CTB][Moench][Mythen3] Sets the bitmask that the mask will be applied to
|
||||
* for every pattern
|
||||
*/
|
||||
/** [CTB][Moench][Mythen3] Selects the bits that will have a pattern mask
|
||||
* applied to the selected patmask for every pattern. */
|
||||
void setPatternBitMask(uint64_t mask, Positions pos = {});
|
||||
|
||||
/** [Mythen3] */
|
||||
@ -1366,26 +1452,30 @@ class Detector {
|
||||
* *
|
||||
* ************************************************/
|
||||
|
||||
/** [Jungfrau][CTB][Moench] fname is a pof file
|
||||
/** Advanced user Function!
|
||||
* [Jungfrau][CTB][Moench] fname is a pof file
|
||||
* [Mythen3][Gotthard2] fname is an rbf file
|
||||
*/
|
||||
void programFPGA(const std::string &fname, Positions pos = {});
|
||||
|
||||
/** [Jungfrau][CTB][Moench] */
|
||||
/** [Jungfrau][CTB][Moench] Advanced user Function! */
|
||||
void resetFPGA(Positions pos = {});
|
||||
|
||||
/** [Jungfrau][Gotthard][CTB][Moench][Mythen3][Gotthard2]
|
||||
* Advanced user Function!
|
||||
* Copy detector server fname from tftp folder of hostname to detector
|
||||
* Also changes respawn server, which is effective after a reboot.
|
||||
*/
|
||||
void copyDetectorServer(const std::string &fname,
|
||||
const std::string &hostname, Positions pos = {});
|
||||
|
||||
/** [Jungfrau][Gotthard][CTB][Moench][Mythen3][Gotthard2] */
|
||||
/** [Jungfrau][Gotthard][CTB][Moench][Mythen3][Gotthard2] Advanced user
|
||||
* Function! */
|
||||
void rebootController(Positions pos = {});
|
||||
|
||||
/**
|
||||
* [Jungfrau][Gotthard][CTB][Moench]
|
||||
* Advanced user Function!
|
||||
* Updates the firmware, detector server and then reboots detector
|
||||
* controller blackfin.
|
||||
* sname is name of detector server binary found on tftp folder of host
|
||||
@ -1397,33 +1487,43 @@ class Detector {
|
||||
const std::string &hostname,
|
||||
const std::string &fname, Positions pos = {});
|
||||
|
||||
/** Advanced user Function! \n
|
||||
* [Eiger] Address is +0x100 for only left, +0x200 for only right. */
|
||||
Result<uint32_t> readRegister(uint32_t addr, Positions pos = {}) const;
|
||||
|
||||
/** Advanced user Function! \n
|
||||
* [Eiger] Address is +0x100 for only left, +0x200 for only right. */
|
||||
void writeRegister(uint32_t addr, uint32_t val, Positions pos = {});
|
||||
|
||||
/** Advanced user Function! */
|
||||
void setBit(uint32_t addr, int bitnr, Positions pos = {});
|
||||
|
||||
/** Advanced user Function! */
|
||||
void clearBit(uint32_t addr, int bitnr, Positions pos = {});
|
||||
|
||||
/** [Gotthard][Jungfrau][Mythen3][Gotthard2][CTB][Moench] */
|
||||
/** [Gotthard][Jungfrau][Mythen3][Gotthard2][CTB][Moench] Advanced user
|
||||
* Function! */
|
||||
void executeFirmwareTest(Positions pos = {});
|
||||
|
||||
/** [Gotthard][Jungfrau][Mythen3][Gotthard2][CTB][Moench] */
|
||||
/** [Gotthard][Jungfrau][Mythen3][Gotthard2][CTB][Moench] Advanced user
|
||||
* Function! */
|
||||
void executeBusTest(Positions pos = {});
|
||||
|
||||
/** [Gotthard][Jungfrau][CTB][Moench] not possible to read back*/
|
||||
/** [Gotthard][Jungfrau][CTB][Moench] Advanced user Function! not possible
|
||||
* to read back */
|
||||
void writeAdcRegister(uint32_t addr, uint32_t value, Positions pos = {});
|
||||
|
||||
/** Advanced user Function! */
|
||||
bool getInitialChecks() const;
|
||||
|
||||
/** initial compaibility and other server start up checks
|
||||
* default enabled */
|
||||
* default enabled Advanced user Function! */
|
||||
void setInitialChecks(const bool value);
|
||||
|
||||
/** [CTB][Moench][Jungfrau] */
|
||||
/** [CTB][Moench][Jungfrau] Advanced user Function! */
|
||||
Result<uint32_t> getADCInvert(Positions pos = {}) const;
|
||||
|
||||
/** [CTB][Moench][Jungfrau] */
|
||||
/** [CTB][Moench][Jungfrau] Advanced user Function! */
|
||||
void setADCInvert(uint32_t value, Positions pos = {});
|
||||
|
||||
/**************************************************
|
||||
@ -1446,6 +1546,7 @@ class Detector {
|
||||
|
||||
Result<bool> getDetectorLock(Positions pos = {}) const;
|
||||
|
||||
/** lock detector to one client IP. default is unlocked */
|
||||
void setDetectorLock(bool lock, Positions pos = {});
|
||||
|
||||
/** Get last client IP saved on detector server */
|
||||
|
@ -182,7 +182,7 @@ std::string CmdProxy::VirtualServer(int action) {
|
||||
std::string CmdProxy::Acquire(int action) {
|
||||
std::ostringstream os;
|
||||
if (action == defs::HELP_ACTION) {
|
||||
os << cmd << " - Acquire the number of frames set up.\n";
|
||||
os << cmd << "\n\tAcquire the number of frames set up.\n";
|
||||
} else {
|
||||
if (det->empty()) {
|
||||
throw sls::RuntimeError(
|
||||
@ -203,7 +203,7 @@ std::string CmdProxy::Acquire(int action) {
|
||||
return os.str();
|
||||
}
|
||||
|
||||
std::string CmdProxy::free(int action) {
|
||||
std::string CmdProxy::Free(int action) {
|
||||
// This function is purely for help, actual functionality is in the caller
|
||||
return "free\n\tFree detector shared memory\n";
|
||||
}
|
||||
@ -332,31 +332,13 @@ std::string CmdProxy::DetectorSize(int action) {
|
||||
return os.str();
|
||||
}
|
||||
|
||||
std::string CmdProxy::SettingsList(int action) {
|
||||
std::ostringstream os;
|
||||
os << cmd << ' ';
|
||||
if (action == defs::HELP_ACTION) {
|
||||
os << "\n\tList of settings implemented for this detector" << '\n';
|
||||
} else if (action == defs::GET_ACTION) {
|
||||
if (!args.empty()) {
|
||||
WrongNumberOfParameters(0);
|
||||
}
|
||||
auto t = det->getSettingsList();
|
||||
os << ToString(t) << "\n";
|
||||
} else if (action == defs::PUT_ACTION) {
|
||||
throw sls::RuntimeError("Cannot put");
|
||||
} else {
|
||||
throw sls::RuntimeError("Unknown action");
|
||||
}
|
||||
return os.str();
|
||||
}
|
||||
|
||||
std::string CmdProxy::GapPixels(int action) {
|
||||
std::ostringstream os;
|
||||
os << cmd << ' ';
|
||||
if (action == defs::HELP_ACTION) {
|
||||
os << "[0, 1]\n\t[Eiger][Jungfrau] Include Gap pixels only in data "
|
||||
"call back."
|
||||
os << "[0, 1]\n\t[Eiger][Jungfrau] Include Gap pixels in client data "
|
||||
"call back in Detecor api. Will not be in detector streaming, "
|
||||
"receiver file or streaming. Default is 0. "
|
||||
<< '\n';
|
||||
} else if (action == defs::GET_ACTION) {
|
||||
if (det_id != -1) {
|
||||
@ -406,25 +388,21 @@ std::string CmdProxy::Exptime(int action) {
|
||||
os << "[duration] [(optional unit) "
|
||||
"ns|us|ms|s]\n\t[Eiger][Jungfrau][Gotthard][Gotthard2]["
|
||||
"Moench][Ctb] Exposure time"
|
||||
"\n\t[Gotthard2] Uploaded to detector just before "
|
||||
"acquisition starts"
|
||||
"\n\t[Mythen3] Exposure time of all gate signals in auto and "
|
||||
"trigger mode (internal gating)."
|
||||
"trigger mode (internal gating). To specify gate index, use "
|
||||
"exptime1, exptime2, exptime3."
|
||||
<< '\n';
|
||||
} else if (cmd == "exptime1") {
|
||||
os << "[n_value]\n\t[Mythen3] Exposure time of gate signal 1 in "
|
||||
"auto and "
|
||||
"trigger mode (internal gating)."
|
||||
"auto and trigger mode (internal gating)."
|
||||
<< '\n';
|
||||
} else if (cmd == "exptime2") {
|
||||
os << "[n_value]\n\t[Mythen3] Exposure time of gate signal 2 in "
|
||||
"auto and "
|
||||
"trigger mode (internal gating)."
|
||||
"auto and trigger mode (internal gating)."
|
||||
<< '\n';
|
||||
} else {
|
||||
os << "[n_value]\n\t[Mythen3] Exposure time of gate signal 3 in "
|
||||
"auto and "
|
||||
"trigger mode (internal gating)."
|
||||
"auto and trigger mode (internal gating)."
|
||||
<< '\n';
|
||||
}
|
||||
} else if (action == defs::GET_ACTION) {
|
||||
@ -495,7 +473,8 @@ std::string CmdProxy::DynamicRange(int action) {
|
||||
os << "[value]\n\tDynamic Range or number of bits per "
|
||||
"pixel in detector.\n\t"
|
||||
"[Eiger] Options: 4, 8, 16, 32\n\t"
|
||||
"[Mythen3] Options: 8, 16, 32"
|
||||
"[Mythen3] Options: 8, 16, 32\n\t"
|
||||
"[Jungfrau][Gotthard][Ctb][Moench][Mythen3][Gotthard2] 16"
|
||||
<< '\n';
|
||||
} else if (action == defs::GET_ACTION) {
|
||||
if (!args.empty()) {
|
||||
@ -525,8 +504,9 @@ std::string CmdProxy::Speed(int action) {
|
||||
if (action == defs::HELP_ACTION) {
|
||||
os << "[0 or full_speed|1 or half_speed|2 or "
|
||||
"quarter_speed]\n\t[Eiger][Jungfrau] Readout speed of "
|
||||
"chip.\n\tJungfrau also overwrites adcphase to recommended "
|
||||
"default. "
|
||||
"chip.\n\t[Jungfrau] FULL_SPEED option only available from v2.0 "
|
||||
"boards and with setting number of interfaces to 2. Also "
|
||||
"overwrites adcphase to recommended default. "
|
||||
<< '\n';
|
||||
} else {
|
||||
defs::detectorType type = det->getDetectorType().squash();
|
||||
@ -582,15 +562,13 @@ std::string CmdProxy::Adcphase(int action) {
|
||||
os << cmd << ' ';
|
||||
if (action == defs::HELP_ACTION) {
|
||||
os << "[n_value] "
|
||||
"[(optional)deg]\n\t[Jungfrau][Ctb][Moench][Moench][Gotthard] "
|
||||
"Phase "
|
||||
"shift of ADC clock. \n\t[Jungfrau] Absolute phase shift. If deg "
|
||||
"used, then shift in degrees. Changing Speed also resets "
|
||||
"[(optional)deg]\n\t[Jungfrau][Ctb][Moench][Gotthard] "
|
||||
"Phase shift of ADC clock. \n\t[Jungfrau] Absolute phase shift. "
|
||||
"If deg used, then shift in degrees. Changing Speed also resets "
|
||||
"adcphase to recommended defaults.\n\t[Ctb][Moench] Absolute "
|
||||
"phase "
|
||||
"shift. If deg used, then shift in degrees. Changing adcclk also "
|
||||
"resets adcphase and sets it to previous values.\n\t[Gotthard] "
|
||||
"Relative phase shift"
|
||||
"phase shift. If deg used, then shift in degrees. Changing "
|
||||
"adcclk also resets adcphase and sets it to previous "
|
||||
"values.\n\t[Gotthard] Relative phase shift. Cannot get"
|
||||
<< '\n';
|
||||
} else {
|
||||
auto det_type = det->getDetectorType().squash(defs::GENERIC);
|
||||
@ -641,11 +619,9 @@ std::string CmdProxy::Dbitphase(int action) {
|
||||
os << cmd << ' ';
|
||||
if (action == defs::HELP_ACTION) {
|
||||
os << "[n_value] [(optional)deg]\n\t[Ctb][Jungfrau] Phase shift of "
|
||||
"clock to "
|
||||
"latch digital bits. Absolute phase shift. If deg used, then "
|
||||
"shift in degrees. \n\t[Ctb]Changing dbitclk also resets "
|
||||
"dbitphase and "
|
||||
"sets to previous values."
|
||||
"clock to latch digital bits. Absolute phase shift. If deg used, "
|
||||
"then shift in degrees. \n\t[Ctb]Changing dbitclk also resets "
|
||||
"dbitphase and sets to previous values."
|
||||
<< '\n';
|
||||
} else {
|
||||
auto det_type = det->getDetectorType().squash(defs::GENERIC);
|
||||
@ -873,12 +849,42 @@ std::string CmdProxy::ExternalSignal(int action) {
|
||||
}
|
||||
|
||||
/** temperature */
|
||||
std::string CmdProxy::TemperatureValues(int action) {
|
||||
std::ostringstream os;
|
||||
os << cmd << ' ';
|
||||
if (action == defs::HELP_ACTION) {
|
||||
os << "\n\tGets the values for every temperature for this detector."
|
||||
<< '\n';
|
||||
} else if (action == defs::GET_ACTION) {
|
||||
if (args.size() != 0) {
|
||||
WrongNumberOfParameters(0);
|
||||
}
|
||||
auto t = det->getTemperatureList();
|
||||
os << '[';
|
||||
if (t.size() > 0) {
|
||||
auto it = t.cbegin();
|
||||
os << ToString(*it) << ' ';
|
||||
os << OutString(det->getTemperature(*it++, {det_id})) << " °C";
|
||||
while (it != t.cend()) {
|
||||
os << ", " << ToString(*it) << ' ';
|
||||
os << OutString(det->getTemperature(*it++, {det_id})) << " °C";
|
||||
}
|
||||
}
|
||||
os << "]\n";
|
||||
} else if (action == defs::PUT_ACTION) {
|
||||
throw sls::RuntimeError("Cannot put");
|
||||
} else {
|
||||
throw sls::RuntimeError("Unknown action");
|
||||
}
|
||||
return os.str();
|
||||
}
|
||||
|
||||
/* dacs */
|
||||
std::string CmdProxy::Dac(int action) {
|
||||
std::ostringstream os;
|
||||
os << cmd << ' ';
|
||||
if (action == defs::HELP_ACTION) {
|
||||
os << "[dac index] [dac or mv value] [(optional unit) mv] "
|
||||
os << "[dac index] [dac or mV value] [(optional unit) mV] "
|
||||
"\n\t[Ctb] Dac."
|
||||
<< '\n';
|
||||
} else if (det->getDetectorType().squash(defs::GENERIC) !=
|
||||
@ -889,9 +895,9 @@ std::string CmdProxy::Dac(int action) {
|
||||
} else if (action == defs::GET_ACTION) {
|
||||
bool mv = false;
|
||||
if (args.size() == 2) {
|
||||
if (args[1] != "mv") {
|
||||
if ((args[1] != "mv") && (args[1] != "mV")) {
|
||||
throw sls::RuntimeError("Unknown argument " + args[1] +
|
||||
". Did you mean mv?");
|
||||
". Did you mean mV?");
|
||||
}
|
||||
mv = true;
|
||||
} else if (args.size() > 2) {
|
||||
@ -900,13 +906,13 @@ std::string CmdProxy::Dac(int action) {
|
||||
auto t = det->getDAC(
|
||||
static_cast<defs::dacIndex>(StringTo<int>(args[0])), mv, {det_id});
|
||||
os << args[0] << ' ' << OutString(t)
|
||||
<< (args.size() > 1 ? " mv\n" : "\n");
|
||||
<< (args.size() > 1 ? " mV\n" : "\n");
|
||||
} else if (action == defs::PUT_ACTION) {
|
||||
bool mv = false;
|
||||
if (args.size() == 3) {
|
||||
if (args[2] != "mv") {
|
||||
if ((args[2] != "mv") && (args[2] != "mV")) {
|
||||
throw sls::RuntimeError("Unknown argument " + args[2] +
|
||||
". Did you mean mv?");
|
||||
". Did you mean mV?");
|
||||
}
|
||||
mv = true;
|
||||
} else if (args.size() > 3 || args.size() < 2) {
|
||||
@ -914,27 +920,7 @@ std::string CmdProxy::Dac(int action) {
|
||||
}
|
||||
det->setDAC(static_cast<defs::dacIndex>(StringTo<int>(args[0])),
|
||||
StringTo<int>(args[1]), mv, {det_id});
|
||||
os << args[0] << ' ' << args[1] << (args.size() > 2 ? " mv\n" : "\n");
|
||||
} else {
|
||||
throw sls::RuntimeError("Unknown action");
|
||||
}
|
||||
return os.str();
|
||||
}
|
||||
|
||||
std::string CmdProxy::DacList(int action) {
|
||||
std::ostringstream os;
|
||||
os << cmd << ' ';
|
||||
if (action == defs::HELP_ACTION) {
|
||||
os << "\n\tGets the list of commands for every dac for this detector."
|
||||
<< '\n';
|
||||
} else if (action == defs::GET_ACTION) {
|
||||
if (!args.empty()) {
|
||||
WrongNumberOfParameters(0);
|
||||
}
|
||||
auto t = det->getDacList();
|
||||
os << ToString(t) << '\n';
|
||||
} else if (action == defs::PUT_ACTION) {
|
||||
throw sls::RuntimeError("Cannot put");
|
||||
os << args[0] << ' ' << args[1] << (args.size() > 2 ? " mV\n" : "\n");
|
||||
} else {
|
||||
throw sls::RuntimeError("Unknown action");
|
||||
}
|
||||
@ -945,15 +931,15 @@ std::string CmdProxy::DacValues(int action) {
|
||||
std::ostringstream os;
|
||||
os << cmd << ' ';
|
||||
if (action == defs::HELP_ACTION) {
|
||||
os << "[(optional unit) mv] \n\tGets the list of commands for every "
|
||||
os << "[(optional unit) mV] \n\tGets the values for every "
|
||||
"dac for this detector."
|
||||
<< '\n';
|
||||
} else if (action == defs::GET_ACTION) {
|
||||
bool mv = false;
|
||||
if (args.size() == 1) {
|
||||
if (args[0] != "mv") {
|
||||
if ((args[0] != "mv") && (args[0] != "mV")) {
|
||||
throw sls::RuntimeError("Unknown argument " + args[0] +
|
||||
". Did you mean mv?");
|
||||
". Did you mean mV?");
|
||||
}
|
||||
mv = true;
|
||||
} else if (args.size() > 1) {
|
||||
@ -964,11 +950,11 @@ std::string CmdProxy::DacValues(int action) {
|
||||
auto it = t.cbegin();
|
||||
os << ToString(*it) << ' ';
|
||||
os << OutString(det->getDAC(*it++, mv, {det_id}))
|
||||
<< (!args.empty() ? " mv" : "");
|
||||
<< (!args.empty() ? " mV" : "");
|
||||
while (it != t.cend()) {
|
||||
os << ", " << ToString(*it) << ' ';
|
||||
os << OutString(det->getDAC(*it++, mv, {det_id}))
|
||||
<< (!args.empty() ? " mv" : "");
|
||||
<< (!args.empty() ? " mV" : "");
|
||||
}
|
||||
os << "]\n";
|
||||
} else if (action == defs::PUT_ACTION) {
|
||||
@ -985,7 +971,8 @@ std::string CmdProxy::ReceiverStatus(int action) {
|
||||
std::ostringstream os;
|
||||
os << cmd << ' ';
|
||||
if (action == defs::HELP_ACTION) {
|
||||
os << "running, idle]\n\tReceiver listener status." << '\n';
|
||||
os << "running, idle, transmitting]\n\tReceiver listener status."
|
||||
<< '\n';
|
||||
} else if (action == defs::GET_ACTION) {
|
||||
if (!args.empty()) {
|
||||
WrongNumberOfParameters(0);
|
||||
@ -1164,7 +1151,7 @@ std::string CmdProxy::UDPDestinationIP2(int action) {
|
||||
}
|
||||
|
||||
/* Receiver Config */
|
||||
std::string CmdProxy::ReceiveHostname(int action) {
|
||||
std::string CmdProxy::ReceiverHostname(int action) {
|
||||
std::ostringstream os;
|
||||
os << cmd << ' ';
|
||||
if (action == defs::HELP_ACTION) {
|
||||
@ -1175,7 +1162,8 @@ std::string CmdProxy::ReceiveHostname(int action) {
|
||||
"tcp port.\n\t"
|
||||
"Used for TCP control communication between client and receiver "
|
||||
"to configure receiver. Also updates receiver with detector "
|
||||
"parameters."
|
||||
"parameters. Also resets any prior receiver property (not on "
|
||||
"detector). "
|
||||
<< '\n';
|
||||
} else if (action == defs::GET_ACTION) {
|
||||
if (!args.empty()) {
|
||||
@ -1327,8 +1315,8 @@ std::string CmdProxy::RateCorrection(int action) {
|
||||
os << cmd << ' ';
|
||||
if (action == defs::HELP_ACTION) {
|
||||
os << "[n_rate (in ns)]\n\t[Eiger] Dead time correction constant in "
|
||||
"ns. -1 will set to default tau of settings. 0 will unset rate "
|
||||
"correction."
|
||||
"ns. -1 will set to default tau of settings from trimbit file. 0 "
|
||||
"will unset rate correction."
|
||||
<< '\n';
|
||||
} else if (action == defs::GET_ACTION) {
|
||||
if (!args.empty()) {
|
||||
@ -1627,7 +1615,7 @@ std::string CmdProxy::VetoPhoton(int action) {
|
||||
os << "[ichip] [#photons] [energy in keV] [reference "
|
||||
"file]\n\t[Gotthard2] Set veto reference for 128 channels for "
|
||||
"chip ichip according to reference file and #photons and energy "
|
||||
"in keV.\n"
|
||||
"in keV.\n\t"
|
||||
<< "[ichip] [output file]\n\t Get gain indices and veto reference "
|
||||
"for 128 channels for chip ichip, saved to file."
|
||||
<< '\n';
|
||||
@ -1699,8 +1687,8 @@ std::string CmdProxy::BurstMode(int action) {
|
||||
std::ostringstream os;
|
||||
os << cmd << ' ';
|
||||
if (action == defs::HELP_ACTION) {
|
||||
os << "[off or 0, internal or 1, external or 2]\n\t[Gotthard2] Default "
|
||||
"is burst internal type"
|
||||
os << "[burst_internal or 0, burst_external or 1, cw_internal or 2, "
|
||||
"cw_external or 3]\n\t[Gotthard2] Default is burst_internal type"
|
||||
<< '\n';
|
||||
} else {
|
||||
if (action == defs::GET_ACTION) {
|
||||
@ -1718,14 +1706,17 @@ std::string CmdProxy::BurstMode(int action) {
|
||||
int ival = StringTo<int>(args[0]);
|
||||
switch (ival) {
|
||||
case 0:
|
||||
t = defs::BURST_OFF;
|
||||
break;
|
||||
case 1:
|
||||
t = defs::BURST_INTERNAL;
|
||||
break;
|
||||
case 2:
|
||||
case 1:
|
||||
t = defs::BURST_EXTERNAL;
|
||||
break;
|
||||
case 2:
|
||||
t = defs::CONTINUOUS_INTERNAL;
|
||||
break;
|
||||
case 3:
|
||||
t = defs::CONTINUOUS_EXTERNAL;
|
||||
break;
|
||||
default:
|
||||
throw sls::RuntimeError("Unknown burst mode " + args[0]);
|
||||
}
|
||||
@ -1803,8 +1794,9 @@ std::string CmdProxy::Counters(int action) {
|
||||
std::ostringstream os;
|
||||
os << cmd << ' ';
|
||||
if (action == defs::HELP_ACTION) {
|
||||
os << "[i0] [i1] [i2]... \n\t[Mythen3] List of counters enabled. Each "
|
||||
"element in list can be 0 - 2 and must be non repetitive."
|
||||
os << "[i0] [i1] [i2]... \n\t[Mythen3] List of counters indices "
|
||||
"enabled. Each element in list can be 0 - 2 and must be non "
|
||||
"repetitive."
|
||||
<< '\n';
|
||||
} else if (action == defs::GET_ACTION) {
|
||||
if (!args.empty()) {
|
||||
@ -1857,23 +1849,19 @@ std::string CmdProxy::GateDelay(int action) {
|
||||
if (cmd == "gatedelay") {
|
||||
os << "[duration] [(optional unit) "
|
||||
"ns|us|ms|s]\n\t[Mythen3] Gate Delay of all gate signals in "
|
||||
"auto and "
|
||||
"trigger mode (internal gating)."
|
||||
"auto and trigger mode (internal gating)."
|
||||
<< '\n';
|
||||
} else if (cmd == "gatedelay1") {
|
||||
os << "[n_value]\n\t[Mythen3] Gate Delay of gate signal 1 in "
|
||||
"auto and "
|
||||
"trigger mode (internal gating)."
|
||||
os << "[n_value]\n\t[Mythen3] Gate Delay of gate signal 1 in auto "
|
||||
"and trigger mode (internal gating)."
|
||||
<< '\n';
|
||||
} else if (cmd == "gatedelay2") {
|
||||
os << "[n_value]\n\t[Mythen3] Gate Delay of gate signal 2 in "
|
||||
"auto and "
|
||||
"trigger mode (internal gating)."
|
||||
os << "[n_value]\n\t[Mythen3] Gate Delay of gate signal 2 in auto "
|
||||
"and trigger mode (internal gating)."
|
||||
<< '\n';
|
||||
} else {
|
||||
os << "[n_value]\n\t[Mythen3] Gate Delay of gate signal 3 in "
|
||||
"auto and "
|
||||
"trigger mode (internal gating)."
|
||||
os << "[n_value]\n\t[Mythen3] Gate Delay of gate signal 3 in auto "
|
||||
"and trigger mode (internal gating)."
|
||||
<< '\n';
|
||||
}
|
||||
} else if (action == defs::GET_ACTION) {
|
||||
@ -2007,8 +1995,7 @@ std::string CmdProxy::ReceiverDbitList(int action) {
|
||||
os << "[all] or [i0] [i1] [i2]... \n\t[Ctb] List of digital signal "
|
||||
"bits read out. If all is used instead of a list, all digital "
|
||||
"bits (64) enabled. Each element in list can be 0 - 63 and must "
|
||||
"be non "
|
||||
"repetitive."
|
||||
"be non repetitive."
|
||||
<< '\n';
|
||||
} else if (action == defs::GET_ACTION) {
|
||||
if (!args.empty()) {
|
||||
@ -2124,8 +2111,7 @@ std::string CmdProxy::PatternLoopAddresses(int action) {
|
||||
if (action == defs::HELP_ACTION) {
|
||||
if (cmd == "patlimits") {
|
||||
os << "[start addr] [stop addr] \n\t[Ctb][Moench][Mythen3] Limits "
|
||||
"of complete "
|
||||
"pattern."
|
||||
"of complete pattern."
|
||||
<< '\n';
|
||||
} else if (cmd == "patloop0") {
|
||||
os << "[start addr] [stop addr] \n\t[Ctb][Moench][Mythen3] Limits "
|
||||
@ -2528,7 +2514,8 @@ std::string CmdProxy::Register(int action) {
|
||||
os << cmd << ' ';
|
||||
if (action == defs::HELP_ACTION) {
|
||||
os << "[address] [32 bit value]\n\tReads/writes to a 32 bit register "
|
||||
"in hex.\n\t[Eiger] +0x100 for only left, +0x200 for only right"
|
||||
"in hex. Advanced Function!\n\t[Eiger] +0x100 for only left, "
|
||||
"+0x200 for only right."
|
||||
<< '\n';
|
||||
} else if (action == defs::GET_ACTION) {
|
||||
if (args.size() != 1) {
|
||||
@ -2555,7 +2542,7 @@ std::string CmdProxy::AdcRegister(int action) {
|
||||
if (action == defs::HELP_ACTION) {
|
||||
os << "[address] [value]\n\t[Jungfrau][Ctb][Moench][Gotthard] Writes "
|
||||
"to an adc "
|
||||
"register in hex."
|
||||
"register in hex. Advanced user Function!"
|
||||
<< '\n';
|
||||
} else if (action == defs::GET_ACTION) {
|
||||
throw sls::RuntimeError("Cannot get.");
|
||||
|
@ -274,29 +274,29 @@
|
||||
else if (action == slsDetectorDefs::GET_ACTION) { \
|
||||
bool mv = false; \
|
||||
if (args.size() == 1) { \
|
||||
if (args[0] != "mv") { \
|
||||
if ((args[0] != "mv") && (args[0] != "mV")) { \
|
||||
throw sls::RuntimeError("Unknown argument " + args[0] + \
|
||||
". Did you mean mv?"); \
|
||||
". Did you mean mV?"); \
|
||||
} \
|
||||
mv = true; \
|
||||
} else if (args.size() > 1) { \
|
||||
WrongNumberOfParameters(0); \
|
||||
} \
|
||||
auto t = det->GETFCN(DAC_INDEX, mv, {det_id}); \
|
||||
os << OutString(t) << (!args.empty() ? " mv\n" : "\n"); \
|
||||
os << OutString(t) << (!args.empty() ? " mV\n" : "\n"); \
|
||||
} else if (action == slsDetectorDefs::PUT_ACTION) { \
|
||||
bool mv = false; \
|
||||
if (args.size() == 2) { \
|
||||
if (args[1] != "mv") { \
|
||||
if ((args[1] != "mv") && (args[1] != "mV")) { \
|
||||
throw sls::RuntimeError("Unknown argument " + args[1] + \
|
||||
". Did you mean mv?"); \
|
||||
". Did you mean mV?"); \
|
||||
} \
|
||||
mv = true; \
|
||||
} else if (args.size() > 2 || args.empty()) { \
|
||||
WrongNumberOfParameters(1); \
|
||||
} \
|
||||
det->SETFCN(DAC_INDEX, StringTo<int>(args[0]), mv, {det_id}); \
|
||||
os << args.front() << (args.size() > 1 ? " mv\n" : "\n"); \
|
||||
os << args.front() << (args.size() > 1 ? " mV\n" : "\n"); \
|
||||
} else { \
|
||||
throw sls::RuntimeError("Unknown action"); \
|
||||
} \
|
||||
@ -414,6 +414,27 @@
|
||||
return os.str(); \
|
||||
}
|
||||
|
||||
/** get only no id (vector, not result) */
|
||||
#define GET_COMMAND_NOID(CMDNAME, GETFCN, HLPSTR) \
|
||||
std::string CMDNAME(const int action) { \
|
||||
std::ostringstream os; \
|
||||
os << cmd << ' '; \
|
||||
if (action == slsDetectorDefs::HELP_ACTION) \
|
||||
os << HLPSTR << '\n'; \
|
||||
else if (action == slsDetectorDefs::GET_ACTION) { \
|
||||
if (!args.empty()) { \
|
||||
WrongNumberOfParameters(0); \
|
||||
} \
|
||||
auto t = det->GETFCN(); \
|
||||
os << sls::ToString(t) << '\n'; \
|
||||
} else if (action == slsDetectorDefs::PUT_ACTION) { \
|
||||
throw sls::RuntimeError("Cannot put"); \
|
||||
} else { \
|
||||
throw sls::RuntimeError("Unknown action"); \
|
||||
} \
|
||||
return os.str(); \
|
||||
}
|
||||
|
||||
/** get only hex*/
|
||||
#define GET_COMMAND_HEX(CMDNAME, GETFCN, HLPSTR) \
|
||||
std::string CMDNAME(const int action) { \
|
||||
@ -614,7 +635,7 @@ class CmdProxy {
|
||||
|
||||
/* configuration */
|
||||
{"config", &CmdProxy::config},
|
||||
{"free", &CmdProxy::free},
|
||||
{"free", &CmdProxy::Free},
|
||||
{"parameters", &CmdProxy::parameters},
|
||||
{"hostname", &CmdProxy::Hostname},
|
||||
{"virtual", &CmdProxy::VirtualServer},
|
||||
@ -627,7 +648,7 @@ class CmdProxy {
|
||||
{"detectornumber", &CmdProxy::detectornumber},
|
||||
{"type", &CmdProxy::type},
|
||||
{"detsize", &CmdProxy::DetectorSize},
|
||||
{"settingslist", &CmdProxy::SettingsList},
|
||||
{"settingslist", &CmdProxy::settingslist},
|
||||
{"settings", &CmdProxy::settings},
|
||||
{"trimbits", &CmdProxy::trimbits},
|
||||
{"trimval", &CmdProxy::trimval},
|
||||
@ -645,7 +666,9 @@ class CmdProxy {
|
||||
{"delayl", &CmdProxy::delayl},
|
||||
{"periodl", &CmdProxy::periodl},
|
||||
{"dr", &CmdProxy::DynamicRange},
|
||||
{"drlist", &CmdProxy::drlist},
|
||||
{"timing", &CmdProxy::timing},
|
||||
{"timinglist", &CmdProxy::timinglist},
|
||||
{"speed", &CmdProxy::Speed},
|
||||
{"adcphase", &CmdProxy::Adcphase},
|
||||
{"maxadcphaseshift", &CmdProxy::maxadcphaseshift},
|
||||
@ -659,8 +682,11 @@ class CmdProxy {
|
||||
{"powerchip", &CmdProxy::powerchip},
|
||||
{"imagetest", &CmdProxy::imagetest},
|
||||
{"extsig", &CmdProxy::ExternalSignal},
|
||||
{"parallel", &CmdProxy::parallel},
|
||||
|
||||
/** temperature */
|
||||
{"templist", &CmdProxy::templist},
|
||||
{"tempvalues", &CmdProxy::TemperatureValues},
|
||||
{"temp_adc", &CmdProxy::temp_adc},
|
||||
{"temp_fpga", &CmdProxy::temp_fpga},
|
||||
{"temp_fpgaext", &CmdProxy::temp_fpgaext},
|
||||
@ -670,6 +696,7 @@ class CmdProxy {
|
||||
{"temp_sodr", &CmdProxy::temp_sodr},
|
||||
{"temp_fpgafl", &CmdProxy::temp_fpgafl},
|
||||
{"temp_fpgafr", &CmdProxy::temp_fpgafr},
|
||||
{"temp_slowadc", &CmdProxy::temp_slowadc},
|
||||
|
||||
/* dacs */
|
||||
{"vthreshold", &CmdProxy::vthreshold},
|
||||
@ -737,7 +764,7 @@ class CmdProxy {
|
||||
{"ibias_sfp", &CmdProxy::ibias_sfp},
|
||||
|
||||
{"dac", &CmdProxy::Dac},
|
||||
{"daclist", &CmdProxy::DacList},
|
||||
{"daclist", &CmdProxy::daclist},
|
||||
{"dacvalues", &CmdProxy::DacValues},
|
||||
|
||||
/* on chip dacs */
|
||||
@ -786,7 +813,7 @@ class CmdProxy {
|
||||
{"txndelay_right", &CmdProxy::txndelay_right},
|
||||
|
||||
/* Receiver Config */
|
||||
{"rx_hostname", &CmdProxy::ReceiveHostname},
|
||||
{"rx_hostname", &CmdProxy::ReceiverHostname},
|
||||
{"rx_tcpport", &CmdProxy::rx_tcpport},
|
||||
{"rx_fifodepth", &CmdProxy::rx_fifodepth},
|
||||
{"rx_silent", &CmdProxy::rx_silent},
|
||||
@ -823,7 +850,6 @@ class CmdProxy {
|
||||
{"threshold", &CmdProxy::Threshold},
|
||||
{"thresholdnotb", &CmdProxy::ThresholdNoTb},
|
||||
{"settingspath", &CmdProxy::settingspath},
|
||||
{"parallel", &CmdProxy::parallel},
|
||||
{"overflow", &CmdProxy::overflow},
|
||||
{"flippeddatax", &CmdProxy::flippeddatax},
|
||||
{"trimen", &CmdProxy::TrimEnergies},
|
||||
@ -985,7 +1011,7 @@ class CmdProxy {
|
||||
/* Commands */
|
||||
std::string ListCommands(int action);
|
||||
/* configuration */
|
||||
std::string free(int action);
|
||||
std::string Free(int action);
|
||||
// std::string config2(int action);
|
||||
std::string Hostname(int action);
|
||||
std::string VirtualServer(int action);
|
||||
@ -994,7 +1020,6 @@ class CmdProxy {
|
||||
std::string PackageVersion(int action);
|
||||
std::string ClientVersion(int action);
|
||||
std::string DetectorSize(int action);
|
||||
std::string SettingsList(int action);
|
||||
std::string GapPixels(int action);
|
||||
/* acquisition parameters */
|
||||
std::string Acquire(int action);
|
||||
@ -1009,9 +1034,9 @@ class CmdProxy {
|
||||
std::string ClockDivider(int action);
|
||||
std::string ExternalSignal(int action);
|
||||
/** temperature */
|
||||
std::string TemperatureValues(int action);
|
||||
/* dacs */
|
||||
std::string Dac(int action);
|
||||
std::string DacList(int action);
|
||||
std::string DacValues(int action);
|
||||
/* acquisition */
|
||||
std::string ReceiverStatus(int action);
|
||||
@ -1021,7 +1046,7 @@ class CmdProxy {
|
||||
std::string UDPDestinationIP(int action);
|
||||
std::string UDPDestinationIP2(int action);
|
||||
/* Receiver Config */
|
||||
std::string ReceiveHostname(int action);
|
||||
std::string ReceiverHostname(int action);
|
||||
/* File */
|
||||
/* ZMQ Streaming Parameters (Receiver<->Client) */
|
||||
/* Eiger Specific */
|
||||
@ -1082,7 +1107,7 @@ class CmdProxy {
|
||||
/* configuration */
|
||||
EXECUTE_SET_COMMAND_NOID_1ARG(
|
||||
config, loadConfig,
|
||||
"[fname]\n\tConfigures detector to configuration contained in fname. "
|
||||
"[fname]\n\tFrees shared memory before loading configuration file. "
|
||||
"Set up once.");
|
||||
|
||||
EXECUTE_SET_COMMAND_NOID_1ARG(
|
||||
@ -1103,6 +1128,9 @@ class CmdProxy {
|
||||
GET_COMMAND(type, getDetectorType,
|
||||
"\n\tSerial number or MAC of detector (hex).");
|
||||
|
||||
GET_COMMAND_NOID(settingslist, getSettingsList,
|
||||
"\n\tList of settings implemented for this detector.");
|
||||
|
||||
INTEGER_COMMAND(settings, getSettings, setSettings,
|
||||
sls::StringTo<slsDetectorDefs::detectorSettings>,
|
||||
"[standard, fast, highgain, dynamicgain, lowgain, "
|
||||
@ -1118,7 +1146,8 @@ class CmdProxy {
|
||||
"\n\t[Gotthard2] - [dynamicgain | fixgain1 | fixgain2]"
|
||||
"\n\t[Moench] - [g1_hg | g1_lg | g2_hc_hg | g2_hc_lg | "
|
||||
"g2_lc_hg | g2_lc_lg | g4_hg | g4_lg]"
|
||||
"\n\t[Eiger] Use threshold or thresholdnotb.");
|
||||
"\n\t[Eiger] Use threshold or thresholdnotb. \n\t[Eiger] "
|
||||
"settings loaded from file found in settingspath.");
|
||||
|
||||
EXECUTE_SET_COMMAND_1ARG(
|
||||
trimbits, loadTrimbits,
|
||||
@ -1133,9 +1162,10 @@ class CmdProxy {
|
||||
|
||||
INTEGER_COMMAND_NOID(
|
||||
frames, getNumberOfFrames, setNumberOfFrames, StringTo<int64_t>,
|
||||
"[n_frames]\n\tNumber of frames per aquire. In trigger mode, number of "
|
||||
"frames per trigger."
|
||||
"\n\t[Gotthard2] Burst mode has a maximum of 2720 frames.");
|
||||
"[n_frames]\n\tNumber of frames per acquisition. In "
|
||||
"trigger mode, number of frames per trigger. Cannot be set in modular "
|
||||
"level. In scan mode, number of frames is set to number of "
|
||||
"steps.\n\t[Gotthard2] Burst mode has a maximum of 2720 frames.");
|
||||
|
||||
INTEGER_COMMAND_NOID(triggers, getNumberOfTriggers, setNumberOfTriggers,
|
||||
StringTo<int64_t>,
|
||||
@ -1144,8 +1174,7 @@ class CmdProxy {
|
||||
|
||||
TIME_COMMAND(
|
||||
period, getPeriod, setPeriod,
|
||||
"[duration] [(optional unit) ns|us|ms|s]\n\tPeriod between frames"
|
||||
"\n\t[Gotthard2] Uploaded to detector just before acquisition starts");
|
||||
"[duration] [(optional unit) ns|us|ms|s]\n\tPeriod between frames");
|
||||
|
||||
TIME_COMMAND(delay, getDelayAfterTrigger, setDelayAfterTrigger,
|
||||
"[duration] [(optional unit) "
|
||||
@ -1172,6 +1201,9 @@ class CmdProxy {
|
||||
" Period left for current frame."
|
||||
"\n\t[Gotthard2] only in continuous mode.");
|
||||
|
||||
GET_COMMAND_NOID(drlist, getDynamicRangeList,
|
||||
"\n\tGets the list of dynamic ranges for this detector.");
|
||||
|
||||
INTEGER_COMMAND(timing, getTimingMode, setTimingMode,
|
||||
sls::StringTo<slsDetectorDefs::timingMode>,
|
||||
"[auto|trigger|gating|burst_trigger]\n\tTiming Mode of "
|
||||
@ -1180,6 +1212,9 @@ class CmdProxy {
|
||||
"[auto|trigger|gating|trigger_gating]\n\t[Eiger] "
|
||||
"[auto|trigger|gating|burst_trigger]");
|
||||
|
||||
GET_COMMAND_NOID(timinglist, getTimingModeList,
|
||||
"\n\tGets the list of timing modes for this detector.");
|
||||
|
||||
GET_COMMAND(maxadcphaseshift, getMaxADCPhaseShift,
|
||||
"\n\t[Jungfrau][CTB][Moench] Absolute maximum Phase shift of "
|
||||
"ADC clock.");
|
||||
@ -1212,7 +1247,16 @@ class CmdProxy {
|
||||
"\n\t[Eiger][Jungfrau] Only for Virtual servers. If 0, each pixel "
|
||||
"intensity incremented by 1. If 1, all pixels almost saturated.");
|
||||
|
||||
INTEGER_COMMAND(parallel, getParallelMode, setParallelMode, StringTo<int>,
|
||||
"[0, 1]\n\t[Eiger][Mythen3] Enable or disable parallel "
|
||||
"mode.\n\t[Mythen3] If exptime is too short, the "
|
||||
"acquisition will return ERROR status and take fewer "
|
||||
"frames than expected.");
|
||||
|
||||
/** temperature */
|
||||
GET_COMMAND_NOID(
|
||||
templist, getTemperatureList,
|
||||
"\n\tList of temperature commands implemented for this detector.");
|
||||
|
||||
GET_IND_COMMAND(temp_adc, getTemperature, slsDetectorDefs::TEMPERATURE_ADC,
|
||||
" °C", "[n_value]\n\t[Jungfrau][Gotthard] ADC Temperature");
|
||||
@ -1249,266 +1293,274 @@ class CmdProxy {
|
||||
temp_fpgafr, getTemperature, slsDetectorDefs::TEMPERATURE_FPGA3, " °C",
|
||||
"[n_value]\n\t[Eiger]Temperature of the left front end board fpga");
|
||||
|
||||
GET_IND_COMMAND(temp_slowadc, getTemperature,
|
||||
slsDetectorDefs::SLOW_ADC_TEMP, " °C",
|
||||
"[n_value]\n\t[Ctb]Temperature of the slow adc");
|
||||
|
||||
/* dacs */
|
||||
|
||||
DAC_COMMAND(vthreshold, getDAC, setDAC, defs::VTHRESHOLD,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Eiger][Mythen3] "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Eiger][Mythen3] "
|
||||
"Detector threshold voltage for single photon counters.");
|
||||
|
||||
DAC_COMMAND(vsvp, getDAC, setDAC, defs::VSVP,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Eiger] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Eiger] Dac for "
|
||||
"?? "); // TODO
|
||||
|
||||
DAC_COMMAND(vsvn, getDAC, setDAC, defs::VSVN,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Eiger] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Eiger] Dac for "
|
||||
"?? \n\t[Mythen3] voltage "
|
||||
"to define feedback resistance of the first shaper"); // TODO
|
||||
|
||||
DAC_COMMAND(vtrim, getDAC, setDAC, defs::VTRIM,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Eiger] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Eiger] Dac for "
|
||||
"?? \n\t[Mythen3] Dac for "
|
||||
"the voltage defining the trim bit size."); // TODO
|
||||
|
||||
DAC_COMMAND(vrpreamp, getDAC, setDAC, defs::VRPREAMP,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Eiger] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Eiger] Dac for "
|
||||
"?? \n\t[Mythen3] voltage "
|
||||
"to define the preamplifier feedback resistance."); // TODO
|
||||
|
||||
DAC_COMMAND(vrshaper, getDAC, setDAC, defs::VRSHAPER,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Eiger] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Eiger] Dac for "
|
||||
"?? \n\t[Mythen3] voltage to define feedback resistance of "
|
||||
"the first shaper"); // TODO
|
||||
|
||||
DAC_COMMAND(vtgstv, getDAC, setDAC, defs::VTGSTV,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Eiger] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Eiger] Dac for "
|
||||
"?? "); // TODO
|
||||
|
||||
DAC_COMMAND(vcmp_ll, getDAC, setDAC, defs::VCMP_LL,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Eiger] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Eiger] Dac for "
|
||||
"?? "); // TODO
|
||||
|
||||
DAC_COMMAND(vcmp_lr, getDAC, setDAC, defs::VCMP_LR,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Eiger] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Eiger] Dac for "
|
||||
"?? "); // TODO
|
||||
|
||||
DAC_COMMAND(vcal, getDAC, setDAC, defs::VCAL,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Eiger] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Eiger] Dac for "
|
||||
"?? "); // TODO
|
||||
|
||||
DAC_COMMAND(vcmp_rl, getDAC, setDAC, defs::VCMP_RL,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Eiger] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Eiger] Dac for "
|
||||
"?? "); // TODO
|
||||
|
||||
DAC_COMMAND(vcmp_rr, getDAC, setDAC, defs::VCMP_RR,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Eiger] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Eiger] Dac for "
|
||||
"?? "); // TODO
|
||||
|
||||
DAC_COMMAND(rxb_rb, getDAC, setDAC, defs::RXB_RB,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Eiger] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Eiger] Dac for "
|
||||
"?? "); // TODO
|
||||
|
||||
DAC_COMMAND(rxb_lb, getDAC, setDAC, defs::RXB_LB,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Eiger] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Eiger] Dac for "
|
||||
"?? "); // TODO
|
||||
|
||||
DAC_COMMAND(vcp, getDAC, setDAC, defs::VCP,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Eiger] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Eiger] Dac for "
|
||||
"?? "); // TODO
|
||||
|
||||
DAC_COMMAND(vcn, getDAC, setDAC, defs::VCN,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Eiger] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Eiger] Dac for "
|
||||
"?? "); // TODO
|
||||
|
||||
DAC_COMMAND(vishaper, getDAC, setDAC, defs::VISHAPER,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Eiger] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Eiger] Dac for "
|
||||
"?? \n\t[Mythen3] Dac for "
|
||||
"the bias current for the shaper."); // TODO
|
||||
|
||||
DAC_COMMAND(iodelay, getDAC, setDAC, defs::IO_DELAY,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Eiger] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Eiger] Dac for "
|
||||
"?? "); // TODO
|
||||
|
||||
DAC_COMMAND(vref_ds, getDAC, setDAC, defs::VREF_DS,
|
||||
"[dac or mv value][(optional unit) mv] "
|
||||
"[dac or mV value][(optional unit) mV] "
|
||||
"\n\t[Gotthard][Jungfrau] Dac for ?? "); // TODO
|
||||
|
||||
DAC_COMMAND(vcascn_pb, getDAC, setDAC, defs::VCASCN_PB,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Gotthard] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Gotthard] Dac for "
|
||||
"?? "); // TODO
|
||||
|
||||
DAC_COMMAND(vcascp_pb, getDAC, setDAC, defs::VCASCP_PB,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Gotthard] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Gotthard] Dac for "
|
||||
"?? "); // TODO
|
||||
|
||||
DAC_COMMAND(vout_cm, getDAC, setDAC, defs::VOUT_CM,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Gotthard] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Gotthard] Dac for "
|
||||
"?? \n\t[Moench] Dac for 5"); // TODO
|
||||
|
||||
DAC_COMMAND(vcasc_out, getDAC, setDAC, defs::VCASC_OUT,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Gotthard] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Gotthard] Dac for "
|
||||
"?? "); // TODO
|
||||
|
||||
DAC_COMMAND(vin_cm, getDAC, setDAC, defs::VIN_CM,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Gotthard] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Gotthard] Dac for "
|
||||
"?? \n\t[Moench] Dac for 2"); // TODO
|
||||
|
||||
DAC_COMMAND(vref_comp, getDAC, setDAC, defs::VREF_COMP,
|
||||
"[dac or mv value][(optional unit) mv] "
|
||||
"[dac or mV value][(optional unit) mV] "
|
||||
"\n\t[Gotthard][Jungfrau] Dac for ?? "); // TODO
|
||||
|
||||
DAC_COMMAND(ib_test_c, getDAC, setDAC, defs::IB_TESTC,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Gotthard] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Gotthard] Dac for "
|
||||
"?? "); // TODO
|
||||
|
||||
DAC_COMMAND(vrshaper_n, getDAC, setDAC, defs::VRSHAPER_N,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Mythen3] voltage "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Mythen3] voltage "
|
||||
"to define feedback resistance of the second shaper.");
|
||||
|
||||
DAC_COMMAND(
|
||||
vipre, getDAC, setDAC, defs::VIPRE,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Mythen3] Dac for the "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Mythen3] Dac for the "
|
||||
"preamplifier's input transistor current.\n\t[Moench] Dac for 1");
|
||||
|
||||
DAC_COMMAND(vdcsh, getDAC, setDAC, defs::VDCSH,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Mythen3] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Mythen3] Dac for "
|
||||
"the reference (DC) voltage for the shaper.");
|
||||
|
||||
DAC_COMMAND(vth1, getDAC, setDAC, defs::VTH1,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Mythen3] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Mythen3] Dac for "
|
||||
"first detector threshold voltage.");
|
||||
|
||||
DAC_COMMAND(vth2, getDAC, setDAC, defs::VTH2,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Mythen3] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Mythen3] Dac for "
|
||||
"second detector threshold voltage.");
|
||||
|
||||
DAC_COMMAND(vth3, getDAC, setDAC, defs::VTH3,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Mythen3] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Mythen3] Dac for "
|
||||
"third detector threshold voltage.");
|
||||
|
||||
DAC_COMMAND(vcal_n, getDAC, setDAC, defs::VCAL_N,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Mythen3] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Mythen3] Dac for "
|
||||
"the low voltage for analog pulsing.");
|
||||
|
||||
DAC_COMMAND(vcal_p, getDAC, setDAC, defs::VCAL_P,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Mythen3] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Mythen3] Dac for "
|
||||
"the high voltage for analog pulsing.");
|
||||
|
||||
DAC_COMMAND(vcassh, getDAC, setDAC, defs::VCASSH,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Mythen3] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Mythen3] Dac for "
|
||||
"the shaper's cascode voltage.");
|
||||
|
||||
DAC_COMMAND(vcas, getDAC, setDAC, defs::VCAS,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Mythen3] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Mythen3] Dac for "
|
||||
"the preamplifier's cascode voltage.");
|
||||
|
||||
DAC_COMMAND(vicin, getDAC, setDAC, defs::VICIN,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Mythen3] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Mythen3] Dac for "
|
||||
"the bias current for the comparator.");
|
||||
|
||||
DAC_COMMAND(vipre_out, getDAC, setDAC, defs::VIPRE_OUT,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Mythen3] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Mythen3] Dac for "
|
||||
"preamplifier's output transistor current."); // TODO
|
||||
|
||||
DAC_COMMAND(vref_h_adc, getDAC, setDAC, defs::VREF_H_ADC,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Gotthard2] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Gotthard2] Dac for "
|
||||
"reference voltage high of ADC.");
|
||||
|
||||
DAC_COMMAND(vb_comp_fe, getDAC, setDAC, defs::VB_COMP_FE,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Gotthard2] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Gotthard2] Dac for "
|
||||
"comparator current of analogue front end.");
|
||||
|
||||
DAC_COMMAND(vb_comp_adc, getDAC, setDAC, defs::VB_COMP_ADC,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Gotthard2] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Gotthard2] Dac for "
|
||||
"comparator current of ADC.");
|
||||
|
||||
DAC_COMMAND(vcom_cds, getDAC, setDAC, defs::VCOM_CDS,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Gotthard2] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Gotthard2] Dac for "
|
||||
"common mode voltage of CDS stage.");
|
||||
|
||||
DAC_COMMAND(
|
||||
vref_rstore, getDAC, setDAC, defs::VREF_RSTORE,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Gotthard2] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Gotthard2] Dac for "
|
||||
"reference charging voltage of temparory storage cell in high gain.");
|
||||
|
||||
DAC_COMMAND(vb_opa_1st, getDAC, setDAC, defs::VB_OPA_1ST,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Gotthard2] dac dac "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Gotthard2] dac dac "
|
||||
"for opa current for driving the other DACs in chip.");
|
||||
|
||||
DAC_COMMAND(vref_comp_fe, getDAC, setDAC, defs::VREF_COMP_FE,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Gotthard2] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Gotthard2] Dac for "
|
||||
"reference voltage of the comparator of analogue front end.");
|
||||
|
||||
DAC_COMMAND(vcom_adc1, getDAC, setDAC, defs::VCOM_ADC1,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Gotthard2] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Gotthard2] Dac for "
|
||||
"common mode voltage of ADC DAC bank 1.");
|
||||
|
||||
DAC_COMMAND(
|
||||
vref_prech, getDAC, setDAC, defs::VREF_PRECH,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Gotthard2][Jungfrau] Dac "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Gotthard2][Jungfrau] Dac "
|
||||
"for reference votlage for precharing the preamplifier."); // TODO also
|
||||
// for
|
||||
// jungfrau?
|
||||
|
||||
DAC_COMMAND(vref_l_adc, getDAC, setDAC, defs::VREF_L_ADC,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Gotthard2] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Gotthard2] Dac for "
|
||||
"reference voltage low for ADC.");
|
||||
|
||||
DAC_COMMAND(vref_cds, getDAC, setDAC, defs::VREF_CDS,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Gotthard2] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Gotthard2] Dac for "
|
||||
"reference voltage of CDS applied to the temporary storage "
|
||||
"cell in medium and low gain.");
|
||||
|
||||
DAC_COMMAND(vb_cs, getDAC, setDAC, defs::VB_CS,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Gotthard2] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Gotthard2] Dac for "
|
||||
"current injection into preamplifier.");
|
||||
|
||||
DAC_COMMAND(vb_opa_fd, getDAC, setDAC, defs::VB_OPA_FD,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Gotthard2] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Gotthard2] Dac for "
|
||||
"current for CDS opa stage.");
|
||||
|
||||
DAC_COMMAND(vcom_adc2, getDAC, setDAC, defs::VCOM_ADC2,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Gotthard2] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Gotthard2] Dac for "
|
||||
"common mode voltage of ADC DAC bank 2.");
|
||||
|
||||
DAC_COMMAND(
|
||||
adcvpp, getDAC, setDAC, defs::ADC_VPP,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Ctb][Moench] Vpp of "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Ctb][Moench] Vpp of "
|
||||
"ADC.\n\t 0 -> 1V ; 1 -> 1.14V ; 2 -> 1.33V ; 3 -> 1.6V ; 4 -> 2V.");
|
||||
|
||||
DAC_COMMAND(vb_ds, getDAC, setDAC, defs::VB_DS,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Jungfrau] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Jungfrau] Dac for "
|
||||
"??"); // TODO
|
||||
|
||||
DAC_COMMAND(vb_comp, getDAC, setDAC, defs::VB_COMP,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Jungfrau] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Jungfrau] Dac for "
|
||||
"??"); // TODO
|
||||
|
||||
DAC_COMMAND(vb_pixbuf, getDAC, setDAC, defs::VB_PIXBUF,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Jungfrau] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Jungfrau] Dac for "
|
||||
"??"); // TODO
|
||||
|
||||
DAC_COMMAND(vin_com, getDAC, setDAC, defs::VIN_COM,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Jungfrau] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Jungfrau] Dac for "
|
||||
"??"); // TODO
|
||||
|
||||
DAC_COMMAND(vdd_prot, getDAC, setDAC, defs::VDD_PROT,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Jungfrau] Dac for "
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Jungfrau] Dac for "
|
||||
"??"); // TODO
|
||||
|
||||
DAC_COMMAND(vbp_colbuf, getDAC, setDAC, defs::VBP_COLBUF,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Moench] Dac for 0");
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Moench] Dac for 0");
|
||||
|
||||
DAC_COMMAND(vb_sda, getDAC, setDAC, defs::VB_SDA,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Moench] Dac for 3");
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Moench] Dac for 3");
|
||||
|
||||
DAC_COMMAND(vcasc_sfp, getDAC, setDAC, defs::VCASC_SFP,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Moench] Dac for 4");
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Moench] Dac for 4");
|
||||
|
||||
DAC_COMMAND(vipre_cds, getDAC, setDAC, defs::VIPRE_CDS,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Moench] Dac for 6");
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Moench] Dac for 6");
|
||||
|
||||
DAC_COMMAND(ibias_sfp, getDAC, setDAC, defs::IBIAS_SFP,
|
||||
"[dac or mv value][(optional unit) mv] \n\t[Moench] Dac for 7");
|
||||
"[dac or mV value][(optional unit) mV] \n\t[Moench] Dac for 7");
|
||||
|
||||
GET_COMMAND_NOID(
|
||||
daclist, getDacList,
|
||||
"\n\tGets the list of commands for every dac for this detector.");
|
||||
|
||||
/* on chip dacs */
|
||||
INTEGER_USER_IND_COMMAND(
|
||||
@ -1563,11 +1615,14 @@ class CmdProxy {
|
||||
"\n\tStops receiver listener for detector data packets and closes "
|
||||
"current data file (if file write enabled).");
|
||||
|
||||
EXECUTE_SET_COMMAND_NOID(start, startDetector,
|
||||
"\n\tStarts detector state machine.");
|
||||
EXECUTE_SET_COMMAND_NOID(
|
||||
start, startDetector,
|
||||
"\n\tStarts detector acquisition. Status changes to RUNNING or WAITING "
|
||||
"and automatically returns to idle at the end of acquisition.");
|
||||
|
||||
EXECUTE_SET_COMMAND_NOID(stop, stopDetector,
|
||||
"\n\tStops detector state machine.");
|
||||
EXECUTE_SET_COMMAND_NOID(
|
||||
stop, stopDetector,
|
||||
"\n\tAbort detector acquisition. Status changes to IDLE or STOPPED.");
|
||||
|
||||
GET_COMMAND(rx_framescaught, getFramesCaught,
|
||||
"\n\tNumber of frames caught by receiver.");
|
||||
@ -1577,8 +1632,9 @@ class CmdProxy {
|
||||
|
||||
INTEGER_COMMAND(startingfnum, getStartingFrameNumber,
|
||||
setStartingFrameNumber, StringTo<uint64_t>,
|
||||
"[n_value]\n\t[Eiger[Jungfrau] Starting frame number for "
|
||||
"next acquisition.");
|
||||
"[n_value]\n\t[Eiger][Jungfrau] Starting frame number for "
|
||||
"next acquisition. Stopping acquiistion might result in "
|
||||
"different frame numbers for different modules.");
|
||||
|
||||
EXECUTE_SET_COMMAND(
|
||||
trigger, sendSoftwareTrigger,
|
||||
@ -1594,11 +1650,12 @@ class CmdProxy {
|
||||
numinterfaces, getNumberofUDPInterfaces, setNumberofUDPInterfaces,
|
||||
StringTo<int>,
|
||||
"[1, 2]\n\t[Jungfrau][Gotthard2] Number of udp interfaces to stream "
|
||||
"data from detector. Default: 1.\n\t"
|
||||
"[Gotthard2] 2 will select 10gbps as channel for veto data streaming "
|
||||
"in detector and also enable second interface in receiver to listen to "
|
||||
"it. This is mainly for debugging purposes. By default, numinterfaces "
|
||||
"is 1 and if veto enabled, it is sent via 2.5 gbps interface");
|
||||
"data from detector. Default: 1.\n\tAlso enables second interface in "
|
||||
"receiver for listening (Writes a file per interface if writing "
|
||||
"enabled).\n\tAlso restarts client and receiver zmq sockets if zmq "
|
||||
"streaming enabled.\n\t[Gotthard2] second interface enabled to send "
|
||||
"veto information via 10Gbps for debugging. By default, if veto "
|
||||
"enabled, it is sent via 2.5 gbps interface.");
|
||||
|
||||
INTEGER_COMMAND(
|
||||
selinterface, getSelectedUDPInterface, selectUDPInterface,
|
||||
@ -1644,7 +1701,7 @@ class CmdProxy {
|
||||
StringTo<int>,
|
||||
"[n]\n\tDefault is 50002.\n\t[Jungfrau] Port number of the receiver "
|
||||
"(destination) udp interface where the second half of detector data is "
|
||||
"sent to. \n[Eiger] Port number of the reciever (desintation) udp "
|
||||
"sent to. \n\t[Eiger] Port number of the reciever (desintation) udp "
|
||||
"interface where the right half of the detector data is sent to.");
|
||||
|
||||
EXECUTE_SET_COMMAND(
|
||||
@ -1672,10 +1729,13 @@ class CmdProxy {
|
||||
INTEGER_COMMAND(
|
||||
txndelay_frame, getTransmissionDelayFrame, setTransmissionDelayFrame,
|
||||
StringTo<int>,
|
||||
"[n_delay]\n\t[Eiger][Jungfrau] Transmission delay of each image being "
|
||||
"[n_delay]\n\t[Eiger][Jungfrau][Mythen3] Transmission delay of each "
|
||||
"image being "
|
||||
"streamed out of the module.\n\t[Jungfrau] [0-31] Each value "
|
||||
"represents 1 ms\n\t[Eiger] Additional delay to txndelay_left and "
|
||||
"txndelay_right. Each value represents 10ns. Typical value is 50000.");
|
||||
"txndelay_right. Each value represents 10ns. Typical value is "
|
||||
"50000.\n\t[Mythen3] [0-16777215] Each value represents 8 ns (125 MHz "
|
||||
"clock), max is 134 ms.");
|
||||
|
||||
INTEGER_COMMAND(
|
||||
txndelay_left, getTransmissionDelayLeft, setTransmissionDelayLeft,
|
||||
@ -1702,7 +1762,7 @@ class CmdProxy {
|
||||
|
||||
INTEGER_COMMAND(rx_fifodepth, getRxFifoDepth, setRxFifoDepth, StringTo<int>,
|
||||
"[n_frames]\n\tSet the number of frames in the receiver "
|
||||
"fifo (buffer between listener and writer threads).");
|
||||
"fifo depth (buffer between listener and writer threads).");
|
||||
|
||||
INTEGER_COMMAND(
|
||||
rx_silent, getRxSilentMode, setRxSilentMode, StringTo<int>,
|
||||
@ -1719,21 +1779,21 @@ class CmdProxy {
|
||||
INTEGER_COMMAND(rx_padding, getPartialFramesPadding,
|
||||
setPartialFramesPadding, StringTo<int>,
|
||||
"[0, 1]\n\tPartial frames padding enable in the "
|
||||
"receiver. 0 does not pad partial frames(fastest), 1 "
|
||||
"(default) pads partial frames");
|
||||
"receiver. Default: enabled. Disabling is fastest.");
|
||||
|
||||
INTEGER_COMMAND(
|
||||
rx_udpsocksize, getRxUDPSocketBufferSize, setRxUDPSocketBufferSize,
|
||||
StringTo<int64_t>,
|
||||
"[n_size]\n\tUDP socket buffer size in receiver. Tune rmem_default and "
|
||||
"rmem_max accordingly. rx_hostname sets it to defaults.");
|
||||
"rmem_max accordingly.");
|
||||
|
||||
GET_COMMAND(rx_realudpsocksize, getRxRealUDPSocketBufferSize,
|
||||
"\n\tActual udp socket buffer size. Double the size of "
|
||||
"rx_udpsocksize due to kernel bookkeeping.");
|
||||
|
||||
INTEGER_COMMAND(rx_lock, getRxLock, setRxLock, StringTo<int>,
|
||||
"[0, 1]\n\tLock receiver to one IP, 1: locks");
|
||||
"[0, 1]\n\tLock receiver to one client IP, 1 locks, 0 "
|
||||
"unlocks. Default is unlocked. 1: locks");
|
||||
|
||||
GET_COMMAND(
|
||||
rx_lastclient, getRxLastClientIP,
|
||||
@ -1757,15 +1817,17 @@ class CmdProxy {
|
||||
|
||||
STRING_COMMAND(
|
||||
fpath, getFilePath, setFilePath,
|
||||
"[path]\n\tDirectory where output data files are written in receiver.");
|
||||
"[path]\n\tDirectory where output data files are written in receiver. "
|
||||
"If path does not exist, it will try to create it.");
|
||||
|
||||
STRING_COMMAND(fname, getFileNamePrefix, setFileNamePrefix,
|
||||
"[path]\n\tFile name prefix for output data file. Default "
|
||||
"[name]\n\tFile name prefix for output data file. Default "
|
||||
"is run. File name: [file name prefix]_d[detector "
|
||||
"index]_f[sub file index]_[acquisition/file index].raw.");
|
||||
|
||||
INTEGER_COMMAND(findex, getAcquisitionIndex, setAcquisitionIndex,
|
||||
StringTo<int64_t>, "[0, 1]\n\tFile or Acquisition index.");
|
||||
StringTo<int64_t>,
|
||||
"[n_value]\n\tFile or Acquisition index.");
|
||||
|
||||
INTEGER_COMMAND(
|
||||
fwrite, getFileWrite, setFileWrite, StringTo<int>,
|
||||
@ -1788,17 +1850,20 @@ class CmdProxy {
|
||||
|
||||
INTEGER_COMMAND(
|
||||
rx_datastream, getRxZmqDataStream, setRxZmqDataStream, StringTo<int>,
|
||||
"[0, 1]\n\tData streaming from receiver enable (eg. to GUI ot another "
|
||||
"process for further processing). 1 enables zmq data stream (creates "
|
||||
"zmq streamer threads), 0 disables (destroys streamer threads). "
|
||||
"Switching to Gui automatically enables data streaming in receiver. "
|
||||
"Switching back to command line acquire will require disabling data "
|
||||
"streaming in receiver for fast applications.");
|
||||
"[0, 1]\n\tEnable/ disable data streaming from receiver via zmq (eg. "
|
||||
"to GUI or to another process for further processing). This creates/ "
|
||||
"destroys zmq streamer threads in receiver. \n\tSwitching to Gui "
|
||||
"automatically enables data streaming in receiver. \n\tSwitching back "
|
||||
"to command line acquire will require disabling data streaming in "
|
||||
"receiver for fast applications. ");
|
||||
|
||||
INTEGER_COMMAND(
|
||||
rx_readfreq, getRxZmqFrequency, setRxZmqFrequency, StringTo<int>,
|
||||
"[nth frame]\n\tStream out every nth frame. Default is 1. 0 means "
|
||||
"streaming every 200 ms and discarding frames in this interval.");
|
||||
"[nth frame]\n\tFrequency of frames streamed out from receiver via "
|
||||
"zmq\n\tDefault: 1, Means every frame is streamed out. \n\tIf 2, every "
|
||||
"second frame is streamed out. \n\tIf 0, streaming timer is the "
|
||||
"timeout, after which current frame is sent out. (default timeout is "
|
||||
"200 ms). Usually used for gui purposes.");
|
||||
|
||||
INTEGER_COMMAND(rx_zmqstartfnum, getRxZmqStartingFrame,
|
||||
setRxZmqStartingFrame, StringTo<int>,
|
||||
@ -1829,7 +1894,7 @@ class CmdProxy {
|
||||
"[x.x.x.x]\n\tZmq Ip Address from which data is to be streamed out of "
|
||||
"the receiver. Also restarts receiver zmq streaming if enabled. "
|
||||
"Default is from rx_hostname. Modified only when using an intermediate "
|
||||
"process between receiver and client(gui).");
|
||||
"process between receiver.");
|
||||
|
||||
INTEGER_COMMAND(
|
||||
zmqip, getClientZmqIp, setClientZmqIp, IpAddr,
|
||||
@ -1843,22 +1908,20 @@ class CmdProxy {
|
||||
|
||||
TIME_COMMAND(subexptime, getSubExptime, setSubExptime,
|
||||
"[duration] [(optional unit) ns|us|ms|s]\n\t[Eiger] Exposure "
|
||||
"time of EIGER subframes");
|
||||
"time of EIGER subframes in 32 bit mode.");
|
||||
|
||||
TIME_COMMAND(subdeadtime, getSubDeadTime, setSubDeadTime,
|
||||
"[duration] [(optional unit) ns|us|ms|s]\n\t[Eiger] Dead time "
|
||||
"of EIGER subframes. Subperiod = subexptime + subdeadtime.");
|
||||
"of EIGER subframes in 32 bit mode. Subperiod = subexptime + "
|
||||
"subdeadtime.");
|
||||
|
||||
STRING_COMMAND(
|
||||
settingspath, getSettingsPath, setSettingsPath,
|
||||
"[path]\n\t[Eiger] Directory where settings files are loaded from/to.");
|
||||
|
||||
INTEGER_COMMAND(parallel, getParallelMode, setParallelMode, StringTo<int>,
|
||||
"[0, 1]\n\t[Eiger] Enable or disable parallel mode.");
|
||||
|
||||
INTEGER_COMMAND(overflow, getOverFlowMode, setOverFlowMode, StringTo<int>,
|
||||
"[0, 1]\n\t[Eiger] Enable or disable show overflow flag in "
|
||||
"32 bit mode.");
|
||||
"32 bit mode. Default is disabled.");
|
||||
|
||||
INTEGER_COMMAND(
|
||||
flippeddatax, getBottom, setBottom, StringTo<int>,
|
||||
@ -1880,8 +1943,8 @@ class CmdProxy {
|
||||
|
||||
TIME_GET_COMMAND(measuredperiod, getMeasuredPeriod,
|
||||
"[(optional unit) ns|us|ms|s]\n\t[Eiger] Measured frame "
|
||||
"period between last frame and previous one. Useful data "
|
||||
"only for acquisitions with more than 1 frame.");
|
||||
"period between last frame and previous one. Can be "
|
||||
"measured with minimum 2 frames in an acquisition.");
|
||||
|
||||
TIME_GET_COMMAND(measuredsubperiod, getMeasuredSubFramePeriod,
|
||||
"[(optional unit) ns|us|ms|s]\n\t[Eiger] Measured sub "
|
||||
@ -1890,7 +1953,8 @@ class CmdProxy {
|
||||
INTEGER_COMMAND(
|
||||
partialreset, getPartialReset, setPartialReset, StringTo<int>,
|
||||
"[0, 1]\n\t[Eiger] Sets up detector to do partial or complete reset at "
|
||||
"start of acquisition. 0 complete reset, 1 partial reset.");
|
||||
"start of acquisition. 0 complete reset, 1 partial reset. Default is "
|
||||
"complete reset. Advanced function!");
|
||||
|
||||
/* Jungfrau Specific */
|
||||
|
||||
@ -1916,11 +1980,12 @@ class CmdProxy {
|
||||
INTEGER_COMMAND(
|
||||
auto_comp_disable, getAutoCompDisable, setAutoCompDisable,
|
||||
StringTo<int>,
|
||||
"[0, 1]\n\t[Jungfrau] Auto comparator disable mode. Default 0 or this "
|
||||
"mode disabled(comparator enabled throughout). 1 enables mode. 0 "
|
||||
"disables mode. This mode disables the on-chip gain switching "
|
||||
"comparator automatically after 93.75% of exposure time (only for "
|
||||
"longer than 100us).");
|
||||
"[0, 1]\n\t[Jungfrau] Auto comparator disable mode. By default, the "
|
||||
"on-chip gain switching is active during the entire exposure.This mode "
|
||||
"disables the on - chip gain switching comparator automatically after "
|
||||
"93.75% of exposure time (only for longer than 100us). \n\tDefault is "
|
||||
"0 or this mode disabled(comparator enabled throughout). 1 enables "
|
||||
"mode. 0 disables mode. ");
|
||||
|
||||
INTEGER_COMMAND_NOID(
|
||||
storagecells, getNumberOfAdditionalStorageCells,
|
||||
@ -1939,7 +2004,7 @@ class CmdProxy {
|
||||
storagecell_delay, getStorageCellDelay, setStorageCellDelay,
|
||||
"[duration (0-1638375 ns)] [(optional unit) ns|us|ms|s]\n\t[Jungfrau] "
|
||||
"Additional time delay between 2 consecutive exposures in burst mode "
|
||||
"(total time gap = (ET + 1 + 86) * 25ns). For advanced users only.");
|
||||
"(resolution of 25ns). For advanced users only.");
|
||||
|
||||
/* Gotthard Specific */
|
||||
TIME_GET_COMMAND(exptimel, getExptimeLeft,
|
||||
@ -1991,7 +2056,7 @@ class CmdProxy {
|
||||
INTEGER_COMMAND(
|
||||
asamples, getNumberOfAnalogSamples, setNumberOfAnalogSamples,
|
||||
StringTo<int>,
|
||||
"[0, 1]\n\t[CTB][Moench] Number of analog samples expected.");
|
||||
"[n_samples]\n\t[CTB][Moench] Number of analog samples expected.");
|
||||
|
||||
INTEGER_COMMAND(
|
||||
adcclk, getADCClock, setADCClock, StringTo<int>,
|
||||
@ -2027,7 +2092,7 @@ class CmdProxy {
|
||||
|
||||
INTEGER_COMMAND(dsamples, getNumberOfDigitalSamples,
|
||||
setNumberOfDigitalSamples, StringTo<int>,
|
||||
"[0, 1]\n\t[CTB] Number of digital samples expected.");
|
||||
"[n_value]\n\t[CTB] Number of digital samples expected.");
|
||||
|
||||
INTEGER_COMMAND(romode, getReadoutMode, setReadoutMode,
|
||||
sls::StringTo<slsDetectorDefs::readoutMode>,
|
||||
@ -2109,9 +2174,10 @@ class CmdProxy {
|
||||
"[0-63]\n\t[Ctb] Sampling source signal for digital data. "
|
||||
"For advanced users only.");
|
||||
|
||||
INTEGER_COMMAND(
|
||||
rx_dbitoffset, getRxDbitOffset, setRxDbitOffset, StringTo<int>,
|
||||
"[n_bytes]\n\t[Ctb] Offset in bytes in digital data in receiver.");
|
||||
INTEGER_COMMAND(rx_dbitoffset, getRxDbitOffset, setRxDbitOffset,
|
||||
StringTo<int>,
|
||||
"[n_bytes]\n\t[Ctb] Offset in bytes in digital data to "
|
||||
"skip in receiver.");
|
||||
|
||||
INTEGER_COMMAND(led, getLEDEnable, setLEDEnable, StringTo<int>,
|
||||
"[0, 1]\n\t[Ctb] Switches on/off all LEDs.");
|
||||
@ -2130,13 +2196,14 @@ class CmdProxy {
|
||||
|
||||
INTEGER_COMMAND_HEX_WIDTH16(
|
||||
patmask, getPatternMask, setPatternMask, StringTo<uint64_t>,
|
||||
"[64 bit mask]\n\t[Ctb][Moench][Mythen3] 64 bit mask applied to every "
|
||||
"pattern. Only these bits for each pattern will be masked against.");
|
||||
"[64 bit mask]\n\t[Ctb][Moench][Mythen3] Sets the mask applied to "
|
||||
"every pattern to the selected bits.");
|
||||
|
||||
INTEGER_COMMAND_HEX_WIDTH16(
|
||||
patsetbit, getPatternBitMask, setPatternBitMask, StringTo<uint64_t>,
|
||||
"[64 bit mask]\n\t[Ctb][Moench][Mythen3] 64 bit values "
|
||||
"applied to the selected patmask for every pattern.");
|
||||
"[64 bit mask]\n\t[Ctb][Moench][Mythen3] Selects the bits that will "
|
||||
"have a pattern mask applied to the selected patmask for every "
|
||||
"pattern.");
|
||||
|
||||
EXECUTE_SET_COMMAND(patternstart, startPattern,
|
||||
"\n\t[Mythen3] Starts Pattern");
|
||||
@ -2213,8 +2280,9 @@ class CmdProxy {
|
||||
"CTB] Timestamp at a frame start."
|
||||
"\n\t[Gotthard2] only in continuous mode.");
|
||||
|
||||
GET_COMMAND(rx_frameindex, getRxCurrentFrameIndex,
|
||||
"\n\tCurrent frame index received in receiver.");
|
||||
GET_COMMAND(
|
||||
rx_frameindex, getRxCurrentFrameIndex,
|
||||
"\n\tCurrent frame index received in receiver during acquisition.");
|
||||
};
|
||||
|
||||
} // namespace sls
|
||||
|
@ -60,29 +60,31 @@ void Detector::loadConfig(const std::string &fname) {
|
||||
}
|
||||
|
||||
void Detector::loadParameters(const std::string &fname) {
|
||||
CmdProxy proxy(this);
|
||||
CmdParser parser;
|
||||
std::ifstream input_file;
|
||||
input_file.open(fname.c_str(), std::ios_base::in);
|
||||
if (!input_file.is_open()) {
|
||||
std::ifstream input_file(fname);
|
||||
if (!input_file) {
|
||||
throw RuntimeError("Could not open configuration file " + fname +
|
||||
" for reading");
|
||||
}
|
||||
std::string current_line;
|
||||
while (input_file.good()) {
|
||||
getline(input_file, current_line);
|
||||
if (current_line.find('#') != std::string::npos) {
|
||||
current_line.erase(current_line.find('#'));
|
||||
std::vector<std::string> parameters;
|
||||
for (std::string line; std::getline(input_file, line);) {
|
||||
if (line.find('#') != std::string::npos) {
|
||||
line.erase(line.find('#'));
|
||||
}
|
||||
LOG(logDEBUG1) << "current_line after removing comments:\n\t"
|
||||
<< current_line;
|
||||
if (current_line.length() > 1) {
|
||||
parser.Parse(current_line);
|
||||
proxy.Call(parser.command(), parser.arguments(),
|
||||
parser.detector_id(), defs::PUT_ACTION);
|
||||
if (line.length() > 1) {
|
||||
parameters.push_back(line);
|
||||
}
|
||||
}
|
||||
input_file.close();
|
||||
loadParameters(parameters);
|
||||
}
|
||||
|
||||
void Detector::loadParameters(const std::vector<std::string> ¶meters) {
|
||||
CmdProxy proxy(this);
|
||||
CmdParser parser;
|
||||
for (const auto ¤t_line : parameters) {
|
||||
parser.Parse(current_line);
|
||||
proxy.Call(parser.command(), parser.arguments(), parser.detector_id(),
|
||||
defs::PUT_ACTION);
|
||||
}
|
||||
}
|
||||
|
||||
Result<std::string> Detector::getHostname(Positions pos) const {
|
||||
@ -241,6 +243,7 @@ Result<ns> Detector::getExptime(Positions pos) const {
|
||||
|
||||
void Detector::setExptime(ns t, Positions pos) {
|
||||
pimpl->Parallel(&Module::setExptime, pos, -1, t.count());
|
||||
updateRxRateCorrections();
|
||||
}
|
||||
|
||||
Result<ns> Detector::getPeriod(Positions pos) const {
|
||||
@ -284,6 +287,17 @@ void Detector::setDynamicRange(int value) {
|
||||
updateRxRateCorrections();
|
||||
}
|
||||
|
||||
std::vector<int> Detector::getDynamicRangeList() const {
|
||||
switch (getDetectorType().squash()) {
|
||||
case defs::EIGER:
|
||||
return std::vector<int>{4, 8, 16, 32};
|
||||
case defs::MYTHEN3:
|
||||
return std::vector<int>{8, 16, 32};
|
||||
default:
|
||||
return std::vector<int>{16};
|
||||
}
|
||||
}
|
||||
|
||||
Result<defs::timingMode> Detector::getTimingMode(Positions pos) const {
|
||||
return pimpl->Parallel(&Module::getTimingMode, pos);
|
||||
}
|
||||
@ -292,6 +306,22 @@ void Detector::setTimingMode(defs::timingMode value, Positions pos) {
|
||||
pimpl->Parallel(&Module::setTimingMode, pos, value);
|
||||
}
|
||||
|
||||
std::vector<defs::timingMode> Detector::getTimingModeList() const {
|
||||
switch (getDetectorType().squash()) {
|
||||
case defs::EIGER:
|
||||
return std::vector<defs::timingMode>{defs::AUTO_TIMING,
|
||||
defs::TRIGGER_EXPOSURE,
|
||||
defs::GATED, defs::BURST_TRIGGER};
|
||||
case defs::MYTHEN3:
|
||||
return std::vector<defs::timingMode>{defs::AUTO_TIMING,
|
||||
defs::TRIGGER_EXPOSURE,
|
||||
defs::GATED, defs::TRIGGER_GATED};
|
||||
default:
|
||||
return std::vector<defs::timingMode>{defs::AUTO_TIMING,
|
||||
defs::TRIGGER_EXPOSURE};
|
||||
}
|
||||
}
|
||||
|
||||
Result<defs::speedLevel> Detector::getSpeed(Positions pos) const {
|
||||
auto res = pimpl->Parallel(&Module::getClockDivider, pos, defs::RUN_CLOCK);
|
||||
Result<defs::speedLevel> speedResult(res.size());
|
||||
@ -417,6 +447,26 @@ void Detector::setImageTestMode(int value, Positions pos) {
|
||||
pimpl->Parallel(&Module::setImageTestMode, pos, value);
|
||||
}
|
||||
|
||||
std::vector<defs::dacIndex> Detector::getTemperatureList() const {
|
||||
std::vector<defs::dacIndex> retval;
|
||||
switch (getDetectorType().squash()) {
|
||||
case defs::CHIPTESTBOARD:
|
||||
return std::vector<defs::dacIndex>{defs::SLOW_ADC_TEMP};
|
||||
case defs::JUNGFRAU:
|
||||
case defs::GOTTHARD:
|
||||
return std::vector<defs::dacIndex>{defs::TEMPERATURE_ADC,
|
||||
defs::TEMPERATURE_FPGA};
|
||||
case defs::EIGER:
|
||||
return std::vector<defs::dacIndex>{
|
||||
defs::TEMPERATURE_FPGA, defs::TEMPERATURE_FPGAEXT,
|
||||
defs::TEMPERATURE_10GE, defs::TEMPERATURE_DCDC,
|
||||
defs::TEMPERATURE_SODL, defs::TEMPERATURE_SODR,
|
||||
defs::TEMPERATURE_FPGA2, defs::TEMPERATURE_FPGA3};
|
||||
default:
|
||||
return std::vector<defs::dacIndex>{};
|
||||
}
|
||||
}
|
||||
|
||||
Result<int> Detector::getTemperature(defs::dacIndex index,
|
||||
Positions pos) const {
|
||||
switch (index) {
|
||||
@ -525,6 +575,14 @@ void Detector::setExternalSignalFlags(int signalIndex,
|
||||
pimpl->Parallel(&Module::setExternalSignalFlags, pos, signalIndex, value);
|
||||
}
|
||||
|
||||
Result<bool> Detector::getParallelMode(Positions pos) const {
|
||||
return pimpl->Parallel(&Module::getParallelMode, pos);
|
||||
}
|
||||
|
||||
void Detector::setParallelMode(bool value, Positions pos) {
|
||||
pimpl->Parallel(&Module::setParallelMode, pos, value);
|
||||
}
|
||||
|
||||
// Acquisition
|
||||
|
||||
void Detector::acquire() { pimpl->acquire(); }
|
||||
@ -1079,14 +1137,6 @@ void Detector::setSettingsPath(const std::string &value, Positions pos) {
|
||||
pimpl->Parallel(&Module::setSettingsDir, pos, value);
|
||||
}
|
||||
|
||||
Result<bool> Detector::getParallelMode(Positions pos) const {
|
||||
return pimpl->Parallel(&Module::getParallelMode, pos);
|
||||
}
|
||||
|
||||
void Detector::setParallelMode(bool value, Positions pos) {
|
||||
pimpl->Parallel(&Module::setParallelMode, pos, value);
|
||||
}
|
||||
|
||||
Result<bool> Detector::getOverFlowMode(Positions pos) const {
|
||||
return pimpl->Parallel(&Module::getOverFlowMode, pos);
|
||||
}
|
||||
@ -1432,7 +1482,6 @@ Result<ns> Detector::getExptime(int gateIndex, Positions pos) const {
|
||||
|
||||
void Detector::setExptime(int gateIndex, ns t, Positions pos) {
|
||||
pimpl->Parallel(&Module::setExptime, pos, gateIndex, t.count());
|
||||
updateRxRateCorrections();
|
||||
}
|
||||
|
||||
Result<std::array<ns, 3>> Detector::getExptimeForAllGates(Positions pos) const {
|
||||
@ -1558,6 +1607,8 @@ Result<defs::readoutMode> Detector::getReadoutMode(Positions pos) const {
|
||||
return pimpl->Parallel(&Module::getReadoutMode, pos);
|
||||
}
|
||||
|
||||
/** Options: ANALOG_ONLY, DIGITAL_ONLY, ANALOG_AND_DIGITAL \n
|
||||
* Default: ANALOG_ONLY */
|
||||
void Detector::setReadoutMode(defs::readoutMode value, Positions pos) {
|
||||
pimpl->Parallel(&Module::setReadoutMode, pos, value);
|
||||
}
|
||||
|
@ -288,16 +288,30 @@ void DetectorImpl::updateDetectorSize() {
|
||||
LOG(logDEBUG) << "Updating Multi-Detector Size: " << size();
|
||||
|
||||
const slsDetectorDefs::xy det_size = detectors[0]->getNumberOfChannels();
|
||||
|
||||
int maxx = multi_shm()->numberOfChannels.x;
|
||||
int maxy = multi_shm()->numberOfChannels.y;
|
||||
if (maxy == 0) {
|
||||
maxy = det_size.y * size();
|
||||
int ndetx = 0, ndety = 0;
|
||||
// 1d, add detectors along x axis
|
||||
if (det_size.y == 1) {
|
||||
if (maxx == 0) {
|
||||
maxx = det_size.x * size();
|
||||
}
|
||||
ndetx = maxx / det_size.x;
|
||||
ndety = size() / ndetx;
|
||||
if ((maxx % det_size.x) > 0) {
|
||||
++ndety;
|
||||
}
|
||||
}
|
||||
|
||||
int ndety = maxy / det_size.y;
|
||||
int ndetx = size() / ndety;
|
||||
if ((maxy % det_size.y) > 0) {
|
||||
++ndetx;
|
||||
// 2d, add detectors along y axis (due to eiger top/bottom)
|
||||
else {
|
||||
if (maxy == 0) {
|
||||
maxy = det_size.y * size();
|
||||
}
|
||||
ndety = maxy / det_size.y;
|
||||
ndetx = size() / ndety;
|
||||
if ((maxy % det_size.y) > 0) {
|
||||
++ndetx;
|
||||
}
|
||||
}
|
||||
|
||||
multi_shm()->numberOfDetector.x = ndetx;
|
||||
@ -464,7 +478,7 @@ void DetectorImpl::readFrameFromReceiver() {
|
||||
std::string currentFileName;
|
||||
uint64_t currentAcquisitionIndex = -1, currentFrameIndex = -1,
|
||||
currentFileIndex = -1;
|
||||
int currentProgress = -1;
|
||||
double currentProgress = 0.00;
|
||||
uint32_t currentSubFrameIndex = -1, coordX = -1, coordY = -1,
|
||||
flippedDataX = -1;
|
||||
|
||||
@ -1074,8 +1088,8 @@ int DetectorImpl::acquire() {
|
||||
if (acquisition_finished != nullptr) {
|
||||
int status = Parallel(&Module::getRunStatus, {}).squash(ERROR);
|
||||
auto a = Parallel(&Module::getReceiverProgress, {});
|
||||
int progress = (*std::min_element(a.begin(), a.end()));
|
||||
acquisition_finished((double)progress, status, acqFinished_p);
|
||||
double progress = (*std::min_element(a.begin(), a.end()));
|
||||
acquisition_finished(progress, status, acqFinished_p);
|
||||
}
|
||||
|
||||
sem_destroy(&sem_newRTAcquisition);
|
||||
@ -1095,8 +1109,9 @@ int DetectorImpl::acquire() {
|
||||
}
|
||||
|
||||
void DetectorImpl::printProgress(double progress) {
|
||||
std::cout << std::fixed << std::setprecision(2) << std::setw(6) << progress
|
||||
<< " \%";
|
||||
// spaces for python printout
|
||||
std::cout << " " << std::fixed << std::setprecision(2) << std::setw(6)
|
||||
<< progress << " \%";
|
||||
std::cout << '\r' << std::flush;
|
||||
}
|
||||
|
||||
|
@ -382,6 +382,14 @@ void Module::setExternalSignalFlags(int signalIndex, externalSignalFlag type) {
|
||||
sendToDetector(F_SET_EXTERNAL_SIGNAL_FLAG, args, nullptr);
|
||||
}
|
||||
|
||||
bool Module::getParallelMode() const {
|
||||
return sendToDetector<int>(F_GET_PARALLEL_MODE);
|
||||
}
|
||||
|
||||
void Module::setParallelMode(const bool enable) {
|
||||
sendToDetector(F_SET_PARALLEL_MODE, static_cast<int>(enable), nullptr);
|
||||
}
|
||||
|
||||
// Acquisition
|
||||
|
||||
void Module::startReceiver() {
|
||||
@ -429,8 +437,8 @@ slsDetectorDefs::runStatus Module::getReceiverStatus() const {
|
||||
return sendToReceiver<runStatus>(F_GET_RECEIVER_STATUS);
|
||||
}
|
||||
|
||||
int Module::getReceiverProgress() const {
|
||||
return sendToReceiver<int>(F_GET_RECEIVER_PROGRESS);
|
||||
double Module::getReceiverProgress() const {
|
||||
return sendToReceiver<double>(F_GET_RECEIVER_PROGRESS);
|
||||
}
|
||||
|
||||
int64_t Module::getFramesCaughtByReceiver() const {
|
||||
@ -474,6 +482,9 @@ defs::scanParameters Module::getScan() const {
|
||||
|
||||
void Module::setScan(const defs::scanParameters t) {
|
||||
auto retval = sendToDetector<int64_t>(F_SET_SCAN, t);
|
||||
if (shm()->useReceiverFlag) {
|
||||
sendToReceiver(F_SET_RECEIVER_SCAN, t, nullptr);
|
||||
}
|
||||
// if disabled, retval is 1, else its number of steps
|
||||
setNumberOfFrames(retval);
|
||||
}
|
||||
@ -1083,6 +1094,9 @@ void Module::setThresholdEnergy(int e_eV, detectorSettings isettings,
|
||||
// check as there is client processing
|
||||
if (shm()->myDetectorType == EIGER) {
|
||||
setThresholdEnergyAndSettings(e_eV, isettings, trimbits);
|
||||
if (shm()->useReceiverFlag) {
|
||||
sendToReceiver(F_RECEIVER_SET_THRESHOLD, e_eV, nullptr);
|
||||
}
|
||||
}
|
||||
// moench - send threshold energy to processor
|
||||
else if (shm()->myDetectorType == MOENCH) {
|
||||
@ -1102,14 +1116,6 @@ std::string Module::setSettingsDir(const std::string &dir) {
|
||||
return shm()->settingsDir;
|
||||
}
|
||||
|
||||
bool Module::getParallelMode() const {
|
||||
return sendToDetector<int>(F_GET_PARALLEL_MODE);
|
||||
}
|
||||
|
||||
void Module::setParallelMode(const bool enable) {
|
||||
sendToDetector(F_SET_PARALLEL_MODE, static_cast<int>(enable), nullptr);
|
||||
}
|
||||
|
||||
bool Module::getOverFlowMode() const {
|
||||
return sendToDetector<int>(F_GET_OVERFLOW_MODE);
|
||||
}
|
||||
@ -1863,7 +1869,7 @@ std::vector<int> Module::getReceiverDbitList() const {
|
||||
F_GET_RECEIVER_DBIT_LIST);
|
||||
}
|
||||
|
||||
void Module::setReceiverDbitList(const std::vector<int> &list) {
|
||||
void Module::setReceiverDbitList(std::vector<int> list) {
|
||||
LOG(logDEBUG1) << "Setting Receiver Dbit List";
|
||||
if (list.size() > 64) {
|
||||
throw sls::RuntimeError("Dbit list size cannot be greater than 64\n");
|
||||
@ -1874,6 +1880,10 @@ void Module::setReceiverDbitList(const std::vector<int> &list) {
|
||||
"Dbit list value must be between 0 and 63\n");
|
||||
}
|
||||
}
|
||||
std::sort(begin(list), end(list));
|
||||
auto last = std::unique(begin(list), end(list));
|
||||
list.erase(last, list.end());
|
||||
|
||||
sls::StaticVector<int, MAX_RX_DBIT> arg = list;
|
||||
sendToReceiver(F_SET_RECEIVER_DBIT_LIST, arg, nullptr);
|
||||
}
|
||||
|
@ -149,6 +149,8 @@ class Module : public virtual slsDetectorDefs {
|
||||
int value);
|
||||
externalSignalFlag getExternalSignalFlags(int signalIndex) const;
|
||||
void setExternalSignalFlags(int signalIndex, externalSignalFlag type);
|
||||
bool getParallelMode() const;
|
||||
void setParallelMode(const bool enable);
|
||||
|
||||
/**************************************************
|
||||
* *
|
||||
@ -162,7 +164,7 @@ class Module : public virtual slsDetectorDefs {
|
||||
void startAndReadAll();
|
||||
runStatus getRunStatus() const;
|
||||
runStatus getReceiverStatus() const;
|
||||
int getReceiverProgress() const;
|
||||
double getReceiverProgress() const;
|
||||
int64_t getFramesCaughtByReceiver() const;
|
||||
std::vector<uint64_t> getNumMissingPackets() const;
|
||||
uint64_t getStartingFrameNumber() const;
|
||||
@ -303,8 +305,6 @@ class Module : public virtual slsDetectorDefs {
|
||||
bool trimbits);
|
||||
std::string getSettingsDir() const;
|
||||
std::string setSettingsDir(const std::string &dir);
|
||||
bool getParallelMode() const;
|
||||
void setParallelMode(const bool enable);
|
||||
bool getOverFlowMode() const;
|
||||
void setOverFlowMode(const bool enable);
|
||||
bool getFlippedDataX() const;
|
||||
@ -442,7 +442,7 @@ class Module : public virtual slsDetectorDefs {
|
||||
bool getExternalSampling() const;
|
||||
void setExternalSampling(bool value);
|
||||
std::vector<int> getReceiverDbitList() const;
|
||||
void setReceiverDbitList(const std::vector<int> &list);
|
||||
void setReceiverDbitList(std::vector<int> list);
|
||||
int getReceiverDbitOffset() const;
|
||||
void setReceiverDbitOffset(int value);
|
||||
void setDigitalIODelay(uint64_t pinMask, int delay);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user