Compare commits

..

No commits in common. "main" and "9.0.0" have entirely different histories.
main ... 9.0.0

150 changed files with 1548 additions and 2721 deletions

View File

@ -1,4 +1,4 @@
name: Native CMake Build name: CMake
on: [push, pull_request] on: [push, pull_request]
@ -14,16 +14,10 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Configure and build using cmake name: Configure and build using cmake
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: 3.12
cache: 'pip'
- run: pip install pytest numpy
- uses: awalsh128/cache-apt-pkgs-action@latest - uses: awalsh128/cache-apt-pkgs-action@latest
with: with:
packages: libhdf5-dev qtbase5-dev qt5-qmake libqt5svg5-dev libpng-dev libtiff-dev packages: libhdf5-dev qtbase5-dev qt5-qmake libqt5svg5-dev
version: 1.0 version: 1.0
- name: Configure CMake - name: Configure CMake
@ -33,15 +27,12 @@ jobs:
- name: Build - name: Build
# Build your program with the given configuration # Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build -j4 --config ${{env.BUILD_TYPE}} run: cmake --build ${{github.workspace}}/build -j2 --config ${{env.BUILD_TYPE}}
- name: C++ unit tests - name: Test
working-directory: ${{github.workspace}}/build working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{env.BUILD_TYPE}} -j1 run: ctest -C ${{env.BUILD_TYPE}} -j1
- name: Python unit tests
working-directory: ${{github.workspace}}/build/bin
run: |
python -m pytest ${{github.workspace}}/python/tests

View File

