diff --git a/CMakeLists.txt b/CMakeLists.txt index 482520f187..47dd5dffbc 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.12) project(slsDetectorPackage) -set(PROJECT_VERSION 5.0.0) +set(PROJECT_VERSION 5.1.0) include(CheckIPOSupported) set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG") @@ -157,8 +157,37 @@ set(CMAKE_INSTALL_RPATH $ORIGIN) set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) +set(ZeroMQ_HINT "" CACHE STRING "Hint where ZeroMQ could be found") +#Adapted from: https://github.com/zeromq/cppzmq/ +if (NOT TARGET libzmq) + if(ZeroMQ_HINT) + message(STATUS "Looking for ZeroMQ in: ${ZeroMQ_HINT}") + find_package(ZeroMQ 4 + NO_DEFAULT_PATH + HINTS ${ZeroMQ_DIR} + ) + else() + find_package(ZeroMQ 4) + endif() + + -find_package(ZeroMQ 4 REQUIRED) + # libzmq autotools install: fallback to pkg-config + if(NOT ZeroMQ_FOUND) + message(STATUS "CMake libzmq package not found, trying again with pkg-config (normal install of zeromq)") + list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/libzmq-pkg-config) + find_package(ZeroMQ 4 REQUIRED) + endif() + + # TODO "REQUIRED" above should already cause a fatal failure if not found, but this doesn't seem to work + if(NOT ZeroMQ_FOUND) + message(FATAL_ERROR "ZeroMQ was not found, neither as a CMake package nor via pkg-config") + endif() + + if (ZeroMQ_FOUND AND NOT TARGET libzmq) + message(FATAL_ERROR "ZeroMQ version not supported!") + endif() +endif() if (SLS_USE_TESTS) enable_testing() diff --git a/RELEASE.txt b/RELEASE.txt index fc1c3793e8..0af457ab54 100755 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -1,13 +1,13 @@ -SLS Detector Package 5.0.1 released on 25.11.2020 (Bug Fix Release) +SLS Detector Package 5.1.0 released on 22.03.2020 (Minor Release) =================================================================== -This document describes the differences between 5.0.1 and 5.0.0 releases. +This document describes the differences between 5.1.0 and 5.0.1 releases. CONTENTS -------- - 1. Topics Concerning + 1. New Features 2. Resolved Issues 3. Known Issues 4. Firmware Requirements @@ -15,45 +15,62 @@ This document describes the differences between 5.0.1 and 5.0.0 releases. -1. Topics Concerning -==================== - - Python bindings - - CMake improvements +1. New Features +=============== + + Client + ------ + + 1. Added settings and threshold features for Mythen3. + 2. Internal modification of acquire for Mythen3. + 3. Added getMaster for Mythen3 + 4. Mythen3, API function to set pattern from memory + Mythen3 server + ----------------- + + 1. Setting timing to auto, sets timing to trigger for slaves + 2. Resolved Issues ================== - Python bindings - --------------- - 1. Fixed function signatures for getRxUDPSocketBufferSize, - setRxUDPSocketBufferSize and getRxRealUDPSocketBufferSize. + Receiver + -------- + + 1. Current code only calls Implementation::setDetectorType from constructor, + but potential memory leak if called out of constructor context. Fixed. + + + Client + ------ - 2. Updated pybind11 to v2.6.1 to remove warnings with Python 3.9 and - better handling of C++ standard. + 1. Fixed missing scanParameters class in Python - 3. Added missing properties in Python. + 2. cmk.sh refactored to have better option handling + 3. Fixed hardcoded path accidentally ending up in the exported CMake package - CMake improvements - ------------------ + Server + -------- - 1. Explicitly state Python 3.6 or greater. + 1. Bottom port not mirrored correctly for Eiger quad - 2. Finds the Python of the activated environment when using conda - without having to supply additional arguments. - 3. Removed redundant libraries for linking targets. 3. Firmware Requirements ======================== - No updates from 5.0.0 + Mythen3: 0x210201 + Jungfrau: 0x210218 (1.0 pcb) + 0x200721 (2.0 pcb, not changed) + + Other detectors no updates from 5.0.0 diff --git a/cmake/FindZeroMQ.cmake b/cmake/FindZeroMQ.cmake deleted file mode 100755 index 5bc561386d..0000000000 --- a/cmake/FindZeroMQ.cmake +++ /dev/null @@ -1,112 +0,0 @@ - -# This file is originally from https://github.com/zeromq/azmq and distributed -# under Boost Software Lincese 1.0 -# Boost Software License - Version 1.0 - August 17th, 2003 - -# Permission is hereby granted, free of charge, to any person or organization -# obtaining a copy of the software and accompanying documentation covered by -# this license (the "Software") to use, reproduce, display, distribute, -# execute, and transmit the Software, and to prepare derivative works of the -# Software, and to permit third-parties to whom the Software is furnished to -# do so, all subject to the following: - -# The copyright notices in the Software and this entire statement, including -# the above license grant, this restriction and the following disclaimer, -# must be included in all copies of the Software, in whole or in part, and -# all derivative works of the Software, unless such copies or derivative -# works are solely in the form of machine-executable object code generated by -# a source language processor. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -# SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -# FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. -# -------------------------------------------------------------------------------- - -# Find ZeroMQ Headers/Libs - -# Variables -# ZMQ_ROOT - set this to a location where ZeroMQ may be found -# -# ZeroMQ_FOUND - True of ZeroMQ found -# ZeroMQ_INCLUDE_DIRS - Location of ZeroMQ includes -# ZeroMQ_LIBRARIES - ZeroMQ libraries - -include(FindPackageHandleStandardArgs) - -if (NOT ZMQ_ROOT) - set(ZMQ_ROOT "$ENV{ZMQ_ROOT}") -endif() - -if (NOT ZMQ_ROOT) - find_path(_ZeroMQ_ROOT NAMES include/zmq.h) -else() - set(_ZeroMQ_ROOT "${ZMQ_ROOT}") -endif() - -find_path(ZeroMQ_INCLUDE_DIRS NAMES zmq.h HINTS ${_ZeroMQ_ROOT}/include) - -if (ZeroMQ_INCLUDE_DIRS) - set(_ZeroMQ_H ${ZeroMQ_INCLUDE_DIRS}/zmq.h) - - function(_zmqver_EXTRACT _ZeroMQ_VER_COMPONENT _ZeroMQ_VER_OUTPUT) - set(CMAKE_MATCH_1 "0") - set(_ZeroMQ_expr "^[ \\t]*#define[ \\t]+${_ZeroMQ_VER_COMPONENT}[ \\t]+([0-9]+)$") - file(STRINGS "${_ZeroMQ_H}" _ZeroMQ_ver REGEX "${_ZeroMQ_expr}") - string(REGEX MATCH "${_ZeroMQ_expr}" ZeroMQ_ver "${_ZeroMQ_ver}") - set(${_ZeroMQ_VER_OUTPUT} "${CMAKE_MATCH_1}" PARENT_SCOPE) - endfunction() - - _zmqver_EXTRACT("ZMQ_VERSION_MAJOR" ZeroMQ_VERSION_MAJOR) - _zmqver_EXTRACT("ZMQ_VERSION_MINOR" ZeroMQ_VERSION_MINOR) - _zmqver_EXTRACT("ZMQ_VERSION_PATCH" ZeroMQ_VERSION_PATCH) - - message(STATUS "ZeroMQ version: ${ZeroMQ_VERSION_MAJOR}.${ZeroMQ_VERSION_MINOR}.${ZeroMQ_VERSION_PATCH}") - - # We should provide version to find_package_handle_standard_args in the same format as it was requested, - # otherwise it can't check whether version matches exactly. - if (ZeroMQ_FIND_VERSION_COUNT GREATER 2) - set(ZeroMQ_VERSION "${ZeroMQ_VERSION_MAJOR}.${ZeroMQ_VERSION_MINOR}.${ZeroMQ_VERSION_PATCH}") - else() - # User has requested ZeroMQ version without patch part => user is not interested in specific patch => - # any patch should be an exact match. - set(ZeroMQ_VERSION "${ZeroMQ_VERSION_MAJOR}.${ZeroMQ_VERSION_MINOR}") - endif() - - if (NOT ${CMAKE_CXX_PLATFORM_ID} STREQUAL "Windows") - find_library(ZeroMQ_LIBRARIES NAMES zmq HINTS ${_ZeroMQ_ROOT}/lib) - else() - find_library( - ZeroMQ_LIBRARY_RELEASE - NAMES - libzmq - "libzmq-${CMAKE_VS_PLATFORM_TOOLSET}-mt-${ZeroMQ_VERSION_MAJOR}_${ZeroMQ_VERSION_MINOR}_${ZeroMQ_VERSION_PATCH}" - HINTS - ${_ZeroMQ_ROOT}/lib - ) - - find_library( - ZeroMQ_LIBRARY_DEBUG - NAMES - libzmq_d - "libzmq-${CMAKE_VS_PLATFORM_TOOLSET}-mt-gd-${ZeroMQ_VERSION_MAJOR}_${ZeroMQ_VERSION_MINOR}_${ZeroMQ_VERSION_PATCH}" - HINTS - ${_ZeroMQ_ROOT}/lib) - - # On Windows we have to use corresponding version (i.e. Release or Debug) of ZeroMQ because of `errno` CRT global variable - # See more at http://www.drdobbs.com/avoiding-the-visual-c-runtime-library/184416623 - set(ZeroMQ_LIBRARIES optimized "${ZeroMQ_LIBRARY_RELEASE}" debug "${ZeroMQ_LIBRARY_DEBUG}") - endif() -endif() - -find_package_handle_standard_args(ZeroMQ FOUND_VAR ZeroMQ_FOUND - REQUIRED_VARS ZeroMQ_INCLUDE_DIRS ZeroMQ_LIBRARIES - VERSION_VAR ZeroMQ_VERSION) - -if (ZeroMQ_FOUND) - mark_as_advanced(ZeroMQ_INCLUDE_DIRS ZeroMQ_LIBRARIES ZeroMQ_VERSION - ZeroMQ_VERSION_MAJOR ZeroMQ_VERSION_MINOR ZeroMQ_VERSION_PATCH) -endif() \ No newline at end of file diff --git a/cmake/package_config.cmake b/cmake/package_config.cmake index bfa0a31a86..7c07ee344f 100755 --- a/cmake/package_config.cmake +++ b/cmake/package_config.cmake @@ -25,6 +25,12 @@ install(FILES DESTINATION ${CMAKE_INSTALL_DIR} ) +install(FILES + "${CMAKE_SOURCE_DIR}/libzmq-pkg-config/FindZeroMQ.cmake" + COMPONENT devel + DESTINATION ${CMAKE_INSTALL_DIR}/libzmq-pkg-config +) + if (PROJECT_LIBRARIES OR PROJECT_STATIC_LIBRARIES) install( EXPORT "${TARGETS_EXPORT_NAME}" diff --git a/cmake/project-config.cmake.in b/cmake/project-config.cmake.in index 3d8646c6ec..0346889531 100755 --- a/cmake/project-config.cmake.in +++ b/cmake/project-config.cmake.in @@ -12,8 +12,21 @@ include(CMakeFindDependencyMacro) set(SLS_USE_HDF5 "@SLS_USE_HDF5@") -# Add optional dependencies here + +find_package(ZeroMQ 4 QUIET) +# libzmq autotools install: fallback to pkg-config +if(NOT ZeroMQ_FOUND) + list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/libzmq-pkg-config) + find_package(ZeroMQ 4 REQUIRED) +endif() + +if(NOT ZeroMQ_FOUND) + message(FATAL_ERROR "ZeroMQ was NOT found!") +endif() + find_dependency(Threads) + +# Add optional dependencies here if (SLS_USE_HDF5) find_dependency(HDF5) endif () diff --git a/conda-recepie/build.sh b/conda-recepie/build.sh index 45607594c1..4d573a716f 100755 --- a/conda-recepie/build.sh +++ b/conda-recepie/build.sh @@ -13,8 +13,9 @@ cmake .. \ -DCMAKE_BUILD_TYPE=Release \ -DSLS_USE_HDF5=OFF\ - -cmake --build . -- -j10 +NCORES=$(getconf _NPROCESSORS_ONLN) +echo "Building using: ${NCORES} cores" +cmake --build . -- -j${NCORES} cmake --build . --target install -CTEST_OUTPUT_ON_FAILURE=1 ctest -j 2 \ No newline at end of file +CTEST_OUTPUT_ON_FAILURE=1 ctest -j 2 diff --git a/conda-recepie/copy_gui.sh b/conda-recepie/copy_gui.sh index 956ec80739..c35d018b0f 100755 --- a/conda-recepie/copy_gui.sh +++ b/conda-recepie/copy_gui.sh @@ -1,3 +1,3 @@ #Copy the GUI -mkdir $PREFIX/bin -cp build/bin/slsDetectorGui $PREFIX/bin/. +mkdir -p $PREFIX/bin +cp build/install/bin/slsDetectorGui $PREFIX/bin/. diff --git a/conda-recepie/copy_lib.sh b/conda-recepie/copy_lib.sh index fa624418d8..e153ad8696 100755 --- a/conda-recepie/copy_lib.sh +++ b/conda-recepie/copy_lib.sh @@ -1,6 +1,6 @@ -mkdir $PREFIX/lib -mkdir $PREFIX/bin +mkdir -p $PREFIX/lib +mkdir -p $PREFIX/bin mkdir -p $PREFIX/include/sls # mkdir $PREFIX/include/slsDetectorPackage diff --git a/conda-recepie/meta.yaml b/conda-recepie/meta.yaml index d3bf39d604..216e509d5c 100755 --- a/conda-recepie/meta.yaml +++ b/conda-recepie/meta.yaml @@ -59,6 +59,16 @@ outputs: script: copy_lib.sh requirements: + build: + - {{ compiler('c') }} + - {{compiler('cxx')}} + - libstdcxx-ng + - libgcc-ng + - zeromq + + host: + - zeromq + run: - libstdcxx-ng - libgcc-ng @@ -78,6 +88,8 @@ outputs: host: - python + - {{ pin_subpackage('slsdetlib', exact=True) }} + run: - libstdcxx-ng @@ -94,6 +106,13 @@ outputs: - name: slsdetgui script: copy_gui.sh requirements: + + build: + - {{ compiler('c') }} + - {{compiler('cxx')}} + - {{ pin_subpackage('slsdetlib', exact=True) }} + - qwt 6.* + run: - {{ pin_subpackage('slsdetlib', exact=True) }} - qwt 6.* diff --git a/libs/pybind11 b/libs/pybind11 index f1abf5d915..8de7772cc7 160000 --- a/libs/pybind11 +++ b/libs/pybind11 @@ -1 +1 @@ -Subproject commit f1abf5d9159b805674197f6bc443592e631c9130 +Subproject commit 8de7772cc72daca8e947b79b83fea46214931604 diff --git a/libzmq-pkg-config/FindZeroMQ.cmake b/libzmq-pkg-config/FindZeroMQ.cmake new file mode 100755 index 0000000000..9d9a4dfbf8 --- /dev/null +++ b/libzmq-pkg-config/FindZeroMQ.cmake @@ -0,0 +1,27 @@ +#From: https://github.com/zeromq/cppzmq/ +set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH ON) +find_package(PkgConfig) +pkg_check_modules(PC_LIBZMQ QUIET libzmq) + +set(ZeroMQ_VERSION ${PC_LIBZMQ_VERSION}) +find_library(ZeroMQ_LIBRARY NAMES libzmq.so libzmq.dylib libzmq.dll + PATHS ${PC_LIBZMQ_LIBDIR} ${PC_LIBZMQ_LIBRARY_DIRS}) +find_library(ZeroMQ_STATIC_LIBRARY NAMES libzmq-static.a libzmq.a libzmq.dll.a + PATHS ${PC_LIBZMQ_LIBDIR} ${PC_LIBZMQ_LIBRARY_DIRS}) + +if(ZeroMQ_LIBRARY OR ZeroMQ_STATIC_LIBRARY) + set(ZeroMQ_FOUND ON) +endif() + +if (TARGET libzmq) + # avoid errors defining targets twice + return() +endif() + +add_library(libzmq SHARED IMPORTED) +set_property(TARGET libzmq PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${PC_LIBZMQ_INCLUDE_DIRS}) +set_property(TARGET libzmq PROPERTY IMPORTED_LOCATION ${ZeroMQ_LIBRARY}) + +add_library(libzmq-static STATIC IMPORTED ${PC_LIBZMQ_INCLUDE_DIRS}) +set_property(TARGET libzmq-static PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${PC_LIBZMQ_INCLUDE_DIRS}) +set_property(TARGET libzmq-static PROPERTY IMPORTED_LOCATION ${ZeroMQ_STATIC_LIBRARY}) \ No newline at end of file diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 7120d0ca32..615aa2ba8e 100755 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -4,6 +4,8 @@ pybind11_add_module(_slsdet src/enums.cpp src/detector.cpp src/network.cpp + src/pattern.cpp + src/scan.cpp ) target_link_libraries(_slsdet PUBLIC @@ -28,6 +30,7 @@ set( PYTHON_FILES enums.py errors.py gotthard.py + pattern.py gotthard2.py moench.py proxy.py diff --git a/python/examples/manipulate_pattern.py b/python/examples/manipulate_pattern.py new file mode 100644 index 0000000000..0e11979c3f --- /dev/null +++ b/python/examples/manipulate_pattern.py @@ -0,0 +1,14 @@ + + +from slsdet import Detector, patternParameters + +d = Detector() +pat = patternParameters() + +#Access to members of the structure using numpy arrays +pat.patlimits = 0x0, 0xa + +d.setPattern(pat) + +#Load pattern from file +pat.load("/some/dir/some.pat") diff --git a/python/examples/use_enum.py b/python/examples/use_enum.py index 67c55394db..8e8eaf2102 100644 --- a/python/examples/use_enum.py +++ b/python/examples/use_enum.py @@ -6,7 +6,7 @@ d.fformat = fileFormat.BINARY # Altough not recommended for convenience all enums -# and some other things can be impored using * +# and some other things can be imported using * from slsdet import * d.speed = speedLevel.FULL_SPEED @@ -15,6 +15,6 @@ import slsdet.enums for enum in dir(slsdet.enums): - # filter out special memebers + # filter out special members if not enum.startswith('_'): print(enum) diff --git a/python/examples/using_scan.py b/python/examples/using_scan.py new file mode 100644 index 0000000000..612cae7546 --- /dev/null +++ b/python/examples/using_scan.py @@ -0,0 +1,19 @@ + +from slsdet import Mythen3, scanParameters, dacIndex + +#Configure scan +sp = scanParameters() +sp.enable = 1 +sp.dacInd = dacIndex.VTH1 +sp.startOffset = 0 +sp.stopOffset = 1000 +sp.stepSize = 100 +sp.dacSettleTime_ns = int(1e9) + + +# Send scan to detector +d = Mythen3() +d.setScan(sp) + + + diff --git a/python/scripts/basic.py b/python/scripts/basic.py index 4e11b33eeb..2135b4a58b 100755 --- a/python/scripts/basic.py +++ b/python/scripts/basic.py @@ -10,6 +10,8 @@ import slsdet + + d = Detector() e = Eiger() c = Ctb() diff --git a/python/scripts/compile_servers.py b/python/scripts/compile_servers.py new file mode 100644 index 0000000000..992dae1c9b --- /dev/null +++ b/python/scripts/compile_servers.py @@ -0,0 +1,80 @@ +import subprocess +import os +import sys +from pathlib import Path +import shutil as sh +from argparse import ArgumentParser + +class color: + HEADER = "\033[95m" + BLUE = "\033[94m" + CYAN = "\033[96m" + GREEN = "\033[92m" + YELLOW = "\033[93m" + RED = "\033[91m" + ENDC = "\033[0m" + BOLD = "\033[1m" + UNDERLINE = "\033[4m" + MAGENTA = "\033[35m" + + @staticmethod + def red(s): + return f"{color.RED}{s}{color.ENDC}" + + @staticmethod + def green(s): + return f"{color.GREEN}{s}{color.ENDC}" + +def add_to_path(): + paths = [ + "/opt/uClinux/bfin-uclinux/bin", + "/opt/nios2-gcc/bin", + "/opt/eldk-5.1/powerpc-4xx-softfloat/sysroots/i686-eldk-linux/usr/bin/ppc405-linux", + ] + os.environ["PATH"] += os.pathsep + os.pathsep.join(paths) + + +def rc_to_string(rc): + if rc == 0: + return color.green("OK") + else: + return color.red("FAIL") + + + +parser = ArgumentParser() +parser.add_argument('-t', '--tag', help = 'Tag added to server file name', default='developer') +parser.add_argument('-g', '--git', help='Add new servers to the git repo', action="store_true") +args = parser.parse_args() + + +servers = [ + "eigerDetectorServer", + "jungfrauDetectorServer", + "mythen3DetectorServer", + "gotthard2DetectorServer", + "gotthardDetectorServer", + "ctbDetectorServer", + "moenchDetectorServer", +] + + +server_root = Path("../../slsDetectorServers/").resolve() + +add_to_path() +for server in servers: + bin_name = f"{server}_{args.tag}" + path = server_root / server + print(f"{bin_name} - ", end="") + os.chdir(path) + try: + sh.rmtree(path/'bin') + except FileNotFoundError: + pass + p = subprocess.run(["make"], stdout=subprocess.DEVNULL) + print(rc_to_string(p.returncode)) + if p.returncode == 0: + sh.move(f"bin/{server}", f"bin/{bin_name}") + if args.git: + print("Adding to git") + subprocess.run(['git', 'add', 'bin', '-f']) diff --git a/python/scripts/generate_enums.py b/python/scripts/generate_enums.py index 29c73f6281..e43f45adfe 100644 --- a/python/scripts/generate_enums.py +++ b/python/scripts/generate_enums.py @@ -55,7 +55,7 @@ def generate_enum_string(enums): data.append('.export_values();\n\n') return ''.join(data) -with open('../../slsSupportLib/include/sls_detector_defs.h') as f: +with open('../../slsSupportLib/include/sls/sls_detector_defs.h') as f: data = f.read() data = remove_comments(data) diff --git a/python/setup.py b/python/setup.py index db4ec2112b..2e6422031b 100755 --- a/python/setup.py +++ b/python/setup.py @@ -2,11 +2,12 @@ Setup file for slsdet Build upon the pybind11 example found here: https://github.com/pybind/python_example """ -from setuptools import setup, Extension, find_packages -from setuptools.command.build_ext import build_ext -import sys -import setuptools + import os +import sys +sys.path.append('../libs/pybind11') +from setuptools import setup, find_packages +from pybind11.setup_helpers import Pybind11Extension, build_ext __version__ = os.environ.get('GIT_DESCRIBE_TAG', 'developer') @@ -19,109 +20,29 @@ def get_conda_path(): return os.environ['CONDA_PREFIX'] -# class get_pybind_include(object): -# """Helper class to determine the pybind11 include path -# The purpose of this class is to postpone importing pybind11 -# until it is actually installed, so that the ``get_include()`` -# method can be invoked. """ - -# def __init__(self, user=False): -# self.user = user - -# def __str__(self): -# import pybind11 -# return pybind11.get_include(self.user) - - +#TODO migrate to CMake build? ext_modules = [ - Extension( + Pybind11Extension( '_slsdet', ['src/main.cpp', 'src/enums.cpp', 'src/detector.cpp', - 'src/network.cpp'], + 'src/network.cpp', + 'src/pattern.cpp', + 'src/scan.cpp',], include_dirs=[ - # Path to pybind11 headers - # get_pybind_include(), - # get_pybind_include(user=True), os.path.join('../libs/pybind11/include'), os.path.join(get_conda_path(), 'include'), ], - libraries=['SlsDetector', 'SlsReceiver', 'zmq'], + libraries=['SlsDetector', 'SlsSupport', 'SlsReceiver', 'zmq'], library_dirs=[ os.path.join(get_conda_path(), 'lib'), - os.path.join(get_conda_path(), 'bin'), ], - language='c++' ), ] - -# As of Python 3.6, CCompiler has a `has_flag` method. -# cf http://bugs.python.org/issue26689 -def has_flag(compiler, flagname): - """Return a boolean indicating whether a flag name is supported on - the specified compiler. - """ - import tempfile - with tempfile.NamedTemporaryFile('w', suffix='.cpp') as f: - f.write('int main (int argc, char **argv) { return 0; }') - try: - compiler.compile([f.name], extra_postargs=[flagname]) - except setuptools.distutils.errors.CompileError: - return False - return True - - -def cpp_flag(compiler): - """Return the -std=c++[11/14] compiler flag. - The c++14 is prefered over c++11 (when it is available). - """ - if has_flag(compiler, '-std=c++14'): - return '-std=c++14' - elif has_flag(compiler, '-std=c++11'): - return '-std=c++11' - else: - raise RuntimeError('Unsupported compiler -- at least C++11 support ' - 'is needed!') - - -class BuildExt(build_ext): - """A custom build extension for adding compiler-specific options.""" - c_opts = { - 'msvc': ['/EHsc'], - 'unix': [], - } - - if sys.platform == 'darwin': - c_opts['unix'] += ['-stdlib=libc++', '-mmacosx-version-min=10.7'] - - def build_extensions(self): - ct = self.compiler.compiler_type - opts = self.c_opts.get(ct, []) - if ct == 'unix': - opts.append('-DVERSION_INFO="%s"' % self.distribution.get_version()) - opts.append(cpp_flag(self.compiler)) - if has_flag(self.compiler, '-fvisibility=hidden'): - opts.append('-fvisibility=hidden') - elif ct == 'msvc': - opts.append('/DVERSION_INFO=\\"%s\\"' % self.distribution.get_version()) - for ext in self.extensions: - ext.extra_compile_args = opts - - print('**************************************************') - print(ct) - print(opts) - print('**************************************************') - build_ext.build_extensions(self) - - - -def get_shared_lib(): - return [f for f in os.listdir('.') if '_slsdet' in f] - setup( name='slsdet', version=__version__, @@ -132,6 +53,6 @@ def get_shared_lib(): long_description='', packages=find_packages(exclude=['contrib', 'docs', 'tests']), ext_modules=ext_modules, - cmdclass={'build_ext': BuildExt}, + cmdclass={"build_ext": build_ext}, zip_safe=False, ) diff --git a/python/slsdet/__init__.py b/python/slsdet/__init__.py index f6df363324..0d98b6f6d2 100755 --- a/python/slsdet/__init__.py +++ b/python/slsdet/__init__.py @@ -8,6 +8,8 @@ from .gotthard2 import Gotthard2 from .gotthard import Gotthard from .moench import Moench +from .pattern import Pattern, patternParameters + import _slsdet xy = _slsdet.xy @@ -18,3 +20,4 @@ IpAddr = _slsdet.IpAddr MacAddr = _slsdet.MacAddr +scanParameters = _slsdet.scanParameters \ No newline at end of file diff --git a/python/slsdet/detector.py b/python/slsdet/detector.py index 18bec9b1b4..f03551ce3c 100755 --- a/python/slsdet/detector.py +++ b/python/slsdet/detector.py @@ -1696,6 +1696,8 @@ def threshold(self): To change settings as well or set threshold without trimbits, use setThresholdEnergy. :setter: It loads trim files from settingspath. """ + if self.type == detectorType.MYTHEN3: + return self.getAllThresholdEnergy() return self.getThresholdEnergy() @threshold.setter diff --git a/python/slsdet/pattern.py b/python/slsdet/pattern.py new file mode 100644 index 0000000000..fc223ff8ed --- /dev/null +++ b/python/slsdet/pattern.py @@ -0,0 +1,53 @@ +import _slsdet + +from _slsdet import Pattern + + +class patternParameters(_slsdet.patternParameters): + def __init__(self): + super().__init__() + self.view = self.numpy_view() + self.names = self.view.dtype.names + + def __getattr__(self, name): + if name in self.names: + return self.view[name][0] + else: + raise KeyError(f"Key: {name} not found") + + def __setattr__(self, name, value): + if name in ["view", "names"]: + self.__dict__[name] = value + elif name in self.names: + self.view[name] = value + else: + raise KeyError(f"Key: {name} not found") + + # Provide custom dir for tab completion + def __dir__(self): + return self.names + + +class Pattern(_slsdet.Pattern): + def __init__(self): + super().__init__() + self.view = self.data().numpy_view() + self.names = self.view.dtype.names + + def __getattr__(self, name): + if name in self.names: + return self.view[name][0] + else: + raise KeyError(f"Key: {name} not found") + + def __setattr__(self, name, value): + if name in ["view", "names"]: + self.__dict__[name] = value + elif name in self.names: + self.view[name] = value + else: + raise KeyError(f"Key: {name} not found") + + # Provide custom dir for tab completion + def __dir__(self): + return self.names \ No newline at end of file diff --git a/python/src/detector.cpp b/python/src/detector.cpp index 0a86001f97..444248d8b9 100644 --- a/python/src/detector.cpp +++ b/python/src/detector.cpp @@ -102,6 +102,34 @@ void init_det(py::module &m) { (void (Detector::*)(defs::detectorSettings, sls::Positions)) & Detector::setSettings, py::arg(), py::arg() = Positions{}) + .def("getThresholdEnergy", + (Result(Detector::*)(sls::Positions) const) & + Detector::getThresholdEnergy, + py::arg() = Positions{}) + .def("getAllThresholdEnergy", + (Result>(Detector::*)(sls::Positions) const) & + Detector::getAllThresholdEnergy, + py::arg() = Positions{}) + .def("setThresholdEnergy", + (void (Detector::*)(int, defs::detectorSettings, bool, + sls::Positions)) & + Detector::setThresholdEnergy, + py::arg(), py::arg() = defs::STANDARD, py::arg() = true, + py::arg() = Positions{}) + .def("setThresholdEnergy", + (void (Detector::*)(std::array, defs::detectorSettings, + bool, sls::Positions)) & + Detector::setThresholdEnergy, + py::arg(), py::arg() = defs::STANDARD, py::arg() = true, + py::arg() = Positions{}) + .def("getSettingsPath", + (Result(Detector::*)(sls::Positions) const) & + Detector::getSettingsPath, + py::arg() = Positions{}) + .def("setSettingsPath", + (void (Detector::*)(const std::string &, sls::Positions)) & + Detector::setSettingsPath, + py::arg(), py::arg() = Positions{}) .def("loadTrimbits", (void (Detector::*)(const std::string &, sls::Positions)) & Detector::loadTrimbits, @@ -114,6 +142,14 @@ void init_det(py::module &m) { (void (Detector::*)(int, sls::Positions)) & Detector::setAllTrimbits, py::arg(), py::arg() = Positions{}) + .def("getTrimEnergies", + (Result>(Detector::*)(sls::Positions) const) & + Detector::getTrimEnergies, + py::arg() = Positions{}) + .def("setTrimEnergies", + (void (Detector::*)(std::vector, sls::Positions)) & + Detector::setTrimEnergies, + py::arg(), py::arg() = Positions{}) .def("getGapPixelsinCallback", (bool (Detector::*)() const) & Detector::getGapPixelsinCallback) .def("setGapPixelsinCallback", @@ -783,24 +819,6 @@ void init_det(py::module &m) { (void (Detector::*)(sls::ns, sls::Positions)) & Detector::setSubDeadTime, py::arg(), py::arg() = Positions{}) - .def("getThresholdEnergy", - (Result(Detector::*)(sls::Positions) const) & - Detector::getThresholdEnergy, - py::arg() = Positions{}) - .def("setThresholdEnergy", - (void (Detector::*)(int, defs::detectorSettings, bool, - sls::Positions)) & - Detector::setThresholdEnergy, - py::arg(), py::arg() = defs::STANDARD, py::arg() = true, - py::arg() = Positions{}) - .def("getSettingsPath", - (Result(Detector::*)(sls::Positions) const) & - Detector::getSettingsPath, - py::arg() = Positions{}) - .def("setSettingsPath", - (void (Detector::*)(const std::string &, sls::Positions)) & - Detector::setSettingsPath, - py::arg(), py::arg() = Positions{}) .def("getOverFlowMode", (Result(Detector::*)(sls::Positions) const) & Detector::getOverFlowMode, @@ -816,14 +834,6 @@ void init_det(py::module &m) { .def("setBottom", (void (Detector::*)(bool, sls::Positions)) & Detector::setBottom, py::arg(), py::arg() = Positions{}) - .def("getTrimEnergies", - (Result>(Detector::*)(sls::Positions) const) & - Detector::getTrimEnergies, - py::arg() = Positions{}) - .def("setTrimEnergies", - (void (Detector::*)(std::vector, sls::Positions)) & - Detector::setTrimEnergies, - py::arg(), py::arg() = Positions{}) .def("getRateCorrection", (Result(Detector::*)(sls::Positions) const) & Detector::getRateCorrection, @@ -1122,6 +1132,10 @@ void init_det(py::module &m) { (Result>(Detector::*)(sls::Positions) const) & Detector::getGateDelayForAllGates, py::arg() = Positions{}) + .def("getMaster", + (Result(Detector::*)(sls::Positions) const) & + Detector::getMaster, + py::arg() = Positions{}) .def("getNumberOfAnalogSamples", (Result(Detector::*)(sls::Positions) const) & Detector::getNumberOfAnalogSamples, @@ -1271,9 +1285,17 @@ void init_det(py::module &m) { (void (Detector::*)(const std::string &, sls::Positions)) & Detector::setPattern, py::arg(), py::arg() = Positions{}) + .def("setPattern", + (void (Detector::*)(const sls::Pattern &, sls::Positions)) & + Detector::setPattern, + py::arg(), py::arg() = Positions{}) .def("savePattern", (void (Detector::*)(const std::string &)) & Detector::savePattern, py::arg()) + .def("loadDefaultPattern", + (void (Detector::*)(sls::Positions)) & + Detector::loadDefaultPattern, + py::arg() = Positions{}) .def("getPatternIOControl", (Result(Detector::*)(sls::Positions) const) & Detector::getPatternIOControl, diff --git a/python/src/enums.cpp b/python/src/enums.cpp index e42c63339f..92391065da 100644 --- a/python/src/enums.cpp +++ b/python/src/enums.cpp @@ -2,10 +2,12 @@ * warning */ #include +#include #include #include #include +#include "sls/Pattern.h" #include "sls/sls_detector_defs.h" namespace py = pybind11; void init_enums(py::module &m) { diff --git a/python/src/enums_in.cpp b/python/src/enums_in.cpp index 2e21b2d587..1291148451 100644 --- a/python/src/enums_in.cpp +++ b/python/src/enums_in.cpp @@ -1,18 +1,19 @@ #include +#include #include #include #include #include "sls/sls_detector_defs.h" +#include "sls/Pattern.h" namespace py = pybind11; void init_enums(py::module &m) { py::class_ Defs(m, "slsDetectorDefs"); py::class_ xy(m, "xy"); xy.def(py::init()); - xy.def(py::init()); + xy.def(py::init()); xy.def_readwrite("x", &slsDetectorDefs::xy::x); xy.def_readwrite("y", &slsDetectorDefs::xy::y); -[[ENUMS]] - + [[ENUMS]] } diff --git a/python/src/main.cpp b/python/src/main.cpp index e199d6efd2..291752c349 100755 --- a/python/src/main.cpp +++ b/python/src/main.cpp @@ -19,6 +19,8 @@ void init_enums(py::module &); void init_experimental(py::module &); void init_det(py::module &); void init_network(py::module &); +void init_pattern(py::module &); +void init_scan(py::module &); PYBIND11_MODULE(_slsdet, m) { m.doc() = R"pbdoc( C/C++ API @@ -33,6 +35,8 @@ PYBIND11_MODULE(_slsdet, m) { init_enums(m); init_det(m); init_network(m); + init_pattern(m); + init_scan(m); // init_experimental(m); diff --git a/python/src/pattern.cpp b/python/src/pattern.cpp new file mode 100644 index 0000000000..c12bc96d99 --- /dev/null +++ b/python/src/pattern.cpp @@ -0,0 +1,29 @@ +#include +#include +#include +#include +#include + +#include "sls/Pattern.h" +#include "sls/sls_detector_defs.h" +namespace py = pybind11; +void init_pattern(py::module &m) { + + using pat = sls::patternParameters; + py::class_ patternParameters(m, "patternParameters"); + + PYBIND11_NUMPY_DTYPE(pat, word, ioctrl, limits, loop, nloop, wait, + waittime); + + patternParameters.def(py::init()); + patternParameters.def("numpy_view", [](py::object &obj) { + pat &o = obj.cast(); + return py::array_t(1, &o, obj); + }); + + py::class_ Pattern(m, "Pattern"); + Pattern.def(py::init()); + Pattern.def("load", &sls::Pattern::load); + Pattern.def("data", (pat * (sls::Pattern::*)()) & sls::Pattern::data, + py::return_value_policy::reference); +} diff --git a/python/src/scan.cpp b/python/src/scan.cpp new file mode 100644 index 0000000000..afd83832b1 --- /dev/null +++ b/python/src/scan.cpp @@ -0,0 +1,39 @@ +#include +#include +#include +#include +#include +#include +#include "sls/sls_detector_defs.h" +namespace py = pybind11; +void init_scan(py::module &m) { + + using sp = slsDetectorDefs::scanParameters; + py::class_ scanParameters(m, "scanParameters"); + + scanParameters.def(py::init()); + + scanParameters.def(py::init()); + scanParameters.def(py::init()); + scanParameters.def_readwrite("enable", &sp::enable); + scanParameters.def_readwrite("dacInd", &sp::dacInd); + scanParameters.def_readwrite("startOffset", &sp::startOffset); + scanParameters.def_readwrite("stopOffset", &sp::stopOffset); + scanParameters.def_readwrite("stepSize", &sp::stepSize); + scanParameters.def_readwrite("dacSettleTime_ns", &sp::dacSettleTime_ns); + scanParameters.def("__repr__", [](const sp &a){ + std::ostringstream oss; + auto indent = " "; + oss << "\n"; + oss << indent << "enable: " << a.enable << '\n'; + oss << indent << "dacInd: " << a.dacInd << '\n'; + oss << indent << "startOffset: " << a.startOffset << '\n'; + oss << indent << "stopOffset: " << a.stopOffset << '\n'; + oss << indent << "stepSize: " << a.stepSize << '\n'; + oss << indent << "dacSettleTime_ns: " << a.dacSettleTime_ns; + return oss.str(); + }); + + + +} diff --git a/serverBin/ctbDetectorServer_developer b/serverBin/ctbDetectorServer_developer new file mode 120000 index 0000000000..2304a20439 --- /dev/null +++ b/serverBin/ctbDetectorServer_developer @@ -0,0 +1 @@ +../slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer \ No newline at end of file diff --git a/serverBin/ctbDetectorServerv5.0.0 b/serverBin/ctbDetectorServerv5.0.0 deleted file mode 120000 index 0379a01d62..0000000000 --- a/serverBin/ctbDetectorServerv5.0.0 +++ /dev/null @@ -1 +0,0 @@ -../slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServerv5.0.0 \ No newline at end of file diff --git a/serverBin/eigerDetectorServer_developer b/serverBin/eigerDetectorServer_developer new file mode 120000 index 0000000000..117c94c378 --- /dev/null +++ b/serverBin/eigerDetectorServer_developer @@ -0,0 +1 @@ +../slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServer_developer \ No newline at end of file diff --git a/serverBin/eigerDetectorServerv5.0.0 b/serverBin/eigerDetectorServerv5.0.0 deleted file mode 120000 index 968790c2f3..0000000000 --- a/serverBin/eigerDetectorServerv5.0.0 +++ /dev/null @@ -1 +0,0 @@ -../slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServerv5.0.0 \ No newline at end of file diff --git a/serverBin/gotthard2DetectorServer_developer b/serverBin/gotthard2DetectorServer_developer new file mode 120000 index 0000000000..7c8e54beef --- /dev/null +++ b/serverBin/gotthard2DetectorServer_developer @@ -0,0 +1 @@ +../slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer \ No newline at end of file diff --git a/serverBin/gotthard2DetectorServerv5.0.0 b/serverBin/gotthard2DetectorServerv5.0.0 deleted file mode 120000 index 50929897b9..0000000000 --- a/serverBin/gotthard2DetectorServerv5.0.0 +++ /dev/null @@ -1 +0,0 @@ -../slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServerv5.0.0 \ No newline at end of file diff --git a/serverBin/gotthardDetectorServer_developer b/serverBin/gotthardDetectorServer_developer new file mode 120000 index 0000000000..28e8385e0a --- /dev/null +++ b/serverBin/gotthardDetectorServer_developer @@ -0,0 +1 @@ +../slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer \ No newline at end of file diff --git a/serverBin/gotthardDetectorServerv5.0.0 b/serverBin/gotthardDetectorServerv5.0.0 deleted file mode 120000 index 4bf2a19233..0000000000 --- a/serverBin/gotthardDetectorServerv5.0.0 +++ /dev/null @@ -1 +0,0 @@ -../slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServerv5.0.0 \ No newline at end of file diff --git a/serverBin/jungfrauDetectorServer_developer b/serverBin/jungfrauDetectorServer_developer new file mode 120000 index 0000000000..8ae22b591f --- /dev/null +++ b/serverBin/jungfrauDetectorServer_developer @@ -0,0 +1 @@ +../slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer \ No newline at end of file diff --git a/serverBin/jungfrauDetectorServerv5.0.0 b/serverBin/jungfrauDetectorServerv5.0.0 deleted file mode 120000 index ebc685cb2c..0000000000 --- a/serverBin/jungfrauDetectorServerv5.0.0 +++ /dev/null @@ -1 +0,0 @@ -../slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServerv5.0.0 \ No newline at end of file diff --git a/serverBin/moenchDetectorServer_developer b/serverBin/moenchDetectorServer_developer new file mode 120000 index 0000000000..147ecfb539 --- /dev/null +++ b/serverBin/moenchDetectorServer_developer @@ -0,0 +1 @@ +../slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_developer \ No newline at end of file diff --git a/serverBin/moenchDetectorServerv5.0.0 b/serverBin/moenchDetectorServerv5.0.0 deleted file mode 120000 index 7bd90c4072..0000000000 --- a/serverBin/moenchDetectorServerv5.0.0 +++ /dev/null @@ -1 +0,0 @@ -../slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServerv5.0.0 \ No newline at end of file diff --git a/serverBin/mythen3DetectorServer_developer b/serverBin/mythen3DetectorServer_developer new file mode 120000 index 0000000000..cc8b2c91fb --- /dev/null +++ b/serverBin/mythen3DetectorServer_developer @@ -0,0 +1 @@ +../slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer \ No newline at end of file diff --git a/serverBin/mythen3DetectorServerv5.0.0 b/serverBin/mythen3DetectorServerv5.0.0 deleted file mode 120000 index dff40247ed..0000000000 --- a/serverBin/mythen3DetectorServerv5.0.0 +++ /dev/null @@ -1 +0,0 @@ -../slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServerv5.0.0 \ No newline at end of file diff --git a/settingsdir/mythen/fast/calibration.snxxx b/settingsdir/mythen/fast/calibration.snxxx deleted file mode 100755 index 326e7f501a..0000000000 --- a/settingsdir/mythen/fast/calibration.snxxx +++ /dev/null @@ -1 +0,0 @@ -800 10 diff --git a/settingsdir/mythen/fast/fast.cal b/settingsdir/mythen/fast/fast.cal deleted file mode 100755 index 1e0a97fbb9..0000000000 --- a/settingsdir/mythen/fast/fast.cal +++ /dev/null @@ -1 +0,0 @@ -829 9.3 diff --git a/settingsdir/mythen/fast/fast.trim b/settingsdir/mythen/fast/fast.trim deleted file mode 100755 index be2e8fa45d..0000000000 --- a/settingsdir/mythen/fast/fast.trim +++ /dev/null @@ -1,1296 +0,0 @@ -Vtrim 824 -Vthresh 560 -Rgsh1 200 -Rgsh2 300 -Rgpr 50 -Vcal 600 -outBuffEnable 0 -0 2 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 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0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 diff --git a/settingsdir/mythen/fast/noise.snxxx b/settingsdir/mythen/fast/noise.snxxx deleted file mode 100755 index fda6c50452..0000000000 --- a/settingsdir/mythen/fast/noise.snxxx +++ /dev/null @@ -1,1296 +0,0 @@ -Vtrim 800 -Vthresh 700 -Rgsh1 200 -Rgsh2 300 -Rgpr 50 -Vcal 600 -outBuffEnable 0 -36 1 0 0 0 0 -13 1 0 0 0 0 -26 1 0 0 0 0 -17 1 0 0 0 0 -34 1 0 0 0 0 -22 1 0 0 0 0 -30 1 0 0 0 0 -27 1 0 0 0 0 -34 1 0 0 0 0 -32 1 0 0 0 0 -27 1 0 0 0 0 -34 1 0 0 0 0 -24 1 0 0 0 0 -22 1 0 0 0 0 -18 1 0 0 0 0 -29 1 0 0 0 0 -57 1 0 0 0 0 -15 1 0 0 0 0 -31 1 0 0 0 0 -34 1 0 0 0 0 -25 1 0 0 0 0 -31 1 0 0 0 0 -29 1 0 0 0 0 -34 1 0 0 0 0 -33 1 0 0 0 0 -33 1 0 0 0 0 -32 1 0 0 0 0 -22 1 0 0 0 0 -30 1 0 0 0 0 -19 1 0 0 0 0 -33 1 0 0 0 0 -43 1 0 0 0 0 -32 1 0 0 0 0 -31 1 0 0 0 0 -30 1 0 0 0 0 -34 1 0 0 0 0 -28 1 0 0 0 0 -22 1 0 0 0 0 -31 1 0 0 0 0 -14 1 0 0 0 0 -36 1 0 0 0 0 -21 1 0 0 0 0 -29 1 0 0 0 0 -26 1 0 0 0 0 -28 1 0 0 0 0 -30 1 0 0 0 0 -25 1 0 0 0 0 -36 1 0 0 0 0 -21 1 0 0 0 0 -33 1 0 0 0 0 -9 1 0 0 0 0 -30 1 0 0 0 0 -33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28 1 0 0 0 0 -38 1 0 0 0 0 -29 1 0 0 0 0 -25 1 0 0 0 0 -27 1 0 0 0 0 -34 1 0 0 0 0 -40 1 0 0 0 0 -19 1 0 0 0 0 -29 1 0 0 0 0 -39 1 0 0 0 0 -19 1 0 0 0 0 -18 1 0 0 0 0 -19 1 0 0 0 0 -37 1 0 0 0 0 -43 1 0 0 0 0 -29 1 0 0 0 0 -46 1 0 0 0 0 -42 1 0 0 0 0 -24 1 0 0 0 0 -14 1 0 0 0 0 -41 1 0 0 0 0 -53 1 0 0 0 0 -42 1 0 0 0 0 -23 1 0 0 0 0 -45 1 0 0 0 0 -24 1 0 0 0 0 -38 1 0 0 0 0 -34 1 0 0 0 0 -31 1 0 0 0 0 -21 1 0 0 0 0 -38 1 0 0 0 0 -29 1 0 0 0 0 -36 1 0 0 0 0 -36 1 0 0 0 0 -37 1 0 0 0 0 -27 1 0 0 0 0 -31 1 0 0 0 0 -27 1 0 0 0 0 -33 1 0 0 0 0 -21 1 0 0 0 0 -40 1 0 0 0 0 -34 1 0 0 0 0 -21 1 0 0 0 0 -25 1 0 0 0 0 -54 1 0 0 0 0 -33 1 0 0 0 0 -26 1 0 0 0 0 -19 1 0 0 0 0 -33 1 0 0 0 0 -32 1 0 0 0 0 -26 1 0 0 0 0 -21 1 0 0 0 0 -33 1 0 0 0 0 -25 1 0 0 0 0 diff --git a/settingsdir/mythen/highgain/calibration.snxxx b/settingsdir/mythen/highgain/calibration.snxxx deleted file mode 100755 index 326e7f501a..0000000000 --- a/settingsdir/mythen/highgain/calibration.snxxx +++ /dev/null @@ -1 +0,0 @@ -800 10 diff --git a/settingsdir/mythen/highgain/highgain.cal b/settingsdir/mythen/highgain/highgain.cal deleted file mode 100755 index b5f43f83a6..0000000000 --- a/settingsdir/mythen/highgain/highgain.cal +++ /dev/null @@ -1 +0,0 @@ -804 15.0 diff --git a/settingsdir/mythen/highgain/highgain.trim b/settingsdir/mythen/highgain/highgain.trim deleted file mode 100755 index b15219ff6b..0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0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 diff --git a/settingsdir/mythen/highgain/noise.snxxx b/settingsdir/mythen/highgain/noise.snxxx deleted file mode 100755 index 0b8de0d309..0000000000 --- a/settingsdir/mythen/highgain/noise.snxxx +++ /dev/null @@ -1,1296 +0,0 @@ -Vtrim 800 -Vthresh 700 -Rgsh1 400 -Rgsh2 260 -Rgpr 200 -Vcal 600 -outBuffEnable 0 -36 1 0 0 0 0 -13 1 0 0 0 0 -26 1 0 0 0 0 -17 1 0 0 0 0 -34 1 0 0 0 0 -22 1 0 0 0 0 -30 1 0 0 0 0 -27 1 0 0 0 0 -34 1 0 0 0 0 -32 1 0 0 0 0 -27 1 0 0 0 0 -34 1 0 0 0 0 -24 1 0 0 0 0 -22 1 0 0 0 0 -18 1 0 0 0 0 -29 1 0 0 0 0 -57 1 0 0 0 0 -15 1 0 0 0 0 -31 1 0 0 0 0 -34 1 0 0 0 0 -25 1 0 0 0 0 -31 1 0 0 0 0 -29 1 0 0 0 0 -34 1 0 0 0 0 -33 1 0 0 0 0 -33 1 0 0 0 0 -32 1 0 0 0 0 -22 1 0 0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a/settingsdir/mythen/standard/calibration.snxxx b/settingsdir/mythen/standard/calibration.snxxx deleted file mode 100755 index 326e7f501a..0000000000 --- a/settingsdir/mythen/standard/calibration.snxxx +++ /dev/null @@ -1 +0,0 @@ -800 10 diff --git a/settingsdir/mythen/standard/noise.snxxx b/settingsdir/mythen/standard/noise.snxxx deleted file mode 100755 index 3cb00d1b9b..0000000000 --- a/settingsdir/mythen/standard/noise.snxxx +++ /dev/null @@ -1,1296 +0,0 @@ -Vtrim 824 -Vthresh 560 -Rgsh1 300 -Rgsh2 260 -Rgpr 100 -Vcal 600 -outBuffEnable 0 -0 2 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0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0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 diff --git a/settingsdir/mythen/standard/standard.cal b/settingsdir/mythen/standard/standard.cal deleted file mode 100755 index a7522a05a4..0000000000 --- a/settingsdir/mythen/standard/standard.cal +++ /dev/null @@ -1 +0,0 @@ -817 11.6 diff --git a/settingsdir/mythen/standard/standard.trim b/settingsdir/mythen/standard/standard.trim deleted file mode 100755 index f590479649..0000000000 --- a/settingsdir/mythen/standard/standard.trim +++ /dev/null @@ -1,1296 +0,0 @@ -Vtrim 824 -Vthresh 560 -Rgsh1 300 -Rgsh2 260 -Rgpr 100 -Vcal 600 -outBuffEnable 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0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 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 -0 1 0 0 0 0 diff --git a/settingsdir/mythen3/fast/11200eV/trim.sn0000 b/settingsdir/mythen3/fast/11200eV/trim.sn0000 new file mode 100644 index 0000000000..e82819eba7 Binary files /dev/null and b/settingsdir/mythen3/fast/11200eV/trim.sn0000 differ diff --git a/settingsdir/mythen3/fast/11200eV/trim.snxxxx b/settingsdir/mythen3/fast/11200eV/trim.snxxxx new file mode 100644 index 0000000000..e82819eba7 Binary files /dev/null and b/settingsdir/mythen3/fast/11200eV/trim.snxxxx differ diff --git a/settingsdir/mythen3/fast/4500eV/trim.sn0000 b/settingsdir/mythen3/fast/4500eV/trim.sn0000 new file mode 100644 index 0000000000..30f6400a24 Binary files /dev/null and b/settingsdir/mythen3/fast/4500eV/trim.sn0000 differ diff --git a/settingsdir/mythen3/fast/4500eV/trim.snxxxx b/settingsdir/mythen3/fast/4500eV/trim.snxxxx new file mode 100644 index 0000000000..30f6400a24 Binary files /dev/null and b/settingsdir/mythen3/fast/4500eV/trim.snxxxx differ diff --git a/settingsdir/mythen3/fast/5400eV/trim.sn0000 b/settingsdir/mythen3/fast/5400eV/trim.sn0000 new file mode 100644 index 0000000000..bd21699332 Binary files /dev/null and b/settingsdir/mythen3/fast/5400eV/trim.sn0000 differ diff --git a/settingsdir/mythen3/fast/5400eV/trim.snxxxx b/settingsdir/mythen3/fast/5400eV/trim.snxxxx new file mode 100644 index 0000000000..bd21699332 Binary files /dev/null and b/settingsdir/mythen3/fast/5400eV/trim.snxxxx differ diff --git a/settingsdir/mythen3/fast/6400eV/trim.sn0000 b/settingsdir/mythen3/fast/6400eV/trim.sn0000 new file mode 100644 index 0000000000..3210033e23 Binary files /dev/null and b/settingsdir/mythen3/fast/6400eV/trim.sn0000 differ diff --git a/settingsdir/mythen3/fast/6400eV/trim.snxxxx b/settingsdir/mythen3/fast/6400eV/trim.snxxxx new file mode 100644 index 0000000000..3210033e23 Binary files /dev/null and b/settingsdir/mythen3/fast/6400eV/trim.snxxxx differ diff --git a/settingsdir/mythen3/fast/8000eV/trim.sn0000 b/settingsdir/mythen3/fast/8000eV/trim.sn0000 new file mode 100644 index 0000000000..b5bf945698 Binary files /dev/null and b/settingsdir/mythen3/fast/8000eV/trim.sn0000 differ diff --git a/settingsdir/mythen3/fast/8000eV/trim.snxxxx b/settingsdir/mythen3/fast/8000eV/trim.snxxxx new file mode 100644 index 0000000000..b5bf945698 Binary files /dev/null and b/settingsdir/mythen3/fast/8000eV/trim.snxxxx differ diff --git a/settingsdir/mythen3/fast/9900eV/trim.sn0000 b/settingsdir/mythen3/fast/9900eV/trim.sn0000 new file mode 100644 index 0000000000..cb986b6a7b Binary files /dev/null and b/settingsdir/mythen3/fast/9900eV/trim.sn0000 differ diff --git a/settingsdir/mythen3/fast/9900eV/trim.snxxxx b/settingsdir/mythen3/fast/9900eV/trim.snxxxx new file mode 100644 index 0000000000..cb986b6a7b Binary files /dev/null and b/settingsdir/mythen3/fast/9900eV/trim.snxxxx differ diff --git a/settingsdir/mythen3/highgain/11200eV/trim.sn0000 b/settingsdir/mythen3/highgain/11200eV/trim.sn0000 new file mode 100644 index 0000000000..e82819eba7 Binary files /dev/null and b/settingsdir/mythen3/highgain/11200eV/trim.sn0000 differ diff --git a/settingsdir/mythen3/highgain/11200eV/trim.snxxxx b/settingsdir/mythen3/highgain/11200eV/trim.snxxxx new file mode 100644 index 0000000000..e82819eba7 Binary files /dev/null and b/settingsdir/mythen3/highgain/11200eV/trim.snxxxx differ diff --git a/settingsdir/mythen3/highgain/4500eV/trim.sn0000 b/settingsdir/mythen3/highgain/4500eV/trim.sn0000 new file mode 100644 index 0000000000..30f6400a24 Binary files /dev/null and b/settingsdir/mythen3/highgain/4500eV/trim.sn0000 differ diff --git a/settingsdir/mythen3/highgain/4500eV/trim.snxxxx b/settingsdir/mythen3/highgain/4500eV/trim.snxxxx new file mode 100644 index 0000000000..30f6400a24 Binary files /dev/null and b/settingsdir/mythen3/highgain/4500eV/trim.snxxxx differ diff --git a/settingsdir/mythen3/highgain/5400eV/trim.sn0000 b/settingsdir/mythen3/highgain/5400eV/trim.sn0000 new file mode 100644 index 0000000000..bd21699332 Binary files /dev/null and b/settingsdir/mythen3/highgain/5400eV/trim.sn0000 differ diff --git a/settingsdir/mythen3/highgain/5400eV/trim.snxxxx b/settingsdir/mythen3/highgain/5400eV/trim.snxxxx new file mode 100644 index 0000000000..bd21699332 Binary files /dev/null and b/settingsdir/mythen3/highgain/5400eV/trim.snxxxx differ diff --git a/settingsdir/mythen3/highgain/6400eV/trim.sn0000 b/settingsdir/mythen3/highgain/6400eV/trim.sn0000 new file mode 100644 index 0000000000..3210033e23 Binary files /dev/null and b/settingsdir/mythen3/highgain/6400eV/trim.sn0000 differ diff --git a/settingsdir/mythen3/highgain/6400eV/trim.snxxxx b/settingsdir/mythen3/highgain/6400eV/trim.snxxxx new file mode 100644 index 0000000000..3210033e23 Binary files /dev/null and b/settingsdir/mythen3/highgain/6400eV/trim.snxxxx differ diff --git a/settingsdir/mythen3/highgain/8000eV/trim.sn0000 b/settingsdir/mythen3/highgain/8000eV/trim.sn0000 new file mode 100644 index 0000000000..b5bf945698 Binary files /dev/null and b/settingsdir/mythen3/highgain/8000eV/trim.sn0000 differ diff --git a/settingsdir/mythen3/highgain/8000eV/trim.snxxxx b/settingsdir/mythen3/highgain/8000eV/trim.snxxxx new file mode 100644 index 0000000000..b5bf945698 Binary files /dev/null and b/settingsdir/mythen3/highgain/8000eV/trim.snxxxx differ diff --git a/settingsdir/mythen3/highgain/9900eV/trim.sn0000 b/settingsdir/mythen3/highgain/9900eV/trim.sn0000 new file mode 100644 index 0000000000..cb986b6a7b Binary files /dev/null and b/settingsdir/mythen3/highgain/9900eV/trim.sn0000 differ diff --git a/settingsdir/mythen3/highgain/9900eV/trim.snxxxx b/settingsdir/mythen3/highgain/9900eV/trim.snxxxx new file mode 100644 index 0000000000..cb986b6a7b Binary files /dev/null and b/settingsdir/mythen3/highgain/9900eV/trim.snxxxx differ diff --git a/settingsdir/mythen3/standard/11200eV/trim.sn0000 b/settingsdir/mythen3/standard/11200eV/trim.sn0000 new file mode 100644 index 0000000000..e82819eba7 Binary files /dev/null and b/settingsdir/mythen3/standard/11200eV/trim.sn0000 differ diff --git a/settingsdir/mythen3/standard/11200eV/trim.snxxxx b/settingsdir/mythen3/standard/11200eV/trim.snxxxx new file mode 100644 index 0000000000..e82819eba7 Binary files /dev/null and b/settingsdir/mythen3/standard/11200eV/trim.snxxxx differ diff --git a/settingsdir/mythen3/standard/4500eV/trim.sn0000 b/settingsdir/mythen3/standard/4500eV/trim.sn0000 new file mode 100644 index 0000000000..30f6400a24 Binary files /dev/null and b/settingsdir/mythen3/standard/4500eV/trim.sn0000 differ diff --git a/settingsdir/mythen3/standard/4500eV/trim.snxxxx b/settingsdir/mythen3/standard/4500eV/trim.snxxxx new file mode 100644 index 0000000000..30f6400a24 Binary files /dev/null and b/settingsdir/mythen3/standard/4500eV/trim.snxxxx differ diff --git a/settingsdir/mythen3/standard/5400eV/trim.sn0000 b/settingsdir/mythen3/standard/5400eV/trim.sn0000 new file mode 100644 index 0000000000..bd21699332 Binary files /dev/null and b/settingsdir/mythen3/standard/5400eV/trim.sn0000 differ diff --git a/settingsdir/mythen3/standard/5400eV/trim.snxxxx b/settingsdir/mythen3/standard/5400eV/trim.snxxxx new file mode 100644 index 0000000000..bd21699332 Binary files /dev/null and b/settingsdir/mythen3/standard/5400eV/trim.snxxxx differ diff --git a/settingsdir/mythen3/standard/6400eV/trim.sn0000 b/settingsdir/mythen3/standard/6400eV/trim.sn0000 new file mode 100644 index 0000000000..3210033e23 Binary files /dev/null and b/settingsdir/mythen3/standard/6400eV/trim.sn0000 differ diff --git a/settingsdir/mythen3/standard/6400eV/trim.snxxxx b/settingsdir/mythen3/standard/6400eV/trim.snxxxx new file mode 100644 index 0000000000..3210033e23 Binary files /dev/null and b/settingsdir/mythen3/standard/6400eV/trim.snxxxx differ diff --git a/settingsdir/mythen3/standard/8000eV/trim.sn0000 b/settingsdir/mythen3/standard/8000eV/trim.sn0000 new file mode 100644 index 0000000000..b5bf945698 Binary files /dev/null and b/settingsdir/mythen3/standard/8000eV/trim.sn0000 differ diff --git a/settingsdir/mythen3/standard/8000eV/trim.snxxxx b/settingsdir/mythen3/standard/8000eV/trim.snxxxx new file mode 100644 index 0000000000..b5bf945698 Binary files /dev/null and b/settingsdir/mythen3/standard/8000eV/trim.snxxxx differ diff --git a/settingsdir/mythen3/standard/9900eV/trim.sn0000 b/settingsdir/mythen3/standard/9900eV/trim.sn0000 new file mode 100644 index 0000000000..cb986b6a7b Binary files /dev/null and b/settingsdir/mythen3/standard/9900eV/trim.sn0000 differ diff --git a/settingsdir/mythen3/standard/9900eV/trim.snxxxx b/settingsdir/mythen3/standard/9900eV/trim.snxxxx new file mode 100644 index 0000000000..cb986b6a7b Binary files /dev/null and b/settingsdir/mythen3/standard/9900eV/trim.snxxxx differ diff --git a/slsDetectorGui/CMakeLists.txt b/slsDetectorGui/CMakeLists.txt index 244fe27331..70e8a2e9b5 100755 --- a/slsDetectorGui/CMakeLists.txt +++ b/slsDetectorGui/CMakeLists.txt @@ -91,7 +91,6 @@ target_include_directories(slsDetectorGui PUBLIC target_link_libraries(slsDetectorGui PUBLIC slsProjectOptions - slsProjectWarnings slsDetectorStatic ${QT_QTCORE_LIBRARIES} ${QT_QTGUI_LIBRARIES} @@ -101,6 +100,9 @@ target_link_libraries(slsDetectorGui PUBLIC Qt4::QtOpenGL Qt4::QtSvg expat + + PRIVATE + slsProjectWarnings ) set_target_properties(slsDetectorGui PROPERTIES @@ -111,7 +113,7 @@ if(SLS_LTO_AVAILABLE) endif() install(TARGETS slsDetectorGui - EXPORT "${TARGETS_EXPORT_NAME}" + # EXPORT "${TARGETS_EXPORT_NAME}" #do not export gui RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} diff --git a/slsDetectorGui/forms/form_tab_settings.ui b/slsDetectorGui/forms/form_tab_settings.ui index 01d9519827..7f44f601a9 100755 --- a/slsDetectorGui/forms/form_tab_settings.ui +++ b/slsDetectorGui/forms/form_tab_settings.ui @@ -32,6 +32,43 @@ Form + + + + false + + + + 140 + 25 + + + + + 140 + 16777215 + + + + false + + + eV + + + -100000 + + + 100000 + + + 100 + + + -1 + + + @@ -39,10 +76,16 @@ - 0 + 140 25 + + + 140 + 16777215 + + false @@ -63,10 +106,32 @@ - - + + + + false + + + + 110 + 0 + + + + + 110 + 16777215 + + + + Dynamic Range: + + + + + - Qt::Horizontal + Qt::Vertical QSizePolicy::Fixed @@ -74,7 +139,7 @@ 20 - 20 + 190 @@ -86,10 +151,16 @@ - 0 + 140 25 + + + 140 + 16777215 + + 1.67772e+07 @@ -112,21 +183,102 @@ - - - - Qt::Horizontal + + + + true - - QSizePolicy::Expanding + + + 0 + 0 + - + - 20 - 20 + 100 + 30 - + + + 16777215 + 30 + + + + + + + + + 20 + 20 + 20 + + + + + + + + + 20 + 20 + 20 + + + + + + + + + 20 + 20 + 20 + + + + + + + + Qt::TabFocus + + + Set + + + + :/icons/images/rightArrow.png:/icons/images/rightArrow.png + + + false + + + + + + + true + + + + 110 + 0 + + + + + 110 + 16777215 + + + + Settings: + + @@ -141,10 +293,16 @@ - 0 + 140 25 + + + 140 + 16777215 + + Settings of the detector. #settings# @@ -266,48 +424,93 @@ + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + false + + + 110 + 0 + + + + + 110 + 16777215 + + Threshold: - - + + false - - Dynamic Range: + + + 140 + 25 + - - - - - - true + + + 140 + 16777215 + - - Settings: + + false + + + eV + + + -100000 + + + 100000 + + + 100 + + + -1 - - + + - Qt::Vertical + Qt::Horizontal - QSizePolicy::Fixed + QSizePolicy::Expanding 20 - 190 + 20 @@ -317,6 +520,9 @@ comboSettings spinThreshold + spinThreshold2 + spinThreshold3 + btnSetThreshold comboDynamicRange diff --git a/slsDetectorGui/include/qTabSettings.h b/slsDetectorGui/include/qTabSettings.h index 6d73488a4d..2effd00bb7 100644 --- a/slsDetectorGui/include/qTabSettings.h +++ b/slsDetectorGui/include/qTabSettings.h @@ -14,6 +14,7 @@ class qTabSettings : public QWidget, private Ui::TabSettingsObject { void SetSettings(int index); void SetDynamicRange(int index); void SetThresholdEnergy(int index); + void SetThresholdEnergies(); private: void SetupWidgetWindow(); @@ -23,6 +24,7 @@ class qTabSettings : public QWidget, private Ui::TabSettingsObject { void GetSettings(); void GetDynamicRange(); void GetThresholdEnergy(); + void GetThresholdEnergies(); sls::Detector *det; enum { diff --git a/slsDetectorGui/src/qTabSettings.cpp b/slsDetectorGui/src/qTabSettings.cpp index c7941e8d9d..504f80b715 100644 --- a/slsDetectorGui/src/qTabSettings.cpp +++ b/slsDetectorGui/src/qTabSettings.cpp @@ -14,14 +14,24 @@ qTabSettings::~qTabSettings() {} void qTabSettings::SetupWidgetWindow() { + spinThreshold2->hide(); + spinThreshold3->hide(); + btnSetThreshold->hide(); + btnSetThreshold->setEnabled(false); // enabling according to det type slsDetectorDefs::detectorType detType = det->getDetectorType().squash(); if (detType == slsDetectorDefs::MYTHEN3) { - lblSettings->setEnabled(false); - comboSettings->setEnabled(false); - lblDynamicRange->setEnabled(true); comboDynamicRange->setEnabled(true); + + spinThreshold2->show(); + spinThreshold3->show(); + lblThreshold->setEnabled(true); + spinThreshold->setEnabled(true); + spinThreshold2->setEnabled(true); + spinThreshold3->setEnabled(true); + btnSetThreshold->setEnabled(true); + btnSetThreshold->show(); // disable dr QStandardItemModel *model = qobject_cast(comboDynamicRange->model()); @@ -34,7 +44,6 @@ void qTabSettings::SetupWidgetWindow() { item = model->itemFromIndex(index); item->setEnabled(false); } - } else if (detType == slsDetectorDefs::EIGER) { lblDynamicRange->setEnabled(true); comboDynamicRange->setEnabled(true); @@ -48,6 +57,10 @@ void qTabSettings::SetupWidgetWindow() { SetupDetectorSettings(); } spinThreshold->setValue(-1); + if (detType == slsDetectorDefs::MYTHEN3) { + spinThreshold2->setValue(-1); + spinThreshold3->setValue(-1); + } Initialization(); // default for the disabled GetDynamicRange(); @@ -104,6 +117,11 @@ void qTabSettings::SetupDetectorSettings() { item[(int)G4_HIGHGAIN]->setEnabled(true); item[(int)G4_LOWGAIN]->setEnabled(true); break; + case slsDetectorDefs::MYTHEN3: + item[(int)STANDARD]->setEnabled(true); + item[(int)FAST]->setEnabled(true); + item[(int)HIGHGAIN]->setEnabled(true); + break; default: LOG(logDEBUG) << "Unknown detector type. Exiting GUI."; qDefs::Message(qDefs::CRITICAL, @@ -126,7 +144,13 @@ void qTabSettings::Initialization() { SLOT(SetDynamicRange(int))); // Threshold - if (spinThreshold->isEnabled()) + // m3 + if (btnSetThreshold->isEnabled()) { + connect(btnSetThreshold, SIGNAL(clicked()), this, + SLOT(SetThresholdEnergies())); + } + // eiger + else if (spinThreshold->isEnabled()) connect(spinThreshold, SIGNAL(valueChanged(int)), this, SLOT(SetThresholdEnergy(int))); } @@ -169,7 +193,7 @@ void qTabSettings::SetSettings(int index) { CATCH_HANDLE("Could not set settings.", "qTabSettings::SetSettings", this, &qTabSettings::GetSettings) // threshold - if (spinThreshold->isEnabled()) { + if (det->getDetectorType().squash() == slsDetectorDefs::EIGER) { SetThresholdEnergy(spinThreshold->value()); } } @@ -233,6 +257,23 @@ void qTabSettings::SetDynamicRange(int index) { &qTabSettings::GetDynamicRange) } +void qTabSettings::GetThresholdEnergies() { + LOG(logDEBUG) << "Getting theshold energies"; + disconnect(btnSetThreshold, SIGNAL(clicked()), this, + SLOT(SetThresholdEnergies())); + try { + auto retval = det->getAllThresholdEnergy().tsquash( + "Inconsistent threhsold energies for all detectors."); + spinThreshold->setValue(retval[0]); + spinThreshold2->setValue(retval[1]); + spinThreshold3->setValue(retval[2]); + } + CATCH_DISPLAY("Could not get threshold energy.", + "qTabDataOutput::GetThresholdEnergies") + connect(btnSetThreshold, SIGNAL(clicked()), this, + SLOT(SetThresholdEnergies())); +} + void qTabSettings::GetThresholdEnergy() { LOG(logDEBUG) << "Getting theshold energy"; disconnect(spinThreshold, SIGNAL(valueChanged(int)), this, @@ -248,6 +289,23 @@ void qTabSettings::GetThresholdEnergy() { SLOT(SetThresholdEnergy(int))); } +void qTabSettings::SetThresholdEnergies() { + std::array eV = {spinThreshold->value(), spinThreshold2->value(), + spinThreshold3->value()}; + slsDetectorDefs::detectorSettings sett = + static_cast( + comboSettings->currentIndex()); + LOG(logINFO) << "Setting Threshold Energies to " << sls::ToString(eV) + << " (eV)"; + try { + det->setThresholdEnergy(eV, sett); + } + CATCH_DISPLAY("Could not get threshold energies.", + "qTabSettings::SetThresholdEnergies") + // set the right value anyway (due to tolerance) + GetThresholdEnergies(); +} + void qTabSettings::SetThresholdEnergy(int index) { LOG(logINFO) << "Setting Threshold Energy to " << index << " eV"; try { @@ -270,8 +328,14 @@ void qTabSettings::Refresh() { GetDynamicRange(); } - if (spinThreshold->isEnabled()) + // m3 + if (btnSetThreshold->isEnabled()) + GetThresholdEnergies(); + // eiger + else if (spinThreshold->isEnabled()) { + LOG(logINFOBLUE) << "calling it!"; GetThresholdEnergy(); + } LOG(logDEBUG) << "**Updated Settings Tab"; } diff --git a/slsDetectorServers/ctbDetectorServer/CMakeLists.txt b/slsDetectorServers/ctbDetectorServer/CMakeLists.txt index 26c9ec0ee0..d06ea78f7a 100644 --- a/slsDetectorServers/ctbDetectorServer/CMakeLists.txt +++ b/slsDetectorServers/ctbDetectorServer/CMakeLists.txt @@ -22,6 +22,7 @@ add_executable(ctbDetectorServer_virtual include_directories( ../slsDetectorServer/include ../../slsSupportLib/include + ../../slsDetectorSoftware/include/sls/ ) target_include_directories(ctbDetectorServer_virtual diff --git a/slsDetectorServers/ctbDetectorServer/Makefile b/slsDetectorServers/ctbDetectorServer/Makefile index 6d6aab3186..3d22608162 100755 --- a/slsDetectorServers/ctbDetectorServer/Makefile +++ b/slsDetectorServers/ctbDetectorServer/Makefile @@ -2,10 +2,11 @@ current_dir = $(shell pwd) main_inc = ../slsDetectorServer/include/ main_src = ../slsDetectorServer/src/ support_lib = ../../slsSupportLib/include/ +det_lib = ../../slsDetectorSoftware/include/sls/ CROSS = bfin-uclinux- CC = $(CROSS)gcc -CFLAGS += -Wall -std=gnu99 -DCHIPTESTBOARDD -DSTOP_SERVER -I$(main_inc) -I$(support_lib) -I$(current_dir) #-DDEBUG1 #-DVERBOSEI #-DVERBOSE +CFLAGS += -Wall -std=gnu99 -DCHIPTESTBOARDD -DSTOP_SERVER -I$(main_inc) -I$(support_lib) -I$(det_lib) -I$(current_dir) #-DDEBUG1 #-DVERBOSEI #-DVERBOSE LDLIBS += -lm -lrt -pthread PROGS = ctbDetectorServer DESTDIR ?= bin diff --git a/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_5.1.0 b/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_5.1.0 new file mode 100755 index 0000000000..2231a67b1b Binary files /dev/null and b/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_5.1.0 differ diff --git a/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServerv5.0.0 b/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServerv5.0.0 deleted file mode 100755 index dcebc38239..0000000000 Binary files a/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServerv5.0.0 and /dev/null differ diff --git a/slsDetectorServers/eigerDetectorServer/FebControl.c b/slsDetectorServers/eigerDetectorServer/FebControl.c index 78cbbdcef5..82440f60bc 100644 --- a/slsDetectorServers/eigerDetectorServer/FebControl.c +++ b/slsDetectorServers/eigerDetectorServer/FebControl.c @@ -1395,7 +1395,7 @@ int Feb_Control_SetMaster(enum MASTERINDEX ind) { int Feb_Control_SetQuad(int val) { LOG(logINFO, ("Setting Quad to %d in Feb\n", val)); // only setting on the right feb if quad - return Feb_Control_SetTop(val == 0 ? TOP_HARDWARE : OW_TOP, 0, 1); + return Feb_Control_SetTop(val == 0 ? TOP_HARDWARE : OW_BOTTOM, 0, 1); } int Feb_Control_SetReadNLines(int value) { diff --git a/slsDetectorServers/eigerDetectorServer/bin/config_eiger.txt b/slsDetectorServers/eigerDetectorServer/bin/config_eiger.txt new file mode 100755 index 0000000000..5bd0988887 --- /dev/null +++ b/slsDetectorServers/eigerDetectorServer/bin/config_eiger.txt @@ -0,0 +1,2 @@ +top 1 +master 1 diff --git a/slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServer_5.1.0 b/slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServer_5.1.0 new file mode 100755 index 0000000000..7b29c540dd Binary files /dev/null and b/slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServer_5.1.0 differ diff --git a/slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServerv5.0.0 b/slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServerv5.0.0 deleted file mode 100755 index deb6f5eafd..0000000000 Binary files a/slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServerv5.0.0 and /dev/null differ diff --git a/slsDetectorServers/eigerDetectorServer/bin/hv9m_blackfin_serverv3.0.0.1 b/slsDetectorServers/eigerDetectorServer/bin/hv9m_blackfin_serverv3.0.0.1 deleted file mode 100755 index 4ab730239a..0000000000 Binary files a/slsDetectorServers/eigerDetectorServer/bin/hv9m_blackfin_serverv3.0.0.1 and /dev/null differ diff --git a/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c index 95cc099c3a..e06df60400 100644 --- a/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c @@ -669,7 +669,9 @@ void allocateDetectorStructureMemory() { (detectorModules)->reg = 0; (detectorModules)->iodelay = 0; (detectorModules)->tau = 0; - (detectorModules)->eV = 0; + (detectorModules)->eV[0] = 0; + (detectorModules)->eV[1] = 0; + (detectorModules)->eV[2] = 0; thisSettings = UNINITIALIZED; // if trimval requested, should return -1 to acknowledge unknown @@ -1090,8 +1092,8 @@ int setModule(sls_detector_module myMod, char *mess) { } // threshold - if (myMod.eV >= 0) - setThresholdEnergy(myMod.eV); + if (myMod.eV[0] >= 0) + setThresholdEnergy(myMod.eV[0]); else { // (loading a random trim file) (dont return fail) setSettings(UNDEFINED); @@ -2554,8 +2556,8 @@ int copyModule(sls_detector_module *destMod, sls_detector_module *srcMod) { destMod->iodelay = srcMod->iodelay; if (srcMod->tau >= 0) destMod->tau = srcMod->tau; - if (srcMod->eV >= 0) - destMod->eV = srcMod->eV; + if (srcMod->eV[0] >= 0) + destMod->eV[0] = srcMod->eV[0]; LOG(logDEBUG1, ("Copying register %x (%x)\n", destMod->reg, srcMod->reg)); if (destMod->nchan != 0) { diff --git a/slsDetectorServers/gotthard2DetectorServer/bin/config_gotthard2.txt b/slsDetectorServers/gotthard2DetectorServer/bin/config_gotthard2.txt new file mode 100755 index 0000000000..e846a68a85 --- /dev/null +++ b/slsDetectorServers/gotthard2DetectorServer/bin/config_gotthard2.txt @@ -0,0 +1,33 @@ + + +#onchip dacs chip index value (max 0x3ff) +vchip_comp_fe -1 0x137 +vchip_opa_1st -1 0x000 +vchip_opa_fd -1 0x134 +vchip_comp_adc -1 0x3FF +vchip_ref_comp_fe -1 0x180 +vchip_cs -1 0x0D0 + +#dacs value (max 4096) +vref_h_adc 2116 +vb_comp_fe 0 +vb_comp_adc 0 +vcom_cds 705 +vref_rstore 150 +vb_opa_1st 0 +vref_comp_fe 0 +vcom_adc1 705 +vref_prech 869 +vref_l_adc 700 +vref_cds 700 +vb_cs 2799 +vb_opa_fd 0 +vcom_adc2 704 + +#configure adc chip index adc index value(max 0x7F) +confadc -1 -1 0x22 + +#vetoreference gain index value(max 4095) +vetoref 1 0 + + diff --git a/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_5.1.0 b/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_5.1.0 new file mode 100755 index 0000000000..04a079dbfd Binary files /dev/null and b/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_5.1.0 differ diff --git a/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServerv5.0.0 b/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServerv5.0.0 deleted file mode 100755 index f13fb09c55..0000000000 Binary files a/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServerv5.0.0 and /dev/null differ diff --git a/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c index 11d5862843..21f7baca15 100644 --- a/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c @@ -409,9 +409,9 @@ void setupDetector() { // pll defines ALTERA_PLL_C10_SetDefines(REG_OFFSET, BASE_READOUT_PLL, BASE_SYSTEM_PLL, - PLL_RESET_REG, PLL_RESET_REG, - PLL_RESET_READOUT_MSK, PLL_RESET_SYSTEM_MSK, - READOUT_PLL_VCO_FREQ_HZ, SYSTEM_PLL_VCO_FREQ_HZ); + PLL_RESET_REG, PLL_RESET_READOUT_MSK, + PLL_RESET_SYSTEM_MSK, READOUT_PLL_VCO_FREQ_HZ, + SYSTEM_PLL_VCO_FREQ_HZ); ALTERA_PLL_C10_ResetPLL(READOUT_PLL); ALTERA_PLL_C10_ResetPLL(SYSTEM_PLL); // hv diff --git a/slsDetectorServers/gotthardDetectorServer/bin/config_gotthard.txt b/slsDetectorServers/gotthardDetectorServer/bin/config_gotthard.txt new file mode 100755 index 0000000000..721434a758 --- /dev/null +++ b/slsDetectorServers/gotthardDetectorServer/bin/config_gotthard.txt @@ -0,0 +1,23 @@ +#masterflags (no_master, is_master, is_slave) +masterflags no_master + +#master default delay +masterdefaultdelay 70 + +#patternphase +patternphase 0 + +#adcphase +adcphase 0 + +#slave pattern phase +slavepatternphase 0 + +#slave adc phase +slaveadcphase 0 + +#rst to sw1 delay +rsttosw1delay 2 + +#start acquisition delay +startacqdelay 1 \ No newline at end of file diff --git a/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_5.1.0 b/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_5.1.0 new file mode 100755 index 0000000000..aefdca309b Binary files /dev/null and b/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_5.1.0 differ diff --git a/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServerv5.0.0 b/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServerv5.0.0 deleted file mode 100755 index ab3956a1e5..0000000000 Binary files a/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServerv5.0.0 and /dev/null differ diff --git a/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_5.1.0 b/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_5.1.0 new file mode 100755 index 0000000000..71aadc17ba Binary files /dev/null and b/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_5.1.0 differ diff --git a/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServerv5.0.0 b/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServerv5.0.0 deleted file mode 100755 index c1303882c8..0000000000 Binary files a/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServerv5.0.0 and /dev/null differ diff --git a/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c index bb5993ce72..aa5c97006d 100644 --- a/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c @@ -1396,11 +1396,8 @@ int setClockDivider(enum CLKINDEX ind, int val) { setPhase(ADC_CLK, adcPhase, 0); LOG(logINFO, ("\tSet ADC Phase Reg to %d\n", adcPhase)); - // only implemented in the new boards now - if (!isHardwareVersion2()) { - setPhase(DBIT_CLK, dbitPhase, 0); - LOG(logINFO, ("\tSet DBIT Phase Reg to %d\n", dbitPhase)); - } + setPhase(DBIT_CLK, dbitPhase, 0); + LOG(logINFO, ("\tSet DBIT Phase Reg to %d\n", dbitPhase)); return OK; } diff --git a/slsDetectorServers/jungfrauDetectorServer/slsDetectorServer_defs.h b/slsDetectorServers/jungfrauDetectorServer/slsDetectorServer_defs.h index bfc832636e..9877917c65 100644 --- a/slsDetectorServers/jungfrauDetectorServer/slsDetectorServer_defs.h +++ b/slsDetectorServers/jungfrauDetectorServer/slsDetectorServer_defs.h @@ -3,7 +3,7 @@ #include "sls/sls_detector_defs.h" #define MIN_REQRD_VRSN_T_RD_API 0x171220 -#define REQRD_FRMWRE_VRSN_BOARD2 0x200724 // 1.0 pcb +#define REQRD_FRMWRE_VRSN_BOARD2 0x210218 // 1.0 pcb #define REQRD_FRMWRE_VRSN 0x200721 // 2.0 pcb #define CTRL_SRVR_INIT_TIME_US (300 * 1000) @@ -113,8 +113,8 @@ enum CLKINDEX { RUN_CLK, ADC_CLK, DBIT_CLK, NUM_CLOCKS }; #define ADC_OFST_FULL_SPEED_VAL (0x10) // 2.0 pcb #define ADC_OFST_HALF_SPEED_VAL (0x08) // 2.0 pcb #define ADC_OFST_QUARTER_SPEED_VAL (0x04) // 2.0 pcb -#define ADC_OFST_HALF_SPEED_BOARD2_VAL (0x13) // 1.0 pcb (2 resistor network) -#define ADC_OFST_QUARTER_SPEED_BOARD2_VAL (0x0b) // 1.0 pcb (2 resistor network) +#define ADC_OFST_HALF_SPEED_BOARD2_VAL (0x10) // 1.0 pcb (2 resistor network) +#define ADC_OFST_QUARTER_SPEED_BOARD2_VAL (0x08) // 1.0 pcb (2 resistor network) #define ADC_PORT_INVERT_VAL (0x5A5A5A5A) #define ADC_PORT_INVERT_BOARD2_VAL (0x453b2a9c) @@ -140,8 +140,8 @@ enum CLKINDEX { RUN_CLK, ADC_CLK, DBIT_CLK, NUM_CLOCKS }; #define ADC_PHASE_FULL_SPEED (150) // 2.0 pcb #define ADC_PHASE_HALF_SPEED (200) // 2.0 pcb #define ADC_PHASE_QUARTER_SPEED (200) // 2.0 pcb -#define ADC_PHASE_HALF_SPEED_BOARD2 (75) // 1.0 pcb (2 resistor network) -#define ADC_PHASE_QUARTER_SPEED_BOARD2 (75) // 1.0 pcb (2 resistor network) +#define ADC_PHASE_HALF_SPEED_BOARD2 (110) // 1.0 pcb (2 resistor network) +#define ADC_PHASE_QUARTER_SPEED_BOARD2 (220) // 1.0 pcb (2 resistor network) #define DBIT_PHASE_FULL_SPEED (85) // 2.0 pcb #define DBIT_PHASE_HALF_SPEED (150) // 2.0 pcb diff --git a/slsDetectorServers/moenchDetectorServer/CMakeLists.txt b/slsDetectorServers/moenchDetectorServer/CMakeLists.txt index 056ee1f5e2..a5c2244912 100644 --- a/slsDetectorServers/moenchDetectorServer/CMakeLists.txt +++ b/slsDetectorServers/moenchDetectorServer/CMakeLists.txt @@ -20,6 +20,7 @@ add_executable(moenchDetectorServer_virtual include_directories( ../slsDetectorServer/include ../../slsSupportLib/include + ../../slsDetectorSoftware/include/sls/ ) target_include_directories(moenchDetectorServer_virtual diff --git a/slsDetectorServers/moenchDetectorServer/Makefile b/slsDetectorServers/moenchDetectorServer/Makefile index a34b3f6b3b..a73300c7fa 100755 --- a/slsDetectorServers/moenchDetectorServer/Makefile +++ b/slsDetectorServers/moenchDetectorServer/Makefile @@ -2,10 +2,11 @@ current_dir = $(shell pwd) main_inc = ../slsDetectorServer/include/ main_src = ../slsDetectorServer/src/ support_lib = ../../slsSupportLib/include/ +det_lib = ../../slsDetectorSoftware/include/sls/ CROSS = bfin-uclinux- CC = $(CROSS)gcc -CFLAGS += -Wall -std=gnu99 -DMOENCHD -DSTOP_SERVER -I$(main_inc) -I$(support_lib) -I$(current_dir)#-DVERBOSEI #-DVERBOSE +CFLAGS += -Wall -std=gnu99 -DMOENCHD -DSTOP_SERVER -I$(main_inc) -I$(support_lib) -I$(det_lib) -I$(current_dir)#-DVERBOSEI #-DVERBOSE LDLIBS += -lm -lrt -pthread PROGS = moenchDetectorServer DESTDIR ?= bin diff --git a/slsDetectorServers/moenchDetectorServer/bin/DefaultPattern_moench.txt b/slsDetectorServers/moenchDetectorServer/bin/DefaultPattern_moench.txt new file mode 100755 index 0000000000..0c64c23fa3 --- /dev/null +++ b/slsDetectorServers/moenchDetectorServer/bin/DefaultPattern_moench.txt @@ -0,0 +1,288 @@ +patword 0x0000 0x0008599f0418503a +patword 0x0001 0x0008599f0418503a +patword 0x0002 0x000859960418503a +patword 0x0003 0x000859960418503a +patword 0x0004 0x000859960418503a +patword 0x0005 0x000859960418503a +patword 0x0006 0x000859960418503a +patword 0x0007 0x000859960418503a +patword 0x0008 0x000859960418503a +patword 0x0009 0x000859960418503a +patword 0x000a 0x000859960418503a +patword 0x000b 0x000859960418503a +patword 0x000c 0x000859960418503a +patword 0x000d 0x000859960418503a +patword 0x000e 0x000859960418503a +patword 0x000f 0x000859960418503a +patword 0x0010 0x000859960418503a +patword 0x0011 0x000859960418503a +patword 0x0012 0x000859960418503a +patword 0x0013 0x000859960418503a +patword 0x0014 0x000859960418503a +patword 0x0015 0x000859960418503a +patword 0x0016 0x000819960418501a +patword 0x0017 0x000819960418501a +patword 0x0018 0x000819960418501a +patword 0x0019 0x000819960418501a +patword 0x001a 0x000819960418501a +patword 0x001b 0x000819960418501a +patword 0x001c 0x000819960418501a +patword 0x001d 0x000819960418501a +patword 0x001e 0x000819960418501a +patword 0x001f 0x000819960418501a +patword 0x0020 0x000819960418501a +patword 0x0021 0x000819960418501a +patword 0x0022 0x000819960418501a +patword 0x0023 0x000819960418501a +patword 0x0024 0x000819960418501a +patword 0x0025 0x000819960418501a +patword 0x0026 0x000819960418501a +patword 0x0027 0x000819960418501a +patword 0x0028 0x000819960418501a +patword 0x0029 0x000819960418501a +patword 0x002a 0x000819960418501a +patword 0x002b 0x000819960418501a +patword 0x002c 0x000819960418501a +patword 0x002d 0x000819960418501a +patword 0x002e 0x000819960418501a +patword 0x002f 0x000819960418501a +patword 0x0030 0x000819960008501a +patword 0x0031 0x000819960008501a +patword 0x0032 0x000819960008501a +patword 0x0033 0x000819960008501a +patword 0x0034 0x000819960008501a +patword 0x0035 0x000819960008501a +patword 0x0036 0x000819960008501a +patword 0x0037 0x000819960008501a +patword 0x0038 0x000819960008501a +patword 0x0039 0x000819960008501a +patword 0x003a 0x000819960008501a +patword 0x003b 0x000819960008501a +patword 0x003c 0x000819960008501a +patword 0x003d 0x000819960008501a +patword 0x003e 0x000819960008501a +patword 0x003f 0x000819960008501a +patword 0x0040 0x000819960008501a +patword 0x0041 0x000819960008501a +patword 0x0042 0x000819960008501a +patword 0x0043 0x000819960008501a +patword 0x0044 0x0008199f0008501a +patword 0x0045 0x0008199f0008501a +patword 0x0046 0x0008199f0008501a +patword 0x0047 0x0008199f0008501a +patword 0x0048 0x0008199f0008501a +patword 0x0049 0x0008199f0008501a +patword 0x004a 0x0008199f0008501a +patword 0x004b 0x0008199f0008501a +patword 0x004c 0x0008199f0008501a +patword 0x004d 0x0008199f0008501a +patword 0x004e 0x0008199f0008501a +patword 0x004f 0x0008199f0008501a +patword 0x0050 0x0008199f0008501a +patword 0x0051 0x0008199f0008501a +patword 0x0052 0x0008199f0008501a +patword 0x0053 0x0008199f0008501a +patword 0x0054 0x0008199f0008501a +patword 0x0055 0x0008199f0008501a +patword 0x0056 0x0008199f0008501a +patword 0x0057 0x0008199f0008501a +patword 0x0058 0x0008599f0008503a +patword 0x0059 0x0008599f0008503a +patword 0x005a 0x000c599f000850ba +patword 0x005b 0x000c599f000850ba +patword 0x005c 0x000c599f000850ba +patword 0x005d 0x000c599f000850ba +patword 0x005e 0x000c599f000850ba +patword 0x005f 0x000c599f000850ba +patword 0x0060 0x000c599f000850ba +patword 0x0061 0x000c599f000850ba +patword 0x0062 0x000c599f000850ba +patword 0x0063 0x000c599f000850ba +patword 0x0064 0x000c599f000850ba +patword 0x0065 0x000c599f000850ba +patword 0x0066 0x000c599f000850ba +patword 0x0067 0x000c599f000850ba +patword 0x0068 0x000c599f000850ba +patword 0x0069 0x000c599f000850ba +patword 0x006a 0x000c599f000850ba +patword 0x006b 0x000c599f000850ba +patword 0x006c 0x000c599f000850ba +patword 0x006d 0x000c599f000850ba +patword 0x006e 0x000c799f010858ba +patword 0x006f 0x000c799f010858ba +patword 0x0070 0x000c599f000850ba +patword 0x0071 0x000c599f000850ba +patword 0x0072 0x000c599f000850ba +patword 0x0073 0x000c599f000850ba +patword 0x0074 0x000c599f000850ba +patword 0x0075 0x000c599f000850ba +patword 0x0076 0x000c599f000850ba +patword 0x0077 0x000c599f000850ba +patword 0x0078 0x000c599f000850ba +patword 0x0079 0x000c599f000850ba +patword 0x007a 0x000c599f000850ba +patword 0x007b 0x000c599f000850ba +patword 0x007c 0x000c599f000850ba +patword 0x007d 0x000c599f000850ba +patword 0x007e 0x000c599f000850ba +patword 0x007f 0x000c599f000850ba +patword 0x0080 0x000c599f000850ba +patword 0x0081 0x000c599f000850ba +patword 0x0082 0x000c599f000850ba +patword 0x0083 0x000c599f000850ba +patword 0x0084 0x000c599f000850ba +patword 0x0085 0x000c599f000850ba +patword 0x0086 0x000c599f400850ba +patword 0x0087 0x000c599f400850ba +patword 0x0088 0x000c599f600850ba +patword 0x0089 0x000c599f400850ba +patword 0x008a 0x000c599f400850ba +patword 0x008b 0x000c599f400850ba +patword 0x008c 0x840c599f682e50ba +patword 0x008d 0x840c599f482850ba +patword 0x008e 0x840c599f000e50ba +patword 0x008f 0x840c599f000850ba +patword 0x0090 0x840c599f000e50ba +patword 0x0091 0x840c599f000850ba +patword 0x0092 0x840c599f000e50ba +patword 0x0093 0x840c599f000850ba +patword 0x0094 0x840c599f000e50ba +patword 0x0095 0x840c599f000850ba +patword 0x0096 0x840c599f000e50ba +patword 0x0097 0x840c599f000850ba +patword 0x0098 0x840c599f000e50ba +patword 0x0099 0x840c599f000850ba +patword 0x009a 0x840c599f000e50ba +patword 0x009b 0x840c599f000850ba +patword 0x009c 0x840c599f000e50ba +patword 0x009d 0x840c599f000850ba +patword 0x009e 0x840c599f000e50ba +patword 0x009f 0x840c599f000850ba +patword 0x00a0 0x840c599f000e50ba +patword 0x00a1 0x840c599f000850ba +patword 0x00a2 0x840c599f000e50ba +patword 0x00a3 0x840c599f000850ba +patword 0x00a4 0x840c599f000e50ba +patword 0x00a5 0x840c599f000850ba +patword 0x00a6 0x840c599f200e50ba +patword 0x00a7 0x840c599f000850ba +patword 0x00a8 0x840c599f000e50ba +patword 0x00a9 0x840c599f000850ba +patword 0x00aa 0x840c599f000e50ba +patword 0x00ab 0x840c599f000850ba +patword 0x00ac 0x840c599f000e50ba +patword 0x00ad 0x840c599f000850ba +patword 0x00ae 0x840c599f000e50ba +patword 0x00af 0x840c599f000850ba +patword 0x00b0 0x840c599f000e50ba +patword 0x00b1 0x840c599f000850ba +patword 0x00b2 0x840c599f000e50ba +patword 0x00b3 0x840c599f000850ba +patword 0x00b4 0x840c599f000e50ba +patword 0x00b5 0x840c599f000850ba +patword 0x00b6 0x840c599f000e50ba +patword 0x00b7 0x840c599f000850ba +patword 0x00b8 0x840c599f000e50ba +patword 0x00b9 0x840c599f000850ba +patword 0x00ba 0x840c599f000e50ba +patword 0x00bb 0x840c599f000850ba +patword 0x00bc 0x840c599f000e50ba +patword 0x00bd 0x840c599f000850ba +patword 0x00be 0x840c599f282e50ba +patword 0x00bf 0x840c599f082850ba +patword 0x00c0 0x840c599f000e50ba +patword 0x00c1 0x840c599f000850ba +patword 0x00c2 0x840c599f000e50ba +patword 0x00c3 0x840c599f000850ba +patword 0x00c4 0x840c599f000e50ba +patword 0x00c5 0x840c599f000850ba +patword 0x00c6 0x840c599f000e50ba +patword 0x00c7 0x840c599f000850ba +patword 0x00c8 0x840c599f000e50ba +patword 0x00c9 0x840c599f000850ba +patword 0x00ca 0x840c599f000e50ba +patword 0x00cb 0x840c599f000850ba +patword 0x00cc 0x840c599f000e50ba +patword 0x00cd 0x840c599f000850ba +patword 0x00ce 0x840c599f000e50ba +patword 0x00cf 0x840c599f000850ba +patword 0x00d0 0x840c599f000e50ba +patword 0x00d1 0x840c599f000850ba +patword 0x00d2 0x840c599f000e50ba +patword 0x00d3 0x840c599f000850ba +patword 0x00d4 0x840c599f000e50ba +patword 0x00d5 0x840c599f000850ba +patword 0x00d6 0x840c599f000e50ba +patword 0x00d7 0x840c599f000850ba +patword 0x00d8 0x840c599f200e50ba +patword 0x00d9 0x840c599f000850ba +patword 0x00da 0x840c599f000e50ba +patword 0x00db 0x840c599f000850ba +patword 0x00dc 0x840c599f000e50ba +patword 0x00dd 0x840c599f000850ba +patword 0x00de 0x840c599f000e50ba +patword 0x00df 0x840c599f000850ba +patword 0x00e0 0x840c599f000e50ba +patword 0x00e1 0x840c599f000850ba +patword 0x00e2 0x840c599f000e50ba +patword 0x00e3 0x840c599f000850ba +patword 0x00e4 0x840c599f000e50ba +patword 0x00e5 0x840c599f000850ba +patword 0x00e6 0x840c599f000e50ba +patword 0x00e7 0x840c599f000850ba +patword 0x00e8 0x840c599f000e50ba +patword 0x00e9 0x840c599f000850ba +patword 0x00ea 0x840c599f000e50ba +patword 0x00eb 0x840c599f000850ba +patword 0x00ec 0x840c599f000e50ba +patword 0x00ed 0x840c599f000850ba +patword 0x00ee 0x840c599f000e50ba +patword 0x00ef 0x840c599f000850ba +patword 0x00f0 0x040c599f000850ba +patword 0x00f1 0x040c599f000850ba +patword 0x00f2 0x000c599f000850ba +patword 0x00f3 0x000c599f000850ba +patword 0x00f4 0x0008599f200e503a +patword 0x00f5 0x0008599f0008503a +patword 0x00f6 0x0008599f200e503a +patword 0x00f7 0x0008599f0008503a +patword 0x00f8 0x0008599f0008503a +patword 0x00f9 0x0008599f0008503a +patword 0x00fa 0x0008599f0008503a +patword 0x00fb 0x0008599f0008503a +patword 0x00fc 0x0008599f0008503a +patword 0x00fd 0x0008599f0008503a +patword 0x00fe 0x0008599f0008503a +patword 0x00ff 0x0008599f0008503a +patword 0x0100 0x0008599f0008503a +patword 0x0101 0x0008599f0008503a +patword 0x0102 0x0008599f0008503a +patword 0x0103 0x0008599f0008503a +patword 0x0104 0x0008599f0008503a +patword 0x0105 0x0008599f0008503a +patword 0x0106 0x0008599f0008503a +patword 0x0107 0x0008599f0008503a +patword 0x0108 0x0008599f0008503a +patword 0x0109 0x0008599f0008503a +patword 0x010a 0x0008599f0008503a +patword 0x010b 0x0008599f0008503a +patword 0x010c 0x0008599f0008503a +patword 0x010d 0x0008599f0008503a +patword 0x010e 0x0008599f0008503a +patword 0x010f 0x0008599f0008503a +patword 0x0110 0x0008599f0008503a +patword 0x0111 0x0008599f0008503a +patioctrl 0x8f0effff6dbffdbf +patlimits 0x0000 0x0110 +patloop0 0x00be 0x00ef +patnloop0 199 +patloop1 0x0400 0x0400 +patnloop1 0 +patloop2 0x0400 0x0400 +patnloop2 0 +patwait0 0x002e +patwaittime0 800 +patwait1 0x0400 +patwaittime1 0 +patwait2 0x0400 +patwaittime2 0 diff --git a/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_5.1.0 b/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_5.1.0 new file mode 100755 index 0000000000..d8a2228b98 Binary files /dev/null and b/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_5.1.0 differ diff --git a/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServerv5.0.0 b/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServerv5.0.0 deleted file mode 100755 index 14cc205fa0..0000000000 Binary files a/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServerv5.0.0 and /dev/null differ diff --git a/slsDetectorServers/moenchDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/moenchDetectorServer/slsDetectorFunctionList.c index a0c28c797e..1ea6275ed5 100644 --- a/slsDetectorServers/moenchDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/moenchDetectorServer/slsDetectorFunctionList.c @@ -550,7 +550,9 @@ void setupDetector() { initError = FAIL; } setPipeline(ADC_CLK, DEFAULT_PIPELINE); - loadDefaultPattern(DEFAULT_PATTERN_FILE); + if (initError != FAIL) { + initError = loadDefaultPattern(DEFAULT_PATTERN_FILE, initErrorMessage); + } setSettings(DEFAULT_SETTINGS); setFrequency(RUN_CLK, DEFAULT_RUN_CLK); diff --git a/slsDetectorServers/mythen3DetectorServer/CMakeLists.txt b/slsDetectorServers/mythen3DetectorServer/CMakeLists.txt index 85baade809..b9740a0fe1 100644 --- a/slsDetectorServers/mythen3DetectorServer/CMakeLists.txt +++ b/slsDetectorServers/mythen3DetectorServer/CMakeLists.txt @@ -17,6 +17,7 @@ add_executable(mythen3DetectorServer_virtual include_directories( ../slsDetectorServer/include ../../slsSupportLib/include + ../../slsDetectorSoftware/include/sls/ ) target_include_directories(mythen3DetectorServer_virtual diff --git a/slsDetectorServers/mythen3DetectorServer/Makefile b/slsDetectorServers/mythen3DetectorServer/Makefile index c07029041d..149cf15c67 100755 --- a/slsDetectorServers/mythen3DetectorServer/Makefile +++ b/slsDetectorServers/mythen3DetectorServer/Makefile @@ -2,10 +2,11 @@ current_dir = $(shell pwd) main_inc = ../slsDetectorServer/include/ main_src = ../slsDetectorServer/src/ support_lib = ../../slsSupportLib/include/ +det_lib = ../../slsDetectorSoftware/include/sls/ CROSS = nios2-buildroot-linux-gnu- CC = $(CROSS)gcc -CFLAGS += -Wall -std=gnu99 -DMYTHEN3D -DSTOP_SERVER -I$(main_inc) -I$(support_lib) -I$(current_dir) #-DDEBUG1 #-DVERBOSEI #-DVERBOSE +CFLAGS += -Wall -std=gnu99 -DMYTHEN3D -DSTOP_SERVER -I$(main_inc) -I$(support_lib) -I$(det_lib) -I$(current_dir) #-DDEBUG1 #-DVERBOSEI #-DVERBOSE LDLIBS += -lm -lrt -pthread PROGS = mythen3DetectorServer DESTDIR ?= bin diff --git a/slsDetectorServers/mythen3DetectorServer/RegisterDefs.h b/slsDetectorServers/mythen3DetectorServer/RegisterDefs.h index 847d396e61..a07a24a503 100644 --- a/slsDetectorServers/mythen3DetectorServer/RegisterDefs.h +++ b/slsDetectorServers/mythen3DetectorServer/RegisterDefs.h @@ -103,7 +103,12 @@ /* Look at me register, read only */ #define LOOK_AT_ME_REG (0x05 * REG_OFFSET + BASE_CONTROL) // Not used in firmware or software, good to play with -#define SYSTEM_STATUS_REG (0x06 * REG_OFFSET + BASE_CONTROL) // Not used in software +#define SYSTEM_STATUS_REG (0x06 * REG_OFFSET + BASE_CONTROL) + +#define SYSTEM_STATUS_R_PLL_LCKD_OFST (1) +#define SYSTEM_STATUS_R_PLL_LCKD_MSK (0x00000001 << SYSTEM_STATUS_R_PLL_LCKD_OFST) +#define SYSTEM_STATUS_RDO_PLL_LCKD_OFST (2) +#define SYSTEM_STATUS_RDO_PLL_LCKD_MSK (0x00000001 << SYSTEM_STATUS_RDO_PLL_LCKD_OFST) /* Config RW regiseter */ #define CONFIG_REG (0x20 * REG_OFFSET + BASE_CONTROL) @@ -483,6 +488,14 @@ /* ASIC Readout Control registers * --------------------------------------------------*/ +/** ASIC Readout Status register */ +#define ASIC_RDO_STATUS_REG (0x00 * REG_OFFSET + BASE_ASIC_RDO) + +#define ASIC_RDO_STATUS_BUSY_OFST (1) +#define ASIC_RDO_STATUS_BUSY_MSK (0x00000001 << ASIC_RDO_STATUS_BUSY_OFST) + + +/** ASIC Readout Res Storage Counter register */ #define ASIC_RDO_CONFIG_REG (0x01 * REG_OFFSET + BASE_ASIC_RDO) #define ASICRDO_CNFG_RESSTRG_LNGTH_OFST (0) diff --git a/slsDetectorServers/mythen3DetectorServer/bin/DefaultPattern_mythen3.txt b/slsDetectorServers/mythen3DetectorServer/bin/DefaultPattern_mythen3.txt new file mode 100755 index 0000000000..511d693b9b --- /dev/null +++ b/slsDetectorServers/mythen3DetectorServer/bin/DefaultPattern_mythen3.txt @@ -0,0 +1,256 @@ +patword 0x0000 0x0000000000000000 +patword 0x0001 0x0000000000000000 +patword 0x0002 0x0000000000000000 +patword 0x0003 0x0000000000000000 +patword 0x0004 0x0000000000000000 +patword 0x0005 0x0000000000000000 +patword 0x0006 0x0000000000c00000 +patword 0x0007 0x0000000000c00000 +patword 0x0008 0x0000000000c00000 +patword 0x0009 0x0000000000c00000 +patword 0x000a 0x0000000000c00000 +patword 0x000b 0x0000000000c00000 +patword 0x000c 0x0000000000000000 +patword 0x000d 0x0000000000000000 +patword 0x000e 0x0000000000000000 +patword 0x000f 0x0000000000000000 +patword 0x0010 0x0000000000000000 +patword 0x0011 0x0000000000000000 +patword 0x0012 0x0000000000200000 +patword 0x0013 0x0000000000200000 +patword 0x0014 0x0000000000e00000 +patword 0x0015 0x0000000000e00000 +patword 0x0016 0x0000000000e00000 +patword 0x0017 0x0000000000e00000 +patword 0x0018 0x0000000000e00000 +patword 0x0019 0x0000000000e00000 +patword 0x001a 0x0000000000e00000 +patword 0x001b 0x0000000000e00000 +patword 0x001c 0x0000000000200000 +patword 0x001d 0x0000000000200000 +patword 0x001e 0x0000000000200000 +patword 0x001f 0x0000000000200000 +patword 0x0020 0x0000000000200000 +patword 0x0021 0x0000000000200000 +patword 0x0022 0x0000000000200000 +patword 0x0023 0x0000000000200000 +patword 0x0024 0x0000000000200000 +patword 0x0025 0x0000000000200000 +patword 0x0026 0x0000000000200000 +patword 0x0027 0x0000000000200000 +patword 0x0028 0x0000000000200000 +patword 0x0029 0x0000000001200000 +patword 0x002a 0x0000000000200000 +patword 0x002b 0x0000000000200000 +patword 0x002c 0x0000000000200000 +patword 0x002d 0x0000000000200000 +patword 0x002e 0x0000000000200000 +patword 0x002f 0x0000000000200000 +patword 0x0030 0x0000000000200000 +patword 0x0031 0x0000000000200000 +patword 0x0032 0x0000000001200000 +patword 0x0033 0x0000000000200000 +patword 0x0034 0x0000000000200000 +patword 0x0035 0x0000000000200000 +patword 0x0036 0x0000000000200000 +patword 0x0037 0x0000000000200000 +patword 0x0038 0x0000000000200000 +patword 0x0039 0x0000000000200000 +patword 0x003a 0x0000000000200000 +patword 0x003b 0x0000000001200000 +patword 0x003c 0x0000000000200000 +patword 0x003d 0x0000000000200000 +patword 0x003e 0x0000000000200000 +patword 0x003f 0x0000000000200000 +patword 0x0040 0x0000000000200000 +patword 0x0041 0x0000000000200000 +patword 0x0042 0x0000000000200000 +patword 0x0043 0x0000000000200000 +patword 0x0044 0x0000000001200000 +patword 0x0045 0x0000000000200000 +patword 0x0046 0x0000000000200000 +patword 0x0047 0x0000000000200000 +patword 0x0048 0x0000000000200000 +patword 0x0049 0x0000000000200000 +patword 0x004a 0x0000000000200000 +patword 0x004b 0x0000000000200000 +patword 0x004c 0x0000000000200000 +patword 0x004d 0x0000000001200000 +patword 0x004e 0x0000000000200000 +patword 0x004f 0x0000000000200000 +patword 0x0050 0x0000000000200000 +patword 0x0051 0x0000000000200000 +patword 0x0052 0x0000000000200000 +patword 0x0053 0x0000000000200000 +patword 0x0054 0x0000000000200000 +patword 0x0055 0x0000000000200000 +patword 0x0056 0x0000000001200000 +patword 0x0057 0x0000000000200000 +patword 0x0058 0x0000000000200000 +patword 0x0059 0x0000000000200000 +patword 0x005a 0x0000000000280000 +patword 0x005b 0x0000000000280000 +patword 0x005c 0x0000000000280000 +patword 0x005d 0x0000000000280000 +patword 0x005e 0x0000000000280000 +patword 0x005f 0x0000000001280000 +patword 0x0060 0x0000000000280000 +patword 0x0061 0x0000000000200000 +patword 0x0062 0x0000000000200000 +patword 0x0063 0x0000000000200000 +patword 0x0064 0x0000000000200000 +patword 0x0065 0x0000000000200000 +patword 0x0066 0x0000000000200000 +patword 0x0067 0x0000000000200000 +patword 0x0068 0x0000000001200000 +patword 0x0069 0x0000000000200000 +patword 0x006a 0x0000000000200000 +patword 0x006b 0x0000000000200000 +patword 0x006c 0x0000000000200000 +patword 0x006d 0x0000000000200000 +patword 0x006e 0x0000000000200000 +patword 0x006f 0x0000000000200000 +patword 0x0070 0x0000000000200000 +patword 0x0071 0x0000000001200000 +patword 0x0072 0x0000000000200000 +patword 0x0073 0x0000000000200000 +patword 0x0074 0x0000000000200000 +patword 0x0075 0x0000000000200000 +patword 0x0076 0x0000000000200000 +patword 0x0077 0x0000000000200000 +patword 0x0078 0x0000000000200000 +patword 0x0079 0x0000000000200000 +patword 0x007a 0x0000000001200000 +patword 0x007b 0x0000000000200000 +patword 0x007c 0x0000000000200000 +patword 0x007d 0x0000000000200000 +patword 0x007e 0x0000000000280000 +patword 0x007f 0x0000000000280000 +patword 0x0080 0x0000000000280000 +patword 0x0081 0x0000000000280000 +patword 0x0082 0x0000000000280000 +patword 0x0083 0x0000000001280000 +patword 0x0084 0x0000000000280000 +patword 0x0085 0x0000000000200000 +patword 0x0086 0x0000000000200000 +patword 0x0087 0x0000000000200000 +patword 0x0088 0x0000000000200000 +patword 0x0089 0x0000000000200000 +patword 0x008a 0x0000000000200000 +patword 0x008b 0x0000000000200000 +patword 0x008c 0x0000000001200000 +patword 0x008d 0x0000000000200000 +patword 0x008e 0x0000000000200000 +patword 0x008f 0x0000000000200000 +patword 0x0090 0x0000000000200000 +patword 0x0091 0x0000000000200000 +patword 0x0092 0x0000000000200000 +patword 0x0093 0x0000000000200000 +patword 0x0094 0x0000000000200000 +patword 0x0095 0x0000000001200000 +patword 0x0096 0x0000000000200000 +patword 0x0097 0x0000000000200000 +patword 0x0098 0x0000000000200000 +patword 0x0099 0x0000000000200000 +patword 0x009a 0x0000000000200000 +patword 0x009b 0x0000000000200000 +patword 0x009c 0x0000000000200000 +patword 0x009d 0x0000000000200000 +patword 0x009e 0x0000000001200000 +patword 0x009f 0x0000000000200000 +patword 0x00a0 0x0000000000200000 +patword 0x00a1 0x0000000000200000 +patword 0x00a2 0x0000000000200000 +patword 0x00a3 0x0000000000200000 +patword 0x00a4 0x0000000000200000 +patword 0x00a5 0x0000000000200000 +patword 0x00a6 0x0000000000200000 +patword 0x00a7 0x0000000001200000 +patword 0x00a8 0x0000000000200000 +patword 0x00a9 0x0000000000200000 +patword 0x00aa 0x0000000000200000 +patword 0x00ab 0x0000000000200000 +patword 0x00ac 0x0000000000200000 +patword 0x00ad 0x0000000000200000 +patword 0x00ae 0x0000000000200000 +patword 0x00af 0x0000000000200000 +patword 0x00b0 0x0000000001200000 +patword 0x00b1 0x0000000000200000 +patword 0x00b2 0x0000000000200000 +patword 0x00b3 0x0000000000200000 +patword 0x00b4 0x0000000000200000 +patword 0x00b5 0x0000000000200000 +patword 0x00b6 0x0000000000200000 +patword 0x00b7 0x0000000000200000 +patword 0x00b8 0x0000000000200000 +patword 0x00b9 0x0000000001200000 +patword 0x00ba 0x0000000000200000 +patword 0x00bb 0x0000000000200000 +patword 0x00bc 0x0000000000200000 +patword 0x00bd 0x0000000000200000 +patword 0x00be 0x0000000000200000 +patword 0x00bf 0x0000000000200000 +patword 0x00c0 0x0000000000200000 +patword 0x00c1 0x0000000000200000 +patword 0x00c2 0x0000000001200000 +patword 0x00c3 0x0000000000200000 +patword 0x00c4 0x0000000000200000 +patword 0x00c5 0x0000000000200000 +patword 0x00c6 0x0000000000300000 +patword 0x00c7 0x0000000000300000 +patword 0x00c8 0x0000000000300000 +patword 0x00c9 0x0000000000300000 +patword 0x00ca 0x0000000000300000 +patword 0x00cb 0x0000000000200000 +patword 0x00cc 0x0000000000200000 +patword 0x00cd 0x0000000000200000 +patword 0x00ce 0x0000000000200000 +patword 0x00cf 0x0000000000200000 +patword 0x00d0 0x0000000000200000 +patword 0x00d1 0x0000000000200000 +patword 0x00d2 0x0000000000000000 +patword 0x00d3 0x0000000000000000 +patword 0x00d4 0x0000000000000000 +patword 0x00d5 0x0000000000000000 +patword 0x00d6 0x0000000000000000 +patword 0x00d7 0x0000000000000000 +patword 0x00d8 0x0000000000000000 +patword 0x00d9 0x0000000000000000 +patword 0x00da 0x0000000000c00000 +patword 0x00db 0x0000000000c00000 +patword 0x00dc 0x0000000000c00000 +patword 0x00dd 0x0000000000c00000 +patword 0x00de 0x0000000000c00000 +patword 0x00df 0x0000000000c00000 +patword 0x00e0 0x0000000000c00000 +patword 0x00e1 0x0000000000c00000 +patword 0x00e2 0x0000000000c00000 +patword 0x00e3 0x0000000000c00000 +patword 0x00e4 0x0000000000000000 +patword 0x00e5 0x0000000000000000 +patword 0x00e6 0x0000000000000000 +patword 0x00e7 0x0000000000000000 +patword 0x00e8 0x0000000000000000 +patword 0x00e9 0x0000000000000000 +patword 0x00ea 0x0000000000000000 +patword 0x00eb 0x0000000000000000 +patword 0x00ec 0x0000000000000000 +patword 0x00ed 0x0000000000000000 +patword 0x00ee 0x0000000000000000 +patword 0x00ef 0x0000000000000000 +patword 0x00f0 0x0000000000000000 +patword 0x00f1 0x0000000000000000 +patword 0x00f2 0x0000000000000000 +patlimits 0x0000 0x00f2 +patloop0 0x0400 0x0400 +patnloop0 0 +patloop1 0x0400 0x0400 +patnloop1 0 +patloop2 0x0400 0x0400 +patnloop2 0 +patwait0 0x0400 +patwaittime0 0 +patwait1 0x0400 +patwaittime1 0 +patwait2 0x0400 +patwaittime2 0 diff --git a/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_5.1.0 b/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_5.1.0 new file mode 100755 index 0000000000..347bb9f7c4 Binary files /dev/null and b/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_5.1.0 differ diff --git a/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServerv5.0.0 b/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServerv5.0.0 deleted file mode 100755 index 496fea42de..0000000000 Binary files a/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServerv5.0.0 and /dev/null differ diff --git a/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c index 44ac9ffbb1..43580109f8 100644 --- a/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c @@ -19,6 +19,9 @@ #include #endif +/// NOT the right place to put it! +int setChipStatusRegister(int csr); + // Global variable from slsDetectorServer_funcs extern int debugflag; extern int updateFlag; @@ -40,6 +43,7 @@ pthread_t pthread_virtual_tid; int64_t virtual_currentFrameNumber = 2; #endif +enum detectorSettings thisSettings; sls_detector_module *detectorModules = NULL; int *detectorChans = NULL; int *detectorDacs = NULL; @@ -50,8 +54,10 @@ uint32_t clkDivider[NUM_CLOCKS] = {}; int highvoltage = 0; int detPos[2] = {}; -int64_t exptimeReg[3] = {0, 0, 0}; -int64_t gateDelayReg[3] = {0, 0, 0}; +int64_t exptimeReg[NCOUNTERS] = {0, 0, 0}; +int64_t gateDelayReg[NCOUNTERS] = {0, 0, 0}; +int vthEnabledVals[NCOUNTERS] = {0, 0, 0}; +int detID = 0; int isInitCheckDone() { return initCheckDone; } @@ -264,13 +270,29 @@ u_int16_t getHardwareVersionNumber() { MCB_SERIAL_NO_VRSN_OFST); } -u_int32_t getDetectorNumber() { -#ifdef VIRTUAL - return 0; +void readDetectorNumber() { +#ifndef VIRTUAL + if (initError == FAIL) { + return; + } + FILE *fd = fopen(ID_FILE, "r"); + if (fd == NULL) { + sprintf(initErrorMessage, "No %s file found.\n", ID_FILE); + LOG(logERROR, ("%s\n\n", initErrorMessage)); + initError = FAIL; + return; + } + char output[255]; + fgets(output, sizeof(output), fd); + sscanf(output, "%u", &detID); + if (isControlServer) { + LOG(logINFOBLUE, ("Detector ID: %u\n", detID)); + } #endif - return bus_r(MCB_SERIAL_NO_REG); } +u_int32_t getDetectorNumber() { return detID; } + u_int64_t getDetectorMAC() { #ifdef VIRTUAL return 0; @@ -365,17 +387,19 @@ void allocateDetectorStructureMemory() { (detectorModules)->reg = UNINITIALIZED; (detectorModules)->iodelay = 0; (detectorModules)->tau = 0; - (detectorModules)->eV = 0; - // thisSettings = UNINITIALIZED; + (detectorModules)->eV[0] = 0; + (detectorModules)->eV[1] = 0; + (detectorModules)->eV[2] = 0; + thisSettings = UNINITIALIZED; // initialize dacs for (int idac = 0; idac < (detectorModules)->ndac; ++idac) { detectorDacs[idac] = 0; } - // if trimval requested, should return -1 to acknowledge unknown + // trimbits start at 0 //TODO: restart server will not have 0 always for (int ichan = 0; ichan < (detectorModules->nchan); ichan++) { - *((detectorModules->chanregs) + ichan) = -1; + *((detectorModules->chanregs) + ichan) = 0; } } @@ -401,10 +425,11 @@ void setupDetector() { #endif // pll defines - ALTERA_PLL_C10_SetDefines(REG_OFFSET, BASE_READOUT_PLL, BASE_SYSTEM_PLL, - PLL_RESET_REG, PLL_RESET_REG, - PLL_RESET_READOUT_MSK, PLL_RESET_SYSTEM_MSK, - READOUT_PLL_VCO_FREQ_HZ, SYSTEM_PLL_VCO_FREQ_HZ); + ALTERA_PLL_C10_SetDefines( + REG_OFFSET, BASE_READOUT_PLL, BASE_SYSTEM_PLL, PLL_RESET_REG, + PLL_RESET_READOUT_MSK, PLL_RESET_SYSTEM_MSK, SYSTEM_STATUS_REG, + SYSTEM_STATUS_RDO_PLL_LCKD_MSK, SYSTEM_STATUS_R_PLL_LCKD_MSK, + READOUT_PLL_VCO_FREQ_HZ, SYSTEM_PLL_VCO_FREQ_HZ); ALTERA_PLL_C10_ResetPLL(READOUT_PLL); ALTERA_PLL_C10_ResetPLL(SYSTEM_PLL); // hv @@ -438,7 +463,7 @@ void setupDetector() { setTiming(DEFAULT_TIMING_MODE); setNumIntGates(DEFAULT_INTERNAL_GATES); setNumGates(DEFAULT_EXTERNAL_GATES); - for (int i = 0; i != 3; ++i) { + for (int i = 0; i != NCOUNTERS; ++i) { setExpTime(i, DEFAULT_GATE_WIDTH); setGateDelay(i, DEFAULT_GATE_DELAY); } @@ -448,6 +473,11 @@ void setupDetector() { #ifdef VIRTUAL enableTenGigabitEthernet(0); #endif + readDetectorNumber(); + if (initError == FAIL) { + return; + } + setSettings(DEFAULT_SETTINGS); // check module type attached if not in debug mode { @@ -482,7 +512,12 @@ void setupDetector() { } powerChip(1); - loadDefaultPattern(DEFAULT_PATTERN_FILE); + if (initError != FAIL) { + initError = setChipStatusRegister(CSR_default); + //loadDefaultPattern(DEFAULT_PATTERN_FILE, initErrorMessage); + //startStateMachine(); //this was missing in previous code! runs the default pattern + } + setAllTrimbits(DEFAULT_TRIMBIT_VALUE); } int setDefaultDacs() { @@ -690,7 +725,7 @@ int getNumGates() { return bus_r(ASIC_EXP_EXT_GATE_NUMBER_REG); } void updateGatePeriod() { uint64_t max = 0; uint32_t countermask = getCounterMask(); - for (int i = 0; i != 3; ++i) { + for (int i = 0; i != NCOUNTERS; ++i) { // only if counter enabled if (countermask & (1 << i)) { uint64_t sum = getExpTime(i) + getGateDelay(i); @@ -877,6 +912,7 @@ void setCounterMask(uint32_t arg) { if (arg == 0 || arg > MAX_COUNTER_MSK) { return; } + uint32_t oldmask = getCounterMask(); LOG(logINFO, ("Setting counter mask to 0x%x\n", arg)); uint32_t addr = CONFIG_REG; bus_w(addr, bus_r(addr) & ~CONFIG_COUNTERS_ENA_MSK); @@ -886,12 +922,21 @@ void setCounterMask(uint32_t arg) { updatePacketizing(); LOG(logINFO, ("\tUpdating Exptime and Gate Delay\n")); - for (int i = 0; i < 3; ++i) { + for (int i = 0; i < NCOUNTERS; ++i) { uint64_t ns = exptimeReg[i] / (1E-9 * getFrequency(SYSTEM_C0)); setExpTime(i, ns); ns = gateDelayReg[i] / (1E-9 * getFrequency(SYSTEM_C0)); setGateDelay(i, ns); } + + LOG(logINFO, ("\tUpdating Vth dacs\n")); + for (int i = 0; i < NCOUNTERS; ++i) { + // if change in enable + if ((arg & (1 << i)) ^ (oldmask & (1 << i))) { + // will disable if counter disabled + setDAC(VTH1, vthEnabledVals[i], 0); + } + } } uint32_t getCounterMask() { @@ -1011,24 +1056,28 @@ int setModule(sls_detector_module myMod, char *mess) { LOG(logINFO, ("Setting module\n")); - /* future implementation - // settings (not yet implemented) - setSettings((enum detectorSettings)myMod.reg); + // settings if (myMod.reg >= 0) { + setSettings((enum detectorSettings)myMod.reg); + if (getSettings() != (enum detectorSettings)myMod.reg) { + sprintf( + mess, + "Could not set module. Could not set settings to %d, read %d\n", + myMod.reg, (int)getSettings()); + LOG(logERROR, (mess)); + return FAIL; + } detectorModules->reg = myMod.reg; } - - // threshold - if (myMod.eV >= 0) - setThresholdEnergy(myMod.eV); + // custom trimbit file else { - // (loading a random trim file) (dont return fail) - setSettings(UNDEFINED); - LOG(logERROR, - ("Settings has been changed to undefined (random trim - file)\n")); + // changed for setsettings (direct), + // custom trimbit file (setmodule with myMod.reg as -1), + // change of dac (direct) + for (int i = 0; i < NCOUNTERS; ++i) { + setThresholdEnergy(i, -1); + } } - */ // dacs for (int i = 0; i < NDAC; ++i) { @@ -1036,16 +1085,42 @@ int setModule(sls_detector_module myMod, char *mess) { 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); + // dont complain if that counter was disabled + if ((i == M_VTH1 || i == M_VTH2 || i == M_VTH3) && + (detectorDacs[i] == DEFAULT_COUNTER_DISABLED_VTH_VAL)) { + continue; + } + sprintf(mess, + "Could not set module. Could not set dac %d, wrote %d, " + "read %d\n", + i, myMod.dacs[i], detectorDacs[i]); LOG(logERROR, (mess)); - // setSettings(UNDEFINED); - // LOG(logERROR, ("Settings has been changed to undefined\n")); return FAIL; } } } + // if settings given and cannot be validated (after setting dacs), return + // error + if (myMod.reg >= 0) { + if (getSettings() != (enum detectorSettings)myMod.reg) { + sprintf( + mess, + "Could not set module. The dacs in file do not correspond to " + "settings %d\n", + myMod.reg); + LOG(logERROR, (mess)); + return FAIL; + } + } + + // threshold + for (int i = 0; i < NCOUNTERS; ++i) { + if (myMod.eV[i] >= 0) { + setThresholdEnergy(i, myMod.eV[i]); + } + } + // trimbits if (myMod.nchan == 0) { LOG(logINFO, ("Setting module without trimbits\n")); @@ -1054,9 +1129,6 @@ int setModule(sls_detector_module myMod, char *mess) { 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; } } @@ -1236,6 +1308,7 @@ int setTrimbits(int *trimbits) { } int setAllTrimbits(int val) { + LOG(logINFO, ("Setting all trimbits to %d\n", val)); int *trimbits = malloc(sizeof(int) * ((detectorModules)->nchan)); for (int ichan = 0; ichan < ((detectorModules)->nchan); ++ichan) { trimbits[ichan] = val; @@ -1245,11 +1318,14 @@ int setAllTrimbits(int 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); + // changed for setsettings (direct), + // custom trimbit file (setmodule with myMod.reg as -1), + // change of dac (direct) + for (int i = 0; i < NCOUNTERS; ++i) { + setThresholdEnergy(i, -1); + } return OK; } @@ -1267,6 +1343,73 @@ int getAllTrimbits() { return value; } +enum detectorSettings setSettings(enum detectorSettings sett) { + switch (sett) { + case STANDARD: + LOG(logINFOBLUE, ("Setting to standard settings\n")); + thisSettings = sett; + setDAC(M_VRPREAMP, DEFAULT_STANDARD_VRPREAMP, 0); + setDAC(M_VRSHAPER, DEFAULT_STANDARD_VRSHAPER, 0); + break; + case FAST: + LOG(logINFOBLUE, ("Setting to fast settings\n")); + thisSettings = sett; + setDAC(M_VRPREAMP, DEFAULT_FAST_VRPREAMP, 0); + setDAC(M_VRSHAPER, DEFAULT_FAST_VRSHAPER, 0); + break; + case HIGHGAIN: + LOG(logINFOBLUE, ("Setting to high gain settings\n")); + thisSettings = sett; + setDAC(M_VRPREAMP, DEFAULT_HIGHGAIN_VRPREAMP, 0); + setDAC(M_VRSHAPER, DEFAULT_HIGHGAIN_VRSHAPER, 0); + break; + default: + LOG(logERROR, + ("Settings %d not defined for this detector\n", (int)sett)); + return thisSettings; + } + + LOG(logINFO, ("Settings: %d\n", thisSettings)); + return thisSettings; +} + +void validateSettings() { + if (detectorDacs[M_VRPREAMP] == DEFAULT_STANDARD_VRPREAMP && + detectorDacs[M_VRSHAPER] == DEFAULT_STANDARD_VRSHAPER) { + if (thisSettings != STANDARD) { + thisSettings = STANDARD; + LOG(logINFOBLUE, ("Validated Settings changed to standard!\n")); + } + } else if (detectorDacs[M_VRPREAMP] == DEFAULT_FAST_VRPREAMP && + detectorDacs[M_VRSHAPER] == DEFAULT_FAST_VRSHAPER) { + if (thisSettings != FAST) { + thisSettings = FAST; + LOG(logINFOBLUE, ("Validated Settings changed to fast!\n")); + } + } else if (detectorDacs[M_VRPREAMP] == DEFAULT_HIGHGAIN_VRPREAMP && + detectorDacs[M_VRSHAPER] == DEFAULT_HIGHGAIN_VRSHAPER) { + if (thisSettings != HIGHGAIN) { + thisSettings = HIGHGAIN; + LOG(logINFOBLUE, ("Validated Settings changed to highgain!\n")); + } + } else { + thisSettings = UNDEFINED; + LOG(logWARNING, + ("Settings set to undefined [vrpreamp: %d, vrshaper: %d]\n", + detectorDacs[M_VRPREAMP], detectorDacs[M_VRSHAPER])); + } +} + +enum detectorSettings getSettings() { return thisSettings; } + +int getThresholdEnergy(int counterIndex) { + return (detectorModules)->eV[counterIndex]; +} + +void setThresholdEnergy(int counterIndex, int eV) { + (detectorModules)->eV[counterIndex] = eV; +} + /* parameters - dac, hv */ void setDAC(enum DACINDEX ind, int val, int mV) { if (val < 0) { @@ -1281,12 +1424,37 @@ void setDAC(enum DACINDEX ind, int val, int mV) { setDAC(M_VTH3, val, mV); return; } - char *dac_names[] = {DAC_NAMES}; + + // remember vthx values and set 2800 if counter disabled + uint32_t counters = getCounterMask(); + int vthdacs[] = {M_VTH1, M_VTH2, M_VTH3}; + for (int i = 0; i < NCOUNTERS; ++i) { + if (vthdacs[i] == (int)ind) { + // remember enabled values for vthx + if (val != DEFAULT_COUNTER_DISABLED_VTH_VAL) { + int vthval = val; + if (mV) { + if (LTC2620_D_VoltageToDac(val, &vthval) == FAIL) { + return; + } + } + vthEnabledVals[i] = vthval; + LOG(logINFO, ("Remembering %s [%d]\n", dac_names[ind], vthval)); + } + // set vthx to disable val, if counter disabled + if (!(counters & (1 << i))) { + LOG(logINFO, ("Disabling %s\n", dac_names[ind])); + val = DEFAULT_COUNTER_DISABLED_VTH_VAL; + mV = 0; + } + } + } + LOG(logDEBUG1, ("Setting dac[%d - %s]: %d %s \n", (int)ind, dac_names[ind], val, (mV ? "mV" : "dac units"))); - int dacval = val; + #ifdef VIRTUAL LOG(logINFO, ("Setting dac[%d - %s]: %d %s \n", (int)ind, dac_names[ind], val, (mV ? "mV" : "dac units"))); @@ -1303,11 +1471,14 @@ void setDAC(enum DACINDEX ind, int val, int mV) { detectorDacs[ind] = dacval; } #endif + if (ind == M_VRPREAMP || ind == M_VRSHAPER) { + validateSettings(); + } } int getDAC(enum DACINDEX ind, int mV) { if (ind == M_VTHRESHOLD) { - int ret[3] = {0}; + int ret[NCOUNTERS] = {0}; ret[0] = getDAC(M_VTH1, mV); ret[1] = getDAC(M_VTH2, mV); ret[2] = getDAC(M_VTH3, mV); @@ -1351,8 +1522,16 @@ int setHighVoltage(int val) { return highvoltage; } +int isMaster(){ + return !(bus_r(0x18) >> 31); +} + /* parameters - timing */ void setTiming(enum timingMode arg) { + + if (!isMaster() && arg == AUTO_TIMING) + arg = TRIGGER_EXPOSURE; + uint32_t addr = CONFIG_REG; switch (arg) { case AUTO_TIMING: @@ -1719,8 +1898,8 @@ uint64_t readPatternWord(int addr) { LOG(logDEBUG1, (" Reading Pattern Word (addr:0x%x)\n", addr)); uint32_t reg_lsb = PATTERN_STEP0_LSB_REG + - addr * REG_OFFSET * 2; // the first word in RAM as base plus the offset - // of the word to write (addr) + addr * REG_OFFSET * 2; // the first word in RAM as base plus the + // offset of the word to write (addr) uint32_t reg_msb = PATTERN_STEP0_MSB_REG + addr * REG_OFFSET * 2; // read value @@ -1750,8 +1929,8 @@ uint64_t writePatternWord(int addr, uint64_t word) { // write word uint32_t reg_lsb = PATTERN_STEP0_LSB_REG + - addr * REG_OFFSET * 2; // the first word in RAM as base plus the offset - // of the word to write (addr) + addr * REG_OFFSET * 2; // the first word in RAM as base plus the + // offset of the word to write (addr) uint32_t reg_msb = PATTERN_STEP0_MSB_REG + addr * REG_OFFSET * 2; set64BitReg(word, reg_lsb, reg_msb); @@ -2420,8 +2599,12 @@ int startReadOut() { // start readout bus_w(CONTROL_REG, bus_r(CONTROL_REG) | CONTROL_STRT_READOUT_MSK); - LOG(logINFO, ("Status Register: %08x\n", bus_r(STATUS_REG))); + usleep(1); + while (bus_r(ASIC_RDO_STATUS_REG) & ASIC_RDO_STATUS_BUSY_MSK) { + usleep(1); + } + LOG(logINFOBLUE, ("Readout done\n")); return OK; } @@ -2472,9 +2655,9 @@ enum runStatus getRunStatus() { 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)); + LOG(logERROR, ("Status: ERROR in Dead Time Reg (too short " + "exptime) %08x\n", + deadtimeReg)); s = ERROR; } // stopped or error @@ -2560,9 +2743,12 @@ int copyModule(sls_detector_module *destMod, sls_detector_module *srcMod) { destMod->iodelay = srcMod->iodelay; if (srcMod->tau >= 0) destMod->tau = srcMod->tau; - if (srcMod->eV >= 0) - destMod->eV = srcMod->eV; */ + for (int i = 0; i < NCOUNTERS; ++i) { + if (srcMod->eV[i] >= 0) + destMod->eV[i] = srcMod->eV[i]; + } + LOG(logDEBUG1, ("Copying register %x (%x)\n", destMod->reg, srcMod->reg)); if (destMod->nchan != 0) { @@ -2592,3 +2778,78 @@ int getTotalNumberOfChannels() { int getNumberOfChips() { return NCHIP; } int getNumberOfDACs() { return NDAC; } int getNumberOfChannelsPerChip() { return NCHAN; } + +int setChipStatusRegister(int csr) { + int iaddr=0; + int nbits=18; + int error=0; + //int start=0, stop=MAX_PATTERN_LENGTH, loop=0; + int patword=0; + patword=setBit(SIGNAL_STATLOAD,patword); + for (int i=0; i<2; i++) + writePatternWord(iaddr++, patword); + patword=setBit(SIGNAL_resStorage,patword); + patword=setBit(SIGNAL_resCounter,patword); + for (int i=0; i<8; i++) + writePatternWord(iaddr++, patword); + patword=clearBit(SIGNAL_resStorage,patword); + patword=clearBit(SIGNAL_resCounter,patword); + for (int i=0; i<8; i++) + writePatternWord(iaddr++, patword); + //#This version of the serializer pushes in the MSB first (compatible with the CSR bit numbering) + for (int ib=nbits-1; ib>=0; ib--) { + if (csr&(1<= MAX_PATTERN_LENGTH) { + LOG(logERROR, ("Addr 0x%x is past max_address_length 0x%x!\n", + iaddr, MAX_PATTERN_LENGTH)); + error = 1; + } + // 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(); + + if (error != 0) { + return FAIL; + } + + return OK; + +} diff --git a/slsDetectorServers/mythen3DetectorServer/slsDetectorServer_defs.h b/slsDetectorServers/mythen3DetectorServer/slsDetectorServer_defs.h index 1b8c63b9ea..bac68d9252 100644 --- a/slsDetectorServers/mythen3DetectorServer/slsDetectorServer_defs.h +++ b/slsDetectorServers/mythen3DetectorServer/slsDetectorServer_defs.h @@ -1,8 +1,9 @@ #pragma once #include "sls/sls_detector_defs.h" -#define REQRD_FRMWRE_VRSN (0x200925) +#define REQRD_FRMWRE_VRSN (0x210201) #define KERNEL_DATE_VRSN "Wed May 20 13:58:38 CEST 2020" +#define ID_FILE "detid_mythen3.txt" #define CTRL_SRVR_INIT_TIME_US (300 * 1000) @@ -25,24 +26,35 @@ #define MAX_EXT_SIGNALS (8) /** Default Parameters */ -#define DEFAULT_PATTERN_FILE ("DefaultPattern_mythen3.txt") -#define DEFAULT_INTERNAL_GATES (1) -#define DEFAULT_EXTERNAL_GATES (1) -#define DEFAULT_DYNAMIC_RANGE (32) -#define DEFAULT_NUM_FRAMES (1) -#define DEFAULT_NUM_CYCLES (1) -#define DEFAULT_GATE_WIDTH (100 * 1000 * 1000) // ns -#define DEFAULT_GATE_DELAY (0) -#define DEFAULT_PERIOD (2 * 1000 * 1000) // ns -#define DEFAULT_DELAY_AFTER_TRIGGER (0) -#define DEFAULT_HIGH_VOLTAGE (0) -#define DEFAULT_TIMING_MODE (AUTO_TIMING) -#define DEFAULT_READOUT_C0 (10) //(100000000) // rdo_clk, 100 MHz -#define DEFAULT_READOUT_C1 (10) //(100000000) // smp sample clk (x2), 100 MHz -#define DEFAULT_SYSTEM_C0 (10) //(100000000) // run_clk, 100 MHz -#define DEFAULT_SYSTEM_C1 (10) //(100000000) // sync_clk, 100 MHz -#define DEFAULT_SYSTEM_C2 (10) //(100000000) // str_clk, 100 MHz -#define DEFAULT_SYSTEM_C3 (5) //(200000000) // smp_clk, 200 MHz +#define DEFAULT_PATTERN_FILE ("DefaultPattern_mythen3.txt") +#define DEFAULT_INTERNAL_GATES (1) +#define DEFAULT_EXTERNAL_GATES (1) +#define DEFAULT_DYNAMIC_RANGE (32) +#define DEFAULT_NUM_FRAMES (1) +#define DEFAULT_NUM_CYCLES (1) +#define DEFAULT_GATE_WIDTH (100 * 1000 * 1000) // ns +#define DEFAULT_GATE_DELAY (0) +#define DEFAULT_PERIOD (2 * 1000 * 1000) // ns +#define DEFAULT_DELAY_AFTER_TRIGGER (0) +#define DEFAULT_HIGH_VOLTAGE (0) +#define DEFAULT_TIMING_MODE (AUTO_TIMING) +#define DEFAULT_SETTINGS (STANDARD) +#define DEFAULT_TRIMBIT_VALUE (0) +#define DEFAULT_COUNTER_DISABLED_VTH_VAL (2800) + +#define DEFAULT_STANDARD_VRPREAMP (1100) +#define DEFAULT_FAST_VRPREAMP (300) +#define DEFAULT_HIGHGAIN_VRPREAMP (1300) +#define DEFAULT_STANDARD_VRSHAPER (1280) +#define DEFAULT_FAST_VRSHAPER (1500) +#define DEFAULT_HIGHGAIN_VRSHAPER (1100) + +#define DEFAULT_READOUT_C0 (10) //(100000000) // rdo_clk, 100 MHz +#define DEFAULT_READOUT_C1 (10) //(100000000) // smp sample clk (x2), 100 MHz +#define DEFAULT_SYSTEM_C0 (10) //(100000000) // run_clk, 100 MHz +#define DEFAULT_SYSTEM_C1 (10) //(100000000) // sync_clk, 100 MHz +#define DEFAULT_SYSTEM_C2 (10) //(100000000) // str_clk, 100 MHz +#define DEFAULT_SYSTEM_C3 (5) //(200000000) // smp_clk, 200 MHz // (DEFAULT_SYSTEM_C3 only for timing receiver) should not be changed #define DEFAULT_TRIMMING_RUN_CLKDIV (40) // (25000000) // 25 MHz @@ -174,3 +186,19 @@ typedef struct udp_header_struct { #define SIGNAL_resCounter (23) #define SIGNAL_CHSclk (24) #define SIGNAL_exposing (25) + +//CHIP STARTUS REGISTER BITS +#define CSR_spypads 0 +#define CSR_invpol 4 +#define CSR_dpulse 5 +#define CSR_interp 6 +#define CSR_C10pre 7 //#default +#define CSR_pumprobe 8 +#define CSR_apulse 9 +#define CSR_C15sh 10 +#define CSR_C30sh 11 //#default +#define CSR_C50sh 12 +#define CSR_C225ACsh 13 // Connects 225fF SHAPER AC cap (1: 225 to shaper, 225 to GND. 0: 450 to shaper) +#define CSR_C15pre 14 + +#define CSR_default (1< #include -int loadDefaultPattern(char *patFname); +int loadDefaultPattern(char *patFname, char *errMessage); int default_writePatternWord(char *line, uint32_t addr, uint64_t word); diff --git a/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h b/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h index ae4e12a3bb..84103f61f4 100644 --- a/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h +++ b/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h @@ -87,7 +87,7 @@ u_int16_t getHardwareSerialNumber(); #ifdef JUNGFRAUD int isHardwareVersion2(); #endif -#ifdef EIGERD +#if defined(EIGERD) || defined(MYTHEN3D) void readDetectorNumber(); #endif u_int32_t getDetectorNumber(); @@ -291,19 +291,23 @@ int setTrimbits(int *trimbits); int setAllTrimbits(int val); int getAllTrimbits(); #endif -#if (!defined(CHIPTESTBOARDD)) && (!defined(MYTHEN3D)) +#ifndef CHIPTESTBOARDD enum detectorSettings setSettings(enum detectorSettings sett); #endif -#if !defined(MYTHEN3D) -enum detectorSettings getSettings(); +#ifdef MYTHEN3D +void validateSettings(); #endif +enum detectorSettings getSettings(); // parameters - threshold #ifdef EIGERD int getThresholdEnergy(); int setThresholdEnergy(int ev); #endif - +#ifdef MYTHEN3D +int getThresholdEnergy(int counterIndex); +void setThresholdEnergy(int counterIndex, int eV); +#endif // parameters - dac, adc, hv #ifdef GOTTHARD2D @@ -348,6 +352,7 @@ void setTiming(enum timingMode arg); enum timingMode getTiming(); #ifdef MYTHEN3D void setInitialExtSignals(); +int isMaster(); #endif #if defined(GOTTHARDD) || defined(MYTHEN3D) void setExtSignal(int signalIndex, enum externalSignalFlag mode); diff --git a/slsDetectorServers/slsDetectorServer/include/slsDetectorServer_funcs.h b/slsDetectorServers/slsDetectorServer/include/slsDetectorServer_funcs.h index 2373cd9012..62a947254e 100644 --- a/slsDetectorServers/slsDetectorServer/include/slsDetectorServer_funcs.h +++ b/slsDetectorServers/slsDetectorServer/include/slsDetectorServer_funcs.h @@ -242,4 +242,8 @@ int validate_udp_configuration(int); int get_bursts_left(int); int start_readout(int); int set_default_dacs(int); -int is_virtual(int); \ No newline at end of file +int is_virtual(int); +int get_pattern(int); +int load_default_pattern(int); +int get_all_threshold_energy(int); +int get_master(int); \ No newline at end of file diff --git a/slsDetectorServers/slsDetectorServer/src/ALTERA_PLL_CYCLONE10.c b/slsDetectorServers/slsDetectorServer/src/ALTERA_PLL_CYCLONE10.c index be52b46b8f..12849f1065 100644 --- a/slsDetectorServers/slsDetectorServer/src/ALTERA_PLL_CYCLONE10.c +++ b/slsDetectorServers/slsDetectorServer/src/ALTERA_PLL_CYCLONE10.c @@ -56,21 +56,35 @@ int ALTERA_PLL_C10_Reg_offset = 0x0; const int ALTERA_PLL_C10_NUM = 2; uint32_t ALTERA_PLL_C10_BaseAddress[2] = {0x0, 0x0}; -uint32_t ALTERA_PLL_C10_Reset_Reg[2] = {0x0, 0x0}; +uint32_t ALTERA_PLL_C10_Reset_Reg = 0x0; uint32_t ALTERA_PLL_C10_Reset_Msk[2] = {0x0, 0x0}; +#ifdef MYTHEN3D +uint32_t ALTERA_PLL_C10_Locked_Status_Reg = 0x0; +uint32_t ALTERA_PLL_C10_Locked_Status_Msk[2] = {0x0, 0x0}; +#endif int ALTERA_PLL_C10_VCO_FREQ[2] = {0, 0}; void ALTERA_PLL_C10_SetDefines(int regofst, uint32_t baseaddr0, - uint32_t baseaddr1, uint32_t resetreg0, - uint32_t resetreg1, uint32_t resetmsk0, - uint32_t resetmsk1, int vcofreq0, int vcofreq1) { + uint32_t baseaddr1, uint32_t resetreg, + uint32_t resetmsk0, uint32_t resetmsk1, +#ifdef MYTHEN3D + uint32_t statusreg, uint32_t statusmsk0, + uint32_t statusmsk1, +#endif + int vcofreq0, int vcofreq1) { ALTERA_PLL_C10_Reg_offset = regofst; ALTERA_PLL_C10_BaseAddress[0] = baseaddr0; ALTERA_PLL_C10_BaseAddress[1] = baseaddr1; - ALTERA_PLL_C10_Reset_Reg[0] = resetreg0; - ALTERA_PLL_C10_Reset_Reg[1] = resetreg1; + ALTERA_PLL_C10_Reset_Reg = resetreg; ALTERA_PLL_C10_Reset_Msk[0] = resetmsk0; ALTERA_PLL_C10_Reset_Msk[1] = resetmsk1; + + // pll locked status reg and msk only used for m3 now +#ifdef MYTHEN3D + ALTERA_PLL_C10_Locked_Status_Reg = statusreg; + ALTERA_PLL_C10_Locked_Status_Msk[0] = statusmsk0; + ALTERA_PLL_C10_Locked_Status_Msk[1] = statusmsk1; +#endif ALTERA_PLL_C10_VCO_FREQ[0] = vcofreq0; ALTERA_PLL_C10_VCO_FREQ[1] = vcofreq1; } @@ -98,12 +112,24 @@ void ALTERA_PLL_C10_Reconfigure(int pllIndex) { } void ALTERA_PLL_C10_ResetPLL(int pllIndex) { - uint32_t resetreg = ALTERA_PLL_C10_Reset_Reg[pllIndex]; + uint32_t resetreg = ALTERA_PLL_C10_Reset_Reg; uint32_t resetmsk = ALTERA_PLL_C10_Reset_Msk[pllIndex]; LOG(logINFO, ("Resetting PLL %d\n", pllIndex)); bus_w_csp1(resetreg, bus_r_csp1(resetreg) | resetmsk); - usleep(ALTERA_PLL_C10_WAIT_TIME_US); + +#ifndef VIRTUAL +#ifdef MYTHEN3D + uint32_t statusreg = ALTERA_PLL_C10_Locked_Status_Reg; + uint32_t statusmsk = ALTERA_PLL_C10_Locked_Status_Msk[pllIndex]; + // wait for pll locked bit to go high + while (!(bus_r(statusreg) & statusmsk)) { + usleep(ALTERA_PLL_C10_WAIT_TIME_US); + LOG(logWARNING, ("Still waiting for PLL %d recovery\n", pllIndex)); + } + LOG(logINFO, ("Reset success for PLL %d\n", pllIndex)); +#endif +#endif } void ALTERA_PLL_C10_SetPhaseShift(int pllIndex, int clkIndex, int phase, diff --git a/slsDetectorServers/slsDetectorServer/src/communication_funcs.c b/slsDetectorServers/slsDetectorServer/src/communication_funcs.c index 8a5c4d103a..29b7d29410 100644 --- a/slsDetectorServers/slsDetectorServer/src/communication_funcs.c +++ b/slsDetectorServers/slsDetectorServer/src/communication_funcs.c @@ -458,12 +458,12 @@ int receiveModule(int file_des, sls_detector_module *myMod) { } ts += n; LOG(level, ("tau received. %d bytes. tau: %d\n", n, myMod->tau)); - n = receiveData(file_des, &(myMod->eV), sizeof(myMod->eV), INT32); + n = receiveData(file_des, myMod->eV, sizeof(myMod->eV), INT32); if (!n) { return -1; } ts += n; - LOG(level, ("eV received. %d bytes. eV: %d\n", n, myMod->eV)); + LOG(level, ("eV received. %d bytes. eV: %d\n", n, myMod->eV[0])); // dacs if (nDacs != (myMod->ndac)) { LOG(logERROR, ("received wrong number of dacs. " diff --git a/slsDetectorServers/slsDetectorServer/src/readDefaultPattern.c b/slsDetectorServers/slsDetectorServer/src/readDefaultPattern.c index 63064fa7e2..ab731062a6 100644 --- a/slsDetectorServers/slsDetectorServer/src/readDefaultPattern.c +++ b/slsDetectorServers/slsDetectorServer/src/readDefaultPattern.c @@ -8,7 +8,6 @@ #include extern char initErrorMessage[MAX_STR_LENGTH]; -extern int initError; #ifndef MYTHEN3D extern uint64_t writePatternIOControl(uint64_t word); @@ -19,11 +18,7 @@ extern uint64_t setPatternWaitTime(int level, uint64_t t); extern void setPatternLoop(int level, int *startAddr, int *stopAddr, int *nLoop); -int loadDefaultPattern(char *patFname) { - if (initError == FAIL) { - return initError; - } - +int loadDefaultPattern(char *patFname, char *errMessage) { char fname[128]; if (getAbsPath(fname, 128, patFname) == FAIL) { return FAIL; @@ -32,10 +27,8 @@ int loadDefaultPattern(char *patFname) { // open config file FILE *fd = fopen(fname, "r"); if (fd == NULL) { - sprintf(initErrorMessage, "Could not open pattern file [%s].\n", - patFname); - initError = FAIL; - LOG(logERROR, ("%s\n\n", initErrorMessage)); + sprintf(errMessage, "Could not open pattern file [%s].\n", patFname); + LOG(logERROR, ("%s\n\n", errMessage)); return FAIL; } LOG(logINFOBLUE, ("Reading default pattern file %s\n", patFname)); @@ -100,7 +93,7 @@ int loadDefaultPattern(char *patFname) { #else if (sscanf(line, "%s 0x%x 0x%llx", command, &addr, &word) != 3) { #endif - sprintf(initErrorMessage, + sprintf(errMessage, "Could not scan patword arguments from default " "pattern file. Line:[%s].\n", line); @@ -123,7 +116,7 @@ int loadDefaultPattern(char *patFname) { #else if (sscanf(line, "%s 0x%llx", command, &arg) != 2) { #endif - sprintf(initErrorMessage, + sprintf(errMessage, "Could not scan patioctrl arguments from default " "pattern file. Line:[%s].\n", line); @@ -144,7 +137,7 @@ int loadDefaultPattern(char *patFname) { // cannot scan values if (sscanf(line, "%s 0x%x 0x%x", command, &startAddr, &stopAddr) != 3) { - sprintf(initErrorMessage, + sprintf(errMessage, "Could not scan patlimits arguments from default " "pattern file. Line:[%s].\n", line); @@ -177,7 +170,7 @@ int loadDefaultPattern(char *patFname) { // cannot scan values if (sscanf(line, "%s 0x%x 0x%x", command, &startAddr, &stopAddr) != 3) { - sprintf(initErrorMessage, + sprintf(errMessage, "Could not scan patloop%d arguments from default " "pattern file. Line:[%s].\n", level, line); @@ -208,7 +201,7 @@ int loadDefaultPattern(char *patFname) { int numLoops = -1; // cannot scan values if (sscanf(line, "%s %d", command, &numLoops) != 2) { - sprintf(initErrorMessage, + sprintf(errMessage, "Could not scan patnloop%d arguments from default " "pattern file. Line:[%s].\n", level, line); @@ -238,7 +231,7 @@ int loadDefaultPattern(char *patFname) { uint32_t addr = 0; // cannot scan values if (sscanf(line, "%s 0x%x", command, &addr) != 2) { - sprintf(initErrorMessage, + sprintf(errMessage, "Could not scan patwait%d arguments from default " "pattern file. Line:[%s].\n", level, line); @@ -273,7 +266,7 @@ int loadDefaultPattern(char *patFname) { #else if (sscanf(line, "%s %lld", command, &waittime) != 2) { #endif - sprintf(initErrorMessage, + sprintf(errMessage, "Could not scan patwaittime%d arguments from default " "pattern file. Line:[%s].\n", level, line); @@ -289,13 +282,12 @@ int loadDefaultPattern(char *patFname) { } fclose(fd); - if (strlen(initErrorMessage)) { - initError = FAIL; - LOG(logERROR, ("%s\n\n", initErrorMessage)); - } else { - LOG(logINFOBLUE, ("Successfully read default pattern file\n")); + if (strlen(errMessage)) { + LOG(logERROR, ("%s\n\n", errMessage)); + return FAIL; } - return initError; + LOG(logINFOBLUE, ("Successfully read default pattern file\n")); + return OK; } int default_writePatternWord(char *line, uint32_t addr, uint64_t word) { diff --git a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c index 2df69676c8..09da78b484 100644 --- a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c +++ b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c @@ -5,6 +5,10 @@ #include "sls/sls_detector_funcs.h" #include "slsDetectorFunctionList.h" +#if defined(CHIPTESTBOARDD) || defined(MOENCHD) || defined(MYTHEN3D) +#include "Pattern.h" +#endif + #include #include #include @@ -361,6 +365,10 @@ void function_table() { flist[F_START_READOUT] = &start_readout; flist[F_SET_DEFAULT_DACS] = &set_default_dacs; flist[F_IS_VIRTUAL] = &is_virtual; + flist[F_GET_PATTERN] = &get_pattern; + flist[F_LOAD_DEFAULT_PATTERN] = &load_default_pattern; + flist[F_GET_ALL_THRESHOLD_ENERGY] = &get_all_threshold_energy; + flist[F_GET_MASTER] = &get_master; // check if (NUM_DET_FUNCTIONS >= RECEIVER_ENUM_START) { @@ -631,7 +639,9 @@ int set_timing_mode(int file_des) { } // get retval = getTiming(); + #ifndef MYTHEN3D validate((int)arg, (int)retval, "set timing mode", DEC); + #endif LOG(logDEBUG1, ("Timing Mode: %d\n", retval)); return Server_SendResult(file_des, INT32, &retval, sizeof(retval)); @@ -1232,6 +1242,16 @@ int validateAndSetDac(enum dacIndex ind, int val, int mV) { } LOG(logDEBUG1, ("Dac (%d): %d %s\n\n", serverDacIndex, retval, (mV ? "mV" : "dac units"))); +#ifdef MYTHEN3D + // changed for setsettings (direct), + // custom trimbit file (setmodule with myMod.reg as -1), + // change of dac (direct) + if (val != GET_FLAG && ret == OK) { + for (int i = 0; i < NCOUNTERS; ++i) { + setThresholdEnergy(i, -1); + } + } +#endif break; } } @@ -1507,7 +1527,7 @@ int set_module(int file_des) { LOG(logDEBUG1, ("module register is %d, nchan %d, nchip %d, " "ndac %d, iodelay %d, tau %d, eV %d\n", module.reg, module.nchan, module.nchip, module.ndac, - module.iodelay, module.tau, module.eV)); + module.iodelay, module.tau, module.eV[0])); // should at least have a dac if (ts <= (int)sizeof(sls_detector_module)) { ret = FAIL; @@ -1534,6 +1554,10 @@ int set_module(int file_des) { case LOWGAIN: case VERYHIGHGAIN: case VERYLOWGAIN: +#elif MYTHEN3D + case STANDARD: + case FAST: + case HIGHGAIN: #elif JUNGFRAUD case DYNAMICGAIN: case DYNAMICHG0: @@ -1555,11 +1579,9 @@ int set_module(int file_des) { } ret = setModule(module, mess); -#ifndef MYTHEN3D enum detectorSettings retval = getSettings(); validate(module.reg, (int)retval, "set module (settings)", DEC); LOG(logDEBUG1, ("Settings: %d\n", retval)); -#endif } free(myChan); free(myDac); @@ -1577,7 +1599,7 @@ int set_settings(int file_des) { if (receiveData(file_des, &isett, sizeof(isett), INT32) < 0) return printSocketReadError(); -#if defined(CHIPTESTBOARDD) || defined(MYTHEN3D) +#ifdef CHIPTESTBOARDD functionNotImplemented(); #else LOG(logDEBUG1, ("Setting settings %d\n", isett)); @@ -1614,13 +1636,17 @@ int set_settings(int file_des) { case G2_LOWCAP_LOWGAIN: case G4_HIGHGAIN: case G4_LOWGAIN: +#elif MYTHEN3D + case STANDARD: + case FAST: + case HIGHGAIN: #endif break; default: if (myDetectorType == EIGER) { ret = FAIL; sprintf(mess, "Cannot set settings via SET_SETTINGS, use " - "SET_MODULE (set threshold)\n"); + "SET_MODULE\n"); LOG(logERROR, (mess)); } else modeNotImplemented("Settings Index", (int)isett); @@ -1645,6 +1671,16 @@ int set_settings(int file_des) { LOG(logERROR, (mess)); } } +#endif +#ifdef MYTHEN3D + // changed for setsettings (direct), + // custom trimbit file (setmodule with myMod.reg as -1), + // change of dac (direct) + if (ret == OK) { + for (int i = 0; i < NCOUNTERS; ++i) { + setThresholdEnergy(i, -1); + } + } #endif } } @@ -7094,15 +7130,20 @@ int get_receiver_parameters(int file_des) { if (n < 0) return printSocketReadError(); - // threshold ev + // threshold ev + { + int i32s[3] = {0, 0, 0}; #ifdef EIGERD - i32 = getThresholdEnergy(); -#else - i32 = 0; + i32s[0] = getThresholdEnergy(); +#elif MYTHEN3D + for (int i = 0; i < NCOUNTERS; ++i) { + i32s[i] = getThresholdEnergy(i); + } #endif - n += sendData(file_des, &i32, sizeof(i32), INT32); - if (n < 0) - return printSocketReadError(); + n += sendData(file_des, i32s, sizeof(i32s), INT32); + if (n < 0) + return printSocketReadError(); + } // dynamic range i32 = setDynamicRange(GET_FLAG); @@ -7530,131 +7571,218 @@ int set_veto(int file_des) { int set_pattern(int file_des) { ret = OK; memset(mess, 0, sizeof(mess)); - uint64_t *patwords = malloc(sizeof(uint64_t) * MAX_PATTERN_LENGTH); - memset(patwords, 0, sizeof(uint64_t) * MAX_PATTERN_LENGTH); - uint64_t patioctrl = 0; - int patlimits[2] = {0, 0}; - int patloop[6] = {0, 0, 0, 0, 0, 0}; - int patnloop[3] = {0, 0, 0}; - int patwait[3] = {0, 0, 0}; - uint64_t patwaittime[3] = {0, 0, 0}; - if (receiveData(file_des, patwords, sizeof(uint64_t) * MAX_PATTERN_LENGTH, - INT64) < 0) - return printSocketReadError(); - if (receiveData(file_des, &patioctrl, sizeof(patioctrl), INT64) < 0) - return printSocketReadError(); - if (receiveData(file_des, patlimits, sizeof(patlimits), INT32) < 0) - return printSocketReadError(); - if (receiveData(file_des, patloop, sizeof(patloop), INT32) < 0) - return printSocketReadError(); - if (receiveData(file_des, patnloop, sizeof(patnloop), INT32) < 0) - return printSocketReadError(); - if (receiveData(file_des, patwait, sizeof(patwait), INT32) < 0) - return printSocketReadError(); - if (receiveData(file_des, patwaittime, sizeof(patwaittime), INT64) < 0) - return printSocketReadError(); #if !defined(CHIPTESTBOARDD) && !defined(MOENCHD) && !defined(MYTHEN3D) functionNotImplemented(); #else + + patternParameters *pat = malloc(sizeof(patternParameters)); + memset(pat, 0, sizeof(patternParameters)); + + // ignoring endianness for eiger + if (receiveData(file_des, pat, sizeof(patternParameters), INT32) < 0) { + if (pat != NULL) + free(pat); + return printSocketReadError(); + } + if (Server_VerifyLock() == OK) { - LOG(logINFO, ("Setting Pattern from file\n")); + LOG(logINFO, ("Setting Pattern from structure\n")); LOG(logINFO, ("Setting Pattern Word (printing every 10 words that are not 0\n")); for (int i = 0; i < MAX_PATTERN_LENGTH; ++i) { - if ((i % 10 == 0) && patwords[i] != 0) { + if ((i % 10 == 0) && pat->word[i] != 0) { LOG(logINFO, ("Setting Pattern Word (addr:0x%x, word:0x%llx)\n", - i, (long long int)patwords[i])); + i, (long long int)pat->word[i])); } - writePatternWord(i, patwords[i]); + writePatternWord(i, pat->word[i]); } - int numLoops = -1, retval0 = -1, retval1 = -1; - uint64_t retval64 = -1; #ifndef MYTHEN3D if (ret == OK) { - retval64 = writePatternIOControl(patioctrl); - validate64(patioctrl, retval64, "set pattern IO Control", HEX); + uint64_t retval64 = writePatternIOControl(pat->ioctrl); + validate64(pat->ioctrl, retval64, "set pattern IO Control", HEX); } #endif if (ret == OK) { - numLoops = -1; - retval0 = patlimits[0]; - retval1 = patlimits[1]; + int numLoops = -1; + int retval0 = pat->limits[0]; + int retval1 = pat->limits[1]; setPatternLoop(-1, &retval0, &retval1, &numLoops); - validate(patlimits[0], retval0, "set pattern Limits start address", - HEX); - validate(patlimits[1], retval1, "set pattern Limits start address", - HEX); - } - if (ret == OK) { - retval0 = patloop[0]; - retval1 = patloop[1]; - numLoops = patnloop[0]; - setPatternLoop(0, &patloop[0], &patloop[1], &numLoops); - validate(patloop[0], retval0, "set pattern Loop 0 start address", - HEX); - validate(patloop[1], retval1, "set pattern Loop 0 stop address", - HEX); - validate(patnloop[0], numLoops, "set pattern Loop 0 num loops", - HEX); - } - if (ret == OK) { - retval0 = patloop[2]; - retval1 = patloop[3]; - numLoops = patnloop[1]; - setPatternLoop(1, &patloop[2], &patloop[3], &numLoops); - validate(patloop[2], retval0, "set pattern Loop 1 start address", - HEX); - validate(patloop[3], retval1, "set pattern Loop 1 stop address", - HEX); - validate(patnloop[1], numLoops, "set pattern Loop 1 num loops", - HEX); - } - if (ret == OK) { - retval0 = patloop[4]; - retval1 = patloop[5]; - numLoops = patnloop[2]; - setPatternLoop(2, &patloop[4], &patloop[5], &numLoops); - validate(patloop[4], retval0, "set pattern Loop 2 start address", - HEX); - validate(patloop[5], retval1, "set pattern Loop 2 stop address", - HEX); - validate(patnloop[2], numLoops, "set pattern Loop 2 num loops", - HEX); - } - if (ret == OK) { - retval0 = setPatternWaitAddress(0, patwait[0]); - validate(patwait[0], retval0, "set pattern Loop 0 wait address", - HEX); - } - if (ret == OK) { - retval0 = setPatternWaitAddress(1, patwait[1]); - validate(patwait[1], retval0, "set pattern Loop 1 wait address", - HEX); + validate(pat->limits[0], retval0, + "set pattern Limits start address", HEX); + validate(pat->limits[1], retval1, + "set pattern Limits start address", HEX); } if (ret == OK) { - retval0 = setPatternWaitAddress(2, patwait[2]); - validate(patwait[2], retval0, "set pattern Loop 2 wait address", - HEX); + for (int i = 0; i <= 2; ++i) { + char msg[128]; + int retval0 = -1, retval1 = -1, numLoops = -1; + uint64_t retval64 = -1; + + // patloop + retval0 = pat->loop[i * 2 + 0]; + retval1 = pat->loop[i * 2 + 1]; + numLoops = pat->nloop[i]; + setPatternLoop(i, &retval0, &retval1, &numLoops); + memset(msg, 0, sizeof(msg)); + sprintf(msg, "set pattern Loop %d start address", i); + validate(pat->loop[i * 2 + 0], retval0, msg, HEX); + if (ret == FAIL) { + break; + } + memset(msg, 0, sizeof(msg)); + sprintf(msg, "set pattern Loop %d stop address", i); + validate(pat->loop[i * 2 + 1], retval1, msg, HEX); + if (ret == FAIL) { + break; + } + memset(msg, 0, sizeof(msg)); + sprintf(msg, "set pattern Loop %d num loops", i); + validate(pat->nloop[i], numLoops, msg, HEX); + if (ret == FAIL) { + break; + } + + // patwait + memset(msg, 0, sizeof(msg)); + sprintf(msg, "set pattern Loop %d wait address", i); + retval0 = setPatternWaitAddress(i, pat->wait[i]); + validate(pat->wait[i], retval0, msg, HEX); + if (ret == FAIL) { + break; + } + + // patwaittime + memset(msg, 0, sizeof(msg)); + sprintf(msg, "set pattern Loop %d wait time", i); + retval64 = setPatternWaitTime(i, pat->waittime[i]); + validate64(pat->waittime[i], retval64, msg, HEX); + if (ret == FAIL) { + break; + } + } } - if (ret == OK) { - uint64_t retval64 = setPatternWaitTime(0, patwaittime[0]); - validate64(patwaittime[0], retval64, "set pattern Loop 0 wait time", - HEX); + } + if (pat != NULL) + free(pat); +#endif + + return Server_SendResult(file_des, INT32, NULL, 0); +} + +int get_pattern(int file_des) { + ret = OK; + memset(mess, 0, sizeof(mess)); + +#if !defined(CHIPTESTBOARDD) && !defined(MOENCHD) && !defined(MYTHEN3D) + functionNotImplemented(); + return Server_SendResult(file_des, INT32, NULL, 0); +#else + + patternParameters *pat = malloc(sizeof(patternParameters)); + memset(pat, 0, sizeof(patternParameters)); + + if (Server_VerifyLock() == OK) { + LOG(logINFO, ("Getting Pattern from structure\n")); + + // patword + LOG(logDEBUG, + ("retval pattern word (printing every 10 words that are not 0\n")); + for (int i = 0; i < MAX_PATTERN_LENGTH; ++i) { + pat->word[i] = readPatternWord(i); + if ((int64_t)pat->word[i] == -1) { + ret = FAIL; + sprintf(mess, "could not read pattern word for address 0x%x\n", + i); + LOG(logERROR, (mess)); + break; + } + // debug print + if ((i % 10 == 0) && pat->word[i] != 0) { + LOG(logDEBUG, + ("retval Patpattern word (addr:0x%x, word:0x%llx)\n", i, + (long long int)pat->word[i])); + } } + + // patioctrl +#ifndef MYTHEN3D if (ret == OK) { - retval64 = setPatternWaitTime(1, patwaittime[1]); - validate64(patwaittime[1], retval64, "set pattern Loop 1 wait time", - HEX); + pat->ioctrl = writePatternIOControl(-1); + LOG(logDEBUG, ("retval pattern io control:0x%llx\n", + (long long int)pat->ioctrl)); } +#endif if (ret == OK) { - retval64 = setPatternWaitTime(2, patwaittime[2]); - validate64(patwaittime[1], retval64, "set pattern Loop 2 wait time", - HEX); + // patlimits + int numLoops = -1; + int retval0 = -1; + int retval1 = -1; + setPatternLoop(-1, &retval0, &retval1, &numLoops); + pat->limits[0] = retval0; + pat->limits[1] = retval1; + LOG(logDEBUG, ("retval pattern limits start:0x%x stop:0x%x\n", + pat->limits[0], pat->limits[1])); + + for (int i = 0; i <= 2; ++i) { + // patloop + { + int numLoops = -1; + int retval0 = -1; + int retval1 = -1; + setPatternLoop(i, &retval0, &retval1, &numLoops); + pat->nloop[i] = numLoops; + pat->loop[i * 2 + 0] = retval0; + pat->loop[i * 2 + 1] = retval1; + LOG(logDEBUG, ("retval pattern loop level %d start:0x%x " + "stop:0x%x numLoops:%d\n", + i, pat->loop[i * 2 + 0], + pat->loop[i * 2 + 0], pat->nloop[i])); + } + // patwait + { + pat->wait[i] = setPatternWaitAddress(i, -1); + if ((int)pat->wait[i] == -1) { + ret = FAIL; + sprintf(mess, + "could not read pattern wait address for level " + "%d\n", + i); + LOG(logERROR, (mess)); + break; + } + LOG(logDEBUG, + ("retval pattern wait address for level %d: 0x%x\n", i, + pat->wait[i])); + } + + // patwaittime + { + pat->waittime[i] = setPatternWaitTime(i, -1); + if ((int64_t)pat->waittime[i] == -1) { + ret = FAIL; + sprintf( + mess, + "could not read pattern wait time for level %d\n", + i); + LOG(logERROR, (mess)); + break; + } + LOG(logDEBUG, + ("retval pattern wait time for level %d: %lld\n", i, + (long long int)pat->waittime[i])); + } + } } } + + // ignoring endianness for eiger + int ret = + Server_SendResult(file_des, INT32, pat, sizeof(patternParameters)); + if (pat != NULL) + free(pat); + return ret; #endif - return Server_SendResult(file_des, INT32, NULL, 0); } int get_scan(int file_des) { @@ -8205,3 +8333,53 @@ int is_virtual(int file_des) { LOG(logDEBUG1, ("is virtual retval: %d\n", retval)); return Server_SendResult(file_des, INT32, &retval, sizeof(retval)); } + +int load_default_pattern(int file_des) { + ret = OK; + memset(mess, 0, sizeof(mess)); + +#if !defined(MYTHEN3D) && !defined(MOENCHD) + functionNotImplemented(); +#else + if (Server_VerifyLock() == OK) { + ret = loadDefaultPattern(DEFAULT_PATTERN_FILE, mess); + if (ret == FAIL) { + LOG(logERROR, (mess)); + } + } +#endif + return Server_SendResult(file_des, INT32, NULL, 0); +} + +int get_all_threshold_energy(int file_des) { + ret = OK; + memset(mess, 0, sizeof(mess)); + int retvals[3] = {-1, -1, -1}; + + LOG(logDEBUG1, ("Getting all threshold energy\n")); + +#ifndef MYTHEN3D + functionNotImplemented(); +#else + for (int i = 0; i < NCOUNTERS; ++i) { + retvals[i] = getThresholdEnergy(i); + LOG(logDEBUG, ("eV[%d]: %deV\n", i, retvals[i])); + } +#endif + return Server_SendResult(file_des, INT32, retvals, sizeof(retvals)); +} + +int get_master(int file_des){ + ret = OK; + memset(mess, 0, sizeof(mess)); + int retval = -1; + + LOG(logDEBUG1, ("Getting master\n")); + +#ifndef MYTHEN3D + functionNotImplemented(); +#else + retval = isMaster(); +#endif + return Server_SendResult(file_des, INT32, &retval, sizeof(retval)); +} diff --git a/slsDetectorSoftware/CMakeLists.txt b/slsDetectorSoftware/CMakeLists.txt index e07454e697..0f8aff770e 100755 --- a/slsDetectorSoftware/CMakeLists.txt +++ b/slsDetectorSoftware/CMakeLists.txt @@ -4,6 +4,7 @@ set(SOURCES src/Detector.cpp src/CmdProxy.cpp src/CmdParser.cpp + src/Pattern.cpp ) add_library(slsDetectorObject OBJECT @@ -30,6 +31,7 @@ set(PUBLICHEADERS include/sls/detectorData.h include/sls/Detector.h include/sls/Result.h + include/sls/Pattern.h ) #Shared library diff --git a/slsDetectorSoftware/include/sls/Detector.h b/slsDetectorSoftware/include/sls/Detector.h index 6b219de2f6..105d95dee7 100644 --- a/slsDetectorSoftware/include/sls/Detector.h +++ b/slsDetectorSoftware/include/sls/Detector.h @@ -1,4 +1,5 @@ #pragma once +#include "sls/Pattern.h" #include "sls/Result.h" #include "sls/network_utils.h" #include "sls/sls_detector_defs.h" @@ -109,7 +110,7 @@ class Detector { /** list of possible settings for this detector */ std::vector getSettingsList() const; - /** [Jungfrau][Gotthard][Gotthard2] */ + /** [Jungfrau][Gotthard][Gotthard2][Mythen3] */ Result getSettings(Positions pos = {}) const; /** [Jungfrau] DYNAMICGAIN, DYNAMICHG0, FIXGAIN1, FIXGAIN2, @@ -117,12 +118,34 @@ class Detector { * LOWGAIN, MEDIUMGAIN, VERYHIGHGAIN \n [Gotthard2] DYNAMICGAIN, * FIXGAIN1, FIXGAIN2 \n [Moench] G1_HIGHGAIN, G1_LOWGAIN, * G2_HIGHCAP_HIGHGAIN, G2_HIGHCAP_LOWGAIN, G2_LOWCAP_HIGHGAIN, - * G2_LOWCAP_LOWGAIN, G4_HIGHGAIN, G4_LOWGAIN \n [Eiger] Use threshold - * command. Settings loaded from file found in - * settingspath + * G2_LOWCAP_LOWGAIN, G4_HIGHGAIN, G4_LOWGAIN \n [Mythen3] STANDARD, FAST, + * HIGHGAIN. Also changes vrshaper and vrpreamp \n [Eiger] Use threshold + * command. Settings loaded from file found in settingspath */ void setSettings(defs::detectorSettings value, Positions pos = {}); + /** [Eiger] */ + Result getThresholdEnergy(Positions pos = {}) const; + + /** Mythen3] threshold energy for the three counters */ + Result> getAllThresholdEnergy(Positions pos = {}) const; + + /** [Eiger][Mythen3] It loads trim files from settingspath */ + void setThresholdEnergy(int threshold_ev, + defs::detectorSettings settings = defs::STANDARD, + bool trimbits = true, Positions pos = {}); + + /** [Mythen3] It loads trim files from settingspath */ + void setThresholdEnergy(std::array threshold_ev, + defs::detectorSettings settings = defs::STANDARD, + bool trimbits = true, Positions pos = {}); + + /** [Eiger][Mythen3] */ + Result getSettingsPath(Positions pos = {}) const; + + /** [Eiger][Mythen3] Directory where settings files are loaded from/to */ + void setSettingsPath(const std::string &value, Positions pos = {}); + /** [Eiger][Mythen3] If no extension specified, serial number of each module * is attached. */ void loadTrimbits(const std::string &fname, Positions pos = {}); @@ -133,6 +156,13 @@ class Detector { /**[Eiger][Mythen3] */ void setAllTrimbits(int value, Positions pos = {}); + /**[Eiger][Mythen3] Returns energies in eV where the module is trimmed */ + Result> getTrimEnergies(Positions pos = {}) const; + + /** [Eiger][Mythen3] List of trim energies, where corresponding default trim + * files exist in corresponding trim folders */ + void setTrimEnergies(std::vector energies, Positions pos = {}); + /**[Eiger][Jungfrau] */ bool getGapPixelsinCallback() const; @@ -939,20 +969,6 @@ class Detector { /** [Eiger] in 32 bit mode */ void setSubDeadTime(ns value, Positions pos = {}); - /** [Eiger] */ - Result getThresholdEnergy(Positions pos = {}) const; - - /** [Eiger] It loads trim files from settingspath */ - void setThresholdEnergy(int threshold_ev, - defs::detectorSettings settings = defs::STANDARD, - bool trimbits = true, Positions pos = {}); - - /** [Eiger] */ - Result getSettingsPath(Positions pos = {}) const; - - /** [Eiger] Directory where settings files are loaded from/to */ - void setSettingsPath(const std::string &value, Positions pos = {}); - /** [Eiger] */ Result getOverFlowMode(Positions pos = {}) const; @@ -965,13 +981,6 @@ class Detector { /** [Eiger] for client call back (gui) purposes to flip bottom image */ void setBottom(bool value, Positions pos = {}); - /**[Eiger] Returns energies in eV where the module is trimmed */ - Result> getTrimEnergies(Positions pos = {}) const; - - /** [Eiger] List of trim energies, where corresponding default trim files - * exist in corresponding trim folders */ - void setTrimEnergies(std::vector energies, Positions pos = {}); - /** [Eiger] deadtime in ns, 0 = disabled */ Result getRateCorrection(Positions pos = {}) const; @@ -1296,6 +1305,9 @@ class Detector { /** [Mythen3] gate delay for all gates in auto or trigger timing mode * (internal gating). Gate index: 0-2, -1 for all */ Result> getGateDelayForAllGates(Positions pos = {}) const; + + Result getMaster(Positions pos = {}) const; + ///@{ /** @name CTB / Moench Specific */ @@ -1457,10 +1469,17 @@ class Detector { * (instead of executing line by line)*/ void setPattern(const std::string &fname, Positions pos = {}); + /** [CTB][Moench][Mythen3] Loads pattern parameters structure directly to + * server */ + void setPattern(const Pattern &pat, Positions pos = {}); + /** [CTB][Moench][Mythen3] [Ctb][Moench][Mythen3] Saves pattern to file * (ascii). \n [Ctb][Moench] Also executes pattern.*/ void savePattern(const std::string &fname); + /** [Mythen3][Moench] Loads and runs default pattern */ + void loadDefaultPattern(Positions pos = {}); + /** [CTB][Moench] */ Result getPatternIOControl(Positions pos = {}) const; diff --git a/slsDetectorSoftware/include/sls/Pattern.h b/slsDetectorSoftware/include/sls/Pattern.h new file mode 100644 index 0000000000..7f435ba542 --- /dev/null +++ b/slsDetectorSoftware/include/sls/Pattern.h @@ -0,0 +1,41 @@ +#pragma once +#include "sls/sls_detector_defs.h" + +#ifdef __cplusplus +#include +namespace sls { +#endif + +// Common C/C++ structure to handle pattern data +typedef struct __attribute__((packed)) { + uint64_t word[MAX_PATTERN_LENGTH]; + uint64_t ioctrl; + uint32_t limits[2]; + // loop0 start, loop0 stop .. loop2 start, loop2 stop + uint32_t loop[6]; + uint32_t nloop[3]; + uint32_t wait[3]; + uint64_t waittime[3]; +} patternParameters; + +#ifdef __cplusplus +class Pattern { + patternParameters *pat = new patternParameters{}; + + public: + Pattern(); + ~Pattern(); + Pattern(const Pattern &other); + bool operator==(const Pattern &other) const; + bool operator!=(const Pattern &other) const; + patternParameters *data(); + patternParameters *data() const; + size_t size() const noexcept { return sizeof(patternParameters); } + void validate() const; + void load(const std::string &fname); + void save(const std::string &fname); + std::string str() const; +}; + +} // namespace sls +#endif diff --git a/slsDetectorSoftware/src/CmdProxy.cpp b/slsDetectorSoftware/src/CmdProxy.cpp index 69a52a36b5..9a47d90f9e 100644 --- a/slsDetectorSoftware/src/CmdProxy.cpp +++ b/slsDetectorSoftware/src/CmdProxy.cpp @@ -54,7 +54,7 @@ bool CmdProxy::ReplaceIfDepreciated(std::string &command) { if (d_it != depreciated_functions.end()) { LOG(logWARNING) << command - << " is depreciated and will be removed. Please migrate to: " + << " is deprecated and will be removed. Please migrate to: " << d_it->second; // insert old command into arguments (for dacs) if (d_it->second == "dac") { @@ -356,6 +356,119 @@ std::string CmdProxy::DetectorSize(int action) { return os.str(); } +std::string CmdProxy::Threshold(int action) { + std::ostringstream os; + os << cmd << ' '; + if (action == defs::HELP_ACTION) { + os << "[eV] [(optinal settings)" + "\n\t[Eiger][Mythen3] Threshold in eV. It loads trim files from " + "settingspath."; + if (cmd == "thresholdnotb") { + os << "Trimbits are not loaded."; + } + os << "\n\nthreshold [eV1] [eV2] [eV3] [(optional settings)]" + "\n\t[Mythen3] Threshold in eV for each counter. It loads trim " + "files from " + "settingspath."; + if (cmd == "thresholdnotb") { + os << "Trimbits are not loaded."; + } + os << '\n'; + } else if (action == defs::GET_ACTION) { + if (cmd == "thresholdnotb") { + throw sls::RuntimeError("cannot get"); + } + if (!args.empty()) { + WrongNumberOfParameters(0); + } + defs::detectorType type = det->getDetectorType().squash(); + if (type == defs::EIGER) { + auto t = det->getThresholdEnergy(std::vector{det_id}); + os << OutString(t) << '\n'; + } else if (type == defs::MYTHEN3) { + auto t = det->getAllThresholdEnergy(std::vector{det_id}); + os << OutString(t) << '\n'; + } else { + throw RuntimeError("Not implemented for this detector\n"); + } + } else if (action == defs::PUT_ACTION) { + defs::detectorType type = det->getDetectorType().squash(); + if (type == defs::EIGER && args.size() != 1 && args.size() != 2) { + WrongNumberOfParameters(1); + } + if (type == defs::MYTHEN3 && (args.size() < 1 || args.size() > 4)) { + WrongNumberOfParameters(1); + } + + bool trimbits = (cmd == "thresholdnotb") ? false : true; + std::array energy = {StringTo(args[0]), 0, 0}; + energy[1] = energy[0]; + energy[2] = energy[0]; + defs::detectorSettings sett = defs::STANDARD; + + // check if argument has settings or get it + if (args.size() == 2 || args.size() == 4) { + sett = StringTo(args[args.size() - 1]); + } else { + sett = det->getSettings(std::vector{det_id}) + .tsquash("Inconsistent settings between detectors"); + } + + // get other threshold values + if (args.size() > 2) { + energy[1] = StringTo(args[1]); + energy[2] = StringTo(args[2]); + } + switch (type) { + case defs::EIGER: + det->setThresholdEnergy(energy[0], sett, trimbits, + std::vector{det_id}); + break; + case defs::MYTHEN3: + det->setThresholdEnergy(energy, sett, trimbits, + std::vector{det_id}); + break; + default: + throw RuntimeError("Not implemented for this detector\n"); + } + os << ToString(args) << '\n'; + } else { + throw sls::RuntimeError("Unknown action"); + } + return os.str(); +} + +std::string CmdProxy::TrimEnergies(int action) { + std::ostringstream os; + os << cmd << ' '; + if (action == defs::HELP_ACTION) { + os << "[trim_ev1] [trim_Ev2 (optional)] [trim_ev3 (optional)] " + "...\n\t[Eiger][Mythen3] Number of trim energies and list of " + "trim " + "energies, where corresponding default trim files exist in " + "corresponding trim folders." + << '\n'; + } else if (action == defs::GET_ACTION) { + if (!args.empty()) { + WrongNumberOfParameters(0); + } + auto t = det->getTrimEnergies(std::vector{det_id}); + os << OutString(t) << '\n'; + } else if (action == defs::PUT_ACTION) { + std::vector t(args.size()); + if (!args.empty()) { + for (size_t i = 0; i < t.size(); ++i) { + t[i] = StringTo(args[i]); + } + } + det->setTrimEnergies(t, std::vector{det_id}); + os << sls::ToString(args) << '\n'; + } else { + throw sls::RuntimeError("Unknown action"); + } + return os.str(); +} + std::string CmdProxy::GapPixels(int action) { std::ostringstream os; os << cmd << ' '; @@ -1264,103 +1377,6 @@ std::string CmdProxy::ZMQHWM(int action) { /* Eiger Specific */ -std::string CmdProxy::Threshold(int action) { - std::ostringstream os; - os << cmd << ' '; - if (action == defs::HELP_ACTION) { - os << "[eV] [(optinal settings) standard, lowgain, veryhighgain, " - "verylowgain]" - "\n\t[Eiger] Threshold in eV. It loads trim files from " - "settingspath." - << '\n'; - } else if (action == defs::GET_ACTION) { - if (!args.empty()) { - WrongNumberOfParameters(0); - } - auto t = det->getThresholdEnergy(std::vector{det_id}); - os << OutString(t) << '\n'; - } else if (action == defs::PUT_ACTION) { - if (args.size() == 1) { - auto t = det->getSettings(std::vector{det_id}) - .tsquash("Inconsistent settings between detectors"); - det->setThresholdEnergy(StringTo(args[0]), t, true, - std::vector{det_id}); - } else if (args.size() == 2) { - det->setThresholdEnergy( - StringTo(args[0]), - sls::StringTo(args[1]), true, - {det_id}); - } else { - WrongNumberOfParameters(1); - } - os << ToString(args) << '\n'; - } else { - throw sls::RuntimeError("Unknown action"); - } - return os.str(); -} - -std::string CmdProxy::ThresholdNoTb(int action) { - std::ostringstream os; - os << cmd << ' '; - if (action == defs::HELP_ACTION) { - os << "[eV] [(optional settings) standard, lowgain, veryhighgain, " - "verylowgain]" - "\n\t[Eiger] Threshold in eV set without setting trimbits" - << '\n'; - } else if (action == defs::GET_ACTION) { - throw sls::RuntimeError("cannot get"); - } else if (action == defs::PUT_ACTION) { - if (args.size() == 1) { - auto t = det->getSettings(std::vector{det_id}) - .tsquash("Inconsistent settings between detectors"); - det->setThresholdEnergy(StringTo(args[0]), t, false, - std::vector{det_id}); - } else if (args.size() == 2) { - det->setThresholdEnergy( - StringTo(args[0]), - sls::StringTo(args[1]), - false, std::vector{det_id}); - } else { - WrongNumberOfParameters(1); - } - os << ToString(args) << '\n'; - } else { - throw sls::RuntimeError("Unknown action"); - } - return os.str(); -} - -std::string CmdProxy::TrimEnergies(int action) { - std::ostringstream os; - os << cmd << ' '; - if (action == defs::HELP_ACTION) { - os << "[trim_ev1] [trim_Ev2 (optional)] [trim_ev3 (optional)] " - "...\n\t[Eiger] Number of trim energies and list of trim " - "energies, where corresponding default trim files exist in " - "corresponding trim folders." - << '\n'; - } else if (action == defs::GET_ACTION) { - if (!args.empty()) { - WrongNumberOfParameters(0); - } - auto t = det->getTrimEnergies(std::vector{det_id}); - os << OutString(t) << '\n'; - } else if (action == defs::PUT_ACTION) { - std::vector t(args.size()); - if (!args.empty()) { - for (size_t i = 0; i < t.size(); ++i) { - t[i] = StringTo(args[i]); - } - } - det->setTrimEnergies(t, std::vector{det_id}); - os << sls::ToString(args) << '\n'; - } else { - throw sls::RuntimeError("Unknown action"); - } - return os.str(); -} - std::string CmdProxy::RateCorrection(int action) { std::ostringstream os; os << cmd << ' '; diff --git a/slsDetectorSoftware/src/CmdProxy.h b/slsDetectorSoftware/src/CmdProxy.h index f95a1b7170..90bf8dd153 100644 --- a/slsDetectorSoftware/src/CmdProxy.h +++ b/slsDetectorSoftware/src/CmdProxy.h @@ -596,6 +596,8 @@ class CmdProxy { {"detectornumber", "serialnumber"}, {"thisversion", "clientversion"}, {"detsizechan", "detsize"}, + {"trimdir", "settingspath"}, + {"settingsdir", "settingspath"}, /* acquisition parameters */ {"cycles", "triggers"}, @@ -724,8 +726,6 @@ class CmdProxy { {"rx_datastream", "rx_zmqstream"}, /* Eiger Specific */ - {"trimdir", "settingspath"}, - {"settingsdir", "settingspath"}, {"resmat", "partialreset"}, /* Jungfrau Specific */ @@ -774,8 +774,12 @@ class CmdProxy { {"detsize", &CmdProxy::DetectorSize}, {"settingslist", &CmdProxy::settingslist}, {"settings", &CmdProxy::settings}, + {"threshold", &CmdProxy::Threshold}, + {"thresholdnotb", &CmdProxy::Threshold}, + {"settingspath", &CmdProxy::settingspath}, {"trimbits", &CmdProxy::trimbits}, {"trimval", &CmdProxy::trimval}, + {"trimen", &CmdProxy::TrimEnergies}, {"gappixels", &CmdProxy::GapPixels}, /* acquisition parameters */ @@ -911,12 +915,8 @@ class CmdProxy { /* Eiger Specific */ {"subexptime", &CmdProxy::subexptime}, {"subdeadtime", &CmdProxy::subdeadtime}, - {"threshold", &CmdProxy::Threshold}, - {"thresholdnotb", &CmdProxy::ThresholdNoTb}, - {"settingspath", &CmdProxy::settingspath}, {"overflow", &CmdProxy::overflow}, {"flippeddatax", &CmdProxy::flippeddatax}, - {"trimen", &CmdProxy::TrimEnergies}, {"ratecorr", &CmdProxy::RateCorrection}, {"readnlines", &CmdProxy::readnlines}, {"interruptsubframe", &CmdProxy::interruptsubframe}, @@ -1014,6 +1014,7 @@ class CmdProxy { /* Pattern */ {"pattern", &CmdProxy::Pattern}, {"savepattern", &CmdProxy::savepattern}, + {"defaultpattern", &CmdProxy::defaultpattern}, {"patioctrl", &CmdProxy::patioctrl}, {"patword", &CmdProxy::PatternWord}, {"patlimits", &CmdProxy::PatternLoopAddresses}, @@ -1081,6 +1082,8 @@ class CmdProxy { std::string PackageVersion(int action); std::string ClientVersion(int action); std::string DetectorSize(int action); + std::string Threshold(int action); + std::string TrimEnergies(int action); std::string GapPixels(int action); /* acquisition parameters */ std::string Acquire(int action); @@ -1112,9 +1115,6 @@ class CmdProxy { /* ZMQ Streaming Parameters (Receiver<->Client) */ std::string ZMQHWM(int action); /* Eiger Specific */ - std::string Threshold(int action); - std::string ThresholdNoTb(int action); - std::string TrimEnergies(int action); std::string RateCorrection(int action); std::string Activate(int action); std::string PulsePixel(int action); @@ -1211,9 +1211,14 @@ 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] " - "settings loaded from file found in settingspath. \n\t[Gotthard] Also " - "loads default dacs on to the detector."); + "\n\t[Mythen3] - [standard | fast | highgain] Also changes vrshaper " + "and vrpreamp. \n\t[Eiger] Use threshold or thresholdnotb. \n\t[Eiger] " + "threshold and settings loaded from file found in settingspath. " + "\n\t[Gotthard] Also loads default dacs on to the detector."); + + STRING_COMMAND(settingspath, getSettingsPath, setSettingsPath, + "[path]\n\t[Eiger][Mythen3] Directory where settings files " + "are loaded from/to."); EXECUTE_SET_COMMAND_1ARG( trimbits, loadTrimbits, @@ -1775,10 +1780,6 @@ class CmdProxy { "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_VEC_ID( overflow, getOverFlowMode, setOverFlowMode, StringTo, "[0, 1]\n\t[Eiger] Enable or disable show overflow flag in " @@ -2063,6 +2064,11 @@ class CmdProxy { "[fname]\n\t[Ctb][Moench][Mythen3] Saves pattern to file (ascii). " "\n\t[Ctb][Moench] Also executes pattern."); + EXECUTE_SET_COMMAND( + defaultpattern, loadDefaultPattern, + "\n\t[Mythen3][Moench] Loads and runs default pattern in pattern " + "generator. It is to go back to initial settings."); + INTEGER_COMMAND_HEX_WIDTH16(patioctrl, getPatternIOControl, setPatternIOControl, StringTo, "[64 bit mask]\n\t[Ctb][Moench] 64 bit mask " diff --git a/slsDetectorSoftware/src/Detector.cpp b/slsDetectorSoftware/src/Detector.cpp index 50f3da660a..b0892c2a21 100644 --- a/slsDetectorSoftware/src/Detector.cpp +++ b/slsDetectorSoftware/src/Detector.cpp @@ -5,6 +5,7 @@ #include "CmdProxy.h" #include "DetectorImpl.h" #include "Module.h" +#include "sls/Pattern.h" #include "sls/container_utils.h" #include "sls/logger.h" #include "sls/sls_detector_defs.h" @@ -170,8 +171,10 @@ std::vector Detector::getSettingsList() const { defs::G2_HIGHCAP_HIGHGAIN, defs::G2_HIGHCAP_LOWGAIN, defs::G2_LOWCAP_HIGHGAIN, defs::G2_LOWCAP_LOWGAIN, defs::G4_HIGHGAIN, defs::G4_LOWGAIN}; - case defs::CHIPTESTBOARD: case defs::MYTHEN3: + return std::vector{defs::STANDARD, defs::FAST, + defs::HIGHGAIN}; + case defs::CHIPTESTBOARD: throw RuntimeError("Settings not implemented for this detector"); default: throw RuntimeError("Unknown detector type"); @@ -183,7 +186,71 @@ Result Detector::getSettings(Positions pos) const { } void Detector::setSettings(const defs::detectorSettings value, Positions pos) { - pimpl->Parallel(&Module::setSettings, pos, value); + if (value == defs::UNINITIALIZED || value == defs::UNDEFINED) { + throw RuntimeError( + "Cannot set settings with undefined or uninitialized settings."); + } + if (anyEqualTo(getSettingsList(), value)) { + pimpl->Parallel(&Module::setSettings, pos, value); + } else { + throw RuntimeError("Unknown Settings " + ToString(value) + + " for this detector\n"); + } +} + +Result Detector::getThresholdEnergy(Positions pos) const { + return pimpl->Parallel(&Module::getThresholdEnergy, pos); +} + +Result> +Detector::getAllThresholdEnergy(Positions pos) const { + return pimpl->Parallel(&Module::getAllThresholdEnergy, pos); +} + +void Detector::setThresholdEnergy(int threshold_ev, + defs::detectorSettings settings, + bool trimbits, Positions pos) { + defs::detectorType type = getDetectorType().squash(); + if (type == defs::MYTHEN3) { + std::array energy = {threshold_ev, threshold_ev, threshold_ev}; + setThresholdEnergy(energy, settings, trimbits, pos); + return; + } + if (type != defs::EIGER) { + throw RuntimeError( + "Set threshold energy not implemented for this detector"); + } + if (anyEqualTo(getSettingsList(), settings)) { + pimpl->Parallel(&Module::setThresholdEnergy, pos, threshold_ev, + settings, static_cast(trimbits)); + } else { + throw RuntimeError("Unknown Settings " + ToString(settings) + + " for this detector\n"); + } +} + +void Detector::setThresholdEnergy(std::array threshold_ev, + defs::detectorSettings settings, + bool trimbits, Positions pos) { + if (getDetectorType().squash() != defs::MYTHEN3) { + throw RuntimeError("Set threshold energy for different counters not " + "implemented for this detector"); + } + if (anyEqualTo(getSettingsList(), settings)) { + pimpl->Parallel(&Module::setAllThresholdEnergy, pos, threshold_ev, + settings, static_cast(trimbits)); + } else { + throw RuntimeError("Unknown Settings " + ToString(settings) + + " for this detector\n"); + } +} + +Result Detector::getSettingsPath(Positions pos) const { + return pimpl->Parallel(&Module::getSettingsDir, pos); +} + +void Detector::setSettingsPath(const std::string &value, Positions pos) { + pimpl->Parallel(&Module::setSettingsDir, pos, value); } void Detector::loadTrimbits(const std::string &fname, Positions pos) { @@ -198,6 +265,14 @@ void Detector::setAllTrimbits(int value, Positions pos) { pimpl->Parallel(&Module::setAllTrimbits, pos, value); } +Result> Detector::getTrimEnergies(Positions pos) const { + return pimpl->Parallel(&Module::getTrimEn, pos); +} + +void Detector::setTrimEnergies(std::vector energies, Positions pos) { + pimpl->Parallel(&Module::setTrimEn, pos, energies); +} + bool Detector::getGapPixelsinCallback() const { return pimpl->getGapPixelsinCallback(); } @@ -599,7 +674,23 @@ void Detector::startReceiver() { pimpl->Parallel(&Module::startReceiver, {}); } void Detector::stopReceiver() { pimpl->Parallel(&Module::stopReceiver, {}); } void Detector::startDetector() { - pimpl->Parallel(&Module::startAcquisition, {}); + auto detector_type = getDetectorType().squash(); + if (detector_type == defs::MYTHEN3 && size() > 1){ + auto is_master = getMaster(); + std::vector master; + std::vector slaves; + for(int i=0; iParallel(&Module::startAcquisition, slaves); + pimpl->Parallel(&Module::startAcquisition, master); + }else{ + pimpl->Parallel(&Module::startAcquisition, {}); + } + } void Detector::startDetectorReadout() { @@ -642,6 +733,9 @@ Result Detector::getScan(Positions pos) const { } void Detector::setScan(const defs::scanParameters t) { + if(getDetectorType().squash() == defs::MYTHEN3 && size()>1 && t.enable != 0){ + throw DetectorError("Scan is only allowed for single module Mythen 3 because of synchronization"); + } pimpl->Parallel(&Module::setScan, {}, t); } @@ -1157,25 +1251,6 @@ void Detector::setSubDeadTime(ns value, Positions pos) { pimpl->Parallel(&Module::setSubDeadTime, pos, value.count()); } -Result Detector::getThresholdEnergy(Positions pos) const { - return pimpl->Parallel(&Module::getThresholdEnergy, pos); -} - -void Detector::setThresholdEnergy(int threshold_ev, - defs::detectorSettings settings, - bool trimbits, Positions pos) { - pimpl->Parallel(&Module::setThresholdEnergy, pos, threshold_ev, settings, - static_cast(trimbits)); -} - -Result Detector::getSettingsPath(Positions pos) const { - return pimpl->Parallel(&Module::getSettingsDir, pos); -} - -void Detector::setSettingsPath(const std::string &value, Positions pos) { - pimpl->Parallel(&Module::setSettingsDir, pos, value); -} - Result Detector::getOverFlowMode(Positions pos) const { return pimpl->Parallel(&Module::getOverFlowMode, pos); } @@ -1192,14 +1267,6 @@ void Detector::setBottom(bool value, Positions pos) { pimpl->Parallel(&Module::setFlippedDataX, pos, value); } -Result> Detector::getTrimEnergies(Positions pos) const { - return pimpl->Parallel(&Module::getTrimEn, pos); -} - -void Detector::setTrimEnergies(std::vector energies, Positions pos) { - pimpl->Parallel(&Module::setTrimEn, pos, energies); -} - Result Detector::getRateCorrection(Positions pos) const { return pimpl->Parallel(&Module::getRateCorrection, pos); } @@ -1544,6 +1611,11 @@ Detector::getGateDelayForAllGates(Positions pos) const { return pimpl->Parallel(&Module::getGateDelayForAllGates, pos); } +Result Detector::getMaster(Positions pos) const{ + return pimpl->Parallel(&Module::isMaster, pos); +} + + // CTB/ Moench Specific Result Detector::getNumberOfAnalogSamples(Positions pos) const { @@ -1753,41 +1825,27 @@ void Detector::setLEDEnable(bool enable, Positions pos) { // Pattern -void Detector::savePattern(const std::string &fname) { - std::ofstream outfile; - outfile.open(fname.c_str(), std::ios_base::out); - if (!outfile.is_open()) { - throw RuntimeError("Could not create file to save pattern"); - } - // get pattern limits - auto r = pimpl->Parallel(&Module::getPatternLoopAddresses, {}, -1) - .tsquash("Inconsistent pattern limits"); +void Detector::setPattern(const std::string &fname, Positions pos) { + Pattern pat; + pat.load(fname); + pat.validate(); + setPattern(pat, pos); +} - CmdProxy proxy(this); - // pattern words - for (int i = r[0]; i <= r[1]; ++i) { - std::ostringstream os; - os << "0x" << std::hex << i; - auto addr = os.str(); - proxy.Call("patword", {addr}, -1, defs::GET_ACTION, outfile); - } - // rest of pattern file - std::vector commands{ - "patioctrl", "patlimits", "patloop0", "patnloop0", - "patloop1", "patnloop1", "patloop2", "patnloop2", - "patwait0", "patwaittime0", "patwait1", "patwaittime1", - "patwait2", "patwaittime2", "patmask", "patsetbit", - }; - auto det_type = getDetectorType().squash(); - if (det_type == defs::MYTHEN3) { - commands.erase(commands.begin(), commands.begin() + 2); - } - for (const auto &cmd : commands) - proxy.Call(cmd, {}, -1, defs::GET_ACTION, outfile); +void Detector::setPattern(const Pattern &pat, Positions pos) { + pat.validate(); + pimpl->Parallel(&Module::setPattern, pos, pat); } -void Detector::setPattern(const std::string &fname, Positions pos) { - pimpl->Parallel(&Module::setPattern, pos, fname); +void Detector::savePattern(const std::string &fname) { + auto t = pimpl->Parallel(&Module::getPattern, {}); + auto pat = t.tsquash("Inconsistent pattern parameters between modules"); + pat.validate(); + pat.save(fname); +} + +void Detector::loadDefaultPattern(Positions pos) { + pimpl->Parallel(&Module::loadDefaultPattern, pos); } Result Detector::getPatternIOControl(Positions pos) const { diff --git a/slsDetectorSoftware/src/DetectorImpl.cpp b/slsDetectorSoftware/src/DetectorImpl.cpp index 925d951066..188b53167b 100644 --- a/slsDetectorSoftware/src/DetectorImpl.cpp +++ b/slsDetectorSoftware/src/DetectorImpl.cpp @@ -1056,11 +1056,15 @@ void DetectorImpl::registerDataCallback(void (*userCallback)(detectorData *, } int DetectorImpl::acquire() { + // ensure acquire isnt started multiple times by same client if (!isAcquireReady()) { return FAIL; } + // We need this to handle Mythen3 synchronization + auto detector_type = Parallel(&Module::getDetectorType, {}).squash(); + try { struct timespec begin, end; clock_gettime(CLOCK_REALTIME, &begin); @@ -1088,7 +1092,25 @@ int DetectorImpl::acquire() { // start and read all try { - Parallel(&Module::startAndReadAll, {}); + if(detector_type == defs::MYTHEN3 && detectors.size() > 1){ + //Multi module mythen + std::vector master; + std::vector slaves; + auto is_master = Parallel(&Module::isMaster, {}); + slaves.reserve(detectors.size()-1); //check this one!! + for (size_t i = 0; i #include #include @@ -152,16 +152,269 @@ void Module::setSettings(detectorSettings isettings) { sendToDetector(F_SET_SETTINGS, isettings); } +int Module::getThresholdEnergy() const { + return sendToDetector(F_GET_THRESHOLD_ENERGY); +} + +std::array Module::getAllThresholdEnergy() const { + return sendToDetector>(F_GET_ALL_THRESHOLD_ENERGY); +} + +void Module::setThresholdEnergy(int e_eV, detectorSettings isettings, + bool trimbits) { + + // verify e_eV exists in trimEneregies[] + if (shm()->trimEnergies.empty() || (e_eV < shm()->trimEnergies.front()) || + (e_eV > shm()->trimEnergies.back())) { + throw RuntimeError("This energy " + std::to_string(e_eV) + + " not defined for this module!"); + } + bool interpolate = + std::all_of(shm()->trimEnergies.begin(), shm()->trimEnergies.end(), + [e_eV](const int &e) { return e != e_eV; }); + + sls_detector_module myMod{shm()->myDetectorType}; + + if (!interpolate) { + std::string settingsfname = getTrimbitFilename(isettings, e_eV); + LOG(logDEBUG1) << "Settings File is " << settingsfname; + myMod = readSettingsFile(settingsfname, trimbits); + } else { + // find the trim values + int trim1 = -1, trim2 = -1; + for (size_t i = 0; i < shm()->trimEnergies.size(); ++i) { + if (e_eV < shm()->trimEnergies[i]) { + trim2 = shm()->trimEnergies[i]; + trim1 = shm()->trimEnergies[i - 1]; + break; + } + } + std::string settingsfname1 = getTrimbitFilename(isettings, trim1); + std::string settingsfname2 = getTrimbitFilename(isettings, trim2); + LOG(logDEBUG1) << "Settings Files are " << settingsfname1 << " and " + << settingsfname2; + auto myMod1 = readSettingsFile(settingsfname1, trimbits); + auto myMod2 = readSettingsFile(settingsfname2, trimbits); + if (myMod1.iodelay != myMod2.iodelay) { + throw RuntimeError("setThresholdEnergyAndSettings: Iodelays do not " + "match between files"); + } + myMod = interpolateTrim(&myMod1, &myMod2, e_eV, trim1, trim2, trimbits); + myMod.iodelay = myMod1.iodelay; + myMod.tau = + linearInterpolation(e_eV, trim1, trim2, myMod1.tau, myMod2.tau); + } + + myMod.reg = isettings; + myMod.eV[0] = e_eV; + setModule(myMod, trimbits); + if (getSettings() != isettings) { + throw RuntimeError("setThresholdEnergyAndSettings: Could not set " + "settings in detector"); + } + + if (shm()->useReceiverFlag) { + sendToReceiver(F_RECEIVER_SET_THRESHOLD, e_eV, nullptr); + } +} + +void Module::setAllThresholdEnergy(std::array e_eV, + detectorSettings isettings, bool trimbits) { + if (shm()->trimEnergies.empty()) { + throw RuntimeError( + "Trim energies have not been defined for this module yet!"); + } + + auto counters = getSetBits(getCounterMask()); + enum mythen3_DacIndex { + M_VCASSH, + M_VTH2, + M_VRSHAPER, + M_VRSHAPER_N, + M_VIPRE_OUT, + M_VTH3, + M_VTH1, + M_VICIN, + M_VCAS, + M_VRPREAMP, + M_VCAL_N, + M_VIPRE, + M_VISHAPER, + M_VCAL_P, + M_VTRIM, + M_VDCSH + }; + + std::vector myMods{shm()->myDetectorType}; + std::vector energy(e_eV.begin(), e_eV.end()); + // if all energies are same + if (allEqualTo(energy, energy[0])) { + energy.resize(1); + } + myMods.resize(energy.size()); + + // for each threshold + for (size_t i = 0; i < energy.size(); ++i) { + // don't interpolate + if (shm()->trimEnergies.anyEqualTo(energy[i])) { + std::string settingsfname = + getTrimbitFilename(isettings, energy[i]); + LOG(logDEBUG1) << "Settings File is " << settingsfname; + myMods[i] = readSettingsFile(settingsfname, trimbits); + } + // interpolate + else { + if (shm()->trimEnergies.size() < 2) { + throw RuntimeError( + "Cannot interpolate with less than 2 trim energies"); + } + // find the trim values + int trim1 = -1, trim2 = -1; + if (energy[i] < shm()->trimEnergies[0]) { + trim1 = shm()->trimEnergies[0]; + trim2 = shm()->trimEnergies[1]; + } else if (energy[i] > + shm()->trimEnergies[shm()->trimEnergies.size() - 1]) { + trim1 = shm()->trimEnergies[shm()->trimEnergies.size() - 2]; + trim2 = shm()->trimEnergies[shm()->trimEnergies.size() - 1]; + } else { + for (size_t j = 0; j < shm()->trimEnergies.size(); ++j) { + // std::cout << "checking " << energy[i] << " and " + // << shm()->trimEnergies[j] << std::endl; + if (energy[i] < shm()->trimEnergies[j]) { + trim1 = shm()->trimEnergies[j - 1]; + trim2 = shm()->trimEnergies[j]; + break; + } + } + } + LOG(logINFO) << "e_eV:" << energy[i] << " [" << trim1 << ", " + << trim2 << "]"; + + std::string settingsfname1 = getTrimbitFilename(isettings, trim1); + std::string settingsfname2 = getTrimbitFilename(isettings, trim2); + LOG(logDEBUG1) << "Settings Files are " << settingsfname1 << " and " + << settingsfname2; + auto myMod1 = readSettingsFile(settingsfname1, trimbits); + auto myMod2 = readSettingsFile(settingsfname2, trimbits); + + myMods[i] = interpolateTrim(&myMod1, &myMod2, energy[i], trim1, + trim2, trimbits); + } + } + + sls_detector_module myMod{shm()->myDetectorType}; + myMod = myMods[0]; + + // if multiple thresholds, combine + if (myMods.size() > 1) { + + // average vtrim of enabled counters + int sum = 0; + for (size_t i = 0; i < counters.size(); ++i) { + sum += myMods[counters[i]].dacs[M_VTRIM]; + } + myMod.dacs[M_VTRIM] = sum / counters.size(); + + // copy vth1, vth2 and vth3 from the correct threshold mods + myMod.dacs[M_VTH1] = myMods[0].dacs[M_VTH1]; + myMod.dacs[M_VTH2] = myMods[1].dacs[M_VTH2]; + myMod.dacs[M_VTH3] = myMods[2].dacs[M_VTH3]; + + // check if dacs are different + for (size_t j = 0; j < 16; ++j) { + if (j == M_VTRIM || j == M_VTH1 || j == M_VTH2 || j == M_VTH3) + continue; + + if (myMods[0].dacs[j] != myMods[1].dacs[j]) { + throw RuntimeError("Dac Index " + std::to_string(j) + + " differs for threshold[0]:[" + + std::to_string(myMods[0].dacs[j]) + + "] and threshold[1]:" + + std::to_string(myMods[1].dacs[j]) + "]"); + } + if (myMods[1].dacs[j] != myMods[2].dacs[j]) { + throw RuntimeError("Dac Index " + std::to_string(j) + + " differs for threshold[1]:[" + + std::to_string(myMods[1].dacs[j]) + + "] and threshold[2]:" + + std::to_string(myMods[2].dacs[j]) + "]"); + } + } + + // replace correct trim values (interleaved) + for (int i = 0; i < myMod.nchan; ++i) { + myMod.chanregs[i] = myMods[i % 3].chanregs[i]; + } + } + + myMod.reg = isettings; + std::copy(e_eV.begin(), e_eV.end(), myMod.eV); + LOG(logDEBUG) << "ev:" << ToString(myMod.eV); + + //check for trimbits that are out of range + bool out_of_range = false; + for(int i = 0; i!=myMod.nchan; ++i){ + if (myMod.chanregs[i]<0){ + myMod.chanregs[i] = 0; + out_of_range = true; + }else if(myMod.chanregs[i]>63){ + myMod.chanregs[i]=63; + out_of_range = true; + } + } + if (out_of_range){ + LOG(logWARNING) << "Some trimbits were out of range after interpolation, these have been replaced with 0 or 63."; + } + + //check dacs + out_of_range = false; + for (auto dac : {M_VTRIM,M_VTH1,M_VTH2, M_VTH3}){ + if (myMod.dacs[dac] < 600){ + myMod.dacs[dac] = 600; + out_of_range = true; + }else if(myMod.dacs[dac] > 2400){ + myMod.dacs[dac] = 2400; + out_of_range = true; + } + } + if (out_of_range){ + LOG(logWARNING) << "Some dacs were out of range after interpolation, these have been replaced with 600 or 2400."; + } + + + setModule(myMod, trimbits); + if (getSettings() != isettings) { + throw RuntimeError("setThresholdEnergyAndSettings: Could not set " + "settings in detector"); + } + + if (shm()->useReceiverFlag) { + sendToReceiver(F_RECEIVER_SET_ALL_THRESHOLD, e_eV, nullptr); + } +} + +std::string Module::getSettingsDir() const { + return std::string(shm()->settingsDir); +} + +std::string Module::setSettingsDir(const std::string &dir) { + sls::strcpy_safe(shm()->settingsDir, dir.c_str()); + return shm()->settingsDir; +} + void Module::loadSettingsFile(const std::string &fname) { // find specific file if it has detid in file name (.snxxx) if (shm()->myDetectorType == EIGER || shm()->myDetectorType == MYTHEN3) { std::ostringstream ostfn; ostfn << fname; - if (fname.find(".sn") == std::string::npos && - fname.find(".trim") == std::string::npos && - fname.find(".settings") == std::string::npos) { - ostfn << ".sn" << std::setfill('0') << std::setw(3) << std::dec - << getSerialNumber(); + int serialNumberWidth = 3; + if (shm()->myDetectorType == MYTHEN3) { + serialNumberWidth = 4; + } + if (fname.find(".sn") == std::string::npos) { + ostfn << ".sn" << std::setfill('0') << std::setw(serialNumberWidth) + << std::dec << getSerialNumber(); } auto myMod = readSettingsFile(ostfn.str()); setModule(myMod); @@ -178,6 +431,30 @@ void Module::setAllTrimbits(int val) { sendToDetector(F_SET_ALL_TRIMBITS, val); } +std::vector Module::getTrimEn() const { + if (shm()->myDetectorType != EIGER && shm()->myDetectorType != MYTHEN3) { + throw RuntimeError("getTrimEn not implemented for this detector."); + } + return std::vector(shm()->trimEnergies.begin(), + shm()->trimEnergies.end()); +} + +int Module::setTrimEn(const std::vector &energies) { + if (shm()->myDetectorType != EIGER && shm()->myDetectorType != MYTHEN3) { + throw RuntimeError("setTrimEn not implemented for this detector."); + } + if (energies.size() > MAX_TRIMEN) { + std::ostringstream os; + os << "Size of trim energies: " << energies.size() + << " exceeds what can be stored in shared memory: " << MAX_TRIMEN + << "\n"; + throw RuntimeError(os.str()); + } + shm()->trimEnergies = energies; + std::sort(shm()->trimEnergies.begin(), shm()->trimEnergies.end()); + return shm()->trimEnergies.size(); +} + bool Module::isVirtualDetectorServer() const { return sendToDetector(F_IS_VIRTUAL); } @@ -1095,33 +1372,6 @@ void Module::setSubDeadTime(int64_t value) { } } -int Module::getThresholdEnergy() const { - return sendToDetector(F_GET_THRESHOLD_ENERGY); -} - -void Module::setThresholdEnergy(int e_eV, detectorSettings isettings, - bool trimbits) { - // 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); - } - } else { - throw RuntimeError( - "Set threshold energy not implemented for this detector"); - } -} - -std::string Module::getSettingsDir() const { - return std::string(shm()->settingsDir); -} - -std::string Module::setSettingsDir(const std::string &dir) { - sls::strcpy_safe(shm()->settingsDir, dir.c_str()); - return shm()->settingsDir; -} - bool Module::getOverFlowMode() const { return sendToDetector(F_GET_OVERFLOW_MODE); } @@ -1138,29 +1388,6 @@ void Module::setFlippedDataX(bool value) { sendToReceiver(F_SET_FLIPPED_DATA_RECEIVER, static_cast(value)); } -std::vector Module::getTrimEn() const { - if (shm()->myDetectorType != EIGER) { - throw RuntimeError("getTrimEn not implemented for this detector."); - } - return std::vector(shm()->trimEnergies.begin(), - shm()->trimEnergies.end()); -} - -int Module::setTrimEn(const std::vector &energies) { - if (shm()->myDetectorType != EIGER) { - throw RuntimeError("setTrimEn not implemented for this detector."); - } - if (energies.size() > MAX_TRIMEN) { - std::ostringstream os; - os << "Size of trim energies: " << energies.size() - << " exceeds what can be stored in shared memory: " << MAX_TRIMEN - << "\n"; - throw RuntimeError(os.str()); - } - shm()->trimEnergies = energies; - return shm()->trimEnergies.size(); -} - int64_t Module::getRateCorrection() const { return sendToDetector(F_GET_RATE_CORRECT); } @@ -1767,6 +1994,10 @@ std::array Module::getGateDelayForAllGates() const { return sendToDetector>(F_GET_GATE_DELAY_ALL_GATES); } +bool Module::isMaster() const{ + return sendToDetector(F_GET_MASTER); +} + // CTB / Moench Specific int Module::getNumberOfAnalogSamples() const { return sendToDetector(F_GET_NUM_ANALOG_SAMPLES); @@ -1913,108 +2144,18 @@ void Module::setLEDEnable(bool enable) { // Pattern -void Module::setPattern(const std::string &fname) { - auto pat = sls::make_unique(); - std::ifstream input_file(fname); - if (!input_file) { - throw RuntimeError("Could not open pattern file " + fname + - " for reading"); - } - for (std::string line; std::getline(input_file, line);) { - if (line.find('#') != std::string::npos) { - line.erase(line.find('#')); - } - LOG(logDEBUG1) << "line after removing comments:\n\t" << line; - if (line.length() > 1) { - - // convert command and string to a vector - std::istringstream iss(line); - auto it = std::istream_iterator(iss); - std::vector args = std::vector( - it, std::istream_iterator()); - - std::string cmd = args[0]; - int nargs = args.size() - 1; +void Module::setPattern(const Pattern &pat) { + sendToDetector(F_SET_PATTERN, pat.data(), pat.size(), nullptr, 0); +} - if (cmd == "patword") { - if (nargs != 2) { - throw RuntimeError("Invalid arguments for " + - ToString(args)); - } - uint32_t addr = StringTo(args[1]); - if (addr >= MAX_PATTERN_LENGTH) { - throw RuntimeError("Invalid address for " + ToString(args)); - } - pat->word[addr] = StringTo(args[2]); - } else if (cmd == "patioctrl") { - if (nargs != 1) { - throw RuntimeError("Invalid arguments for " + - ToString(args)); - } - pat->patioctrl = StringTo(args[1]); - } else if (cmd == "patlimits") { - if (nargs != 2) { - throw RuntimeError("Invalid arguments for " + - ToString(args)); - } - pat->patlimits[0] = StringTo(args[1]); - pat->patlimits[1] = StringTo(args[2]); - if (pat->patlimits[0] >= MAX_PATTERN_LENGTH || - pat->patlimits[1] >= MAX_PATTERN_LENGTH) { - throw RuntimeError("Invalid address for " + ToString(args)); - } - } else if (cmd == "patloop0" || cmd == "patloop1" || - cmd == "patloop2") { - if (nargs != 2) { - throw RuntimeError("Invalid arguments for " + - ToString(args)); - } - int level = cmd[cmd.find_first_of("012")] - '0'; - int patloop1 = StringTo(args[1]); - int patloop2 = StringTo(args[2]); - pat->patloop[level * 2 + 0] = patloop1; - pat->patloop[level * 2 + 1] = patloop2; - if (patloop1 >= MAX_PATTERN_LENGTH || - patloop2 >= MAX_PATTERN_LENGTH) { - throw RuntimeError("Invalid address for " + ToString(args)); - } - } else if (cmd == "patnloop0" || cmd == "patnloop1" || - cmd == "patnloop2") { - if (nargs != 1) { - throw RuntimeError("Invalid arguments for " + - ToString(args)); - } - int level = cmd[cmd.find_first_of("012")] - '0'; - pat->patnloop[level] = StringTo(args[1]); - } else if (cmd == "patwait0" || cmd == "patwait1" || - cmd == "patwait2") { - if (nargs != 1) { - throw RuntimeError("Invalid arguments for " + - ToString(args)); - } - int level = cmd[cmd.find_first_of("012")] - '0'; - pat->patwait[level] = StringTo(args[1]); - if (pat->patwait[level] >= MAX_PATTERN_LENGTH) { - throw RuntimeError("Invalid address for " + ToString(args)); - } - } else if (cmd == "patwaittime0" || cmd == "patwaittime1" || - cmd == "patwaittime2") { - if (nargs != 1) { - throw RuntimeError("Invalid arguments for " + - ToString(args)); - } - int level = cmd[cmd.find_first_of("012")] - '0'; - pat->patwaittime[level] = StringTo(args[1]); - } else { - throw RuntimeError("Unknown command in pattern file " + cmd); - } - } - } - LOG(logDEBUG1) << "Sending pattern from file to detector:" << *pat; - sendToDetector(F_SET_PATTERN, pat.get(), sizeof(patternParameters), nullptr, - 0); +Pattern Module::getPattern() { + Pattern pat; + sendToDetector(F_GET_PATTERN, nullptr, 0, pat.data(), pat.size()); + return pat; } +void Module::loadDefaultPattern() { sendToDetector(F_LOAD_DEFAULT_PATTERN); } + uint64_t Module::getPatternIOControl() const { return sendToDetector(F_SET_PATTERN_IO_CONTROL, int64_t(GET_FLAG)); @@ -2839,9 +2980,9 @@ int Module::sendModule(sls_detector_module *myMod, sls::ClientSocket &client) { ts += n; LOG(level) << "tau sent. " << n << " bytes. tau: " << myMod->tau; - n = client.Send(&(myMod->eV), sizeof(myMod->eV)); + n = client.Send(myMod->eV, sizeof(myMod->eV)); ts += n; - LOG(level) << "ev sent. " << n << " bytes. ev: " << myMod->eV; + LOG(level) << "ev sent. " << n << " bytes. ev: " << ToString(myMod->eV); n = client.Send(myMod->dacs, sizeof(int) * (myMod->ndac)); ts += n; @@ -2889,68 +3030,12 @@ void Module::updateRateCorrection() { sendToDetector(F_UPDATE_RATE_CORRECTION); } -void Module::setThresholdEnergyAndSettings(int e_eV, detectorSettings isettings, - bool trimbits) { - - // verify e_eV exists in trimEneregies[] - if (shm()->trimEnergies.empty() || (e_eV < shm()->trimEnergies.front()) || - (e_eV > shm()->trimEnergies.back())) { - throw RuntimeError("This energy " + std::to_string(e_eV) + - " not defined for this module!"); - } - - bool interpolate = - std::all_of(shm()->trimEnergies.begin(), shm()->trimEnergies.end(), - [e_eV](const int &e) { return e != e_eV; }); - - sls_detector_module myMod{shm()->myDetectorType}; - - if (!interpolate) { - std::string settingsfname = getTrimbitFilename(isettings, e_eV); - LOG(logDEBUG1) << "Settings File is " << settingsfname; - myMod = readSettingsFile(settingsfname, trimbits); - } else { - // find the trim values - int trim1 = -1, trim2 = -1; - for (size_t i = 0; i < shm()->trimEnergies.size(); ++i) { - if (e_eV < shm()->trimEnergies[i]) { - trim2 = shm()->trimEnergies[i]; - trim1 = shm()->trimEnergies[i - 1]; - break; - } - } - std::string settingsfname1 = getTrimbitFilename(isettings, trim1); - std::string settingsfname2 = getTrimbitFilename(isettings, trim2); - LOG(logDEBUG1) << "Settings Files are " << settingsfname1 << " and " - << settingsfname2; - auto myMod1 = readSettingsFile(settingsfname1, trimbits); - auto myMod2 = readSettingsFile(settingsfname2, trimbits); - if (myMod1.iodelay != myMod2.iodelay) { - throw RuntimeError("setThresholdEnergyAndSettings: Iodelays do not " - "match between files"); - } - myMod = interpolateTrim(&myMod1, &myMod2, e_eV, trim1, trim2, trimbits); - myMod.iodelay = myMod1.iodelay; - myMod.tau = - linearInterpolation(e_eV, trim1, trim2, myMod1.tau, myMod2.tau); - } - - myMod.reg = isettings; - myMod.eV = e_eV; - setModule(myMod, trimbits); - if (getSettings() != isettings) { - throw RuntimeError("setThresholdEnergyAndSettings: Could not set " - "settings in detector"); - } -} - sls_detector_module Module::interpolateTrim(sls_detector_module *a, sls_detector_module *b, const int energy, const int e1, const int e2, bool trimbits) { - - // only implemented for eiger currently (in terms of which dacs) - if (shm()->myDetectorType != EIGER) { + // dacs specified only for eiger and mythen3 + if (shm()->myDetectorType != EIGER && shm()->myDetectorType != MYTHEN3) { throw NotImplementedError( "Interpolation of Trim values not implemented for this detector!"); } @@ -2974,36 +3059,72 @@ sls_detector_module Module::interpolateTrim(sls_detector_module *a, E_VCN, E_VIS }; + enum mythen3_DacIndex { + M_VCASSH, + M_VTH2, + M_VRSHAPER, + M_VRSHAPER_N, + M_VIPRE_OUT, + M_VTH3, + M_VTH1, + M_VICIN, + M_VCAS, + M_VRPREAMP, + M_VCAL_N, + M_VIPRE, + M_VISHAPER, + M_VCAL_P, + M_VTRIM, + M_VDCSH + }; + + // create copy and interpolate dac lists + std::vector dacs_to_copy, dacs_to_interpolate; + if (shm()->myDetectorType == EIGER) { + dacs_to_copy.insert( + dacs_to_copy.end(), + {E_SVP, E_VTR, E_SVN, E_VTGSTV, E_RXB_RB, E_RXB_LB, E_VCN, E_VIS}); + // interpolate vrf, vcmp, vcp + dacs_to_interpolate.insert( + dacs_to_interpolate.end(), + {E_VRF, E_VCMP_LL, E_VCMP_LR, E_VCMP_RL, E_VCMP_RR, E_VCP, E_VRS}); + } else { + dacs_to_copy.insert(dacs_to_copy.end(), + {M_VCASSH, M_VRSHAPER, M_VRSHAPER_N, M_VIPRE_OUT, + M_VICIN, M_VCAS, M_VRPREAMP, M_VCAL_N, M_VIPRE, + M_VISHAPER, M_VCAL_P, M_VDCSH}); + // interpolate vtrim, vth1, vth2, vth3 + dacs_to_interpolate.insert(dacs_to_interpolate.end(), + {M_VTH1, M_VTH2, M_VTH3, M_VTRIM}); + } - // Copy other dacs - int dacs_to_copy[] = {E_SVP, E_VTR, E_SVN, E_VTGSTV, - E_RXB_RB, E_RXB_LB, E_VCN, E_VIS}; - int num_dacs_to_copy = sizeof(dacs_to_copy) / sizeof(dacs_to_copy[0]); - for (int i = 0; i < num_dacs_to_copy; ++i) { + // Copy Dacs + for (size_t i = 0; i < dacs_to_copy.size(); ++i) { if (a->dacs[dacs_to_copy[i]] != b->dacs[dacs_to_copy[i]]) { - throw RuntimeError("Interpolate module: dacs different"); + throw RuntimeError("Interpolate module: dacs " + std::to_string(i) + + " different"); } myMod.dacs[dacs_to_copy[i]] = a->dacs[dacs_to_copy[i]]; } - // Copy irrelevant dacs (without failing): CAL - if (a->dacs[E_CAL] != b->dacs[E_CAL]) { - LOG(logWARNING) << "DAC CAL differs in both energies (" - << a->dacs[E_CAL] << "," << b->dacs[E_CAL] - << ")!\nTaking first: " << a->dacs[E_CAL]; - } - myMod.dacs[E_CAL] = a->dacs[E_CAL]; - - // Interpolate vrf, vcmp, vcp - int dacs_to_interpolate[] = {E_VRF, E_VCMP_LL, E_VCMP_LR, E_VCMP_RL, - E_VCMP_RR, E_VCP, E_VRS}; - int num_dacs_to_interpolate = - sizeof(dacs_to_interpolate) / sizeof(dacs_to_interpolate[0]); - for (int i = 0; i < num_dacs_to_interpolate; ++i) { + // Interpolate Dacs + for (size_t i = 0; i < dacs_to_interpolate.size(); ++i) { myMod.dacs[dacs_to_interpolate[i]] = linearInterpolation(energy, e1, e2, a->dacs[dacs_to_interpolate[i]], b->dacs[dacs_to_interpolate[i]]); } + + // Copy irrelevant dacs (without failing) + if (shm()->myDetectorType == EIGER) { + // CAL + if (a->dacs[E_CAL] != b->dacs[E_CAL]) { + LOG(logWARNING) + << "DAC CAL differs in both energies (" << a->dacs[E_CAL] << "," + << b->dacs[E_CAL] << ")!\nTaking first: " << a->dacs[E_CAL]; + } + myMod.dacs[E_CAL] = a->dacs[E_CAL]; + } + // Interpolate all trimbits if (trimbits) { for (int i = 0; i < myMod.nchan; ++i) { @@ -3020,6 +3141,9 @@ std::string Module::getTrimbitFilename(detectorSettings s, int e_eV) { case STANDARD: ssettings = "/standard"; break; + case FAST: + ssettings = "/fast"; + break; case HIGHGAIN: ssettings = "/highgain"; break; @@ -3038,8 +3162,20 @@ std::string Module::getTrimbitFilename(detectorSettings s, int e_eV) { throw RuntimeError(ss.str()); } std::ostringstream ostfn; - ostfn << shm()->settingsDir << ssettings << "/" << e_eV << "eV" - << "/noise.sn" << std::setfill('0') << std::setw(3) << std::dec + ostfn << shm()->settingsDir << ssettings << "/" << e_eV << "eV"; + if (shm()->myDetectorType == EIGER) { + ostfn << "/noise.sn"; + } else if (shm()->myDetectorType == MYTHEN3) { + ostfn << "/trim.sn"; + } else { + throw RuntimeError( + "Settings or trimbit files not defined for this detector."); + } + int serialNumberWidth = 3; + if (shm()->myDetectorType == MYTHEN3) { + serialNumberWidth = 4; + } + ostfn << std::setfill('0') << std::setw(serialNumberWidth) << std::dec << getSerialNumber() << std::setbase(10); return ostfn.str(); } @@ -3066,6 +3202,11 @@ sls_detector_module Module::readSettingsFile(const std::string &fname, infile.read(reinterpret_cast(&myMod.iodelay), sizeof(myMod.iodelay)); infile.read(reinterpret_cast(&myMod.tau), sizeof(myMod.tau)); + for (int i = 0; i < myMod.ndac; ++i) { + LOG(logDEBUG1) << "dac " << i << ":" << myMod.dacs[i]; + } + LOG(logDEBUG1) << "iodelay:" << myMod.iodelay; + LOG(logDEBUG1) << "tau:" << myMod.tau; if (trimbits) { infile.read(reinterpret_cast(myMod.chanregs), sizeof(int) * (myMod.nchan)); @@ -3075,28 +3216,24 @@ sls_detector_module Module::readSettingsFile(const std::string &fname, "for settings for " + fname); } - for (int i = 0; i < myMod.ndac; ++i) { - LOG(logDEBUG1) << "dac " << i << ":" << myMod.dacs[i]; - } - LOG(logDEBUG1) << "iodelay:" << myMod.iodelay; - LOG(logDEBUG1) << "tau:" << myMod.tau; } // mythen3 (dacs, trimbits) else if (shm()->myDetectorType == MYTHEN3) { infile.read(reinterpret_cast(myMod.dacs), sizeof(int) * (myMod.ndac)); - infile.read(reinterpret_cast(myMod.chanregs), - sizeof(int) * (myMod.nchan)); - + for (int i = 0; i < myMod.ndac; ++i) { + LOG(logDEBUG) << "dac " << i << ":" << myMod.dacs[i]; + } + if (trimbits) { + infile.read(reinterpret_cast(myMod.chanregs), + sizeof(int) * (myMod.nchan)); + } if (!infile) { throw RuntimeError("readSettingsFile: Could not load all values " "for settings for " + fname); } - for (int i = 0; i < myMod.ndac; ++i) { - LOG(logDEBUG1) << "dac " << i << ":" << myMod.dacs[i]; - } } else { diff --git a/slsDetectorSoftware/src/Module.h b/slsDetectorSoftware/src/Module.h index 7e9abeb534..a1c52d0f78 100644 --- a/slsDetectorSoftware/src/Module.h +++ b/slsDetectorSoftware/src/Module.h @@ -1,6 +1,7 @@ #pragma once #include "SharedMemory.h" #include "sls/ClientSocket.h" +#include "sls/Pattern.h" #include "sls/StaticVector.h" #include "sls/logger.h" #include "sls/network_utils.h" @@ -100,9 +101,19 @@ class Module : public virtual slsDetectorDefs { void updateNumberOfDetector(slsDetectorDefs::xy det); detectorSettings getSettings() const; void setSettings(detectorSettings isettings); + int getThresholdEnergy() const; + std::array getAllThresholdEnergy() const; + void setThresholdEnergy(int e_eV, detectorSettings isettings, + bool trimbits); + void setAllThresholdEnergy(std::array e_eV, + detectorSettings isettings, bool trimbits); + std::string getSettingsDir() const; + std::string setSettingsDir(const std::string &dir); void loadSettingsFile(const std::string &fname); int getAllTrimbits() const; void setAllTrimbits(int val); + std::vector getTrimEn() const; + int setTrimEn(const std::vector &energies = {}); bool isVirtualDetectorServer() const; /************************************************** @@ -307,17 +318,10 @@ class Module : public virtual slsDetectorDefs { void setSubExptime(int64_t value); int64_t getSubDeadTime() const; void setSubDeadTime(int64_t value); - int getThresholdEnergy() const; - void setThresholdEnergy(int e_eV, detectorSettings isettings, - bool trimbits); - std::string getSettingsDir() const; - std::string setSettingsDir(const std::string &dir); bool getOverFlowMode() const; void setOverFlowMode(const bool enable); bool getFlippedDataX() const; void setFlippedDataX(bool value); - std::vector getTrimEn() const; - int setTrimEn(const std::vector &energies = {}); int64_t getRateCorrection() const; void setDefaultRateCorrection(); void setRateCorrection(int64_t t = 0); @@ -421,6 +425,7 @@ class Module : public virtual slsDetectorDefs { int64_t getGateDelay(int gateIndex) const; void setGateDelay(int gateIndex, int64_t value); std::array getGateDelayForAllGates() const; + bool isMaster() const; /************************************************** * * @@ -462,7 +467,9 @@ class Module : public virtual slsDetectorDefs { * Pattern * * * * ************************************************/ - void setPattern(const std::string &fname); + void setPattern(const Pattern &pat); + Pattern getPattern(); + void loadDefaultPattern(); uint64_t getPatternIOControl() const; void setPatternIOControl(uint64_t word); uint64_t getPatternWord(int addr) const; @@ -677,8 +684,6 @@ class Module : public virtual slsDetectorDefs { void updateReceiverStreamingIP(); void updateRateCorrection(); - void setThresholdEnergyAndSettings(int e_eV, detectorSettings isettings, - bool trimbits = true); /** Template function to do linear interpolation between two points (Eiger only) */ template diff --git a/slsDetectorSoftware/src/Pattern.cpp b/slsDetectorSoftware/src/Pattern.cpp new file mode 100644 index 0000000000..aade2548ca --- /dev/null +++ b/slsDetectorSoftware/src/Pattern.cpp @@ -0,0 +1,240 @@ +#include "sls/Pattern.h" +#include "sls/ToString.h" +#include "sls/logger.h" +#include +#include +#include + +namespace sls { + +Pattern::Pattern() = default; +Pattern::~Pattern() { delete pat; } + +Pattern::Pattern(const Pattern &other) { + memcpy(pat, other.pat, sizeof(patternParameters)); +} + +bool Pattern::operator==(const Pattern &other) const { + for (size_t i = 0; i < (sizeof(pat->word) / sizeof(pat->word[0])); ++i) { + if (pat->word[i] != other.pat->word[i]) + return false; + } + if (pat->ioctrl != other.pat->ioctrl) + return false; + + for (size_t i = 0; i < (sizeof(pat->limits) / sizeof(pat->limits[0])); + ++i) { + if (pat->limits[i] != other.pat->limits[i]) + return false; + } + for (size_t i = 0; i < (sizeof(pat->loop) / sizeof(pat->loop[0])); ++i) { + if (pat->loop[i] != other.pat->loop[i]) + return false; + } + for (size_t i = 0; i < (sizeof(pat->nloop) / sizeof(pat->nloop[0])); ++i) { + if (pat->nloop[i] != other.pat->nloop[i]) + return false; + } + for (size_t i = 0; i < (sizeof(pat->wait) / sizeof(pat->wait[0])); ++i) { + if (pat->wait[i] != other.pat->wait[i]) + return false; + } + for (size_t i = 0; i < (sizeof(pat->waittime) / sizeof(pat->waittime[0])); + ++i) { + if (pat->waittime[i] != other.pat->waittime[i]) + return false; + } + return true; +} + +bool Pattern::operator!=(const Pattern &other) const { + return !(*this == other); +} + +patternParameters *Pattern::data() { return pat; } +patternParameters *Pattern::data() const { return pat; } + +void Pattern::validate() const { + if (pat->limits[0] >= MAX_PATTERN_LENGTH || + pat->limits[1] >= MAX_PATTERN_LENGTH) { + throw RuntimeError("Invalid Pattern limits address [" + + ToString(pat->limits[0]) + std::string(", ") + + ToString(pat->limits[1]) + std::string("]")); + } + for (int i = 0; i != 3; ++i) { + if (pat->loop[i * 2 + 0] >= MAX_PATTERN_LENGTH || + pat->loop[i * 2 + 1] >= MAX_PATTERN_LENGTH) { + throw RuntimeError( + "Invalid Pattern loop address for level " + ToString(i) + + std::string(" [") + ToString(pat->loop[i * 2 + 0]) + + std::string(", ") + ToString(pat->loop[i * 2 + 1]) + + std::string("]")); + } + if (pat->wait[i] >= MAX_PATTERN_LENGTH) { + throw RuntimeError("Invalid Pattern wait address for level " + + ToString(i) + std::string(" ") + + ToString(pat->wait[i])); + } + } +} + +void Pattern::load(const std::string &fname) { + std::ifstream input_file(fname); + if (!input_file) { + throw RuntimeError("Could not open pattern file " + fname + + " for reading"); + } + for (std::string line; std::getline(input_file, line);) { + if (line.find('#') != std::string::npos) { + line.erase(line.find('#')); + } + LOG(logDEBUG1) << "line after removing comments:\n\t" << line; + if (line.length() > 1) { + + // convert command and string to a vector + std::istringstream iss(line); + auto it = std::istream_iterator(iss); + std::vector args = std::vector( + it, std::istream_iterator()); + + std::string cmd = args[0]; + int nargs = args.size() - 1; + + if (cmd == "patword") { + if (nargs != 2) { + throw RuntimeError("Invalid arguments for " + + ToString(args)); + } + uint32_t addr = StringTo(args[1]); + if (addr >= MAX_PATTERN_LENGTH) { + throw RuntimeError("Invalid address for " + ToString(args)); + } + pat->word[addr] = StringTo(args[2]); + } else if (cmd == "patioctrl") { + if (nargs != 1) { + throw RuntimeError("Invalid arguments for " + + ToString(args)); + } + pat->ioctrl = StringTo(args[1]); + } else if (cmd == "patlimits") { + if (nargs != 2) { + throw RuntimeError("Invalid arguments for " + + ToString(args)); + } + pat->limits[0] = StringTo(args[1]); + pat->limits[1] = StringTo(args[2]); + } else if (cmd == "patloop0" || cmd == "patloop1" || + cmd == "patloop2") { + if (nargs != 2) { + throw RuntimeError("Invalid arguments for " + + ToString(args)); + } + int level = cmd[cmd.find_first_of("012")] - '0'; + int loop1 = StringTo(args[1]); + int loop2 = StringTo(args[2]); + pat->loop[level * 2 + 0] = loop1; + pat->loop[level * 2 + 1] = loop2; + } else if (cmd == "patnloop0" || cmd == "patnloop1" || + cmd == "patnloop2") { + if (nargs != 1) { + throw RuntimeError("Invalid arguments for " + + ToString(args)); + } + int level = cmd[cmd.find_first_of("012")] - '0'; + pat->nloop[level] = StringTo(args[1]); + } else if (cmd == "patwait0" || cmd == "patwait1" || + cmd == "patwait2") { + if (nargs != 1) { + throw RuntimeError("Invalid arguments for " + + ToString(args)); + } + int level = cmd[cmd.find_first_of("012")] - '0'; + pat->wait[level] = StringTo(args[1]); + } else if (cmd == "patwaittime0" || cmd == "patwaittime1" || + cmd == "patwaittime2") { + if (nargs != 1) { + throw RuntimeError("Invalid arguments for " + + ToString(args)); + } + int level = cmd[cmd.find_first_of("012")] - '0'; + pat->waittime[level] = StringTo(args[1]); + } else { + throw RuntimeError("Unknown command in pattern file " + cmd); + } + } + } +} + +void Pattern::save(const std::string &fname) { + std::ofstream output_file(fname); + if (!output_file) { + throw RuntimeError("Could not open pattern file " + fname + + " for writing"); + } + std::ostringstream os; + // pattern word + for (uint32_t i = pat->limits[0]; i <= pat->limits[1]; ++i) { + output_file << "patword " << ToStringHex(i, 4) << " " + << ToStringHex(pat->word[i], 16) << std::endl; + } + + // patioctrl + output_file << "patioctrl " << ToStringHex(pat->ioctrl, 16) << std::endl; + + // patlimits + output_file << "patlimits " << ToStringHex(pat->limits[0], 4) << " " + << ToStringHex(pat->limits[1], 4) << std::endl; + + for (size_t i = 0; i < 3; ++i) { + // patloop + output_file << "patloop" << i << " " + << ToStringHex(pat->loop[i * 2 + 0], 4) << " " + << ToStringHex(pat->loop[i * 2 + 1], 4) << std::endl; + // patnloop + output_file << "patnloop" << i << " " << pat->nloop[i] << std::endl; + } + + for (size_t i = 0; i < 3; ++i) { + // patwait + output_file << "patwait" << i << " " << ToStringHex(pat->wait[i], 4) + << std::endl; + // patwaittime + output_file << "patwaittime" << i << " " << pat->waittime[i] + << std::endl; + } +} + +std::string Pattern::str() const { + std::ostringstream oss; + oss << '[' << std::setfill('0') << std::endl; + int addr_width = 4; + int word_width = 16; + for (int i = 0; i < MAX_PATTERN_LENGTH; ++i) { + if (pat->word[i] != 0) { + oss << "patword " << ToStringHex(i, addr_width) << " " + << ToStringHex(pat->word[i], word_width) << std::endl; + } + } + oss << "patioctrl " << ToStringHex(pat->ioctrl, word_width) << std::endl + << "patlimits " << ToStringHex(pat->limits[0], addr_width) << " " + << ToStringHex(pat->limits[1], addr_width) << std::endl + << "patloop0 " << ToStringHex(pat->loop[0], addr_width) << " " + << ToStringHex(pat->loop[1], addr_width) << std::endl + << "patnloop0 " << pat->nloop[0] << std::endl + << "patloop1 " << ToStringHex(pat->loop[2], addr_width) << " " + << ToStringHex(pat->loop[3], addr_width) << std::endl + << "patnloop1 " << pat->nloop[1] << std::endl + << "patloop2 " << ToStringHex(pat->loop[4], addr_width) << " " + << ToStringHex(pat->loop[5], addr_width) << std::endl + << "patnloop2 " << pat->nloop[2] << std::endl + << "patwait0 " << ToStringHex(pat->wait[0], addr_width) << std::endl + << "patwaittime0 " << pat->waittime[0] << std::endl + << "patwait1 " << ToStringHex(pat->wait[1], addr_width) << std::endl + << "patwaittime1 " << pat->waittime[1] << std::endl + << "patwait2 " << ToStringHex(pat->wait[2], addr_width) << std::endl + << "patwaittime2 " << pat->waittime[2] << std::endl + << ']'; + return oss.str(); +} + +} // namespace sls \ No newline at end of file diff --git a/slsDetectorSoftware/tests/CMakeLists.txt b/slsDetectorSoftware/tests/CMakeLists.txt index 3d48b65a7b..a17ec4a027 100755 --- a/slsDetectorSoftware/tests/CMakeLists.txt +++ b/slsDetectorSoftware/tests/CMakeLists.txt @@ -15,6 +15,7 @@ target_sources(tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/test-Result.cpp ${CMAKE_CURRENT_SOURCE_DIR}/test-CmdParser.cpp ${CMAKE_CURRENT_SOURCE_DIR}/test-Module.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/test-Pattern.cpp ) target_include_directories(tests PUBLIC "$") \ No newline at end of file diff --git a/slsDetectorSoftware/tests/test-CmdProxy-eiger.cpp b/slsDetectorSoftware/tests/test-CmdProxy-eiger.cpp index da96095e42..0249b64605 100644 --- a/slsDetectorSoftware/tests/test-CmdProxy-eiger.cpp +++ b/slsDetectorSoftware/tests/test-CmdProxy-eiger.cpp @@ -319,80 +319,6 @@ TEST_CASE("subdeadtime", "[.cmd]") { } } -TEST_CASE("threshold", "[.cmd]") { - Detector det; - CmdProxy proxy(&det); - - auto det_type = det.getDetectorType().squash(); - if (det_type == defs::EIGER) { - auto prev_threshold = det.getThresholdEnergy(); - auto prev_energies = - det.getTrimEnergies().tsquash("inconsistent trim energies to test"); - if (!prev_energies.empty()) { - std::ostringstream oss1, oss2; - proxy.Call("threshold", {"4500", "standard"}, -1, PUT, oss1); - REQUIRE(oss1.str() == "threshold [4500, standard]\n"); - proxy.Call("threshold", {}, -1, GET, oss2); - REQUIRE(oss2.str() == "threshold 4500\n"); - det.setTrimEnergies(prev_energies); - for (int i = 0; i != det.size(); ++i) { - if (prev_threshold[i] >= 0) { - det.setThresholdEnergy(prev_threshold[i], defs::STANDARD, - true, {i}); - } - } - } - REQUIRE_NOTHROW(proxy.Call("threshold", {}, -1, GET)); - } else { - REQUIRE_THROWS(proxy.Call("threshold", {}, -1, GET)); - } -} - -TEST_CASE("thresholdnotb", "[.cmd]") { - Detector det; - CmdProxy proxy(&det); - - auto det_type = det.getDetectorType().squash(); - if (det_type == defs::EIGER) { - auto prev_threshold = det.getThresholdEnergy(); - auto prev_energies = - det.getTrimEnergies().tsquash("inconsistent trim energies to test"); - if (!prev_energies.empty()) { - std::ostringstream oss1, oss2; - proxy.Call("thresholdnotb", {"4500 standard"}, -1, PUT, oss1); - REQUIRE(oss1.str() == "thresholdnotb [4500 standard]\n"); - proxy.Call("threshold", {}, -1, GET, oss2); - REQUIRE(oss2.str() == "threshold 4500\n"); - det.setTrimEnergies(prev_energies); - for (int i = 0; i != det.size(); ++i) { - if (prev_threshold[i] >= 0) { - det.setThresholdEnergy(prev_threshold[i], defs::STANDARD, - false, {i}); - } - } - } - REQUIRE_NOTHROW(proxy.Call("threshold", {}, -1, GET)); - } else { - REQUIRE_THROWS(proxy.Call("thresholdnotb", {}, -1, GET)); - } -} - -TEST_CASE("settingspath", "[.cmd]") { - Detector det; - CmdProxy proxy(&det); - auto prev_val = det.getSettingsPath(); - { - std::ostringstream oss1, oss2; - proxy.Call("settingspath", {"/tmp"}, -1, PUT, oss1); - REQUIRE(oss1.str() == "settingspath /tmp\n"); - proxy.Call("settingspath", {}, -1, GET, oss2); - REQUIRE(oss2.str() == "settingspath /tmp\n"); - } - for (int i = 0; i != det.size(); ++i) { - det.setSettingsPath(prev_val[i], {i}); - } -} - TEST_CASE("overflow", "[.cmd]") { Detector det; CmdProxy proxy(&det); @@ -435,27 +361,6 @@ TEST_CASE("flippeddatax", "[.cmd]") { } } -TEST_CASE("trimen", "[.cmd][.this]") { - Detector det; - CmdProxy proxy(&det); - auto det_type = det.getDetectorType().squash(); - if (det_type == defs::EIGER) { - auto previous = det.getTrimEnergies(); - std::ostringstream oss1, oss2; - proxy.Call("trimen", {"4500", "5400", "6400"}, -1, PUT, oss1); - REQUIRE(oss1.str() == "trimen [4500, 5400, 6400]\n"); - proxy.Call("trimen", {}, -1, GET, oss2); - REQUIRE(oss2.str() == "trimen [4500, 5400, 6400]\n"); - - for (int i = 0; i != det.size(); ++i) { - det.setTrimEnergies(previous[i], {i}); - } - } else { - REQUIRE_THROWS(proxy.Call("trimen", {"4500", "5400", "6400"}, -1, PUT)); - REQUIRE_THROWS(proxy.Call("trimen", {}, -1, GET)); - } -} - TEST_CASE("ratecorr", "[.cmd]") { Detector det; CmdProxy proxy(&det); diff --git a/slsDetectorSoftware/tests/test-CmdProxy-pattern.cpp b/slsDetectorSoftware/tests/test-CmdProxy-pattern.cpp index 7e504711cd..1f7d4db45b 100644 --- a/slsDetectorSoftware/tests/test-CmdProxy-pattern.cpp +++ b/slsDetectorSoftware/tests/test-CmdProxy-pattern.cpp @@ -46,6 +46,19 @@ TEST_CASE("savepattern", "[.cmd]") { } } +TEST_CASE("defaultpattern", "[.cmd]") { + Detector det; + CmdProxy proxy(&det); + auto det_type = det.getDetectorType().squash(); + if (det_type == defs::MOENCH || det_type == defs::MYTHEN3) { + REQUIRE_THROWS(proxy.Call("defaultpattern", {}, -1, GET)); + REQUIRE_NOTHROW(proxy.Call("defaultpattern", {}, -1, PUT)); + } else { + REQUIRE_THROWS(proxy.Call("defaultpattern", {}, -1, GET)); + REQUIRE_NOTHROW(proxy.Call("defaultpattern", {}, -1, PUT)); + } +} + TEST_CASE("patioctrl", "[.cmd]") { Detector det; CmdProxy proxy(&det); diff --git a/slsDetectorSoftware/tests/test-CmdProxy.cpp b/slsDetectorSoftware/tests/test-CmdProxy.cpp index 2f3b9a8c5b..a28fedde2b 100644 --- a/slsDetectorSoftware/tests/test-CmdProxy.cpp +++ b/slsDetectorSoftware/tests/test-CmdProxy.cpp @@ -130,7 +130,7 @@ TEST_CASE("settingslist", "[.cmd]") { Detector det; CmdProxy proxy(&det); auto det_type = det.getDetectorType().squash(); - if (det_type == defs::CHIPTESTBOARD || det_type == defs::MYTHEN3) { + if (det_type == defs::CHIPTESTBOARD) { REQUIRE_THROWS(proxy.Call("settingslist", {}, -1, GET)); } else { REQUIRE_NOTHROW(proxy.Call("settingslist", {}, -1, GET)); @@ -174,6 +174,11 @@ TEST_CASE("settings", "[.cmd]") { sett.push_back("g4_hg"); sett.push_back("g4_lg"); break; + case defs::MYTHEN3: + sett.push_back("standard"); + sett.push_back("fast"); + sett.push_back("highgain"); + break; default: if (det_type == defs::EIGER) { // FIXME: need to remove when settings removed @@ -206,6 +211,181 @@ TEST_CASE("settings", "[.cmd]") { } } +TEST_CASE("threshold", "[.cmd]") { + Detector det; + CmdProxy proxy(&det); + + auto det_type = det.getDetectorType().squash(); + if (det_type == defs::EIGER) { + auto prev_threshold = det.getThresholdEnergy(); + auto prev_energies = + det.getTrimEnergies().tsquash("inconsistent trim energies to test"); + if (!prev_energies.empty()) { + std::string senergy = std::to_string(prev_energies[0]); + std::ostringstream oss1, oss2; + proxy.Call("threshold", {senergy, "standard"}, -1, PUT, oss1); + REQUIRE(oss1.str() == "threshold [" + senergy + ", standard]\n"); + proxy.Call("threshold", {}, -1, GET, oss2); + REQUIRE(oss2.str() == "threshold " + senergy + "\n"); + + REQUIRE_THROWS(proxy.Call( + "threshold", {senergy, senergy, senergy, "standard"}, -1, PUT)); + REQUIRE_THROWS( + proxy.Call("threshold", {senergy, "undefined"}, -1, PUT)); + + det.setTrimEnergies(prev_energies); + for (int i = 0; i != det.size(); ++i) { + if (prev_threshold[i] >= 0) { + det.setThresholdEnergy(prev_threshold[i], defs::STANDARD, + true, {i}); + } + } + } + REQUIRE_NOTHROW(proxy.Call("threshold", {}, -1, GET)); + } else if (det_type == defs::MYTHEN3) { + auto prev_threshold = det.getAllThresholdEnergy(); + auto prev_settings = + det.getSettings().tsquash("inconsistent settings to test"); + auto prev_energies = + det.getTrimEnergies().tsquash("inconsistent trim energies to test"); + if (!prev_energies.empty()) { + std::string senergy = std::to_string(prev_energies[0]); + std::ostringstream oss1, oss2; + proxy.Call("threshold", {senergy, "standard"}, -1, PUT, oss1); + REQUIRE(oss1.str() == "threshold [" + senergy + ", standard]\n"); + proxy.Call("threshold", {}, -1, GET, oss2); + REQUIRE(oss2.str() == "threshold [" + senergy + ", " + senergy + + ", " + senergy + "]\n"); + std::string senergy2 = std::to_string(prev_energies[1]); + std::string senergy3 = std::to_string(prev_energies[2]); + std::ostringstream oss3, oss4; + proxy.Call("threshold", {senergy, senergy2, senergy3, "standard"}, + -1, PUT, oss3); + REQUIRE(oss3.str() == "threshold [" + senergy + ", " + senergy2 + + ", " + senergy3 + ", standard]\n"); + proxy.Call("threshold", {}, -1, GET, oss4); + REQUIRE(oss4.str() == "threshold [" + senergy + ", " + senergy2 + + ", " + senergy3 + "]\n"); + + REQUIRE_THROWS(proxy.Call("threshold", + {senergy, senergy, "standard"}, -1, PUT)); + REQUIRE_THROWS( + proxy.Call("threshold", {senergy, "undefined"}, -1, PUT)); + REQUIRE_NOTHROW(proxy.Call("threshold", {senergy}, -1, PUT)); + REQUIRE_NOTHROW(proxy.Call("threshold", + {senergy, senergy2, senergy3}, -1, PUT)); + det.setTrimEnergies(prev_energies); + for (int i = 0; i != det.size(); ++i) { + if (prev_threshold[i][0] >= 0) { + std::cout + << "prev cvalues:" << sls::ToString(prev_threshold[i]) + << std::endl; + det.setThresholdEnergy(prev_threshold[i], prev_settings, + true, {i}); + } + } + } + REQUIRE_NOTHROW(proxy.Call("threshold", {}, -1, GET)); + } else { + REQUIRE_THROWS(proxy.Call("threshold", {}, -1, GET)); + } +} + +TEST_CASE("thresholdnotb", "[.cmd]") { + Detector det; + CmdProxy proxy(&det); + + auto det_type = det.getDetectorType().squash(); + if (det_type == defs::EIGER) { + auto prev_threshold = det.getThresholdEnergy(); + auto prev_energies = + det.getTrimEnergies().tsquash("inconsistent trim energies to test"); + if (!prev_energies.empty()) { + std::string senergy = std::to_string(prev_energies[0]); + std::ostringstream oss1, oss2; + proxy.Call("thresholdnotb", {senergy, "standard"}, -1, PUT, oss1); + REQUIRE(oss1.str() == "threshold [" + senergy + ", standard]\n"); + proxy.Call("threshold", {}, -1, GET, oss2); + REQUIRE(oss2.str() == "threshold " + senergy + "\n"); + REQUIRE_THROWS(proxy.Call("thresholdnotb", + {senergy, senergy, senergy, "standard"}, + -1, PUT)); + REQUIRE_THROWS( + proxy.Call("thresholdnotb", {senergy, "undefined"}, -1, PUT)); + det.setTrimEnergies(prev_energies); + for (int i = 0; i != det.size(); ++i) { + if (prev_threshold[i] >= 0) { + det.setThresholdEnergy(prev_threshold[i], defs::STANDARD, + false, {i}); + } + } + } + REQUIRE_NOTHROW(proxy.Call("threshold", {}, -1, GET)); + } else if (det_type == defs::MYTHEN3) { + auto prev_threshold = det.getAllThresholdEnergy(); + auto prev_settings = + det.getSettings().tsquash("inconsistent settings to test"); + auto prev_energies = + det.getTrimEnergies().tsquash("inconsistent trim energies to test"); + if (!prev_energies.empty()) { + std::string senergy = std::to_string(prev_energies[0]); + std::ostringstream oss1, oss2; + proxy.Call("thresholdnotb", {senergy, "standard"}, -1, PUT, oss1); + REQUIRE(oss1.str() == + "thresholdnotb [" + senergy + ", standard]\n"); + proxy.Call("threshold", {}, -1, GET, oss2); + REQUIRE(oss2.str() == "threshold [" + senergy + ", " + senergy + + ", " + senergy + "]\n"); + std::string senergy2 = std::to_string(prev_energies[1]); + std::string senergy3 = std::to_string(prev_energies[2]); + std::ostringstream oss3, oss4; + proxy.Call("thresholdnotb", + {senergy, senergy2, senergy3, "standard"}, -1, PUT, + oss3); + REQUIRE(oss3.str() == "thresholdnotb [" + senergy + ", " + + senergy2 + ", " + senergy3 + + ", standard]\n"); + proxy.Call("threshold", {}, -1, GET, oss4); + REQUIRE(oss4.str() == "threshold [" + senergy + ", " + senergy2 + + ", " + senergy3 + "]\n"); + + REQUIRE_THROWS(proxy.Call("thresholdnotb", + {senergy, senergy, "standard"}, -1, PUT)); + REQUIRE_THROWS( + proxy.Call("thresholdnotb", {senergy, "undefined"}, -1, PUT)); + REQUIRE_NOTHROW(proxy.Call("thresholdnotb", {senergy}, -1, PUT)); + REQUIRE_NOTHROW(proxy.Call("thresholdnotb", + {senergy, senergy2, senergy3}, -1, PUT)); + det.setTrimEnergies(prev_energies); + for (int i = 0; i != det.size(); ++i) { + if (prev_threshold[i][0] >= 0) { + det.setThresholdEnergy(prev_threshold[i], prev_settings, + true, {i}); + } + } + } + REQUIRE_NOTHROW(proxy.Call("threshold", {}, -1, GET)); + } else { + REQUIRE_THROWS(proxy.Call("thresholdnotb", {}, -1, GET)); + } +} + +TEST_CASE("settingspath", "[.cmd]") { + Detector det; + CmdProxy proxy(&det); + auto prev_val = det.getSettingsPath(); + { + std::ostringstream oss1, oss2; + proxy.Call("settingspath", {"/tmp"}, -1, PUT, oss1); + REQUIRE(oss1.str() == "settingspath /tmp\n"); + proxy.Call("settingspath", {}, -1, GET, oss2); + REQUIRE(oss2.str() == "settingspath /tmp\n"); + } + for (int i = 0; i != det.size(); ++i) { + det.setSettingsPath(prev_val[i], {i}); + } +} + TEST_CASE("trimbits", "[.cmd]") { Detector det; CmdProxy proxy(&det); @@ -246,6 +426,65 @@ TEST_CASE("trimval", "[.cmd]") { } } +TEST_CASE("trimen", "[.cmd][.this]") { + Detector det; + CmdProxy proxy(&det); + auto det_type = det.getDetectorType().squash(); + if (det_type == defs::EIGER || det_type == defs::MYTHEN3) { + auto previous = det.getTrimEnergies(); + std::ostringstream oss1, oss2; + proxy.Call("trimen", {"4500", "5400", "6400"}, -1, PUT, oss1); + REQUIRE(oss1.str() == "trimen [4500, 5400, 6400]\n"); + proxy.Call("trimen", {}, -1, GET, oss2); + REQUIRE(oss2.str() == "trimen [4500, 5400, 6400]\n"); + + for (int i = 0; i != det.size(); ++i) { + det.setTrimEnergies(previous[i], {i}); + } + } else { + REQUIRE_THROWS(proxy.Call("trimen", {"4500", "5400", "6400"}, -1, PUT)); + REQUIRE_THROWS(proxy.Call("trimen", {}, -1, GET)); + } +} + +TEST_CASE("gappixels", "[.cmd]") { + Detector det; + CmdProxy proxy(&det); + auto det_type = det.getDetectorType().squash(); + + if (det_type == defs::JUNGFRAU || det_type == defs::EIGER) { + auto prev_val = det.getGapPixelsinCallback(); + { + std::ostringstream oss; + proxy.Call("gappixels", {"1"}, -1, PUT, oss); + REQUIRE(oss.str() == "gappixels 1\n"); + } + { + std::ostringstream oss; + proxy.Call("gappixels", {"0"}, -1, PUT, oss); + REQUIRE(oss.str() == "gappixels 0\n"); + } + { + std::ostringstream oss; + proxy.Call("gappixels", {}, -1, GET, oss); + REQUIRE(oss.str() == "gappixels 0\n"); + } + det.setGapPixelsinCallback(prev_val); + } else { + { + std::ostringstream oss; + proxy.Call("gappixels", {}, -1, GET, oss); + REQUIRE(oss.str() == "gappixels 0\n"); + } + { + std::ostringstream oss; + proxy.Call("gappixels", {"0"}, -1, PUT, oss); + REQUIRE(oss.str() == "gappixels 0\n"); + } + REQUIRE_THROWS(proxy.Call("gappixels", {"1"}, -1, PUT)); + } +} + /* acquisition parameters */ // acquire: not testing @@ -1510,44 +1749,6 @@ TEST_CASE("scanerrmsg", "[.cmd]") { REQUIRE_THROWS(proxy.Call("scanerrmsg", {""}, -1, PUT)); } -TEST_CASE("gappixels", "[.cmd]") { - Detector det; - CmdProxy proxy(&det); - auto det_type = det.getDetectorType().squash(); - - if (det_type == defs::JUNGFRAU || det_type == defs::EIGER) { - auto prev_val = det.getGapPixelsinCallback(); - { - std::ostringstream oss; - proxy.Call("gappixels", {"1"}, -1, PUT, oss); - REQUIRE(oss.str() == "gappixels 1\n"); - } - { - std::ostringstream oss; - proxy.Call("gappixels", {"0"}, -1, PUT, oss); - REQUIRE(oss.str() == "gappixels 0\n"); - } - { - std::ostringstream oss; - proxy.Call("gappixels", {}, -1, GET, oss); - REQUIRE(oss.str() == "gappixels 0\n"); - } - det.setGapPixelsinCallback(prev_val); - } else { - { - std::ostringstream oss; - proxy.Call("gappixels", {}, -1, GET, oss); - REQUIRE(oss.str() == "gappixels 0\n"); - } - { - std::ostringstream oss; - proxy.Call("gappixels", {"0"}, -1, PUT, oss); - REQUIRE(oss.str() == "gappixels 0\n"); - } - REQUIRE_THROWS(proxy.Call("gappixels", {"1"}, -1, PUT)); - } -} - /* Network Configuration (Detector<->Receiver) */ TEST_CASE("numinterfaces", "[.cmd]") { diff --git a/slsDetectorSoftware/tests/test-Pattern.cpp b/slsDetectorSoftware/tests/test-Pattern.cpp new file mode 100644 index 0000000000..28fb21056d --- /dev/null +++ b/slsDetectorSoftware/tests/test-Pattern.cpp @@ -0,0 +1,31 @@ +#include "catch.hpp" +#include "sls/Pattern.h" + +using sls::Pattern; + +TEST_CASE("Pattern is default constructable and has zeroed fields"){ + Pattern p; + for (int i = 0; i!=MAX_PATTERN_LENGTH; ++i) + REQUIRE(p.data()->word[i] == 0); + REQUIRE(p.data()->ioctrl == 0); +} + +TEST_CASE("Copy construct pattern"){ + Pattern p; + p.data()->loop[0] = 7; + Pattern p1(p); + REQUIRE(p1.data()->loop[0] == 7); +} + +TEST_CASE("Compare patterns"){ + Pattern p; + Pattern p1; + REQUIRE(p == p1); + + p1.data()->word[500] = 1; + REQUIRE_FALSE(p == p1); +} + + + + diff --git a/slsReceiverSoftware/src/ClientInterface.cpp b/slsReceiverSoftware/src/ClientInterface.cpp index 5dfe2f2083..8f644000e7 100644 --- a/slsReceiverSoftware/src/ClientInterface.cpp +++ b/slsReceiverSoftware/src/ClientInterface.cpp @@ -208,6 +208,7 @@ int ClientInterface::functionTable(){ flist[F_RECEIVER_SET_THRESHOLD] = &ClientInterface::set_threshold; flist[F_GET_RECEIVER_STREAMING_HWM] = &ClientInterface::get_streaming_hwm; flist[F_SET_RECEIVER_STREAMING_HWM] = &ClientInterface::set_streaming_hwm; + flist[F_RECEIVER_SET_ALL_THRESHOLD] = &ClientInterface::set_all_threshold; for (int i = NUM_DET_FUNCTIONS + 1; i < NUM_REC_FUNCTIONS ; i++) { LOG(logDEBUG1) << "function fnum: " << i << " (" << @@ -408,7 +409,14 @@ int ClientInterface::setup_receiver(Interface &socket) { " due to fifo strucutre memory allocation"); } impl()->setReadNLines(arg.numLinesReadout); - impl()->setThresholdEnergy(arg.thresholdEnergyeV); + impl()->setThresholdEnergy(arg.thresholdEnergyeV[0]); + } + if (myDetectorType == MYTHEN3) { + std::array val; + for (int i = 0; i < 3; ++i) { + val[i] = arg.thresholdEnergyeV[i]; + } + impl()->setThresholdEnergy(val); } if (myDetectorType == EIGER || myDetectorType == MYTHEN3) { try { @@ -1677,3 +1685,13 @@ int ClientInterface::set_streaming_hwm(Interface &socket) { impl()->setStreamingHwm(limit); return socket.Send(OK); } + +int ClientInterface::set_all_threshold(Interface &socket) { + auto eVs = socket.Receive>(); + LOG(logDEBUG) << "Threshold:" << sls::ToString(eVs); + if (myDetectorType != MYTHEN3) + functionNotImplemented(); + verifyIdle(socket); + impl()->setThresholdEnergy(eVs); + return socket.Send(OK); +} diff --git a/slsReceiverSoftware/src/ClientInterface.h b/slsReceiverSoftware/src/ClientInterface.h index e9bd2cc2f5..fa3d3b683a 100644 --- a/slsReceiverSoftware/src/ClientInterface.h +++ b/slsReceiverSoftware/src/ClientInterface.h @@ -161,6 +161,7 @@ class ClientInterface : private virtual slsDetectorDefs { int set_threshold(sls::ServerInterface &socket); int get_streaming_hwm(sls::ServerInterface &socket); int set_streaming_hwm(sls::ServerInterface &socket); + int set_all_threshold(sls::ServerInterface &socket); Implementation *impl() { if (receiver != nullptr) { diff --git a/slsReceiverSoftware/src/Implementation.cpp b/slsReceiverSoftware/src/Implementation.cpp index 3c00add2e2..daa5c14f32 100644 --- a/slsReceiverSoftware/src/Implementation.cpp +++ b/slsReceiverSoftware/src/Implementation.cpp @@ -121,6 +121,9 @@ void Implementation::setDetectorType(const detectorType d) { std::to_string(static_cast(d))); } + delete generalData; + generalData = nullptr; + // set detector specific variables switch (myDetectorType) { case GOTTHARD: @@ -755,6 +758,7 @@ void Implementation::SetupWriter() { masterAttributes->dynamicRange = dynamicRange; masterAttributes->tenGiga = tengigaEnable; masterAttributes->thresholdEnergyeV = thresholdEnergyeV; + masterAttributes->thresholdAllEnergyeV = thresholdAllEnergyeV; masterAttributes->subExptime = subExpTime; masterAttributes->subPeriod = subPeriod; masterAttributes->quad = quadEnable; @@ -1530,6 +1534,12 @@ void Implementation::setThresholdEnergy(const int value) { LOG(logINFO) << "Threshold Energy: " << thresholdEnergyeV << " eV"; } +void Implementation::setThresholdEnergy(const std::array value) { + thresholdAllEnergyeV = value; + LOG(logINFO) << "Threshold Energy (eV): " + << sls::ToString(thresholdAllEnergyeV); +} + void Implementation::setRateCorrections(const std::vector &t) { rateCorrections = t; LOG(logINFO) << "Rate Corrections: " << sls::ToString(rateCorrections); diff --git a/slsReceiverSoftware/src/Implementation.h b/slsReceiverSoftware/src/Implementation.h index f5dbb838b1..1a82e1c039 100644 --- a/slsReceiverSoftware/src/Implementation.h +++ b/slsReceiverSoftware/src/Implementation.h @@ -219,6 +219,7 @@ class Implementation : private virtual slsDetectorDefs { void setReadNLines(const int value); /** [Eiger] */ void setThresholdEnergy(const int value); + void setThresholdEnergy(const std::array value); /* [Eiger] */ void setRateCorrections(const std::vector &t); readoutMode getReadoutMode() const; @@ -348,6 +349,7 @@ class Implementation : private virtual slsDetectorDefs { bool deactivatedPaddingEnable{true}; int numLinesReadout{MAX_EIGER_ROWS_PER_READOUT}; int thresholdEnergyeV{-1}; + std::array thresholdAllEnergyeV={{-1, -1, -1}}; std::vector rateCorrections; readoutMode readoutType{ANALOG_ONLY}; uint32_t adcEnableMaskOneGiga{BIT32_MASK}; @@ -368,7 +370,7 @@ class Implementation : private virtual slsDetectorDefs { void *pRawDataReady{nullptr}; // class objects - GeneralData *generalData; + GeneralData *generalData{nullptr}; std::vector> listener; std::vector> dataProcessor; std::vector> dataStreamer; diff --git a/slsReceiverSoftware/src/MasterAttributes.h b/slsReceiverSoftware/src/MasterAttributes.h index 76f5c4ded1..2444f2318d 100644 --- a/slsReceiverSoftware/src/MasterAttributes.h +++ b/slsReceiverSoftware/src/MasterAttributes.h @@ -36,6 +36,7 @@ struct MasterAttributes { uint32_t dynamicRange{0}; uint32_t tenGiga{0}; int thresholdEnergyeV{0}; + std::array thresholdAllEnergyeV={{0, 0, 0}}; ns subExptime{0}; ns subPeriod{0}; uint32_t quad{0}; @@ -353,6 +354,7 @@ class EigerMasterAttributes : public MasterAttributes { << "Ten Giga : " << tenGiga << '\n' << "Exptime : " << sls::ToString(exptime) << '\n' << "Period : " << sls::ToString(period) << '\n' + << "Threshold Energy : " << thresholdEnergyeV << '\n' << "SubExptime : " << sls::ToString(subExptime) << '\n' << "SubPeriod : " << sls::ToString(subPeriod) @@ -450,7 +452,9 @@ class Mythen3MasterAttributes : public MasterAttributes { << '\n' << "GateDelay3 : " << sls::ToString(gateDelay3) << '\n' - << "Gates : " << gates << '\n'; + << "Gates : " << gates << '\n' + << "Threshold Energies : " + << sls::ToString(thresholdAllEnergyeV) << '\n'; std::string message = oss.str(); MasterAttributes::WriteBinaryAttributes(fd, message); }; @@ -523,6 +527,14 @@ class Mythen3MasterAttributes : public MasterAttributes { group->createDataSet("Gates", PredType::STD_U32LE, dataspace); dataset.write(&gates, PredType::STD_U32LE); } + // Threshold Energies + { + DataSpace dataspace = DataSpace(H5S_SCALAR); + StrType strdatatype(PredType::C_S1, 1024); + DataSet dataset = group->createDataSet("Threshold Energies", + strdatatype, dataspace); + dataset.write(sls::ToString(thresholdAllEnergyeV), strdatatype); + } }; #endif }; @@ -679,4 +691,4 @@ class CtbMasterAttributes : public MasterAttributes { } }; #endif -}; \ No newline at end of file +}; diff --git a/slsSupportLib/CMakeLists.txt b/slsSupportLib/CMakeLists.txt index 4ea86add57..421c9041d1 100755 --- a/slsSupportLib/CMakeLists.txt +++ b/slsSupportLib/CMakeLists.txt @@ -56,14 +56,12 @@ target_include_directories(slsSupportObject PUBLIC "$" "$" - PRIVATE - ${ZeroMQ_INCLUDE_DIRS} ) target_link_libraries(slsSupportObject PUBLIC slsProjectOptions - ${ZeroMQ_LIBRARIES} + libzmq rapidjson PRIVATE slsProjectWarnings @@ -75,7 +73,6 @@ endif(SLS_USE_TESTS) # Add shared library version of the support lib add_library(slsSupportShared SHARED $) - target_link_libraries(slsSupportShared PUBLIC slsSupportObject) set_target_properties(slsSupportShared PROPERTIES @@ -107,3 +104,4 @@ install(TARGETS slsSupportShared slsSupportStatic slsSupportObject PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sls ) + diff --git a/slsSupportLib/include/sls/StaticVector.h b/slsSupportLib/include/sls/StaticVector.h index a9cd0f3cae..06b552e2bf 100644 --- a/slsSupportLib/include/sls/StaticVector.h +++ b/slsSupportLib/include/sls/StaticVector.h @@ -100,6 +100,12 @@ template class StaticVector { constexpr const T &front() const noexcept { return data_.front(); } constexpr const T &back() const noexcept { return data_[current_size - 1]; } + bool anyEqualTo(const T value) { + return std::any_of( + data_.cbegin(), data_.cend(), + [value](const T &element) { return element == value; }); + } + // iterators iterator begin() noexcept { return data_.begin(); } // auto begin() noexcept -> decltype(data_.begin()) { return data_.begin(); diff --git a/slsSupportLib/include/sls/ToString.h b/slsSupportLib/include/sls/ToString.h index bccf85e2ea..1d13d849a7 100644 --- a/slsSupportLib/include/sls/ToString.h +++ b/slsSupportLib/include/sls/ToString.h @@ -44,9 +44,6 @@ std::ostream &operator<<(std::ostream &os, const slsDetectorDefs::ROI &roi); std::string ToString(const slsDetectorDefs::rxParameters &r); std::ostream &operator<<(std::ostream &os, const slsDetectorDefs::rxParameters &r); -std::string ToString(const slsDetectorDefs::patternParameters &r); -std::ostream &operator<<(std::ostream &os, - const slsDetectorDefs::patternParameters &r); std::string ToString(const slsDetectorDefs::scanParameters &r); std::ostream &operator<<(std::ostream &os, const slsDetectorDefs::scanParameters &r); @@ -181,6 +178,22 @@ std::string ToString(const std::map &m) { return os.str(); } +/** + * Print a c style array + */ +template std::string ToString(const T (&arr)[size]) { + std::ostringstream os; + os << '['; + if (size) { + size_t i = 0; + os << ToString(arr[i++]); + for (; i < size; ++i) + os << ", " << ToString(arr[i]); + } + os << ']'; + return os.str(); +} + /** * For a container loop over all elements and call ToString on the element * Container is excluded diff --git a/slsSupportLib/include/sls/sls_detector_defs.h b/slsSupportLib/include/sls/sls_detector_defs.h index 897f18a9bd..3e2c4bbeef 100644 --- a/slsSupportLib/include/sls/sls_detector_defs.h +++ b/slsSupportLib/include/sls/sls_detector_defs.h @@ -21,6 +21,7 @@ #include #include #include +#include #include #else // C includes @@ -453,7 +454,7 @@ typedef struct { int activate{0}; int quad{0}; int numLinesReadout{0}; - int thresholdEnergyeV{0}; + int thresholdEnergyeV[3]{0, 0, 0}; int dynamicRange{16}; timingMode timMode{AUTO_TIMING}; int tenGiga{0}; @@ -472,18 +473,6 @@ typedef struct { int gates{0}; scanParameters scanParams{}; } __attribute__((packed)); - - /** pattern structure */ - struct patternParameters { - uint64_t word[MAX_PATTERN_LENGTH]{}; - uint64_t patioctrl{0}; - uint32_t patlimits[2]{}; - uint32_t patloop[6]{}; - uint32_t patnloop[3]{}; - uint32_t patwait[3]{}; - uint64_t patwaittime[3]{}; - } __attribute__((packed)); - #endif #ifdef __cplusplus @@ -582,14 +571,14 @@ typedef struct { int reg; /**< is the module register settings (gain level) */ int iodelay; /**< iodelay */ int tau; /**< tau */ - int eV; /**< threshold energy */ + int eV[3]; /**< threshold energy */ int *dacs; /**< is the pointer to the array of the dac values (in V) */ int *chanregs; /**< is the pointer to the array of the channel registers */ #ifdef __cplusplus sls_detector_module() : serialnumber(0), nchan(0), nchip(0), ndac(0), reg(-1), iodelay(0), - tau(0), eV(-1), dacs(nullptr), chanregs(nullptr) {} + tau(0), eV{-1, -1, -1}, dacs(nullptr), chanregs(nullptr) {} explicit sls_detector_module(slsDetectorDefs::detectorType type) : sls_detector_module() { @@ -618,7 +607,7 @@ typedef struct { reg = other.reg; iodelay = other.iodelay; tau = other.tau; - eV = other.eV; + std::copy(other.eV, other.eV + 3, eV); dacs = new int[ndac]; std::copy(other.dacs, other.dacs + ndac, dacs); chanregs = new int[nchan]; diff --git a/slsSupportLib/include/sls/sls_detector_funcs.h b/slsSupportLib/include/sls/sls_detector_funcs.h index 8ea0bcee70..9abb18d7f5 100755 --- a/slsSupportLib/include/sls/sls_detector_funcs.h +++ b/slsSupportLib/include/sls/sls_detector_funcs.h @@ -217,6 +217,10 @@ enum detFuncs { F_START_READOUT, F_SET_DEFAULT_DACS, F_IS_VIRTUAL, + F_GET_PATTERN, + F_LOAD_DEFAULT_PATTERN, + F_GET_ALL_THRESHOLD_ENERGY, + F_GET_MASTER, NUM_DET_FUNCTIONS, RECEIVER_ENUM_START = 256, /**< detector function should not exceed this @@ -320,6 +324,7 @@ enum detFuncs { F_RECEIVER_SET_THRESHOLD, F_GET_RECEIVER_STREAMING_HWM, F_SET_RECEIVER_STREAMING_HWM, + F_RECEIVER_SET_ALL_THRESHOLD, NUM_REC_FUNCTIONS }; @@ -539,7 +544,11 @@ const char* getFunctionNameFromEnum(enum detFuncs func) { case F_START_READOUT: return "F_START_READOUT"; case F_SET_DEFAULT_DACS: return "F_SET_DEFAULT_DACS"; case F_IS_VIRTUAL: return "F_IS_VIRTUAL"; - + case F_GET_PATTERN: return "F_GET_PATTERN"; + case F_LOAD_DEFAULT_PATTERN: return "F_LOAD_DEFAULT_PATTERN"; + case F_GET_ALL_THRESHOLD_ENERGY: return "F_GET_ALL_THRESHOLD_ENERGY"; + case F_GET_MASTER: return "F_GET_MASTER"; + case NUM_DET_FUNCTIONS: return "NUM_DET_FUNCTIONS"; case RECEIVER_ENUM_START: return "RECEIVER_ENUM_START"; @@ -641,6 +650,7 @@ const char* getFunctionNameFromEnum(enum detFuncs func) { case F_RECEIVER_SET_THRESHOLD: return "F_RECEIVER_SET_THRESHOLD"; case F_GET_RECEIVER_STREAMING_HWM: return "F_GET_RECEIVER_STREAMING_HWM"; case F_SET_RECEIVER_STREAMING_HWM: return "F_SET_RECEIVER_STREAMING_HWM"; + case F_RECEIVER_SET_ALL_THRESHOLD: return "F_RECEIVER_SET_ALL_THRESHOLD"; case NUM_REC_FUNCTIONS: return "NUM_REC_FUNCTIONS"; diff --git a/slsSupportLib/include/sls/versionAPI.h b/slsSupportLib/include/sls/versionAPI.h index dbcef4ec98..f39bec75fc 100644 --- a/slsSupportLib/include/sls/versionAPI.h +++ b/slsSupportLib/include/sls/versionAPI.h @@ -1,12 +1,12 @@ /** API versions */ -#define GITBRANCH "5.0.1" -#define APICTB 0x201117 -#define APIGOTTHARD 0x201117 -#define APIGOTTHARD2 0x201117 -#define APIJUNGFRAU 0x201117 -#define APIMYTHEN3 0x201117 -#define APIMOENCH 0x201117 -#define APIEIGER 0x201117 -#define APILIB 0x201125 -#define APIRECEIVER 0x201125 -#define APIGUI 0x201125 +#define GITBRANCH "5.1.0" +#define APICTB 0x210225 +#define APIGOTTHARD 0x210225 +#define APIGOTTHARD2 0x210225 +#define APIJUNGFRAU 0x210225 +#define APIMOENCH 0x210225 +#define APIEIGER 0x210225 +#define APIMYTHEN3 0x210225 +#define APILIB 0x210225 +#define APIRECEIVER 0x210225 +#define APIGUI 0x210225 diff --git a/slsSupportLib/src/ToString.cpp b/slsSupportLib/src/ToString.cpp index 9b9944e282..97b9025fdf 100644 --- a/slsSupportLib/src/ToString.cpp +++ b/slsSupportLib/src/ToString.cpp @@ -54,7 +54,7 @@ std::string ToString(const slsDetectorDefs::rxParameters &r) { << "activate:" << r.activate << std::endl << "quad:" << r.quad << std::endl << "numLinesReadout:" << r.numLinesReadout << std::endl - << "thresholdEnergyeV:" << r.thresholdEnergyeV << std::endl + << "thresholdEnergyeV:" << ToString(r.thresholdEnergyeV) << std::endl << "dynamicRange:" << r.dynamicRange << std::endl << "timMode:" << r.timMode << std::endl << "tenGiga:" << r.tenGiga << std::endl @@ -88,44 +88,6 @@ std::ostream &operator<<(std::ostream &os, return os << ToString(r); } -std::string ToString(const slsDetectorDefs::patternParameters &r) { - std::ostringstream oss; - oss << '[' << std::setfill('0') << std::endl; - int addr_width = 4; - int word_width = 16; - for (int i = 0; i < MAX_PATTERN_LENGTH; ++i) { - if (r.word[i] != 0) { - oss << "patword " << ToStringHex(i, addr_width) << " " - << ToStringHex(r.word[i], word_width) << std::endl; - } - } - oss << "patioctrl " << ToStringHex(r.patioctrl, word_width) << std::endl - << "patlimits " << ToStringHex(r.patlimits[0], addr_width) << " " - << ToStringHex(r.patlimits[1], addr_width) << std::endl - << "patloop0 " << ToStringHex(r.patloop[0], addr_width) << " " - << ToStringHex(r.patloop[1], addr_width) << std::endl - << "patnloop0 " << r.patnloop[0] << std::endl - << "patloop1 " << ToStringHex(r.patloop[2], addr_width) << " " - << ToStringHex(r.patloop[3], addr_width) << std::endl - << "patnloop1 " << r.patnloop[1] << std::endl - << "patloop2 " << ToStringHex(r.patloop[4], addr_width) << " " - << ToStringHex(r.patloop[5], addr_width) << std::endl - << "patnloop2 " << r.patnloop[2] << std::endl - << "patwait0 " << ToStringHex(r.patwait[0], addr_width) << std::endl - << "patwaittime0 " << r.patwaittime[0] << std::endl - << "patwait1 " << ToStringHex(r.patwait[1], addr_width) << std::endl - << "patwaittime1 " << r.patwaittime[1] << std::endl - << "patwait2 " << ToStringHex(r.patwait[2], addr_width) << std::endl - << "patwaittime2 " << r.patwaittime[2] << std::endl - << ']'; - return oss.str(); -} - -std::ostream &operator<<(std::ostream &os, - const slsDetectorDefs::patternParameters &r) { - return os << ToString(r); -} - std::string ToString(const slsDetectorDefs::scanParameters &r) { std::ostringstream oss; oss << '['; diff --git a/slsSupportLib/tests/test-ToString.cpp b/slsSupportLib/tests/test-ToString.cpp index adeb53c502..46a95f33a7 100644 --- a/slsSupportLib/tests/test-ToString.cpp +++ b/slsSupportLib/tests/test-ToString.cpp @@ -2,7 +2,9 @@ #include "sls/TimeHelper.h" #include "sls/ToString.h" #include "sls/network_utils.h" +#include "sls/Pattern.h" #include "sls/sls_detector_defs.h" +#include "sls/container_utils.h" #include #include #include @@ -298,4 +300,27 @@ TEST_CASE("Streaming of slsDetectorDefs::scanParameters") { REQUIRE(oss.str() == "[enabled\ndac vth2\nstart 500\nstop 1500\nstep " "500\nsettleTime 0.5s\n]"); } +} + +TEST_CASE("Printing c style arrays of int"){ + int arr[]{3, 5}; + REQUIRE(ToString(arr) == "[3, 5]"); +} + +TEST_CASE("Printing c style arrays of uint8"){ + uint8_t arr[]{1,2,3,4,5}; + REQUIRE(ToString(arr) == "[1, 2, 3, 4, 5]"); +} + +TEST_CASE("Printing c style arrays of double"){ + double arr[]{3.4, 5.3, 6.2}; + REQUIRE(ToString(arr) == "[3.4, 5.3, 6.2]"); +} + +TEST_CASE("Print a member of patternParameters"){ + auto pat = sls::make_unique(); + pat->limits[0] = 4; + pat->limits[1] = 100; + REQUIRE(ToString(pat->limits) == "[4, 100]"); + } \ No newline at end of file diff --git a/slsSupportLib/tests/test-sls_detector_defs.cpp b/slsSupportLib/tests/test-sls_detector_defs.cpp index 95c6a4bd95..fd5001808c 100644 --- a/slsSupportLib/tests/test-sls_detector_defs.cpp +++ b/slsSupportLib/tests/test-sls_detector_defs.cpp @@ -12,7 +12,9 @@ TEST_CASE("sls_detector_module default construction", "[support][new]") { CHECK(m.reg == -1); CHECK(m.iodelay == 0); CHECK(m.tau == 0); - CHECK(m.eV == -1); + CHECK(m.eV[0] == -1); + CHECK(m.eV[1] == -1); + CHECK(m.eV[2] == -1); CHECK(m.dacs == nullptr); CHECK(m.chanregs == nullptr); } @@ -26,7 +28,9 @@ TEST_CASE("sls_detector_module from type", "[support]") { CHECK(m.reg == -1); CHECK(m.iodelay == 0); CHECK(m.tau == 0); - CHECK(m.eV == -1); + CHECK(m.eV[0] == -1); + CHECK(m.eV[1] == -1); + CHECK(m.eV[2] == -1); CHECK(m.dacs != nullptr); CHECK(m.chanregs != nullptr); } diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 3cdb3d6347..93c52afeb5 100755 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -18,22 +18,24 @@ set_target_properties(testserver PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) add_executable(tests ${SLS_TEST_SOURCES}) -target_link_libraries(tests - slsProjectOptions - slsProjectWarnings - slsSupportShared - pthread - rt +target_link_libraries(tests + PUBLIC + slsProjectOptions + slsSupportShared + pthread + rt + PRIVATE + slsProjectWarnings ) if (SLS_USE_TEXTCLIENT) - target_link_libraries(tests + target_link_libraries(tests PUBLIC slsDetectorShared ) endif (SLS_USE_TEXTCLIENT) if (SLS_USE_RECEIVER) - target_link_libraries(tests + target_link_libraries(tests PUBLIC slsReceiverShared ) endif (SLS_USE_RECEIVER) diff --git a/this_build_bin_path.sh b/this_build_bin_path.sh index 79f7630916..646f4175e4 100755 --- a/this_build_bin_path.sh +++ b/this_build_bin_path.sh @@ -30,6 +30,8 @@ fi echo "this_path="$THIS_PATH export PATH=$THIS_PATH:$PATH export LD_LIBRARY_PATH=$THIS_PATH:$LD_LIBRARY_PATH + export PYTHONPATH=$THIS_PATH:$PYTHONPATH echo "path="$PATH echo "ld_library_path="$LD_LIBRARY_PATH + echo "pythonpath="$PYTHON_PATH