@ -1,42 +0,0 @@
name: Build slsdetlib
on: [pull_request]
jobs:
build:
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, ] # macos-12, windows-2019]
python-version: ["3.12",]
runs-on: ${{ matrix.platform }}
# The setup-miniconda action needs this to activate miniconda
defaults:
run:
shell: "bash -l {0}"
steps:
- uses: actions/checkout@v4
- name: Get conda
uses: conda-incubator/setup-miniconda@v3.0.4
with:
python-version: ${{ matrix.python-version }}
channels: conda-forge
- name: Prepare
run: conda install conda-build conda-verify pytest anaconda-client
- name: Disable upload
run: conda config --set anaconda_upload no
- name: Build
run: conda build conda-recipes/main-library --output-folder build_output
- name: Upload all Conda packages
uses: actions/upload-artifact@v4
with:
name: conda-packages
path: build_output/** # Uploads all packages

View File

@ -1,42 +0,0 @@
name: slsdet
on: [pull_request]
jobs:
build:
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, ] # macos-12, windows-2019]
python-version: ["3.12",]
runs-on: ${{ matrix.platform }}
# The setup-miniconda action needs this to activate miniconda
defaults:
run:
shell: "bash -l {0}"
steps:
- uses: actions/checkout@v4
- name: Get conda
uses: conda-incubator/setup-miniconda@v3.0.4
with:
python-version: ${{ matrix.python-version }}
channels: conda-forge
- name: Prepare
run: conda install conda-build conda-verify pytest anaconda-client
- name: Disable upload
run: conda config --set anaconda_upload no
- name: Build
run: conda build conda-recipes/python-client --output-folder build_output
- name: Upload all Conda packages
uses: actions/upload-artifact@v4
with:
name: conda-packages
path: build_output/** # Uploads all packages

View File

@ -0,0 +1 @@
# This file is generated by cmake for dependency checking of the CMakeCache.txt file

View File

@ -1,6 +1,6 @@
# SPDX-License-Identifier: LGPL-3.0-or-other # SPDX-License-Identifier: LGPL-3.0-or-other
# Copyright (C) 2021 Contributors to the SLS Detector Package # Copyright (C) 2021 Contributors to the SLS Detector Package
cmake_minimum_required(VERSION 3.15) cmake_minimum_required(VERSION 3.14)
project(slsDetectorPackage) project(slsDetectorPackage)
# Read VERSION file into project version # Read VERSION file into project version
@ -29,40 +29,20 @@ include(FetchContent)
option(SLS_FETCH_ZMQ_FROM_GITHUB "Fetch zmq from github" OFF) option(SLS_FETCH_ZMQ_FROM_GITHUB "Fetch zmq from github" OFF)
option(SLS_FETCH_PYBIND11_FROM_GITHUB "Fetch pybind11 from github" OFF) option(SLS_FETCH_PYBIND11_FROM_GITHUB "Fetch pybind11 from github" OFF)
# Allow FetchContent_Populate to be called with a single argument
# otherwise deprecated warning is issued
# Note: From cmake 3.28 we can pass EXCLUDE_FROM_ALL to FetchContent_Declare
# and avoid direct use of Populate
if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.30")
cmake_policy(SET CMP0169 OLD)
endif()
# Patch libzmq to set minimum cmake version to 3.15 to avoid warnings
# with newer cmake versions
# Patch is applied in the FetchContent_Declare
set(SLS_LIBZMQ_VERSION "4.3.4")
if(SLS_FETCH_ZMQ_FROM_GITHUB) if(SLS_FETCH_ZMQ_FROM_GITHUB)
# Opt in to pull down a zmq version from github instead of # Opt in to pull down a zmq version from github instead of
# using the bundled version # using the bundled verison
FetchContent_Declare( FetchContent_Declare(
libzmq libzmq
GIT_REPOSITORY https://github.com/zeromq/libzmq.git GIT_REPOSITORY https://github.com/zeromq/libzmq.git
GIT_TAG v${SLS_LIBZMQ_VERSION} GIT_TAG v4.3.4
PATCH_COMMAND ${CMAKE_COMMAND} -E chdir <SOURCE_DIR> patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/libs/libzmq/libzmq_cmake_version.patch
UPDATE_DISCONNECTED 1
) )
else() else()
# Standard behaviour use libzmq included in this repo (libs/libzmq) # Standard behaviour use libzmq included in this repo (libs/libzmq)
FetchContent_Declare( FetchContent_Declare(
libzmq libzmq
URL ${CMAKE_CURRENT_SOURCE_DIR}/libs/libzmq/libzmq-${SLS_LIBZMQ_VERSION}.tar.gz URL ${CMAKE_CURRENT_SOURCE_DIR}/libs/libzmq/libzmq-4.3.4.tar.gz
URL_HASH MD5=cc20b769ac10afa352e5ed2769bb23b3 URL_HASH MD5=cc20b769ac10afa352e5ed2769bb23b3
PATCH_COMMAND ${CMAKE_COMMAND} -E chdir <SOURCE_DIR> patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/libs/libzmq/libzmq_cmake_version.patch
UPDATE_DISCONNECTED 1
) )
endif() endif()
@ -74,11 +54,6 @@ set(ENABLE_CPACK OFF CACHE BOOL "")
set(ENABLE_CLANG OFF CACHE BOOL "") set(ENABLE_CLANG OFF CACHE BOOL "")
set(ENABLE_CURVE OFF CACHE BOOL "") set(ENABLE_CURVE OFF CACHE BOOL "")
set(ENABLE_DRAFTS OFF CACHE BOOL "") set(ENABLE_DRAFTS OFF CACHE BOOL "")
set(ENABLE_PRECOMPILED OFF CACHE BOOL "")
set(WITH_DOC OFF CACHE BOOL "")
set(WITH_DOCS OFF CACHE BOOL "")
# Using GetProperties and Populate to be able to exclude zmq # Using GetProperties and Populate to be able to exclude zmq
# from install (not possible with FetchContent_MakeAvailable(libzmq)) # from install (not possible with FetchContent_MakeAvailable(libzmq))
@ -216,7 +191,7 @@ endif()
# to control options for the libraries # to control options for the libraries
if(NOT TARGET slsProjectOptions) if(NOT TARGET slsProjectOptions)
add_library(slsProjectOptions INTERFACE) add_library(slsProjectOptions INTERFACE)
target_compile_features(slsProjectOptions INTERFACE cxx_std_11) target_compile_features(slsProjectOptions INTERFACE cxx_std_11)
endif() endif()
if (NOT TARGET slsProjectWarnings) if (NOT TARGET slsProjectWarnings)
@ -274,8 +249,8 @@ endif()
if(SLS_USE_SANITIZER) if(SLS_USE_SANITIZER)
target_compile_options(slsProjectOptions INTERFACE -fsanitize=address,undefined -fno-omit-frame-pointer) target_compile_options(slsProjectOptions INTERFACE -fsanitize=address,undefined -fno-omit-frame-pointer)
target_link_libraries(slsProjectOptions INTERFACE -fsanitize=address,undefined) target_link_libraries(slsProjectOptions INTERFACE -fsanitize=address,undefined)
#target_compile_options(slsProjectOptions INTERFACE -fsanitize=thread -fno-omit-frame-pointer) # target_compile_options(slsProjectOptions INTERFACE -fsanitize=thread)
#target_link_libraries(slsProjectOptions INTERFACE -fsanitize=thread) # target_link_libraries(slsProjectOptions INTERFACE -fsanitize=thread)
endif() endif()
@ -354,15 +329,9 @@ if (SLS_USE_CTBGUI)
add_subdirectory(pyctbgui) add_subdirectory(pyctbgui)
endif(SLS_USE_CTBGUI) endif(SLS_USE_CTBGUI)
# Workaround for file note being copied to build directory configure_file( .clang-tidy
# when issuing a python -m build ${CMAKE_BINARY_DIR}/.clang-tidy
# TODO! Proper fix )
if(EXISTS ".clang-tidy")
configure_file(.clang-tidy
${CMAKE_BINARY_DIR}/.clang-tidy
)
endif()
if (SLS_BUILD_EXAMPLES) if (SLS_BUILD_EXAMPLES)
add_subdirectory(sample) add_subdirectory(sample)

View File

@ -1,36 +1,284 @@
SLS Detector Package Minor Release 9.2.0 released on 02.06.2025 SLS Detector Package Major Release 9.0.0 released on 26.11.2024
================================================================== ===============================================================
This document describes the differences between v9.2.0 and v9.1.1 This document describes the differences between v9.0.0 and v8.0.2
CONTENTS CONTENTS
-------- --------
1 New or Changed Features 1 Compilation Changes
2 On-board Detector Server Compatibility 2 New or Changed Features
3 Firmware Requirements 2.1 Breaking API
4 Kernel Requirements 2.2 Resolved or Changed Features
5 Download, Documentation & Support 2.3 New Features
3 On-board Detector Server Compatibility
4 Firmware Requirements
5 Kernel Requirements
6 Download, Documentation & Support
1 New or Changed Features 2 Compilation Changes
========================= =====================
Python * Python version
Minimum python version is changed from 3.6 to 3.8
* Pybind11 version
In-built version and the one picked up from github
updated from v2.11.0 to v2.13.6
* Python lib versioning
slsdet.__version__ now returns the package release version.
* Python version in conda build
Added python 3.13 also to conda build
2 New, Changed or Resolved Features
=====================================
2.1 Breaking API
==================
Receiver
--------
* Receiver callbacks
Brought much more metadata to receiver callbacks to construct the image.
Update MultiReceiverApp to reflect this change.
* File path
At start of acquisition or at rx_start command, the file path is only
then verified if it exists and created if it does not.
Client
------ ------
* Python module is now built using scikit-build-core * Removed receiver/publisher ZMQ IP
Command line: rx_zmqip gives a warning and does nothing
Python : rx_zmqip removed
C++ API: get/setRxZmqIP removed
Publisher zmq IP set to '0.0.0.0' or to listen on all interfaces.
The publisher will determine which interface to stream out from based on
the network route to the subscriber IP. Hence, receiver zmq IP is not
required.
* slsdet is available on PyPI from this release onwards * Write register, Set or Clear bit
Validation for this advanced feature has been removed by default.
One can force validation by using --validate in the command line or by
setting the validate option in the API.
* Updated documentation on python module installation ZMQ
---
* Publisher socket constructor does not take an IP anymore.
The details are above under 'Removed receiver/publisher ZMQ IP'.
GUI/ Client Callback
--------------------
* completeImage member in detectorData attribute now returns false only
if any the sub images (from different udp ports) have completeImage
set to false in the JSON header. This is set if therea are any missing
packets for that udp port on slsReceiver/slsMultiReceiver.
The different subimages are anyway not synchronized. This errs when
there are different missing images across multiple UDP ports.
The Gui does not show "complete image" in the status bar anymore.
If any of the udp ports have missing packets for that current disaplayed
image, then the "missing packets" will show in red in the status bar.
Detector Server
---------------
* [Mythen3] Only run clock can be set
Clock 0 is now the run clock and the only one that can be set.
The others are be read only.
This affects the following commands:
Command line or python API: clkdiv, clkfreq, clkphase, maxclkphaseshift
C++ API: get/setClockDivider, getClockFrequency, get/setClockPhase,
getMaxClockPhaseShift
* [Jungfrau] Temperature Control
Temperature control is enabled by default at on-board detector server
startup.
As before, the default temperature threshold is 65°C and crossing this
value will set a temperature event.
2.2 Resolved or Changed Features
================================
Compilation
-----------
* cmake_source_dir
Fixed compilation error when using python and adding the slsDetectorPackage
as a subfolder due to cmake source directory changing.
Client
------
* Command line Code Generation
The command line parsing code is now generated from a yaml file. This is
transparent to the user.
* Clearer error message about freeing shared memory.
Detector Server
---------------
* [Gotthard2] Chip reconfiguration
- Powering off/on the chip will now switch off chip configuration
property/ configure the chip every time.
- Switching off high voltage from a non zero value will now wait
10s to return for safety reasons.
- Powering off the chip requires high voltage to have been
switched off prior.
- Acquisition requires chip to have been configured prior.
* [Gotthard2] Burst mode options restricted
Burst mode external and continuous mode internal are not allowed to be set
anymore as they are anyway not implemented.
Receiver
--------
* [Gotthard I] fixed header stripping fixing segfault.
* Error or help message for invalid arguments to slsMultiReceiver.
Simulator
---------
* Refactored stop server to have better start up.
* Fixed possible memory leak when taking non blocking acquisitions.
* [Jungfrau] Valid gain values in data sent out. Previously, 2 was also sent out.
ZMQ
---
* Publiser socket constructor
- enables keep alive socket options to send heartbeat messages to prevent
discarded TCP flows if there is no packet for a longer period.
- enables IPv6 interfaces
* Prints specific error for ENOENT (endpoint does not exist)
2.3 New Features
================
Client
------
* Auto completion
bash_autocomplete.sh or zsh_autocomplete.sh must be sourced from the
main package folder to enable auto completion of commands and arguments
for the command line on that shell.
* sls_detector
New executable that can be used instead of 'sls_detector_get' and
'sls_detector_put' for most commands. It will infer from the number of
arguments, which executable (sls_detector_put or sls_detector_get) to use.
For the rare commands that cannot be inferred from the number of arguments,
it will complain accordingly.
* [Jungfrau] Timing Info Decoder (Advanced configuration)
Command line or python API: timing_info_decoder
C++ API: get/setTimingInfoDecoder. Options: SWISSFEL (Default), SHINE
* [Jungfrau] Collection Mode (Advanced configuration)
Command line or python API: collectionmode
C++ API: get/setCollectionMode. Options: ELECTRON, HOLE (Default)
If chip v1.1, also configures the chip afterwards.
* [Gotthard2] Next frame number
'Stop' in G2 25um is not synchronous and hence might trigger an extra set
of frames in the slave module, resulting in the next acquiistion starting
with inconsistent frame numbers between master and slave. Solved by
setting next frame number to the larger value (max + 1) after a stop command.
Requires a firmware update.
Command line or python API: nextframenumber
C++ API: get/setNextFrameNumber
Can set/get the starting frame number for the next acquistion.
* [Mythen3] Readout speed
Command line, python API: readoutspeed. Options: full_speed (10MHz),
half_speed (20MHz, default), quarter_speed (40MHz)
C++ API: get/setReadoutSpeed
Also affect:
Command line, python API: readoutspeedlist
C++ API: getReadoutSpeedList
* Sleep
Command line, python/ C++ API: sleep
Client sleeps for required time. Advanced command mainly for firmware
developers to use in config files.
* Xilinx Chip Test Board added
@ -39,8 +287,8 @@ This document describes the differences between v9.2.0 and v9.1.1
Eiger 9.0.0 Eiger 9.0.0
Jungfrau 9.1.0 Jungfrau 9.0.0
Mythen3 9.1.1 Mythen3 9.0.0
Gotthard2 9.0.0 Gotthard2 9.0.0
Gotthard 9.0.0 Gotthard 9.0.0
Moench 9.0.0 Moench 9.0.0
@ -69,8 +317,8 @@ This document describes the differences between v9.2.0 and v9.1.1
Eiger 02.10.2023 (v32) (updated in 7.0.3) Eiger 02.10.2023 (v32) (updated in 7.0.3)
Jungfrau 09.02.2025 (v1.6, HW v1.0) (updated in 9.1.0) Jungfrau 20.09.2023 (v1.5, HW v1.0) (updated in 8.0.0)
08.02.2025 (v2.6, HW v2.0) (updated in 9.1.0) 21.09.2023 (v2.5, HW v2.0) (updated in 8.0.0)
Mythen3 13.11.2024 (v2.0) (updated in 9.0.0) Mythen3 13.11.2024 (v2.0) (updated in 9.0.0)
@ -112,7 +360,6 @@ This document describes the differences between v9.2.0 and v9.1.1
4 Kernel Requirements 4 Kernel Requirements
====================== ======================
Blackfin Blackfin
-------- --------
Latest version: Fri Oct 29 00:00:00 2021 Latest version: Fri Oct 29 00:00:00 2021
@ -120,12 +367,10 @@ This document describes the differences between v9.2.0 and v9.1.1
Older ones will work, but might have issues with programming firmware via Older ones will work, but might have issues with programming firmware via
the package. the package.
Nios Nios
----- -----
Compatible version: Mon May 10 18:00:21 CEST 2021 Compatible version: Mon May 10 18:00:21 CEST 2021
Kernel Upgrade Kernel Upgrade
--------------- ---------------
Eiger via bit files Eiger via bit files
@ -215,4 +460,3 @@ This document describes the differences between v9.2.0 and v9.1.1
dhanya.thattil@psi.ch dhanya.thattil@psi.ch
erik.frojdh@psi.ch erik.frojdh@psi.ch
alice.mazzoleni@psi.ch

View File

@ -1 +1 @@
9.2.0 9.0.0

View File

@ -8,7 +8,7 @@ if [ ! -d "install" ]; then
mkdir install mkdir install
fi fi
cd build cd build
cmake .. -G Ninja \ cmake .. \
-DCMAKE_PREFIX_PATH=$CONDA_PREFIX \ -DCMAKE_PREFIX_PATH=$CONDA_PREFIX \
-DCMAKE_INSTALL_PREFIX=install \ -DCMAKE_INSTALL_PREFIX=install \
-DSLS_USE_TEXTCLIENT=ON \ -DSLS_USE_TEXTCLIENT=ON \
@ -18,7 +18,7 @@ cmake .. -G Ninja \
-DSLS_USE_TESTS=ON \ -DSLS_USE_TESTS=ON \
-DSLS_USE_PYTHON=OFF \ -DSLS_USE_PYTHON=OFF \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DSLS_USE_HDF5=OFF \ -DSLS_USE_HDF5=OFF\
NCORES=$(getconf _NPROCESSORS_ONLN) NCORES=$(getconf _NPROCESSORS_ONLN)
echo "Building using: ${NCORES} cores" echo "Building using: ${NCORES} cores"

11
conda-recipe/build_pylib.sh Executable file
View File

@ -0,0 +1,11 @@
# SPDX-License-Identifier: LGPL-3.0-or-other
# Copyright (C) 2021 Contributors to the SLS Detector Package
echo "|<-------- starting python build"
cd python
# copy VERSION into slsdet for installation
cp ../VERSION slsdet/VERSION
${PYTHON} setup.py install

View File

@ -0,0 +1,8 @@
python:
- 3.8
- 3.9
- 3.10
- 3.11
- 3.12
- 3.13

View File

@ -0,0 +1,11 @@
# SPDX-License-Identifier: LGPL-3.0-or-other
# Copyright (C) 2021 Contributors to the SLS Detector Package
mkdir $PREFIX/lib
mkdir $PREFIX/bin
mkdir $PREFIX/include
cp build/bin/ctbGui $PREFIX/bin/.
cp build/bin/libctbRootLib.so $PREFIX/lib/.

View File

@ -4,20 +4,18 @@
mkdir -p $PREFIX/lib mkdir -p $PREFIX/lib
mkdir -p $PREFIX/bin mkdir -p $PREFIX/bin
mkdir -p $PREFIX/include/sls mkdir -p $PREFIX/include/sls
# mkdir $PREFIX/include/slsDetectorPackage
#Shared and static libraries #Shared and static libraries
cp build/install/lib/* $PREFIX/lib/ cp build/install/lib/* $PREFIX/lib/
#Binaries #Binaries
cp build/install/bin/sls_detector_acquire $PREFIX/bin/. cp build/install/bin/sls_detector_acquire $PREFIX/bin/.
cp build/install/bin/sls_detector_acquire_zmq $PREFIX/bin/.
cp build/install/bin/sls_detector_get $PREFIX/bin/. cp build/install/bin/sls_detector_get $PREFIX/bin/.
cp build/install/bin/sls_detector_put $PREFIX/bin/. cp build/install/bin/sls_detector_put $PREFIX/bin/.
cp build/install/bin/sls_detector_help $PREFIX/bin/. cp build/install/bin/sls_detector_help $PREFIX/bin/.
cp build/install/bin/sls_detector $PREFIX/bin/.
cp build/install/bin/slsReceiver $PREFIX/bin/. cp build/install/bin/slsReceiver $PREFIX/bin/.
cp build/install/bin/slsMultiReceiver $PREFIX/bin/. cp build/install/bin/slsMultiReceiver $PREFIX/bin/.
cp build/install/bin/slsFrameSynchronizer $PREFIX/bin/.
cp build/install/include/sls/* $PREFIX/include/sls cp build/install/include/sls/* $PREFIX/include/sls

125
conda-recipe/meta.yaml Executable file
View File

@ -0,0 +1,125 @@
package:
name: sls_detector_software
version: {{ environ.get('GIT_DESCRIBE_TAG', '') }}
source:
path: ..
build:
number: 0
binary_relocation: True
rpaths:
- lib/
requirements:
build:
- {{ compiler('c') }}
- {{compiler('cxx')}}
- cmake
- qt 5.*
- xorg-libx11
- xorg-libice
- xorg-libxext
- xorg-libsm
- xorg-libxau
- xorg-libxrender
- xorg-libxfixes
- {{ cdt('mesa-libgl-devel') }} # [linux]
- {{ cdt('mesa-libegl-devel') }} # [linux]
- {{ cdt('mesa-dri-drivers') }} # [linux]
- {{ cdt('libselinux') }} # [linux]
- {{ cdt('libxdamage') }} # [linux]
- {{ cdt('libxxf86vm') }} # [linux]
- expat
host:
- libstdcxx-ng
- libgcc-ng
- xorg-libx11
- xorg-libice
- xorg-libxext
- xorg-libsm
- xorg-libxau
- xorg-libxrender
- xorg-libxfixes
- expat
run:
- libstdcxx-ng
- libgcc-ng
outputs:
- name: slsdetlib
script: copy_lib.sh
requirements:
build:
- {{ compiler('c') }}
- {{compiler('cxx')}}
- libstdcxx-ng
- libgcc-ng
run:
- libstdcxx-ng
- libgcc-ng
- name: slsdet
script: build_pylib.sh
requirements:
build:
- python
- {{ compiler('c') }}
- {{compiler('cxx')}}
- {{ pin_subpackage('slsdetlib', exact=True) }}
- setuptools
- pybind11=2.13
host:
- python
- {{ pin_subpackage('slsdetlib', exact=True) }}
- setuptools
- pybind11=2.13
run:
- libstdcxx-ng
- libgcc-ng
- python
- numpy
- {{ pin_subpackage('slsdetlib', exact=True) }}
test:
imports:
- slsdet
- name: slsdetgui
script: copy_gui.sh
requirements:
build:
- {{ compiler('c') }}
- {{compiler('cxx')}}
- {{ pin_subpackage('slsdetlib', exact=True) }}
run:
- {{ pin_subpackage('slsdetlib', exact=True) }}
- qt 5.*
- expat
- name: moenchzmq
script: copy_moench.sh
requirements:
build:
- {{ compiler('c') }}
- {{compiler('cxx')}}
- {{ pin_subpackage('slsdetlib', exact=True) }}
run:
- {{ pin_subpackage('slsdetlib', exact=True) }}
- expat

3
conda-recipe/run_test.sh Executable file
View File

@ -0,0 +1,3 @@
# SPDX-License-Identifier: LGPL-3.0-or-other
# Copyright (C) 2021 Contributors to the SLS Detector Package
ctest -j2

View File

@ -1,13 +0,0 @@
c_compiler:
- gcc # [linux]
c_stdlib:
- sysroot # [linux]
cxx_compiler:
- gxx # [linux]
c_stdlib_version: # [linux]
- 2.17 # [linux]

View File

@ -1,78 +0,0 @@
source:
path: ../..
{% set version = load_file_regex(load_file = 'VERSION', regex_pattern = '(\d+(?:\.\d+)*(?:[\+\w\.]+))').group(1) %}
package:
name: sls_detector_software
version: {{ version }}
build:
number: 0
binary_relocation: True
rpaths:
- lib/
requirements:
build:
- {{ compiler('c') }}
- {{ stdlib("c") }}
- {{ compiler('cxx') }}
- git
- cmake
- ninja
- qt 5.*
host:
- libstdcxx-ng
- libgcc-ng
- libgl-devel # [linux]
- libtiff
- zlib
- expat
run:
- libstdcxx-ng
- libgcc-ng
outputs:
- name: slsdetlib
script: copy_lib.sh
requirements:
build:
- {{ compiler('c') }}
- {{ stdlib("c") }}
- {{ compiler('cxx') }}
run:
- libstdcxx-ng
- libgcc-ng
- name: slsdetgui
script: copy_gui.sh
requirements:
build:
- {{ compiler('c') }}
- {{compiler('cxx')}}
- {{ pin_subpackage('slsdetlib', exact=True) }}
run:
- {{ pin_subpackage('slsdetlib', exact=True) }}
- qt 5.*
- name: moenchzmq
script: copy_moench.sh
requirements:
build:
- {{ compiler('c') }}
- {{compiler('cxx')}}
- {{ pin_subpackage('slsdetlib', exact=True) }}
run:
- {{ pin_subpackage('slsdetlib', exact=True) }}

View File

@ -1,16 +0,0 @@
python:
- 3.11
- 3.12
- 3.13
c_compiler:
- gcc # [linux]
c_stdlib:
- sysroot # [linux]
cxx_compiler:
- gxx # [linux]
c_stdlib_version: # [linux]
- 2.17 # [linux]

View File

@ -1,45 +0,0 @@
source:
path: ../..
{% set version = load_file_regex(load_file = 'VERSION', regex_pattern = '(\d+(?:\.\d+)*(?:[\+\w\.]+))').group(1) %}
package:
name: slsdet
version: {{ version }}
build:
number: 0
script:
- unset CMAKE_GENERATOR && {{ PYTHON }} -m pip install . -vv # [not win]
requirements:
build:
- python {{python}}
- {{ compiler('c') }}
- {{ stdlib("c") }}
- {{ compiler('cxx') }}
host:
- cmake
- ninja
- python {{python}}
- pip
- scikit-build-core
- pybind11 >=2.13.0
- fmt
- zeromq
- nlohmann_json
- catch2
run:
- python {{python}}
- numpy
test:
imports:
- slsdet
about:
summary: An example project built with pybind11 and scikit-build.
# license_file: LICENSE

View File

@ -63,4 +63,4 @@ html_static_path = ['static']
def setup(app): def setup(app):
app.add_css_file('css/extra.css') # may also be an URL app.add_stylesheet('css/extra.css') # may also be an URL

View File

@ -4,54 +4,11 @@ Command line interface
Usage Usage
------------- -------------
The syntax is *'[detector index]-[module index]:[command]'*, where the indices are by default '0', when not specified. Commands can be used either with sls_detector_get or sls_detector_put
Module index
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Modules are indexed based on their order in the hostname command. They are used to configure a specific module within a detector and are followed by a ':' in syntax.
.. code-block::
# Applies to all modules of detector 0
sls_detector_put exptime 5s
# Applies to only the 4th module
sls_detector_put 3:exptime 5s
Detector index
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This index is useful when configuring multiple detectors from a single host. Each detector uses a unique shared memory identified by a detector index, derived again from the hostname command. It is followed by a '-'.
.. code-block::
# For detector with index 2 in shared memory
sls_detector_put 2-hostname bchip133+bchip123+bchip456
# Without '-', the detector index defaults to 0
sls_detector_put hostname bchip133+bchip123+bchip456
# Accessing all modules with detector index 2
sls_detector_put 2-exptime
# Starting acquisition only for detector with index 2
sls_detector_put 2-start
# Applies only to the 2nd detector, 4th module
sls_detector_put 1-3:exptime 5s
Command Execution
^^^^^^^^^^^^^^^^^^^^^^^
Commands can be executed using:
* **sls_detector_put**: setting values
* **sls_detector_get**: getting values
* **sls_detector**: automatically infers based on the number of arguments.
* **sls_detector_help**: gets help on the specific command
* **sls_detector_acquire**: initiates acquisition with the detector. This command blocks until the entire acquisition process is completed.
.. code-block::
sls_detector_get exptime
Help Help
-------- --------
@ -71,17 +28,14 @@ Help
# list of deprecated commands # list of deprecated commands
list deprecated list deprecated
# autocompletion
Autocompletion # bash_autocomplete.sh or zsh_autocomplete.sh must be sourced from the
--------------- # main package folder to enable auto completion of commands and arguments
# for the command line on that shell.
bash_autocomplete.sh or zsh_autocomplete.sh must be sourced from the main package folder to enable auto completion of commands and arguments for the command line on that shell.
.. code-block::
source bash_autocomplete.sh source bash_autocomplete.sh
Commands Commands
----------- -----------

View File

@ -13,6 +13,7 @@ containing results from all modules. (:ref:`Result class<Result Class>`)
Here are some :ref:`examples <Cplusplus Api Examples>` on how to use the API. Here are some :ref:`examples <Cplusplus Api Examples>` on how to use the API.
.. _Cplusplus Api Examples:
.. doxygenclass:: sls::Detector .. doxygenclass:: sls::Detector
:members: :members:
:undoc-members: :undoc-members:

View File

@ -39,7 +39,7 @@ Welcome to slsDetectorPackage's documentation!
.. toctree:: .. toctree::
:caption: Command line :caption: Command line
:maxdepth: 1 :maxdepth: 2
commandline commandline
quick_start_guide quick_start_guide
@ -79,9 +79,8 @@ Welcome to slsDetectorPackage's documentation!
:caption: Receiver :caption: Receiver
:maxdepth: 2 :maxdepth: 2
slsreceiver
receivers receivers
slsreceiver
.. toctree:: .. toctree::
:caption: Receiver Files :caption: Receiver Files

View File

@ -6,47 +6,28 @@
Installation Installation
=============== ===============
.. contents:: One can either install pre-built binaries using conda or build from source.
:local:
:depth: 2
:backlinks: top
.. warning ::
Overview Before building from source make sure that you have the
-------------- :doc:`dependencies <../dependencies>` installed. If installing using conda, conda will
manage the dependencies. Avoid also installing packages with pip.
The ``slsDetectorPackage`` provides core detector software implemented in C++, along with Python bindings packaged as the ``slsdet`` Python extension module. Choose the option that best fits your environment and use case.
:ref:`conda pre-built binaries`:
Install pre-built binaries for the C++ client, receiver, GUI and the Python API (``slsdet``), simplifying setup across platforms.
:ref:`pip`:
Install only the Python extension module, either by downloading the pre-built library from PyPI or by building the extension locally from source. Available only from v9.2.0 onwards.
:ref:`build from source`:
Compile the entire package yourself, including both the C++ core and the Python bindings, for maximum control and customization. However, make sure that you have the :doc:`dependencies <../dependencies>` installed. If installing using conda, conda will manage the dependencies. Avoid installing packages with pip and conda simultaneously.
Install binaries using conda
.. _conda pre-built binaries: ----------------------------------
1. Install pre-built binaries using conda (Recommended)
--------------------------------------------------------
Conda is not only useful to manage python environments but can also Conda is not only useful to manage python environments but can also
be used as a user space package manager. Dates in the tag (for eg. 2020.07.23.dev0) be used as a user space package manager. Dates in the tag (for eg. 2020.07.23.dev0)
are from the developer branch. Please use released tags for stability. are from the developer branch. Please use released tags for stability.
We have four different packages available: We have three different packages available:
============== =============================================
Package Description * **slsdetlib** shared libraries and command line utilities
============== ============================================= * **slsdetgui** GUI
slsdetlib shared libraries and command line utilities * **slsdet** Python bindings
slsdetgui GUI
slsdet Python bindings
moenchzmq moench
============== =============================================
.. code-block:: bash .. code-block:: bash
@ -62,7 +43,7 @@ We have four different packages available:
#ready to use #ready to use
sls_detector_get exptime sls_detector_get exptime
... etc ...
.. code-block:: bash .. code-block:: bash
@ -74,33 +55,14 @@ We have four different packages available:
conda search slsdet conda search slsdet
# gui # gui
conda search slsdetgui conda search slsdetgui
# moench
conda search moenchzmq
.. _pip:
2. Pip
-------
The Python extension module ``slsdet`` can be installed using pip. This is available from v9.2.0 onwards.
.. code-block:: bash
#Install the Python extension module from PyPI
pip install slsdet
# or install the python extension locally from source
git clone https://github.com/slsdetectorgroup/slsDetectorPackage.git --branch 9.2.0
cd slsDetectorPackage
pip install .
.. _build from source: Build from source
----------------------
3. Build from source 1. Download Source Code from github
-------------------------
3.1. Download Source Code from github
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: bash .. code-block:: bash
@ -115,12 +77,12 @@ The Python extension module ``slsdet`` can be installed using pip. This is avail
3.2. Build from Source 2. Build from Source
^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^
One can either build using cmake or use the in-built cmk.sh script. One can either build using cmake or use the in-built cmk.sh script.
3.2.1. Build using CMake Build using CMake
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: bash .. code-block:: bash
@ -167,7 +129,7 @@ Example cmake options Comment
For v7.x.x of slsDetectorPackage and older, refer :ref:`zeromq notes for cmake option to hint library location. <zeromq for different slsDetectorPackage versions>` For v7.x.x of slsDetectorPackage and older, refer :ref:`zeromq notes for cmake option to hint library location. <zeromq for different slsDetectorPackage versions>`
3.2.2. Build using in-built cmk.sh script Build using in-built cmk.sh script
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -217,8 +179,8 @@ Example cmake options Comment
For v7.x.x of slsDetectorPackage and older, refer :ref:`zeromq notes for cmk script option to hint library location. <zeromq for different slsDetectorPackage versions>` For v7.x.x of slsDetectorPackage and older, refer :ref:`zeromq notes for cmk script option to hint library location. <zeromq for different slsDetectorPackage versions>`
3.3. Build on old distributions using conda Build on old distributions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If your linux distribution doesn't come with a C++11 compiler (gcc>4.8) then If your linux distribution doesn't come with a C++11 compiler (gcc>4.8) then
it's possible to install a newer gcc using conda and build the slsDetectorPackage it's possible to install a newer gcc using conda and build the slsDetectorPackage
@ -242,7 +204,7 @@ using this compiler
3.4. Build slsDetectorGui (Qt5) Build slsDetectorGui (Qt5)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1. Using pre-built binary on conda 1. Using pre-built binary on conda
@ -303,7 +265,7 @@ using this compiler
3.5. Build this documentation Build this documentation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The documentation for the slsDetectorPackage is build using a combination The documentation for the slsDetectorPackage is build using a combination
@ -326,8 +288,8 @@ is to use conda
make rst # rst only, saves time in case the API did not change make rst # rst only, saves time in case the API did not change
4. Pybind and Zeromq Pybind and Zeromq
------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. _pybind for different slsDetectorPackage versions: .. _pybind for different slsDetectorPackage versions:

View File

@ -1,6 +1,5 @@
.. _master file attributes: .. _master file attributes:
Master File Attributes Master File Attributes
======================= =======================

View File

@ -128,10 +128,6 @@ For Multiple Modules
# set file path # set file path
fpath /tmp fpath /tmp
.. note ::
The **hostname** and **detsize** command in a multi module system can affect the row and column values in the udp/zmq header. The modules are stacked row by row until they reach the y-axis limit set by detsize (if specified). Then, stacking continues in the next column and so on.
Gui Gui
---- ----

View File

@ -1,25 +1,25 @@
Custom Receiver Receivers
================= =================
The receiver essentially listens to UDP data packets sent out by the detector. Receiver processes can be run on same or different machines as the client, receives the data from the detector (via UDP packets).
When using the slsReceiver/ slsMultiReceiver, they can be further configured by the client control software (via TCP/IP) to set file name, file path, progress of acquisition etc.
To know more about detector receiver setup in the config file, please check out :ref:`the detector-receiver UDP configuration in the config file<detector udp header config>` and the :ref:`detector udp format<detector udp header>`.
| Please note the following when using a custom receiver: To know more about detector receiver configuration, please check out :ref:`detector udp header and udp commands in the config file <detector udp header>`
* **udp_dstmac** must be configured in the config file. This parameter is not required when using an in-built receiver. Custom Receiver
----------------
* Cannot use "auto" for **udp_dstip**. | When using custom receiver with our package, ensure that **udp_dstmac** is also configured in the config file. This parameter is not required when using slsReceiver.
* No **rx_** commands in the config file. These commands are for configuring the slsReceiver. | Cannot use "auto" for **udp_dstip**.
| Also ensure that there are no **rx_** commands in the config file. These commands are for configuring the slsReceiver.
The main difference is the lack of **rx_** commands or file commands (eg. **f**write, **f**path) and the **udp_dstmac** is required in config file.
Example of a custom receiver config file Example of a custom receiver config file
* The main difference is the lack of **rx_** commands or file commands (eg. fwrite, fpath) and the udp_dstmac is required in config file.
.. code-block:: bash .. code-block:: bash
# detector hostname # detector hostname

View File

@ -39,13 +39,13 @@ Arguments
.. _Automatic start servers: .. _Automatic start servers:
Automatic start Automatic start
------------------ ------------------
One can start the on-board detector server automatically upon powering on the board. One can start the on-board detector server automatically upon powering on the board.
#. Create a soft link to the binary on board: #. Create a soft link to the binary on board
:
.. code-block:: bash .. code-block:: bash
ln -sf someDetectorServervx.x.x someDetectorServer ln -sf someDetectorServervx.x.x someDetectorServer
@ -87,7 +87,8 @@ One can start the on-board detector server automatically upon powering on the bo
/root/xxxDetectorServer >> /dev/null & /root/xxxDetectorServer >> /dev/null &
#. Sync, reboot and verify: #. Sync, reboot and verify
:
.. code-block:: bash .. code-block:: bash
sync sync

View File

@ -1,5 +1,4 @@
.. _Detector Server Upgrade: .. _Detector Server Upgrade:
Upgrade Upgrade
======== ========

View File

@ -1,55 +1,16 @@
In-built Receiver slsReceiver/ slsMultiReceiver
================================ ================================
| One has to start the slsReceiver before loading config file or using any receiver commands (prefix: **rx_** )
The receiver essentially listens to UDP data packets sent out by the detector. It's main features are:
- **Listening**: Receives UDP data from the detector.
- **Writing to File**: Optionally writes received data to disk.
- **Streaming via ZMQ**: Optionally streams out the data using ZeroMQ.
Each of these operations runs asynchronously and in parallel for each UDP port.
.. note ::
* Can be run on the same or different machine as the client.
* Can be configured by the client. (set file name/ discard policy, get progress etc.)
* Has to be started before the client runs any receiver specific command.
Receiver Variants
-----------------
There are three main receiver types. How to start them is described :ref:`below<Starting up the Receiver>`.
+----------------------+--------------------+-----------------------------------------+--------------------------------+
| Receiver Type | slsReceiver | slsMultiReceiver |slsFrameSynchronizer |
+======================+====================+=========================================+================================+
| Modules Supported | 1 | Multiple | Multiple |
+----------------------+--------------------+-----------------------------------------+--------------------------------+
| Internal Architecture| Threads per porttt | Multiple child processes of slsReceiver | Multi-threading of slsReceiver |
+----------------------+--------------------+-----------------------------------------+--------------------------------+
| ZMQ Streaming | Disabled by default| Disabled by default | Enabled, not optional |
+----------------------+--------------------+-----------------------------------------+--------------------------------+
| ZMQ Synchronization | No | No | Yes, across ports |
+----------------------+--------------------+-----------------------------------------+--------------------------------+
| Image Reconstruction | No | No | No |
+----------------------+--------------------+-----------------------------------------+--------------------------------+
.. _Starting up the Receiver:
Starting up the Receiver
-------------------------
For a Single Module For a Single Module
.. code-block:: bash .. code-block:: bash
slsReceiver # default port 1954 # default port 1954
slsReceiver
slsReceiver -t2012 # custom port 2012 # custom port 2012
slsReceiver -t2012
For Multiple Modules For Multiple Modules
@ -57,66 +18,57 @@ For Multiple Modules
# each receiver (for each module) requires a unique tcp port (if all on same machine) # each receiver (for each module) requires a unique tcp port (if all on same machine)
# option 1 (one for each module) # using slsReceiver in multiple consoles
slsReceiver slsReceiver
slsReceiver -t1955 slsReceiver -t1955
# option 2 # slsMultiReceiver [starting port] [number of receivers]
slsMultiReceiver 2012 2 slsMultiReceiver 2012 2
# option 3 # slsMultiReceiver [starting port] [number of receivers] [print each frame header for debugging]
slsFrameSynchronizer 2012 2 slsMultiReceiver 2012 2 1
Client Commands Client Commands
----------------- -----------------
* Client commands to the receiver begin with **rx_** or **f_** (file commands). | One can remove **udp_dstmac** from the config file, as the slsReceiver fetches this from the **udp_ip**.
* **rx_hostname** has to be the first command to the receiver so the client knows which receiver process to communicate with. | One can use "auto" for **udp_dstip** if one wants to use default ip of **rx_hostname**.
* Can use 'auto' for **udp_dstip** if using 1GbE interface or the :ref:`virtual simulators<Virtual Detector Servers>`. | The first command to the receiver (**rx_** commands) should be **rx_hostname**. The following are the different ways to establish contact.
To know more about detector receiver setup in the config file, please check out :ref:`the detector-receiver UDP configuration in the config file<detector udp header config>` and the :ref:`detector udp format<detector udp header>`.
The following are the different ways to establish contact using **rx_hostname** command.
.. code-block:: bash .. code-block:: bash
# ---single module--- # default receiver tcp port (1954)
# default receiver port at 1954
rx_hostname xxx rx_hostname xxx
# custom receiver port # custom receiver port
rx_hostname xxx:1957 # option 1 rx_hostname xxx:1957
rx_tcpport 1957 # option 2 # custom receiver port
rx_tcpport 1954
rx_hostname xxx rx_hostname xxx
# multi modules with custom ports
rx_hostname xxx:1955+xxx:1956+
# ---multi module---
# using increasing tcp ports # multi modules using increasing tcp ports when using multi detector command
rx_tcpport 1955 rx_tcpport 1955
rx_hostname xxx rx_hostname xxx
# custom ports # or specify multi modules with custom ports on same rxr pc
rx_hostname xxx:1955+xxx:1958+ # option 1 0:rx_tcpport 1954
0:rx_tcpport 1954 # option 2
1:rx_tcpport 1955 1:rx_tcpport 1955
2:rx_tcpport 1956 2:rx_tcpport 1956
rx_hostname xxx rx_hostname xxx
# custom ports on different receiver machines # multi modules with custom ports on different rxr pc
0:rx_tcpport 1954 0:rx_tcpport 1954
0:rx_hostname xxx 0:rx_hostname xxx
1:rx_tcpport 1955 1:rx_tcpport 1955
1:rx_hostname yyyrxr 1:rx_hostname yyy
| Example commands: | Example commands:
@ -139,32 +91,6 @@ The following are the different ways to establish contact using **rx_hostname**
sls_detector_get -h rx_framescaught sls_detector_get -h rx_framescaught
Example of a config file using in-built receiver
.. code-block:: bash
# detector hostname
hostname bchip052+bchip053+
# udp destination port (receiver)
# sets increasing destination udp ports starting at 50004
udp_dstport 50004
# udp destination ip (receiver)
0:udp_dstip 10.0.1.100
1:udp_dstip 10.0.2.100
# udp source ip (same subnet as udp_dstip)
0:udp_srcip 10.0.1.184
1:udp_srcip 10.0.2.184
# udp destination mac - not required (picked up from udp_dstip)
#udp_dstmac 22:47:d5:48:ad:ef
# connects to receivers at increasing tcp port starting at 1954
rx_hostname mpc3434
# same as rx_hostname mpc3434:1954+mpc3434:1955+
Performance Performance

View File

@ -1,4 +1,4 @@
.. _detector udp header config: .. _detector udp header:
Config file Config file

View File

@ -73,9 +73,9 @@ Description
* **modId**: module ID picked up from det_id_[detector type].txt on the detector cpu. * **modId**: module ID picked up from det_id_[detector type].txt on the detector cpu.
* **row**: row position of the module in the detector system. It is calculated by the order of the module in hostname command, as well as the detsize command. The modules are stacked row by row until they reach the y-axis limit set by detsize (if specified). Then, stacking continues in the next column and so on. * **row**: row position of the module in the detector system. It is calculated by the order of the module in hostname command, as well as the detsize command.
* **column**: column position of the module in the detector system. It is calculated by the order of the module in hostname command, as well as the detsize command. The modules are stacked row by row until they reach the y-axis limit set by detsize (if specified). Then, stacking continues in the next column and so on. * **column**: column position of the module in the detector system. It is calculated by the order of the module in hostname command, as well as the detsize command.
* **detType**: detector type from enum of detectorType in the package. * **detType**: detector type from enum of detectorType in the package.

View File

@ -1,5 +1,4 @@
.. _Virtual Detector Servers: .. _Virtual Detector Servers:
Simulators Simulators
=========== ===========

View File

@ -1,18 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index dd3d8eb9..c0187747 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,11 +1,8 @@
# CMake build script for ZeroMQ
project(ZeroMQ)
-if(${CMAKE_SYSTEM_NAME} STREQUAL Darwin)
- cmake_minimum_required(VERSION 3.0.2)
-else()
- cmake_minimum_required(VERSION 2.8.12)
-endif()
+cmake_minimum_required(VERSION 3.15)
+message(STATUS "Patched cmake version")
include(CheckIncludeFiles)
include(CheckCCompilerFlag)

View File

@ -11,6 +11,4 @@ slsDetectorPackage/8.0.1_rh7 stable cmake/3.15.5 Qt/5.12.10
slsDetectorPackage/8.0.1_rh8 stable cmake/3.15.5 Qt/5.12.10 slsDetectorPackage/8.0.1_rh8 stable cmake/3.15.5 Qt/5.12.10
slsDetectorPackage/8.0.2_rh7 stable cmake/3.15.5 Qt/5.12.10 slsDetectorPackage/8.0.2_rh7 stable cmake/3.15.5 Qt/5.12.10
slsDetectorPackage/8.0.2_rh8 stable cmake/3.15.5 Qt/5.12.10 slsDetectorPackage/8.0.2_rh8 stable cmake/3.15.5 Qt/5.12.10
slsDetectorPackage/9.0.0_rh8 stable cmake/3.15.5 Qt/5.12.10

View File

@ -14,8 +14,6 @@ from pyctbgui.utils.defines import Defines
import pyctbgui.utils.pixelmap as pm import pyctbgui.utils.pixelmap as pm
from pyctbgui.utils.recordOrApplyPedestal import recordOrApplyPedestal from pyctbgui.utils.recordOrApplyPedestal import recordOrApplyPedestal
from slsdet import detectorType
if typing.TYPE_CHECKING: if typing.TYPE_CHECKING:
from pyctbgui.services import AcquisitionTab, PlotTab from pyctbgui.services import AcquisitionTab, PlotTab
@ -32,7 +30,6 @@ class AdcTab(QtWidgets.QWidget):
self.acquisitionTab: AcquisitionTab | None = None self.acquisitionTab: AcquisitionTab | None = None
self.legend: LegendItem | None = None self.legend: LegendItem | None = None
self.logger = logging.getLogger('AdcTab') self.logger = logging.getLogger('AdcTab')
self.tengiga = True
def setup_ui(self): def setup_ui(self):
self.plotTab = self.mainWindow.plotTab self.plotTab = self.mainWindow.plotTab
@ -46,12 +43,6 @@ class AdcTab(QtWidgets.QWidget):
# subscribe to toggle legend # subscribe to toggle legend
self.plotTab.subscribeToggleLegend(self.updateLegend) self.plotTab.subscribeToggleLegend(self.updateLegend)
if self.det.type == detectorType.XILINX_CHIPTESTBOARD:
self.view.checkBoxADC0_15Inv.setDisabled(True)
self.view.checkBoxADC16_31Inv.setDisabled(True)
self.view.lineEditADCInversion.setDisabled(True)
self.view.labelADCInversion.setDisabled(True)
def initializeAllAnalogPlots(self): def initializeAllAnalogPlots(self):
self.mainWindow.plotAnalogWaveform = pg.plot() self.mainWindow.plotAnalogWaveform = pg.plot()
self.mainWindow.plotAnalogWaveform.addLegend(colCount=Defines.colCount) self.mainWindow.plotAnalogWaveform.addLegend(colCount=Defines.colCount)
@ -76,8 +67,7 @@ class AdcTab(QtWidgets.QWidget):
def connect_ui(self): def connect_ui(self):
for i in range(Defines.adc.count): for i in range(Defines.adc.count):
if self.det.type == detectorType.CHIPTESTBOARD: getattr(self.view, f"checkBoxADC{i}Inv").stateChanged.connect(partial(self.setADCInv, i))
getattr(self.view, f"checkBoxADC{i}Inv").stateChanged.connect(partial(self.setADCInv, i))
getattr(self.view, f"checkBoxADC{i}En").stateChanged.connect(partial(self.setADCEnable, i)) getattr(self.view, f"checkBoxADC{i}En").stateChanged.connect(partial(self.setADCEnable, i))
getattr(self.view, f"checkBoxADC{i}Plot").stateChanged.connect(partial(self.setADCEnablePlot, i)) getattr(self.view, f"checkBoxADC{i}Plot").stateChanged.connect(partial(self.setADCEnablePlot, i))
getattr(self.view, f"pushButtonADC{i}").clicked.connect(partial(self.selectADCColor, i)) getattr(self.view, f"pushButtonADC{i}").clicked.connect(partial(self.selectADCColor, i))
@ -87,17 +77,15 @@ class AdcTab(QtWidgets.QWidget):
self.view.checkBoxADC0_15Plot.stateChanged.connect(partial(self.setADCEnablePlotRange, 0, Defines.adc.half)) self.view.checkBoxADC0_15Plot.stateChanged.connect(partial(self.setADCEnablePlotRange, 0, Defines.adc.half))
self.view.checkBoxADC16_31Plot.stateChanged.connect( self.view.checkBoxADC16_31Plot.stateChanged.connect(
partial(self.setADCEnablePlotRange, Defines.adc.half, Defines.adc.count)) partial(self.setADCEnablePlotRange, Defines.adc.half, Defines.adc.count))
self.view.lineEditADCEnable.editingFinished.connect(self.setADCEnableReg) self.view.checkBoxADC0_15Inv.stateChanged.connect(partial(self.setADCInvRange, 0, Defines.adc.half))
if self.det.type == detectorType.CHIPTESTBOARD: self.view.checkBoxADC16_31Inv.stateChanged.connect(
self.view.checkBoxADC0_15Inv.stateChanged.connect(partial(self.setADCInvRange, 0, Defines.adc.half))
self.view.checkBoxADC16_31Inv.stateChanged.connect(
partial(self.setADCInvRange, Defines.adc.half, Defines.adc.count)) partial(self.setADCInvRange, Defines.adc.half, Defines.adc.count))
self.view.lineEditADCInversion.editingFinished.connect(self.setADCInvReg) self.view.lineEditADCInversion.editingFinished.connect(self.setADCInvReg)
self.view.lineEditADCEnable.editingFinished.connect(self.setADCEnableReg)
def refresh(self): def refresh(self):
self.updateADCNames() self.updateADCNames()
if self.det.type == detectorType.CHIPTESTBOARD: self.updateADCInv()
self.updateADCInv()
self.updateADCEnable() self.updateADCEnable()
# ADCs Tab functions # ADCs Tab functions
@ -208,11 +196,9 @@ class AdcTab(QtWidgets.QWidget):
return decoder.decode(analog_array, pm.moench04_analog()) return decoder.decode(analog_array, pm.moench04_analog())
def getADCEnableReg(self): def getADCEnableReg(self):
if self.det.type == detectorType.CHIPTESTBOARD: retval = self.det.adcenable
self.tengiga = self.det.tengiga if self.det.tengiga:
retval = self.det.adcenable10g retval = self.det.adcenable10g
if not self.tengiga:
retval = self.det.adcenable
self.view.lineEditADCEnable.editingFinished.disconnect() self.view.lineEditADCEnable.editingFinished.disconnect()
self.view.lineEditADCEnable.setText("0x{:08x}".format(retval)) self.view.lineEditADCEnable.setText("0x{:08x}".format(retval))
self.view.lineEditADCEnable.editingFinished.connect(self.setADCEnableReg) self.view.lineEditADCEnable.editingFinished.connect(self.setADCEnableReg)
@ -221,8 +207,8 @@ class AdcTab(QtWidgets.QWidget):
def setADCEnableReg(self): def setADCEnableReg(self):
self.view.lineEditADCEnable.editingFinished.disconnect() self.view.lineEditADCEnable.editingFinished.disconnect()
try: try:
mask = int(self.view.lineEditADCEnable.text(), 16) mask = int(self.mainWindow.lineEditADCEnable.text(), 16)
if self.tengiga: if self.det.tengiga:
self.det.adcenable10g = mask self.det.adcenable10g = mask
else: else:
self.det.adcenable = mask self.det.adcenable = mask
@ -253,7 +239,7 @@ class AdcTab(QtWidgets.QWidget):
def setADCEnable(self, i): def setADCEnable(self, i):
checkBox = getattr(self.view, f"checkBoxADC{i}En") checkBox = getattr(self.view, f"checkBoxADC{i}En")
try: try:
if self.tengiga: if self.det.tengiga:
enableMask = manipulate_bit(checkBox.isChecked(), self.det.adcenable10g, i) enableMask = manipulate_bit(checkBox.isChecked(), self.det.adcenable10g, i)
self.det.adcenable10g = enableMask self.det.adcenable10g = enableMask
else: else:
@ -279,7 +265,7 @@ class AdcTab(QtWidgets.QWidget):
for i in range(start_nr, end_nr): for i in range(start_nr, end_nr):
mask = manipulate_bit(checkBox.isChecked(), mask, i) mask = manipulate_bit(checkBox.isChecked(), mask, i)
try: try:
if self.tengiga: if self.det.tengiga:
self.det.adcenable10g = mask self.det.adcenable10g = mask
else: else:
self.det.adcenable = mask self.det.adcenable = mask
@ -358,7 +344,7 @@ class AdcTab(QtWidgets.QWidget):
def setADCInvReg(self): def setADCInvReg(self):
self.view.lineEditADCInversion.editingFinished.disconnect() self.view.lineEditADCInversion.editingFinished.disconnect()
try: try:
self.det.adcinvert = int(self.view.lineEditADCInversion.text(), 16) self.det.adcinvert = int(self.mainWindow.lineEditADCInversion.text(), 16)
except Exception as e: except Exception as e:
QtWidgets.QMessageBox.warning(self.mainWindow, "ADC Inversion Fail", str(e), QtWidgets.QMessageBox.Ok) QtWidgets.QMessageBox.warning(self.mainWindow, "ADC Inversion Fail", str(e), QtWidgets.QMessageBox.Ok)
pass pass
@ -409,12 +395,7 @@ class AdcTab(QtWidgets.QWidget):
self.updateADCInv() self.updateADCInv()
def saveParameters(self) -> list[str]: def saveParameters(self) -> list[str]:
if self.det.type == detectorType.CHIPTESTBOARD: return [
return [ f"adcenable {self.view.lineEditADCEnable.text()}",
f"adcenable {self.view.lineEditADCEnable.text()}", f"adcinvert {self.view.lineEditADCInversion.text()}",
f"adcinvert {self.view.lineEditADCInversion.text()}", ]
]
else:
return [
f"adcenable {self.view.lineEditADCEnable.text()}"
]

View File

@ -7,7 +7,7 @@ import zmq
from PyQt5 import QtWidgets, uic from PyQt5 import QtWidgets, uic
import logging import logging
from slsdet import readoutMode, runStatus, detectorType from slsdet import readoutMode, runStatus
from pyctbgui.utils.defines import Defines from pyctbgui.utils.defines import Defines
from pyctbgui.utils.numpyWriter.npy_writer import NumpyFileManager from pyctbgui.utils.numpyWriter.npy_writer import NumpyFileManager
from pyctbgui.utils.numpyWriter.npz_writer import NpzFileWriter from pyctbgui.utils.numpyWriter.npz_writer import NpzFileWriter
@ -49,37 +49,20 @@ class AcquisitionTab(QtWidgets.QWidget):
self.adcTab = self.mainWindow.adcTab self.adcTab = self.mainWindow.adcTab
self.plotTab = self.mainWindow.plotTab self.plotTab = self.mainWindow.plotTab
self.toggleStartButton(False) self.toggleStartButton(False)
if self.det.type == detectorType.XILINX_CHIPTESTBOARD:
self.view.labelRunF.setDisabled(True)
self.view.labelADCF.setDisabled(True)
self.view.labelADCPhase.setDisabled(True)
self.view.labelADCPipeline.setDisabled(True)
self.view.labelDBITF.setDisabled(True)
self.view.labelDBITPhase.setDisabled(True)
self.view.labelDBITPipeline.setDisabled(True)
self.view.spinBoxRunF.setDisabled(True)
self.view.spinBoxADCF.setDisabled(True)
self.view.spinBoxADCPhase.setDisabled(True)
self.view.spinBoxADCPipeline.setDisabled(True)
self.view.spinBoxDBITF.setDisabled(True)
self.view.spinBoxDBITPhase.setDisabled(True)
self.view.spinBoxDBITPipeline.setDisabled(True)
def connect_ui(self): def connect_ui(self):
# For Acquistions Tab # For Acquistions Tab
self.view.comboBoxROMode.currentIndexChanged.connect(self.setReadOut) self.view.comboBoxROMode.currentIndexChanged.connect(self.setReadOut)
self.view.spinBoxRunF.editingFinished.connect(self.setRunFrequency)
self.view.spinBoxTransceiver.editingFinished.connect(self.setTransceiver) self.view.spinBoxTransceiver.editingFinished.connect(self.setTransceiver)
self.view.spinBoxAnalog.editingFinished.connect(self.setAnalog) self.view.spinBoxAnalog.editingFinished.connect(self.setAnalog)
self.view.spinBoxDigital.editingFinished.connect(self.setDigital) self.view.spinBoxDigital.editingFinished.connect(self.setDigital)
self.view.spinBoxADCF.editingFinished.connect(self.setADCFrequency)
if self.det.type == detectorType.CHIPTESTBOARD: self.view.spinBoxADCPhase.editingFinished.connect(self.setADCPhase)
self.view.spinBoxRunF.editingFinished.connect(self.setRunFrequency) self.view.spinBoxADCPipeline.editingFinished.connect(self.setADCPipeline)
self.view.spinBoxADCF.editingFinished.connect(self.setADCFrequency) self.view.spinBoxDBITF.editingFinished.connect(self.setDBITFrequency)
self.view.spinBoxADCPhase.editingFinished.connect(self.setADCPhase) self.view.spinBoxDBITPhase.editingFinished.connect(self.setDBITPhase)
self.view.spinBoxADCPipeline.editingFinished.connect(self.setADCPipeline) self.view.spinBoxDBITPipeline.editingFinished.connect(self.setDBITPipeline)
self.view.spinBoxDBITF.editingFinished.connect(self.setDBITFrequency)
self.view.spinBoxDBITPhase.editingFinished.connect(self.setDBITPhase)
self.view.spinBoxDBITPipeline.editingFinished.connect(self.setDBITPipeline)
self.view.checkBoxFileWriteRaw.stateChanged.connect(self.setFileWrite) self.view.checkBoxFileWriteRaw.stateChanged.connect(self.setFileWrite)
self.view.checkBoxFileWriteNumpy.stateChanged.connect(self.setFileWriteNumpy) self.view.checkBoxFileWriteNumpy.stateChanged.connect(self.setFileWriteNumpy)
@ -94,19 +77,16 @@ class AcquisitionTab(QtWidgets.QWidget):
def refresh(self): def refresh(self):
self.getReadout() self.getReadout()
self.getRunFrequency()
self.getTransceiver() self.getTransceiver()
self.getAnalog() self.getAnalog()
self.getDigital() self.getDigital()
self.getADCFrequency()
if self.det.type == detectorType.CHIPTESTBOARD: self.getADCPhase()
self.getRunFrequency() self.getADCPipeline()
self.getADCFrequency() self.getDBITFrequency()
self.getADCPhase() self.getDBITPhase()
self.getADCPipeline() self.getDBITPipeline()
self.getDBITFrequency()
self.getDBITPhase()
self.getDBITPipeline()
self.getFileWrite() self.getFileWrite()
self.getFileName() self.getFileName()
self.getFilePath() self.getFilePath()
@ -717,39 +697,23 @@ class AcquisitionTab(QtWidgets.QWidget):
self.socket.subscribe("") self.socket.subscribe("")
def saveParameters(self) -> list[str]: def saveParameters(self) -> list[str]:
if self.det.type == detectorType.CHIPTESTBOARD: return [
return [ f'romode {self.view.comboBoxROMode.currentText().lower()}',
f'romode {self.view.comboBoxROMode.currentText().lower()}', f'runclk {self.view.spinBoxRunF.value()}',
f'runclk {self.view.spinBoxRunF.value()}', f'adcclk {self.view.spinBoxADCF.value()}',
f'adcclk {self.view.spinBoxADCF.value()}', f'adcphase {self.view.spinBoxADCPhase.value()}',
f'adcphase {self.view.spinBoxADCPhase.value()}', f'adcpipeline {self.view.spinBoxADCPipeline.value()}',
f'adcpipeline {self.view.spinBoxADCPipeline.value()}', f'dbitclk {self.view.spinBoxDBITF.value()}',
f'dbitclk {self.view.spinBoxDBITF.value()}', f'dbitphase {self.view.spinBoxDBITPhase.value()}',
f'dbitphase {self.view.spinBoxDBITPhase.value()}', f'dbitpipeline {self.view.spinBoxDBITPipeline.value()}',
f'dbitpipeline {self.view.spinBoxDBITPipeline.value()}', f'fwrite {int(self.view.checkBoxFileWriteRaw.isChecked())}',
f'fwrite {int(self.view.checkBoxFileWriteRaw.isChecked())}', f'fname {self.view.lineEditFileName.text()}',
f'fname {self.view.lineEditFileName.text()}', f'fpath {self.view.lineEditFilePath.text()}',
f'fpath {self.view.lineEditFilePath.text()}', f'findex {self.view.spinBoxAcquisitionIndex.value()}',
f'findex {self.view.spinBoxAcquisitionIndex.value()}', f'frames {self.view.spinBoxFrames.value()}',
f'frames {self.view.spinBoxFrames.value()}', f'triggers {self.view.spinBoxTriggers.value()}',
f'triggers {self.view.spinBoxTriggers.value()}', f'period {self.view.spinBoxPeriod.value()} {self.view.comboBoxPeriod.currentText().lower()}',
f'period {self.view.spinBoxPeriod.value()} {self.view.comboBoxPeriod.currentText().lower()}', f'asamples {self.view.spinBoxAnalog.value()}',
f'asamples {self.view.spinBoxAnalog.value()}', f'dsamples {self.view.spinBoxDigital.value()}',
f'dsamples {self.view.spinBoxDigital.value()}', f'tsamples {self.view.spinBoxTransceiver.value()}',
f'tsamples {self.view.spinBoxTransceiver.value()}', ]
]
else:
return [
f'romode {self.view.comboBoxROMode.currentText().lower()}',
f'fwrite {int(self.view.checkBoxFileWriteRaw.isChecked())}',
f'fname {self.view.lineEditFileName.text()}',
f'fpath {self.view.lineEditFilePath.text()}',
f'findex {self.view.spinBoxAcquisitionIndex.value()}',
f'frames {self.view.spinBoxFrames.value()}',
f'triggers {self.view.spinBoxTriggers.value()}',
f'period {self.view.spinBoxPeriod.value()} {self.view.comboBoxPeriod.currentText().lower()}',
f'asamples {self.view.spinBoxAnalog.value()}',
f'dsamples {self.view.spinBoxDigital.value()}',
f'tsamples {self.view.spinBoxTransceiver.value()}',
]

View File

@ -4,7 +4,7 @@ from pathlib import Path
from PyQt5 import QtWidgets, uic from PyQt5 import QtWidgets, uic
from pyctbgui.utils.defines import Defines from pyctbgui.utils.defines import Defines
from slsdet import dacIndex, detectorType from slsdet import dacIndex
class DacTab(QtWidgets.QWidget): class DacTab(QtWidgets.QWidget):
@ -19,14 +19,7 @@ class DacTab(QtWidgets.QWidget):
dac = getattr(dacIndex, f"DAC_{i}") dac = getattr(dacIndex, f"DAC_{i}")
getattr(self.view, f"spinBoxDAC{i}").setValue(self.det.getDAC(dac)[0]) getattr(self.view, f"spinBoxDAC{i}").setValue(self.det.getDAC(dac)[0])
if self.det.type == detectorType.XILINX_CHIPTESTBOARD: if self.det.highvoltage == 0:
self.view.checkBoxHighVoltage.setDisabled(True)
self.view.spinBoxHighVoltage.setDisabled(True)
self.view.labelHighVoltage.setDisabled(True)
self.view.labelADCVppDacName.setDisabled(True)
self.view.labelADCVpp.setDisabled(True)
self.view.comboBoxADCVpp.setDisabled(True)
elif self.det.highvoltage == 0:
self.view.spinBoxHighVoltage.setDisabled(True) self.view.spinBoxHighVoltage.setDisabled(True)
self.view.checkBoxHighVoltage.setChecked(False) self.view.checkBoxHighVoltage.setChecked(False)
@ -37,11 +30,9 @@ class DacTab(QtWidgets.QWidget):
getattr(self.view, f"checkBoxDAC{i}").stateChanged.connect(partial(self.setDACTristate, i)) getattr(self.view, f"checkBoxDAC{i}").stateChanged.connect(partial(self.setDACTristate, i))
getattr(self.view, f"checkBoxDAC{i}mV").stateChanged.connect(partial(self.getDAC, i)) getattr(self.view, f"checkBoxDAC{i}mV").stateChanged.connect(partial(self.getDAC, i))
if self.view.comboBoxADCVpp.isEnabled(): self.view.comboBoxADCVpp.currentIndexChanged.connect(self.setADCVpp)
self.view.comboBoxADCVpp.currentIndexChanged.connect(self.setADCVpp) self.view.spinBoxHighVoltage.editingFinished.connect(self.setHighVoltage)
if self.view.checkBoxHighVoltage.isEnabled(): self.view.checkBoxHighVoltage.stateChanged.connect(self.setHighVoltage)
self.view.spinBoxHighVoltage.editingFinished.connect(self.setHighVoltage)
self.view.checkBoxHighVoltage.stateChanged.connect(self.setHighVoltage)
def refresh(self): def refresh(self):
self.updateDACNames() self.updateDACNames()
@ -49,10 +40,8 @@ class DacTab(QtWidgets.QWidget):
self.getDACTristate(i) self.getDACTristate(i)
self.getDAC(i) self.getDAC(i)
if self.view.comboBoxADCVpp.isEnabled(): self.getADCVpp()
self.getADCVpp() self.getHighVoltage()
if self.view.checkBoxHighVoltage.isEnabled():
self.getHighVoltage()
def updateDACNames(self): def updateDACNames(self):
for i, name in enumerate(self.det.getDacNames()): for i, name in enumerate(self.det.getDacNames()):
@ -176,8 +165,6 @@ class DacTab(QtWidgets.QWidget):
unit = " mV" if inMV else "" unit = " mV" if inMV else ""
commands.append(f"dac {i} {value}{unit}") commands.append(f"dac {i} {value}{unit}")
if self.view.comboBoxADCVpp.isEnabled(): commands.append(f"adcvpp {self.view.comboBoxADCVpp.currentText()} mV")
commands.append(f"adcvpp {self.view.comboBoxADCVpp.currentText()} mV") commands.append(f"highvoltage {self.view.spinBoxHighVoltage.value()}")
if self.view.checkBoxHighVoltage.isEnabled():
commands.append(f"highvoltage {self.view.spinBoxHighVoltage.value()}")
return commands return commands

View File

@ -4,7 +4,7 @@ from pathlib import Path
from PyQt5 import QtWidgets, uic from PyQt5 import QtWidgets, uic
from pyctbgui.utils.defines import Defines from pyctbgui.utils.defines import Defines
from slsdet import dacIndex, detectorType from slsdet import dacIndex
class PowerSuppliesTab(QtWidgets.QWidget): class PowerSuppliesTab(QtWidgets.QWidget):
@ -18,8 +18,7 @@ class PowerSuppliesTab(QtWidgets.QWidget):
self.updateVoltageNames() self.updateVoltageNames()
for i in Defines.powerSupplies: for i in Defines.powerSupplies:
self.getVoltage(i) self.getVoltage(i)
if self.det.type == detectorType.CHIPTESTBOARD: self.getCurrent(i)
self.getCurrent(i)
def connect_ui(self): def connect_ui(self):
for i in Defines.powerSupplies: for i in Defines.powerSupplies:
@ -39,12 +38,6 @@ class PowerSuppliesTab(QtWidgets.QWidget):
if retval == 0: if retval == 0:
checkBox.setChecked(False) checkBox.setChecked(False)
spinBox.setDisabled(True) spinBox.setDisabled(True)
if self.det.type == detectorType.XILINX_CHIPTESTBOARD:
label = getattr(self.view, f"labelI{i}")
label.setDisabled(True)
if self.det.type == detectorType.XILINX_CHIPTESTBOARD:
self.view.spinBoxVChip.setDisabled(True)
def updateVoltageNames(self): def updateVoltageNames(self):
retval = self.det.getPowerNames() retval = self.det.getPowerNames()
@ -63,10 +56,7 @@ class PowerSuppliesTab(QtWidgets.QWidget):
spinBox.editingFinished.disconnect() spinBox.editingFinished.disconnect()
checkBox.stateChanged.disconnect() checkBox.stateChanged.disconnect()
if self.det.type == detectorType.XILINX_CHIPTESTBOARD: retval = self.det.getMeasuredPower(voltageIndex)[0]
retval = self.det.getPower(voltageIndex)[0]
else:
retval = self.det.getMeasuredPower(voltageIndex)[0]
# spinBox.setValue(retval) # spinBox.setValue(retval)
if retval > 1: if retval > 1:
checkBox.setChecked(True) checkBox.setChecked(True)
@ -79,8 +69,7 @@ class PowerSuppliesTab(QtWidgets.QWidget):
spinBox.editingFinished.connect(partial(self.setVoltage, i)) spinBox.editingFinished.connect(partial(self.setVoltage, i))
checkBox.stateChanged.connect(partial(self.setVoltage, i)) checkBox.stateChanged.connect(partial(self.setVoltage, i))
if self.det.type == detectorType.CHIPTESTBOARD: self.getVChip()
self.getVChip()
# TODO: handle multiple events when pressing enter (twice) # TODO: handle multiple events when pressing enter (twice)
@ -102,8 +91,7 @@ class PowerSuppliesTab(QtWidgets.QWidget):
# TODO: (properly) disconnecting and connecting to handle multiple events (out of focus and pressing enter). # TODO: (properly) disconnecting and connecting to handle multiple events (out of focus and pressing enter).
spinBox.editingFinished.connect(partial(self.setVoltage, i)) spinBox.editingFinished.connect(partial(self.setVoltage, i))
self.getVoltage(i) self.getVoltage(i)
if self.det.type == detectorType.CHIPTESTBOARD: self.getCurrent(i)
self.getCurrent(i)
def getCurrent(self, i): def getCurrent(self, i):
label = getattr(self.view, f"labelI{i}") label = getattr(self.view, f"labelI{i}")

View File

@ -4,7 +4,7 @@ from pathlib import Path
from PyQt5 import uic, QtWidgets from PyQt5 import uic, QtWidgets
from pyctbgui.utils.defines import Defines from pyctbgui.utils.defines import Defines
from slsdet import dacIndex, detectorType from slsdet import dacIndex
class SlowAdcTab(QtWidgets.QWidget): class SlowAdcTab(QtWidgets.QWidget):
@ -17,8 +17,7 @@ class SlowAdcTab(QtWidgets.QWidget):
self.det = None self.det = None
def setup_ui(self): def setup_ui(self):
if self.det.type == detectorType.XILINX_CHIPTESTBOARD: pass
self.view.pushButtonTemp.setDisabled(True)
def connect_ui(self): def connect_ui(self):
for i in range(Defines.slowAdc.count): for i in range(Defines.slowAdc.count):
@ -29,8 +28,7 @@ class SlowAdcTab(QtWidgets.QWidget):
self.updateSlowAdcNames() self.updateSlowAdcNames()
for i in range(Defines.slowAdc.count): for i in range(Defines.slowAdc.count):
self.updateSlowAdc(i) self.updateSlowAdc(i)
if self.det.type == detectorType.CHIPTESTBOARD: self.updateTemperature()
self.updateTemperature()
def updateSlowAdcNames(self): def updateSlowAdcNames(self):
for i, name in enumerate(self.mainWindow.det.getSlowADCNames()): for i, name in enumerate(self.mainWindow.det.getSlowADCNames()):

View File

@ -817,7 +817,7 @@ Only pressing enter on spinbox will set DAC (with this condition).</string>
</widget> </widget>
</item> </item>
<item row="18" column="0"> <item row="18" column="0">
<widget class="QLabel" name="labelADCVppDacName"> <widget class="QLabel" name="label_125">
<property name="text"> <property name="text">
<string>ADC_VPP</string> <string>ADC_VPP</string>
</property> </property>

View File

@ -118,7 +118,7 @@
</widget> </widget>
</item> </item>
<item row="1" column="4"> <item row="1" column="4">
<widget class="QLabel" name="labelRunF"> <widget class="QLabel" name="label_70">
<property name="text"> <property name="text">
<string>Run Clock Frequency (MHz):</string> <string>Run Clock Frequency (MHz):</string>
</property> </property>
@ -218,7 +218,7 @@
</property> </property>
<layout class="QGridLayout" name="gridLayout_6"> <layout class="QGridLayout" name="gridLayout_6">
<item row="2" column="3"> <item row="2" column="3">
<widget class="QLabel" name="labelDBITF"> <widget class="QLabel" name="label_74">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>200</width> <width>200</width>
@ -231,7 +231,7 @@
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="2" column="0">
<widget class="QLabel" name="labelADCF"> <widget class="QLabel" name="label_71">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred"> <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -278,7 +278,7 @@
</widget> </widget>
</item> </item>
<item row="4" column="3"> <item row="4" column="3">
<widget class="QLabel" name="labelDBITPipeline"> <widget class="QLabel" name="label_76">
<property name="text"> <property name="text">
<string>DBIT Pipeline:</string> <string>DBIT Pipeline:</string>
</property> </property>
@ -338,21 +338,21 @@
</widget> </widget>
</item> </item>
<item row="4" column="0"> <item row="4" column="0">
<widget class="QLabel" name="labelADCPipeline"> <widget class="QLabel" name="label_73">
<property name="text"> <property name="text">
<string>ADC Pipeline:</string> <string>ADC Pipeline:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0"> <item row="3" column="0">
<widget class="QLabel" name="labelADCPhase"> <widget class="QLabel" name="label_72">
<property name="text"> <property name="text">
<string>ADC Clock Phase (a.u.):</string> <string>ADC Clock Phase (a.u.):</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="3"> <item row="3" column="3">
<widget class="QLabel" name="labelDBITPhase"> <widget class="QLabel" name="label_75">
<property name="text"> <property name="text">
<string>DBIT Clock Phase (a.u.):</string> <string>DBIT Clock Phase (a.u.):</string>
</property> </property>

View File

@ -19,7 +19,7 @@
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<widget class="QFrame" name="frame_ADC"> <widget class="QFrame" name="frame_7">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
@ -3142,7 +3142,7 @@
</property> </property>
<layout class="QGridLayout" name="gridLayout_20"> <layout class="QGridLayout" name="gridLayout_20">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="labelADCInversion"> <widget class="QLabel" name="label_67">
<property name="font"> <property name="font">
<font> <font>
<pointsize>10</pointsize> <pointsize>10</pointsize>
@ -3188,7 +3188,7 @@
</widget> </widget>
</item> </item>
<item row="0" column="3"> <item row="0" column="3">
<widget class="QLabel" name="labelADCEnable"> <widget class="QLabel" name="label_68">
<property name="font"> <property name="font">
<font> <font>
<pointsize>10</pointsize> <pointsize>10</pointsize>

View File

@ -19,7 +19,7 @@
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<widget class="QFrame" name="frame_slowadcs"> <widget class="QFrame" name="frame_4">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>

View File

@ -1,37 +0,0 @@
[tool.scikit-build.metadata.version]
provider = "scikit_build_core.metadata.regex"
input = "VERSION"
regex = '^(?P<version>\d+(?:\.\d+)*(?:[\.\+\w]+)?)$'
result = "{version}"
[build-system]
requires = [ "scikit-build-core>=0.10", "pybind11", "numpy",]
build-backend = "scikit_build_core.build"
[project]
name = "slsdet"
dynamic = ["version"]
dependencies = [
"numpy",
]
[tool.cibuildwheel]
before-all = "uname -a"
build = "cp{311,312,313}-manylinux_x86_64"
[tool.scikit-build.build]
verbose = true
[tool.scikit-build.cmake]
build-type = "Release"
[tool.scikit-build.install]
components = [ "python",]
[tool.scikit-build.cmake.define]
SLS_USE_RECEIVER = "OFF"
SLS_USE_RECEIVER_BINARIES = "OFF"
SLS_USE_TEXTCLIENT = "OFF"
SLS_BUILD_SHARED_LIBRARIES = "OFF"
SLS_USE_PYTHON = "ON"
SLS_INSTALL_PYTHONEXT = "ON"

View File

@ -20,7 +20,7 @@ target_link_libraries(_slsdet PUBLIC
set_target_properties(_slsdet PROPERTIES set_target_properties(_slsdet PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/slsdet LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
) )
#Copy Python code #Copy Python code
@ -64,10 +64,6 @@ configure_file( scripts/test_virtual.py
${CMAKE_BINARY_DIR}/test_virtual.py ${CMAKE_BINARY_DIR}/test_virtual.py
) )
configure_file(scripts/frameSynchronizerPullSocket.py
${CMAKE_BINARY_DIR}/bin/frameSynchronizerPullSocket.py COPYONLY)
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/../VERSION configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/../VERSION
${CMAKE_BINARY_DIR}/bin/slsdet/VERSION ${CMAKE_BINARY_DIR}/bin/slsdet/VERSION
) )
@ -75,18 +71,9 @@ configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/../VERSION
if(SLS_INSTALL_PYTHONEXT) if(SLS_INSTALL_PYTHONEXT)
install(TARGETS _slsdet install(TARGETS _slsdet
EXPORT "${TARGETS_EXPORT_NAME}" EXPORT "${TARGETS_EXPORT_NAME}"
LIBRARY DESTINATION slsdet LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/python
COMPONENT python
) )
install(
FILES ${PYTHON_FILES}
DESTINATION slsdet
COMPONENT python
)
install(
FILES ../VERSION
DESTINATION slsdet
COMPONENT python
)
install(FILES ${PYTHON_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/python/slsdet)
install(FILES ../VERSION DESTINATION ${CMAKE_INSTALL_PREFIX}/python/slsdet)
endif() endif()

View File

@ -1,19 +0,0 @@
# SPDX-License-Identifier: LGPL-3.0-or-other
# Copyright (C) 2021 Contributors to the SLS Detector Package
# Script to get combined zmq packets from frame synchronizer using pull zmq sockets
import json
import zmq
c = zmq.Context()
s = c.socket(zmq.PULL)
s.connect("tcp://127.0.0.1:5555")
while True:
m = s.recv_multipart()
for p in m:
if p.startswith(b"{"):
print(p.decode().strip())
else:
print("binary")
print("--------")

View File

@ -123,9 +123,6 @@ def visit(node):
if node.kind == cindex.CursorKind.CLASS_DECL: if node.kind == cindex.CursorKind.CLASS_DECL:
if node.displayname == "Detector": if node.displayname == "Detector":
for child in node.get_children(): for child in node.get_children():
# Skip assignment operators
if child.kind == cindex.CursorKind.CXX_METHOD and child.spelling == "operator=":
continue
if ( if (
child.kind == cindex.CursorKind.CXX_METHOD child.kind == cindex.CursorKind.CXX_METHOD
and child.access_specifier == cindex.AccessSpecifier.PUBLIC and child.access_specifier == cindex.AccessSpecifier.PUBLIC

77
python/setup.py Executable file
View File

@ -0,0 +1,77 @@
# SPDX-License-Identifier: LGPL-3.0-or-other
# Copyright (C) 2021 Contributors to the SLS Detector Package
"""
Setup file for slsdet
Build upon the pybind11 example found here: https://github.com/pybind/python_example
"""
import os
import sys
from setuptools import setup, find_packages
from pybind11.setup_helpers import Pybind11Extension, build_ext
def read_version():
try:
version_file = os.path.join(os.path.dirname(__file__), 'slsdet', 'VERSION')
with open(version_file, "r") as f:
return f.read().strip()
except:
raise RuntimeError("VERSION file not found in slsdet package from setup.py.")
__version__ = read_version()
def get_conda_path():
"""
Keep this a function if we need some fancier logic later
"""
print('Prefix: ', os.environ['CONDA_PREFIX'])
return os.environ['CONDA_PREFIX']
#TODO migrate to CMake build or fetch files from cmake?
ext_modules = [
Pybind11Extension(
'_slsdet',
['src/main.cpp',
'src/enums.cpp',
'src/current.cpp',
'src/detector.cpp',
'src/network.cpp',
'src/pattern.cpp',
'src/scan.cpp',
'src/duration.cpp',
'src/DurationWrapper.cpp',
'src/pedestal.cpp',
]
,
include_dirs=[
os.path.join(get_conda_path(), 'include'),
],
libraries=['SlsDetector', 'SlsSupport', 'SlsReceiver'],
library_dirs=[
os.path.join(get_conda_path(), 'lib'),
],
language='c++'
),
]
setup(
name='slsdet',
version=__version__,
author='Erik Frojdh',
author_email='erik.frojdh@psi.ch',
url='https://github.com/slsdetectorgroup/slsDetectorPackage',
description='Detector API for SLS Detector Group detectors',
long_description='',
packages=find_packages(exclude=['contrib', 'docs', 'tests']),
package_data={
'slsdet': ['VERSION'],
},
ext_modules=ext_modules,
cmdclass={"build_ext": build_ext},
zip_safe=False,
)

View File

@ -14,7 +14,7 @@ from .moench import Moench
from .pattern import Pattern, patternParameters from .pattern import Pattern, patternParameters
from .gaincaps import Mythen3GainCapsWrapper from .gaincaps import Mythen3GainCapsWrapper
from . import _slsdet import _slsdet
xy = _slsdet.xy xy = _slsdet.xy
defs = _slsdet.slsDetectorDefs defs = _slsdet.slsDetectorDefs
@ -41,6 +41,3 @@ def read_version():
__version__ = read_version() __version__ = read_version()

View File

@ -4,7 +4,7 @@ from .detector import Detector, freeze
from .utils import element_if_equal from .utils import element_if_equal
from .dacs import DetectorDacs, NamedDacs from .dacs import DetectorDacs, NamedDacs
from .powers import DetectorPowers, NamedPowers from .powers import DetectorPowers, NamedPowers
from . import _slsdet import _slsdet
dacIndex = _slsdet.slsDetectorDefs.dacIndex dacIndex = _slsdet.slsDetectorDefs.dacIndex
from .detector_property import DetectorProperty from .detector_property import DetectorProperty

View File

@ -3,7 +3,7 @@
from .detector_property import DetectorProperty from .detector_property import DetectorProperty
from functools import partial from functools import partial
import numpy as np import numpy as np
from . import _slsdet import _slsdet
from .detector import freeze from .detector import freeze
dacIndex = _slsdet.slsDetectorDefs.dacIndex dacIndex = _slsdet.slsDetectorDefs.dacIndex
class Dac(DetectorProperty): class Dac(DetectorProperty):

View File

@ -1,8 +1,8 @@
# SPDX-License-Identifier: LGPL-3.0-or-other # SPDX-License-Identifier: LGPL-3.0-or-other
# Copyright (C) 2021 Contributors to the SLS Detector Package # Copyright (C) 2021 Contributors to the SLS Detector Package
from ._slsdet import CppDetectorApi from _slsdet import CppDetectorApi
from ._slsdet import slsDetectorDefs from _slsdet import slsDetectorDefs
from ._slsdet import IpAddr, MacAddr from _slsdet import IpAddr, MacAddr
runStatus = slsDetectorDefs.runStatus runStatus = slsDetectorDefs.runStatus
timingMode = slsDetectorDefs.timingMode timingMode = slsDetectorDefs.timingMode
@ -15,7 +15,7 @@ defs = slsDetectorDefs
from .utils import element_if_equal, all_equal, get_set_bits, list_to_bitmask from .utils import element_if_equal, all_equal, get_set_bits, list_to_bitmask
from .utils import Geometry, to_geo, element, reduce_time, is_iterable, hostname_list from .utils import Geometry, to_geo, element, reduce_time, is_iterable, hostname_list
from ._slsdet import xy from _slsdet import xy
from .gaincaps import Mythen3GainCapsWrapper from .gaincaps import Mythen3GainCapsWrapper
from . import utils as ut from . import utils as ut
from .proxy import JsonProxy, SlowAdcProxy, ClkDivProxy, MaxPhaseProxy, ClkFreqProxy, PatLoopProxy, PatNLoopProxy, PatWaitProxy, PatWaitTimeProxy from .proxy import JsonProxy, SlowAdcProxy, ClkDivProxy, MaxPhaseProxy, ClkFreqProxy, PatLoopProxy, PatNLoopProxy, PatWaitProxy, PatWaitTimeProxy
@ -152,10 +152,6 @@ class Detector(CppDetectorApi):
"""Frees shared memory and sets hostname (or IP address) of all modules concatenated by + """Frees shared memory and sets hostname (or IP address) of all modules concatenated by +
Virtual servers can already use the port in hostname separated by ':' and ports incremented by 2 to accomodate the stop server as well. Virtual servers can already use the port in hostname separated by ':' and ports incremented by 2 to accomodate the stop server as well.
Note
-----
The row and column values in the udp/zmq header are affected by the order in this command and the detsize command. The modules are stacked row by row until they reach the y-axis limit set by detsize (if specified). Then, stacking continues in the next column and so on. This only affects row and column in udp/zmq header.
Example Example
------- -------
>>> d.hostname = 'beb031+beb032+' >>> d.hostname = 'beb031+beb032+'
@ -2570,7 +2566,7 @@ class Detector(CppDetectorApi):
Note Note
----- -----
By default, the on-chip gain switching is active during the entire exposure. This mode disables the on-chip gain switching comparator automatically and the duration is set using compdisabletime.\n By default, the on-chip gain switching is active during the entire exposure. This mode disables the on-chip gain switching comparator automatically after 93.75% of exposure time (only for longer than 100us). The % is only for chipv1.0, the duration can be set for chipv1.1.\n
Default is 0 or this mode disabled (comparator enabled throughout). 1 enables mode. 0 disables mode. Default is 0 or this mode disabled (comparator enabled throughout). 1 enables mode. 0 disables mode.
""" """
return self.getAutoComparatorDisable() return self.getAutoComparatorDisable()
@ -2584,6 +2580,10 @@ class Detector(CppDetectorApi):
def compdisabletime(self): def compdisabletime(self):
"""[Jungfrau] Time before end of exposure when comparator is disabled. """[Jungfrau] Time before end of exposure when comparator is disabled.
Note
-----
It is only possible for chipv1.1.
:getter: always returns in seconds. To get in DurationWrapper, use getComparatorDisableTime :getter: always returns in seconds. To get in DurationWrapper, use getComparatorDisableTime
Example Example
@ -2913,7 +2913,7 @@ class Detector(CppDetectorApi):
@property @property
@element @element
def timing_info_decoder(self): def timing_info_decoder(self):
"""[Jungfrau] [Jungfrau] Advanced Command and only for SWISSFEL and SHINE. Sets the bunch id or timing info decoder. Default is SWISSFEL. Only allowed for pcbv2.0. """[Jungfrau] [Jungfrau] Advanced Command and only for SWISSFEL and SHINE. Sets the bunch id or timing info decoder. Default is SWISSFEL.
Enum: timingInfoDecoder Enum: timingInfoDecoder
""" """
return self.getTimingInfoDecoder() return self.getTimingInfoDecoder()

View File

@ -11,7 +11,7 @@ Created on Wed Dec 6 11:51:18 2017
from .detector import Detector from .detector import Detector
from .temperature import Temperature, DetectorTemperature from .temperature import Temperature, DetectorTemperature
from .dacs import DetectorDacs from .dacs import DetectorDacs
from . import _slsdet import _slsdet
dacIndex = _slsdet.slsDetectorDefs.dacIndex dacIndex = _slsdet.slsDetectorDefs.dacIndex
from .detector_property import DetectorProperty from .detector_property import DetectorProperty

View File

@ -15,8 +15,8 @@ if dt === detectorType.EIGER:
""" """
from . import _slsdet import _slsdet
for name, cls in _slsdet.slsDetectorDefs.__dict__.items(): for name, cls in _slsdet.slsDetectorDefs.__dict__.items():
if isinstance(cls, type): if isinstance(cls, type):
exec(f'{name} = _slsdet.{cls.__qualname__}') exec(f'{name} = {cls.__module__}.{cls.__qualname__}')

View File

@ -1,6 +1,6 @@
from . import _slsdet import _slsdet
gc = _slsdet.slsDetectorDefs.M3_GainCaps gc = _slsdet.slsDetectorDefs.M3_GainCaps

View File

@ -9,7 +9,7 @@ This file contains the specialization for the Moench detector
from .detector import Detector, freeze from .detector import Detector, freeze
from .dacs import DetectorDacs from .dacs import DetectorDacs
from . import _slsdet import _slsdet
dacIndex = _slsdet.slsDetectorDefs.dacIndex dacIndex = _slsdet.slsDetectorDefs.dacIndex
from .detector_property import DetectorProperty from .detector_property import DetectorProperty

View File

@ -11,7 +11,7 @@ from .detector import Detector, freeze
# from .adcs import Adc, DetectorAdcs # from .adcs import Adc, DetectorAdcs
from .dacs import DetectorDacs from .dacs import DetectorDacs
from . import _slsdet import _slsdet
dacIndex = _slsdet.slsDetectorDefs.dacIndex dacIndex = _slsdet.slsDetectorDefs.dacIndex
from .detector_property import DetectorProperty from .detector_property import DetectorProperty

View File

@ -11,7 +11,7 @@ from .detector import Detector, freeze
# from .adcs import Adc, DetectorAdcs # from .adcs import Adc, DetectorAdcs
from .dacs import DetectorDacs from .dacs import DetectorDacs
from . import _slsdet import _slsdet
dacIndex = _slsdet.slsDetectorDefs.dacIndex dacIndex = _slsdet.slsDetectorDefs.dacIndex
from .detector_property import DetectorProperty from .detector_property import DetectorProperty

View File

@ -9,7 +9,7 @@ This file contains the specialization for the Moench detector
from .detector import Detector, freeze from .detector import Detector, freeze
from .dacs import DetectorDacs from .dacs import DetectorDacs
from . import _slsdet import _slsdet
dacIndex = _slsdet.slsDetectorDefs.dacIndex dacIndex = _slsdet.slsDetectorDefs.dacIndex
from .detector_property import DetectorProperty from .detector_property import DetectorProperty

View File

@ -11,7 +11,7 @@ from .detector import Detector, freeze
# from .adcs import Adc, DetectorAdcs # from .adcs import Adc, DetectorAdcs
from .dacs import DetectorDacs from .dacs import DetectorDacs
from . import _slsdet import _slsdet
dacIndex = _slsdet.slsDetectorDefs.dacIndex dacIndex = _slsdet.slsDetectorDefs.dacIndex
gc_enums = _slsdet.slsDetectorDefs.M3_GainCaps gc_enums = _slsdet.slsDetectorDefs.M3_GainCaps
from .detector_property import DetectorProperty from .detector_property import DetectorProperty

View File

@ -1,8 +1,8 @@
# SPDX-License-Identifier: LGPL-3.0-or-other # SPDX-License-Identifier: LGPL-3.0-or-other
# Copyright (C) 2021 Contributors to the SLS Detector Package # Copyright (C) 2021 Contributors to the SLS Detector Package
from . import _slsdet import _slsdet
from ._slsdet import Pattern from _slsdet import Pattern
class patternParameters(_slsdet.patternParameters): class patternParameters(_slsdet.patternParameters):

View File

@ -3,7 +3,7 @@
from .detector_property import DetectorProperty from .detector_property import DetectorProperty
from functools import partial from functools import partial
import numpy as np import numpy as np
from . import _slsdet import _slsdet
from .detector import freeze from .detector import freeze
dacIndex = _slsdet.slsDetectorDefs.dacIndex dacIndex = _slsdet.slsDetectorDefs.dacIndex
class Power(DetectorProperty): class Power(DetectorProperty):

View File

@ -3,7 +3,7 @@
from .utils import element_if_equal from .utils import element_if_equal
from .enums import dacIndex from .enums import dacIndex
from .defines import M3_MAX_PATTERN_LEVELS, MAX_PATTERN_LEVELS from .defines import M3_MAX_PATTERN_LEVELS, MAX_PATTERN_LEVELS
from ._slsdet import slsDetectorDefs from _slsdet import slsDetectorDefs
detectorType = slsDetectorDefs.detectorType detectorType = slsDetectorDefs.detectorType

View File

@ -6,7 +6,7 @@ but not directly used in controlling the detector
""" """
from collections import namedtuple from collections import namedtuple
from . import _slsdet #C++ lib import _slsdet #C++ lib
import functools import functools
import datetime as dt import datetime as dt
import pathlib import pathlib

View File

@ -1,4 +1,3 @@
#include <chrono>
#include "py_headers.h" #include "py_headers.h"
#include "DurationWrapper.h" #include "DurationWrapper.h"
@ -20,25 +19,4 @@ void init_duration(py::module &m) {
<< " count: " << self.count() << ")"; << " count: " << self.count() << ")";
return ss.str(); return ss.str();
}); });
m.def(
"test_return_DurationWrapper",
[]() {
DurationWrapper t(1.3);
return t;
},
R"(
Test function to return a DurationWrapper object. Ensures that the automatic conversion in typecaster.h works.
)");
m.def(
"test_duration_to_ns",
[](const std::chrono::nanoseconds t) {
//Duration wrapper is used to be able to convert from time in python to chrono::nanoseconds
//return count to have something to test
return t.count();
},
R"(
Test function convert DurationWrapper or number to chrono::ns. Ensures that the automatic conversion in typecaster.h works.
)"); // default value to test the default constructor
} }

View File

@ -54,16 +54,11 @@ template <> struct type_caster<std::chrono::nanoseconds> {
value = duration_cast<nanoseconds>(duration<double>(PyFloat_AsDouble(src.ptr()))); value = duration_cast<nanoseconds>(duration<double>(PyFloat_AsDouble(src.ptr())));
return true; return true;
} }
// If invoked with an int we assume it is nanoseconds and convert, same as in chrono.h
if (PyLong_Check(src.ptr())) {
value = duration_cast<nanoseconds>(duration<int64_t>(PyLong_AsLongLong(src.ptr())));
return true;
}
// Lastly if we were actually called with a DurationWrapper object we get // Lastly if we were actually called with a DurationWrapper object we get
// the number of nanoseconds and create a std::chrono::nanoseconds from it // the number of nanoseconds and create a std::chrono::nanoseconds from it
py::object py_cls = py::module::import("slsdet._slsdet").attr("DurationWrapper"); py::object py_cls = py::module::import("_slsdet").attr("DurationWrapper");
if (py::isinstance(src, py_cls)){ if (py::isinstance(src, py_cls)){
sls::DurationWrapper *cls = src.cast<sls::DurationWrapper *>(); sls::DurationWrapper *cls = src.cast<sls::DurationWrapper *>();
value = nanoseconds(cls->count()); value = nanoseconds(cls->count());
@ -82,7 +77,7 @@ template <> struct type_caster<std::chrono::nanoseconds> {
* set the count from chrono::nanoseconds and return * set the count from chrono::nanoseconds and return
*/ */
static handle cast(std::chrono::nanoseconds src, return_value_policy /* policy */, handle /* parent */) { static handle cast(std::chrono::nanoseconds src, return_value_policy /* policy */, handle /* parent */) {
py::object py_cls = py::module::import("slsdet._slsdet").attr("DurationWrapper"); py::object py_cls = py::module::import("_slsdet").attr("DurationWrapper");
py::object* obj = new py::object; py::object* obj = new py::object;
*obj = py_cls(); *obj = py_cls();
sls::DurationWrapper *dur = obj->cast<sls::DurationWrapper *>(); sls::DurationWrapper *dur = obj->cast<sls::DurationWrapper *>();

View File

@ -1,58 +0,0 @@
import pytest
from slsdet import DurationWrapper
#import the compiled extension to use test functions for the automatic conversion
from slsdet import _slsdet
def test_default_construction_of_DurationWrapper():
"""Test default construction of DurationWrapper"""
t = DurationWrapper()
assert t.count() == 0
assert t.total_seconds() == 0
def test_construction_of_DurationWrapper():
"""Test construction of DurationWrapper with total_seconds"""
t = DurationWrapper(5)
assert t.count() == 5e9
assert t.total_seconds() == 5
def test_set_count_on_DurationWrapper():
"""Test set_count on DurationWrapper"""
t = DurationWrapper()
t.set_count(10)
assert t.count() == 10
assert t.total_seconds() == 10e-9
t.set_count(0)
assert t.count() == 0
assert t.total_seconds() == 0
def test_return_a_DurationWrapper_from_cpp():
"""Test returning a DurationWrapper from C++"""
t = _slsdet.test_return_DurationWrapper()
assert t.count() == 1.3e9
assert t.total_seconds() == 1.3
def test_call_a_cpp_function_with_a_duration_wrapper():
"""C++ functions can accept a DurationWrapper"""
t = DurationWrapper(5)
assert _slsdet.test_duration_to_ns(t) == 5e9
def test_call_a_cpp_function_converting_number_to_DurationWrapper():
"""int and float can be converted to std::chrono::nanoseconds"""
assert _slsdet.test_duration_to_ns(0) == 0
assert _slsdet.test_duration_to_ns(3) == 3e9
assert _slsdet.test_duration_to_ns(1.3) == 1.3e9
assert _slsdet.test_duration_to_ns(10e-9) == 10
def test_call_a_cpp_function_with_datetime_timedelta():
"""datetime.timedelta can be converted to std::chrono::nanoseconds"""
import datetime
t = datetime.timedelta(seconds=5)
assert _slsdet.test_duration_to_ns(t) == 5e9
t = datetime.timedelta(seconds=0)
assert _slsdet.test_duration_to_ns(t) == 0
t = datetime.timedelta(seconds=1.3)
assert _slsdet.test_duration_to_ns(t) == 1.3e9

View File

@ -0,0 +1 @@
../slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServerv9.0.0

View File

@ -1 +0,0 @@
../slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServerv9.1.0

View File

@ -0,0 +1 @@
../slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServerv9.0.0

View File

@ -1 +0,0 @@
../slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServerv9.1.0

View File

@ -0,0 +1 @@
../slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServerv9.0.0

View File

@ -1 +0,0 @@
../slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServerv9.1.1

View File

@ -0,0 +1 @@
../slsDetectorServers/xilinx_ctbDetectorServer/bin/xilinx_ctbDetectorServerv9.0.0

View File

@ -1 +0,0 @@
../slsDetectorServers/xilinx_ctbDetectorServer/bin/xilinx_ctbDetectorServerv9.1.0

View File

@ -503,7 +503,6 @@ class singlePhotonDetector : public analogDetector<uint16_t> {
} }
#endif #endif
if (ee == PHOTON && val[iy * nx + ix] == max) { if (ee == PHOTON && val[iy * nx + ix] == max) {
good = 1;
ee = PHOTON_MAX; ee = PHOTON_MAX;
// cout << "**" <<id<< " " << iframe << " " << nDark << " " // cout << "**" <<id<< " " << iframe << " " << nDark << " "
// << ix << " " << iy << " " << rms << " " << max << " " << // << ix << " " << iy << " " << rms << " " << max << " " <<
@ -537,6 +536,7 @@ class singlePhotonDetector : public analogDetector<uint16_t> {
cout << max << " " << val[iy * nx + ix] << endl; cout << max << " " << val[iy * nx + ix] << endl;
} }
//else (clusters + nph)->print(); //else (clusters + nph)->print();
good = 1;
if (eMin > 0 && tot < eMin) if (eMin > 0 && tot < eMin)
good = 0; good = 0;
if (eMax > 0 && tot > eMax) if (eMax > 0 && tot > eMax)

View File

@ -61,9 +61,7 @@ class qDefs : public QWidget {
} }
} }
template <class CT> struct NonDeduced { template <class CT> struct NonDeduced { using type = CT; };
using type = CT;
};
template <class S, typename RT, typename... CT> template <class S, typename RT, typename... CT>
static void HandleExceptions(const std::string emsg, const std::string src, static void HandleExceptions(const std::string emsg, const std::string src,
S *s, RT (S::*somefunc)(CT...), S *s, RT (S::*somefunc)(CT...),

26
slsDetectorServers/compileAllServers.sh Executable file → Normal file
View File

@ -1,6 +1,8 @@
# SPDX-License-Identifier: LGPL-3.0-or-other # SPDX-License-Identifier: LGPL-3.0-or-other
# Copyright (C) 2021 Contributors to the SLS Detector Package # Copyright (C) 2021 Contributors to the SLS Detector Package
# empty branch = developer branch in updateAPIVersion.sh
branch=""
det_list=("ctbDetectorServer det_list=("ctbDetectorServer
gotthardDetectorServer gotthardDetectorServer
gotthard2DetectorServer gotthard2DetectorServer
@ -9,12 +11,7 @@ det_list=("ctbDetectorServer
moenchDetectorServer moenchDetectorServer
xilinx_ctbDetectorServer" xilinx_ctbDetectorServer"
) )
usage="\nUsage: compileAllServers.sh [server|all(opt)] [update_api(opt)]. \n\tNo arguments mean all servers with 'developer' branch. \n\tupdate_api if true updates the api to version in VERSION file" usage="\nUsage: compileAllServers.sh [server|all(opt)] [branch(opt)]. \n\tNo arguments mean all servers with 'developer' branch. \n\tNo 'branch' input means 'developer branch'"
update_api=true
target=version
# arguments # arguments
if [ $# -eq 0 ]; then if [ $# -eq 0 ]; then
@ -38,12 +35,15 @@ elif [ $# -eq 1 ] || [ $# -eq 2 ]; then
declare -a det=("${1}") declare -a det=("${1}")
#echo "Compiling only $1" #echo "Compiling only $1"
fi fi
# branch
if [ $# -eq 2 ]; then if [ $# -eq 2 ]; then
update_api=$2 # arg in list
if not $update_api ; then if [[ $det_list == *$2* ]]; then
target=clean echo -e "Invalid argument 2: $2. $usage"
return 1
fi fi
branch+=$2
#echo "with branch $branch"
fi fi
else else
echo -e "Too many arguments.$usage" echo -e "Too many arguments.$usage"
@ -54,9 +54,6 @@ declare -a deterror=("OK" "OK" "OK" "OK" "OK" "OK")
echo -e "list is ${det[@]}" echo -e "list is ${det[@]}"
if $update_api; then
echo "updating api to $(cat ../VERSION)"
fi
# compile each server # compile each server
idet=0 idet=0
for i in ${det[@]} for i in ${det[@]}
@ -66,13 +63,14 @@ do
echo -e "Compiling $dir [$file]" echo -e "Compiling $dir [$file]"
cd $dir cd $dir
make clean make clean
if make $target; then if make version API_BRANCH=$branch; then
deterror[$idet]="OK" deterror[$idet]="OK"
else else
deterror[$idet]="FAIL" deterror[$idet]="FAIL"
fi fi
mv bin/$dir bin/$file mv bin/$dir bin/$file
git add -f bin/$file git add -f bin/$file
cp bin/$file /tftpboot/
cd .. cd ..
echo -e "\n\n" echo -e "\n\n"
((++idet)) ((++idet))

View File

@ -0,0 +1,87 @@
# SPDX-License-Identifier: LGPL-3.0-or-other
# Copyright (C) 2021 Contributors to the SLS Detector Package
# empty branch = developer branch in updateAPIVersion.sh
branch=""
det_list=("ctbDetectorServer"
"gotthardDetectorServer"
"gotthard2DetectorServer"
"jungfrauDetectorServer"
"mythen3DetectorServer"
"moenchDetectorServer"
"xilinx_ctbDetectorServer"
)
usage="\nUsage: compileAllServers.sh [server|all(opt)] [branch(opt)]. \n\tNo arguments mean all servers with 'developer' branch. \n\tNo 'branch' input means 'developer branch'"
# arguments
if [ $# -eq 0 ]; then
# no argument, all servers
declare -a det=${det_list[@]}
echo "Compiling all servers"
elif [ $# -eq 1 ] || [ $# -eq 2 ]; then
# 'all' servers
if [[ $1 == "all" ]]; then
declare -a det=${det_list[@]}
echo "Compiling all servers"
else
# only one server
# arg not in list
if [[ $det_list != *$1* ]]; then
echo -e "Invalid argument 1: $1. $usage"
return -1
fi
declare -a det=("${1}")
#echo "Compiling only $1"
fi
# branch
if [ $# -eq 2 ]; then
# arg in list
if [[ $det_list == *$2* ]]; then
echo -e "Invalid argument 2: $2. $usage"
return -1
fi
branch+=$2
#echo "with branch $branch"
fi
else
echo -e "Too many arguments.$usage"
return -1
fi
declare -a deterror=("OK" "OK" "OK" "OK" "OK" "OK")
echo -e "list is ${det[@]}"
# compile each server
idet=0
for i in ${det[@]}
do
dir=$i
file="${i}_developer"
echo -e "Compiling $dir [$file]"
cd $dir
make clean
if make API_BRANCH=$branch; then
deterror[$idet]="OK"
else
deterror[$idet]="FAIL"
fi
mv bin/$dir bin/$file
git add -f bin/$file
cp bin/$file /tftpboot/
cd ..
echo -e "\n\n"
((++idet))
done
echo -e "Results:"
idet=0
for i in ${det[@]}
do
printf "%s\t\t= %s\n" "$i" "${deterror[$idet]}"
((++idet))
done

23
slsDetectorServers/compileEigerServer.sh Executable file → Normal file
View File

@ -3,31 +3,21 @@
deterror="OK" deterror="OK"
dir="eigerDetectorServer" dir="eigerDetectorServer"
file="${dir}_developer" file="${dir}_developer"
branch=""
usage="\nUsage: compileAllServers.sh [update_api(opt)]. \n\t update_api if true updates the api to version in VERSION file"
update_api=true
target=version
# arguments # arguments
if [ $# -eq 1 ]; then if [ $# -eq 1 ]; then
update_api=$1 branch+=$1
if not $update_api ; then #echo "with branch $branch"
target=clean
fi
elif [ ! $# -eq 0 ]; then elif [ ! $# -eq 0 ]; then
echo -e "Only one optional argument allowed for update_api." echo -e "Only one optional argument allowed for branch."
return -1 return -1
fi fi
if $update_api; then
echo "updating api to $(cat ../VERSION)"
fi
echo -e "Compiling $dir [$file]" echo -e "Compiling $dir [$file]"
cd $dir cd $dir
if make $target; then make clean
if make version API_BRANCH=$branch; then
deterror="OK" deterror="OK"
else else
deterror="FAIL" deterror="FAIL"
@ -35,6 +25,7 @@ fi
mv bin/$dir bin/$file mv bin/$dir bin/$file
git add -f bin/$file git add -f bin/$file
cp bin/$file /tftpboot/
cd .. cd ..
echo -e "\n\n" echo -e "\n\n"
printf "Result:\t\t= %s\n" "${deterror}" printf "Result:\t\t= %s\n" "${deterror}"

View File

@ -25,10 +25,11 @@ version: clean versioning $(PROGS)
boot: $(OBJS) boot: $(OBJS)
version_branch=$(API_BRANCH)
version_name=APICTB version_name=APICTB
version_path=slsDetectorServers/ctbDetectorServer version_path=slsDetectorServers/ctbDetectorServer
versioning: versioning:
cd ../../ && echo $(PWD) && echo `tput setaf 6; python updateAPIVersion.py $(version_name) $(version_path); tput sgr0;` cd ../../ && echo $(PWD) && echo `tput setaf 6; ./updateAPIVersion.sh $(version_name) $(version_path) $(version_branch); tput sgr0;`
$(PROGS): $(OBJS) $(PROGS): $(OBJS)

View File

@ -17,7 +17,7 @@
#define BUFFERSIZE 16 #define BUFFERSIZE 16
#define I2C_DEVICE_FILE "/dev/i2c-0" #define I2C_DEVICE_FILE "/dev/i2c-0"
#define I2C_DEVICE_ADDRESS 0x4C #define I2C_DEVICE_ADDRESS 0x4C
// #define I2C_DEVICE_ADDRESS 0x48 //#define I2C_DEVICE_ADDRESS 0x48
#define I2C_REGISTER_ADDRESS 0x40 #define I2C_REGISTER_ADDRESS 0x40
int i2c_open(const char *file, unsigned int addr) { int i2c_open(const char *file, unsigned int addr) {

View File

@ -98,8 +98,8 @@
// everything at ~200 kHz (200 kHz MHz ddr readout) // everything at ~200 kHz (200 kHz MHz ddr readout)
#define DAQ_CHIP_CONTROLLER_SUPER_SLOW_SPEED 0x000c0000 #define DAQ_CHIP_CONTROLLER_SUPER_SLOW_SPEED 0x000c0000
// #define DAQ_FIFO_ENABLE 0x00100000 commented out as it //#define DAQ_FIFO_ENABLE 0x00100000 commented out as it
// is not used anywhere // is not used anywhere
#define DAQ_REG_CHIP_CMDS_INT_TRIGGER 0x00100000 #define DAQ_REG_CHIP_CMDS_INT_TRIGGER 0x00100000
// direct chip commands to the DAQ_REG_CHIP_CMDS register // direct chip commands to the DAQ_REG_CHIP_CMDS register
@ -131,9 +131,8 @@
#define DAQ_NEXPOSURERS_ACTIVATE_AUTO_SUBIMAGING 0x20000000 #define DAQ_NEXPOSURERS_ACTIVATE_AUTO_SUBIMAGING 0x20000000
#define DAQ_NEXPOSURERS_ACTIVATE_RATE_CORRECTION 0x40000000 #define DAQ_NEXPOSURERS_ACTIVATE_RATE_CORRECTION 0x40000000
// #define DAQ_MASTER_HALF_MODULE 0x80000000 currently //#define DAQ_MASTER_HALF_MODULE 0x80000000 currently not
// not // used
// used
// chips static bits // chips static bits
#define DAQ_STATIC_BIT_PROGRAM 0x00000001 #define DAQ_STATIC_BIT_PROGRAM 0x00000001

View File

@ -25,10 +25,11 @@ version: clean versioning $(PROGS) #hv9m_blackfin_server
boot: $(OBJS) boot: $(OBJS)
version_branch=$(API_BRANCH)
version_name=APIEIGER version_name=APIEIGER
version_path=slsDetectorServers/eigerDetectorServer version_path=slsDetectorServers/eigerDetectorServer
versioning: versioning:
cd ../../ && echo $(PWD) && echo `tput setaf 6; python updateAPIVersion.py $(version_name) $(version_path); tput sgr0;` cd ../../ && echo $(PWD) && echo `tput setaf 6; ./updateAPIVersion.sh $(version_name) $(version_path) $(version_branch); tput sgr0;`
$(PROGS): $(OBJS) $(PROGS): $(OBJS)

View File

@ -2,7 +2,7 @@
// Copyright (C) 2021 Contributors to the SLS Detector Package // Copyright (C) 2021 Contributors to the SLS Detector Package
#pragma once #pragma once
// #include "types.h" //#include "types.h"
#include <stdint.h> #include <stdint.h>
/******************************************************************************/ /******************************************************************************/
/* types */ /* types */

View File

@ -92,7 +92,7 @@ XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_BASEADDR
#define XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_HIGHADDR 0xC410FFFF #define XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_HIGHADDR 0xC410FFFF
/* Definitions for a new memory */ /* Definitions for a new memory */
// #define XPAR_PLB_LL_NEW_MEMORY 0xD1000000//0xD1000084//0xC4200000 //#define XPAR_PLB_LL_NEW_MEMORY 0xD1000000//0xD1000084//0xC4200000
/* Definitions for peripheral PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_RIGHT */ /* Definitions for peripheral PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_RIGHT */
#define XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_RIGHT_BASEADDR 0xC4110000 #define XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_RIGHT_BASEADDR 0xC4110000

View File

@ -24,10 +24,11 @@ version: clean versioning $(PROGS)
boot: $(OBJS) boot: $(OBJS)
version_branch=$(API_BRANCH)
version_name=APIGOTTHARD2 version_name=APIGOTTHARD2
version_path=slsDetectorServers/gotthard2DetectorServer version_path=slsDetectorServers/gotthard2DetectorServer
versioning: versioning:
cd ../../ && echo $(PWD) && echo `tput setaf 6; python updateAPIVersion.py $(version_name) $(version_path); tput sgr0;` cd ../../ && echo $(PWD) && echo `tput setaf 6; ./updateAPIVersion.sh $(version_name) $(version_path) $(version_branch); tput sgr0;`
$(PROGS): $(OBJS) $(PROGS): $(OBJS)

View File

@ -27,7 +27,7 @@ version_branch=$(API_BRANCH)
version_name=APIGOTTHARD version_name=APIGOTTHARD
version_path=slsDetectorServers/gotthardDetectorServer version_path=slsDetectorServers/gotthardDetectorServer
versioning: versioning:
cd ../../ && echo $(PWD) && echo `tput setaf 6; python updateAPIVersion.py $(version_name) $(version_path); tput sgr0;` cd ../../ && echo $(PWD) && echo `tput setaf 6; ./updateAPIVersion.sh $(version_name) $(version_path) $(version_branch); tput sgr0;`
$(PROGS): $(OBJS) $(PROGS): $(OBJS)

View File

@ -22,13 +22,13 @@
((0x1 << GAIN_CONFGAIN_OFST) & GAIN_CONFGAIN_MSK) ((0x1 << GAIN_CONFGAIN_OFST) & GAIN_CONFGAIN_MSK)
/** Flow Control register */ /** Flow Control register */
// #define FLOW_CONTROL_REG (0x11 << MEM_MAP_SHIFT) //#define FLOW_CONTROL_REG (0x11 << MEM_MAP_SHIFT)
/** Flow Status register */ /** Flow Status register */
// #define FLOW_STATUS_REG (0x12 << MEM_MAP_SHIFT) //#define FLOW_STATUS_REG (0x12 << MEM_MAP_SHIFT)
/** Frame register */ /** Frame register */
// #define FRAME_REG (0x13 << MEM_MAP_SHIFT) //#define FRAME_REG (0x13 << MEM_MAP_SHIFT)
/** Multi Purpose register */ /** Multi Purpose register */
#define MULTI_PURPOSE_REG (0x14 << MEM_MAP_SHIFT) #define MULTI_PURPOSE_REG (0x14 << MEM_MAP_SHIFT)
@ -79,7 +79,7 @@
((0x0007f << DAQ_PCKT_LNGTH_OFST) & DAQ_PCKT_LNGTH_MSK) ((0x0007f << DAQ_PCKT_LNGTH_OFST) & DAQ_PCKT_LNGTH_MSK)
/** Time From Start register */ /** Time From Start register */
// #define TIME_FROM_START_REG (0x16 << MEM_MAP_SHIFT) //#define TIME_FROM_START_REG (0x16 << MEM_MAP_SHIFT)
/** DAC Control register */ /** DAC Control register */
#define SPI_REG (0x17 << MEM_MAP_SHIFT) #define SPI_REG (0x17 << MEM_MAP_SHIFT)
@ -139,7 +139,7 @@
((0x1b << ADC_SYNC_ENET_DELAY_OFST) & ADC_SYNC_ENET_DELAY_MSK) ((0x1b << ADC_SYNC_ENET_DELAY_OFST) & ADC_SYNC_ENET_DELAY_MSK)
/** Time From Start register */ /** Time From Start register */
// #define MU_TIME_REG (0x1a << MEM_MAP_SHIFT) //#define MU_TIME_REG (0x1a << MEM_MAP_SHIFT)
/** Temperatre SPI In register */ /** Temperatre SPI In register */
#define TEMP_SPI_IN_REG (0x1b << MEM_MAP_SHIFT) #define TEMP_SPI_IN_REG (0x1b << MEM_MAP_SHIFT)
@ -171,7 +171,7 @@
#define ENET_CONF_REG (0x1e << MEM_MAP_SHIFT) #define ENET_CONF_REG (0x1e << MEM_MAP_SHIFT)
/** Write TSE Shadow register */ /** Write TSE Shadow register */
// #define WRITE_TSE_SHADOW_REG (0x1f << MEM_MAP_SHIFT) //#define WRITE_TSE_SHADOW_REG (0x1f << MEM_MAP_SHIFT)
/** High Voltage register */ /** High Voltage register */
#define HV_REG (0x20 << MEM_MAP_SHIFT) #define HV_REG (0x20 << MEM_MAP_SHIFT)
@ -288,10 +288,10 @@
((0x4 << EXT_SIGNAL_OFST) & EXT_SIGNAL_MSK) ((0x4 << EXT_SIGNAL_OFST) & EXT_SIGNAL_MSK)
/** Look at me register */ /** Look at me register */
// #define LOOK_AT_ME_REG (0x28 << MEM_MAP_SHIFT) //#define LOOK_AT_ME_REG (0x28 << MEM_MAP_SHIFT)
/** FPGA SVN register */ /** FPGA SVN register */
// #define FPGA_SVN_REG (0x29 << MEM_MAP_SHIFT) //#define FPGA_SVN_REG (0x29 << MEM_MAP_SHIFT)
/** Chip of Interest register */ /** Chip of Interest register */
#define CHIP_OF_INTRST_REG (0x2a << MEM_MAP_SHIFT) #define CHIP_OF_INTRST_REG (0x2a << MEM_MAP_SHIFT)
@ -303,7 +303,7 @@
(0x0000FFFF << CHIP_OF_INTRST_NUM_CHNNLS_OFST) (0x0000FFFF << CHIP_OF_INTRST_NUM_CHNNLS_OFST)
/** Out MUX register */ /** Out MUX register */
// #define OUT_MUX_REG (0x2b << MEM_MAP_SHIFT) //#define OUT_MUX_REG (0x2b << MEM_MAP_SHIFT)
/** Board Version register */ /** Board Version register */
#define BOARD_REVISION_REG (0x2c << MEM_MAP_SHIFT) #define BOARD_REVISION_REG (0x2c << MEM_MAP_SHIFT)
@ -312,29 +312,29 @@
#define BOARD_REVISION_MSK (0x0000FFFF << BOARD_REVISION_OFST) #define BOARD_REVISION_MSK (0x0000FFFF << BOARD_REVISION_OFST)
#define DETECTOR_TYPE_OFST (16) #define DETECTOR_TYPE_OFST (16)
#define DETECTOR_TYPE_MSK (0x0000000F << DETECTOR_TYPE_OFST) #define DETECTOR_TYPE_MSK (0x0000000F << DETECTOR_TYPE_OFST)
// #define DETECTOR_TYPE_GOTTHARD_VAL (??) //#define DETECTOR_TYPE_GOTTHARD_VAL (??)
#define DETECTOR_TYPE_MOENCH_VAL (2) #define DETECTOR_TYPE_MOENCH_VAL (2)
/** Memory Test register */ /** Memory Test register */
// #define MEMORY_TEST_REG (0x2d << MEM_MAP_SHIFT) //#define MEMORY_TEST_REG (0x2d << MEM_MAP_SHIFT)
/** Hit Threshold register */ /** Hit Threshold register */
// #define HIT_THRESHOLD_REG (0x2e << MEM_MAP_SHIFT) //#define HIT_THRESHOLD_REG (0x2e << MEM_MAP_SHIFT)
/** Hit Count register */ /** Hit Count register */
// #define HIT_COUNT_REG (0x2f << MEM_MAP_SHIFT) //#define HIT_COUNT_REG (0x2f << MEM_MAP_SHIFT)
/* 16 bit Fifo Data register */ /* 16 bit Fifo Data register */
#define FIFO_DATA_REG (0x50 << MEM_MAP_SHIFT) // Not used in FW and SW (16bit) #define FIFO_DATA_REG (0x50 << MEM_MAP_SHIFT) // Not used in FW and SW (16bit)
/** Dacs Set 1 register */ /** Dacs Set 1 register */
// #define DACS_SET_1_REG (0x65 << MEM_MAP_SHIFT) //#define DACS_SET_1_REG (0x65 << MEM_MAP_SHIFT)
/** Dacs Set 2 register */ /** Dacs Set 2 register */
// #define DACS_SET_2_REG (0x66 << MEM_MAP_SHIFT) //#define DACS_SET_2_REG (0x66 << MEM_MAP_SHIFT)
/** Dacs Set 3 register */ /** Dacs Set 3 register */
// #define DACS_SET_3_REG (0x67 << MEM_MAP_SHIFT) //#define DACS_SET_3_REG (0x67 << MEM_MAP_SHIFT)
/* Set Delay 64 bit register */ /* Set Delay 64 bit register */
#define SET_DELAY_LSB_REG (0x68 << MEM_MAP_SHIFT) #define SET_DELAY_LSB_REG (0x68 << MEM_MAP_SHIFT)
@ -377,12 +377,12 @@
#define GET_EXPTIME_MSB_REG (0x7b << MEM_MAP_SHIFT) #define GET_EXPTIME_MSB_REG (0x7b << MEM_MAP_SHIFT)
/* Set Gates 64 bit register */ /* Set Gates 64 bit register */
// #define SET_GATES_LSB_REG (0x7c << MEM_MAP_SHIFT) //#define SET_GATES_LSB_REG (0x7c << MEM_MAP_SHIFT)
// #define SET_GATES_MSB_REG (0x7d << MEM_MAP_SHIFT) //#define SET_GATES_MSB_REG (0x7d << MEM_MAP_SHIFT)
/* Set Gates 64 bit register */ /* Set Gates 64 bit register */
// #define GET_GATES_LSB_REG (0x7e << MEM_MAP_SHIFT) //#define GET_GATES_LSB_REG (0x7e << MEM_MAP_SHIFT)
// #define GET_GATES_MSB_REG (0x7f << MEM_MAP_SHIFT) //#define GET_GATES_MSB_REG (0x7f << MEM_MAP_SHIFT)
/* Dark Image starting address */ /* Dark Image starting address */
#define DARK_IMAGE_REG (0x81 << MEM_MAP_SHIFT) #define DARK_IMAGE_REG (0x81 << MEM_MAP_SHIFT)

View File

@ -24,10 +24,11 @@ version: clean versioning $(PROGS)
boot: $(OBJS) boot: $(OBJS)
version_branch=$(API_BRANCH)
version_name=APIJUNGFRAU version_name=APIJUNGFRAU
version_path=slsDetectorServers/jungfrauDetectorServer version_path=slsDetectorServers/jungfrauDetectorServer
versioning: versioning:
cd ../../ && echo $(PWD) && echo `tput setaf 6; python updateAPIVersion.py $(version_name) $(version_path); tput sgr0;` cd ../../ && echo $(PWD) && echo `tput setaf 6; ./updateAPIVersion.sh $(version_name) $(version_path) $(version_branch); tput sgr0;`
$(PROGS): $(OBJS) $(PROGS): $(OBJS)

View File

@ -1974,6 +1974,9 @@ int autoCompDisable(int on) {
} }
int setComparatorDisableTime(int64_t val) { int setComparatorDisableTime(int64_t val) {
if (getChipVersion() != 11) {
return FAIL;
}
if (val < 0) { if (val < 0) {
LOG(logERROR, LOG(logERROR,
("Invalid comp disable time: %lld ns\n", (long long int)val)); ("Invalid comp disable time: %lld ns\n", (long long int)val));
@ -2814,8 +2817,7 @@ void *start_timer(void *arg) {
getNextFrameNumber(&frameNr); getNextFrameNumber(&frameNr);
int iRxEntry = firstDest; int iRxEntry = firstDest;
for (int iframes = 0; iframes != numFrames; ++iframes) { for (int iframes = 0; iframes != numFrames; ++iframes) {
if (transmissionDelayUs) usleep(transmissionDelayUs);
usleep(transmissionDelayUs);
// check if manual stop // check if manual stop
if (sharedMemory_getStop() == 1) { if (sharedMemory_getStop() == 1) {

View File

@ -5,8 +5,8 @@
#include "sls/sls_detector_defs.h" #include "sls/sls_detector_defs.h"
#define MIN_REQRD_VRSN_T_RD_API 0x171220 #define MIN_REQRD_VRSN_T_RD_API 0x171220
#define REQRD_FRMWRE_VRSN_BOARD2 0x250209 // 1.0 pcb (version = 010) #define REQRD_FRMWRE_VRSN_BOARD2 0x230920 // 1.0 pcb (version = 010)
#define REQRD_FRMWRE_VRSN 0x250208 // 2.0 pcb (version = 011) #define REQRD_FRMWRE_VRSN 0x230921 // 2.0 pcb (version = 011)
#define NUM_HARDWARE_VERSIONS (2) #define NUM_HARDWARE_VERSIONS (2)
#define HARDWARE_VERSION_NUMBERS \ #define HARDWARE_VERSION_NUMBERS \

View File

@ -24,10 +24,11 @@ version: clean versioning $(PROGS)
boot: $(OBJS) boot: $(OBJS)
version_branch=$(API_BRANCH)
version_name=APIMOENCH version_name=APIMOENCH
version_path=slsDetectorServers/moenchDetectorServer version_path=slsDetectorServers/moenchDetectorServer
versioning: versioning:
cd ../../ && echo $(PWD) && echo `tput setaf 6; python updateAPIVersion.py $(version_name) $(version_path); tput sgr0;` cd ../../ && echo $(PWD) && echo `tput setaf 6; ./updateAPIVersion.sh $(version_name) $(version_path) $(version_branch); tput sgr0;`
$(PROGS): $(OBJS) $(PROGS): $(OBJS)

View File

@ -1927,8 +1927,7 @@ void *start_timer(void *arg) {
getNextFrameNumber(&frameNr); getNextFrameNumber(&frameNr);
int iRxEntry = firstDest; int iRxEntry = firstDest;
for (int iframes = 0; iframes != numFrames; ++iframes) { for (int iframes = 0; iframes != numFrames; ++iframes) {
if (transmissionDelayUs) usleep(transmissionDelayUs);
usleep(transmissionDelayUs);
// check if manual stop // check if manual stop
if (sharedMemory_getStop() == 1) { if (sharedMemory_getStop() == 1) {

View File

@ -25,10 +25,11 @@ version: clean versioning $(PROGS)
boot: $(OBJS) boot: $(OBJS)
version_branch=$(API_BRANCH)
version_name=APIMYTHEN3 version_name=APIMYTHEN3
version_path=slsDetectorServers/mythen3DetectorServer version_path=slsDetectorServers/mythen3DetectorServer
versioning: versioning:
cd ../../ && echo $(PWD) && echo `tput setaf 6; python updateAPIVersion.py $(version_name) $(version_path); tput sgr0;` cd ../../ && echo $(PWD) && echo `tput setaf 6; ./updateAPIVersion.sh $(version_name) $(version_path) $(version_branch); tput sgr0;`
$(PROGS): $(OBJS) $(PROGS): $(OBJS)

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