mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-17 07:17:13 +02:00
Compare commits
140 Commits
Author | SHA1 | Date | |
---|---|---|---|
835e62425f | |||
c8cdbfc488 | |||
2f75143245 | |||
6f7c31b747 | |||
75c2d987c4 | |||
726f5eba29 | |||
4404ee717a | |||
54530ab103 | |||
6126780660 | |||
9b7f9b1be1 | |||
26c829d766 | |||
3fde5c5b55 | |||
3e5f546ebe | |||
9833a7d330 | |||
8f9155e578 | |||
9df1eac3c1 | |||
5ededf9be4 | |||
3e8774798a | |||
3dce1e46f9 | |||
08ecc1e52d | |||
8c1974b34e | |||
d89d349247 | |||
910961cf41 | |||
595b7aa5e8 | |||
f72ad4326f | |||
2306e44ae3 | |||
e7eee67fed | |||
f36a12e454 | |||
d7ce5fedfd | |||
3a2682ffe7 | |||
bf74a4135e | |||
252ecf2769 | |||
de01ab75e9 | |||
5698da5f95 | |||
7300d73675 | |||
d4b467a641 | |||
7b71076180 | |||
9197d2b209 | |||
e094e41d89 | |||
512e1a3136 | |||
6d04c14bd6 | |||
64183d8d6a | |||
287efde54a | |||
faa25b9e9f | |||
1b92b01a46 | |||
4849063b6c | |||
5cd020ae81 | |||
160fabe02c | |||
90dd8e70e5 | |||
08e121c71f | |||
cb3b337a99 | |||
5d9a952316 | |||
8cc05c5848 | |||
d69d69e892 | |||
07a120fc4a | |||
11e8796847 | |||
f79b009978 | |||
3259bfb008 | |||
934bc5b9db | |||
6d11faed87 | |||
35fc52dae7 | |||
e599bfe56f | |||
764becc271 | |||
7462d1002d | |||
834794ad98 | |||
56c504abbb | |||
4d6346e678 | |||
dc7e448759 | |||
e658cbacda | |||
1e6c6dea71 | |||
0e5d4d1d8e | |||
a2986784d3 | |||
975cbb576e | |||
e48a92d9cd | |||
befdcf7f36 | |||
02f5c472a8 | |||
75ed2cd2e4 | |||
3be045f9b6 | |||
8fae982802 | |||
128ec88b5f | |||
d5fc158330 | |||
864e6e4c81 | |||
343d96ff16 | |||
4142328437 | |||
6c797988c7 | |||
215c262981 | |||
081b809078 | |||
9263567cd8 | |||
58e90a85be | |||
025c836e25 | |||
5d5abae3f4 | |||
e2ad46386e | |||
308d44e452 | |||
69da61b1fb | |||
460168ce04 | |||
4e429c0d77 | |||
bf4fab549d | |||
f7705eb1da | |||
a2217e2066 | |||
aaa02706fc | |||
6a80bc5b54 | |||
b9275646ad | |||
9e2f2697c7 | |||
b6b0df62b6 | |||
0ba537e479 | |||
75ddf535dc | |||
b1de501bef | |||
0f3a63f101 | |||
3b4b2d707f | |||
f405aa1733 | |||
df0fdb7ecb | |||
91b7a87557 | |||
9468b9ca1e | |||
d7982e178e | |||
9cf5714a5b | |||
0c9ac8911a | |||
4730c8c0a9 | |||
43efb8acfd | |||
6ecca8fcb0 | |||
17cb63a57f | |||
4f83fcb001 | |||
ab94af6d29 | |||
7c725cc69b | |||
f0198d2d2e | |||
5ddccbdee4 | |||
8fb39b8c7e | |||
bd5293f4b1 | |||
b91180f5b2 | |||
7c3b5065a5 | |||
9aef802bea | |||
f7d85231f2 | |||
5b3a911e8d | |||
65f5e1c1ab | |||
839896c7e6 | |||
4a7e246604 | |||
7f293115c4 | |||
f59f40a659 | |||
64fd82f92c | |||
cd232fd732 | |||
172fa66b1f |
@ -2,5 +2,5 @@ BasedOnStyle: LLVM
|
||||
IndentWidth: 4
|
||||
|
||||
UseTab: Never
|
||||
ColumnLimit: 80
|
||||
ColumnLimit: 0
|
||||
AlignConsecutiveAssignments: false
|
31
.clang-tidy
31
.clang-tidy
@ -1,32 +1,7 @@
|
||||
---
|
||||
Checks: '*,
|
||||
-android-cloexec-fopen,
|
||||
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
|
||||
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
|
||||
-fuchsia*,
|
||||
-readability-else-after-return,
|
||||
-readability-avoid-const-params-in-decls,
|
||||
-cppcoreguidelines-pro-bounds-constant-array-index,
|
||||
-cppcoreguidelines-pro-type-reinterpret-cast,
|
||||
-llvm-header-guard,
|
||||
-readability-static-accessed-through-instance,
|
||||
-readability-braces-around-statements,
|
||||
-hicpp-signed-bitwise,
|
||||
-hicpp-no-array-decay,
|
||||
-hicpp-braces-around-statements,
|
||||
-google-runtime-references,
|
||||
-google-readability-todo,
|
||||
-google-readability-braces-around-statements'
|
||||
|
||||
HeaderFilterRegex: \.h
|
||||
Checks: '*, -google-runtime-references, -hicpp-no-array-decay, -cppcoreguidelines-pro-bounds-array-to-pointer-decay, -cppcoreguidelines-pro-bounds-pointer-arithmetic, -fuchsia*,-readability-else-after-return,-readability-avoid-const-params-in-decls,-hicpp-signed-bitwise,-cppcoreguidelines-pro-bounds-constant-array-index,-llvm-header-guard,-readability-static-accessed-through-instance,-google-readability-todo'
|
||||
WarningsAsErrors: '*'
|
||||
HeaderFilterRegex: '.*'
|
||||
AnalyzeTemporaryDtors: false
|
||||
FormatStyle: none
|
||||
CheckOptions:
|
||||
- { key: readability-identifier-naming.NamespaceCase, value: lower_case }
|
||||
# - { key: readability-identifier-naming.FunctionCase, value: lower_case }
|
||||
- { key: readability-identifier-naming.ClassCase, value: CamelCase }
|
||||
# - { key: readability-identifier-naming.MethodCase, value: CamelCase }
|
||||
# - { key: readability-identifier-naming.StructCase, value: CamelCase }
|
||||
# - { key: readability-identifier-naming.VariableCase, value: lower_case }
|
||||
- { key: readability-identifier-naming.GlobalConstantCase, value: UPPER_CASE }
|
||||
...
|
||||
|
9
.gitignore
vendored
9
.gitignore
vendored
@ -6,13 +6,6 @@ bin/
|
||||
*.log
|
||||
*.out
|
||||
*.toc
|
||||
*.o
|
||||
.*
|
||||
build
|
||||
docs/
|
||||
RELEASE.txt
|
||||
Testing/
|
||||
|
||||
|
||||
*.pyc
|
||||
*/__pycache__/*
|
||||
|
||||
|
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -1,3 +0,0 @@
|
||||
[submodule "python/pybind11"]
|
||||
path = libs/pybind11
|
||||
url = https://github.com/pybind/pybind11.git
|
20
.travis.yml
20
.travis.yml
@ -2,13 +2,10 @@ sudo: false
|
||||
|
||||
language: cpp
|
||||
|
||||
os: linux
|
||||
|
||||
env:
|
||||
matrix:
|
||||
- CONDA_PY=3.6
|
||||
- CONDA_PY=3.7
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- os: linux
|
||||
env: CONDA_PY=3.6
|
||||
|
||||
dist: trusty
|
||||
|
||||
@ -25,9 +22,7 @@ install:
|
||||
- conda config --add channels slsdetectorgroup
|
||||
- conda update conda
|
||||
- conda update --all
|
||||
- conda install conda-build=3.17
|
||||
- conda install anaconda-client
|
||||
- conda install conda-verify
|
||||
- conda install conda-build anaconda-client
|
||||
|
||||
# Useful for debugging any issues with conda
|
||||
- conda info -a
|
||||
@ -39,12 +34,11 @@ install:
|
||||
- conda-build .
|
||||
|
||||
script:
|
||||
- CTEST_OUTPUT_ON_FAILURE=1 ctest -j 2
|
||||
- echo "No test scripts to be run!"
|
||||
|
||||
|
||||
deploy:
|
||||
provider: script
|
||||
script: find $HOME/miniconda/conda-bld/${TRAVIS_OS_NAME}-64 -name "*.tar.bz2" -exec anaconda -t $CONDA_TOKEN upload --force {} \;
|
||||
on:
|
||||
branch: filip1
|
||||
|
||||
all_branches: true
|
||||
|
193
CMakeLists.txt
Executable file → Normal file
193
CMakeLists.txt
Executable file → Normal file
@ -1,31 +1,6 @@
|
||||
cmake_minimum_required(VERSION 3.9)
|
||||
project(slsDetectorPackage)
|
||||
set(PROJECT_VERSION 5.0.0)
|
||||
|
||||
include(CheckIPOSupported)
|
||||
|
||||
|
||||
cmake_policy(SET CMP0074 NEW)
|
||||
include(cmake/project_version.cmake)
|
||||
|
||||
# Include additional modules that are used unconditionally
|
||||
include(GNUInstallDirs)
|
||||
|
||||
# If conda build, always set lib dir to 'lib'
|
||||
if($ENV{CONDA_BUILD})
|
||||
set(CMAKE_INSTALL_LIBDIR "lib")
|
||||
endif()
|
||||
|
||||
# Set lower / upper case project names
|
||||
string(TOUPPER "${PROJECT_NAME}" PROJECT_NAME_UPPER)
|
||||
string(TOLOWER "${PROJECT_NAME}" PROJECT_NAME_LOWER)
|
||||
|
||||
# Set targets export name (used by slsDetectorPackage and dependencies)
|
||||
set(TARGETS_EXPORT_NAME "${PROJECT_NAME_LOWER}-targets")
|
||||
#set(namespace "${PROJECT_NAME}::")
|
||||
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
|
||||
|
||||
set (CALIBRATE OFF)
|
||||
|
||||
# Check if project is being used directly or via add_subdirectory
|
||||
set(SLS_MASTER_PROJECT OFF)
|
||||
@ -34,166 +9,68 @@ if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
|
||||
endif()
|
||||
|
||||
option (SLS_USE_HDF5 "HDF5 File format" OFF)
|
||||
option (SLS_USE_TEXTCLIENT "Text Client" ON)
|
||||
option (SLS_USE_RECEIVER "Receiver" ON)
|
||||
option (SLS_USE_TEXTCLIENT "Text Client" OFF)
|
||||
option (SLS_USE_RECEIVER "Receiver" OFF)
|
||||
option (SLS_USE_GUI "GUI" OFF)
|
||||
option (SLS_USE_SIMULATOR "Simulator" OFF)
|
||||
option (SLS_USE_TESTS "TESTS" OFF)
|
||||
option (SLS_USE_INTEGRATION_TESTS "Integration Tests" OFF)
|
||||
option(SLS_USE_SANITIZER "Sanitizers for debugging" OFF)
|
||||
option(SLS_USE_PYTHON "Python bindings" OFF)
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||
message(STATUS "No build type selected, default to Release")
|
||||
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type (default Release)" FORCE)
|
||||
endif()
|
||||
|
||||
|
||||
#Add two fake libraries to manage options
|
||||
add_library(slsProjectOptions INTERFACE)
|
||||
add_library(slsProjectWarnings INTERFACE)
|
||||
target_compile_features(slsProjectOptions INTERFACE cxx_std_11)
|
||||
target_compile_options(slsProjectWarnings INTERFACE
|
||||
-Wall
|
||||
-Wextra
|
||||
-Wno-unused-parameter #Needs to be slowly mitigated
|
||||
# -Wold-style-cast
|
||||
-Wnon-virtual-dtor
|
||||
-Woverloaded-virtual
|
||||
-Wdouble-promotion
|
||||
-Wformat=2
|
||||
-Wredundant-decls
|
||||
# -Wconversion
|
||||
-Wdouble-promotion
|
||||
#Flags to always be used
|
||||
# -Wno-unused-parameter should eventually be removes
|
||||
# -Wno-overloaded-virtual TODO! remove warnings in refactor
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-overloaded-virtual -Wno-unused-parameter -std=c++98")
|
||||
|
||||
)
|
||||
|
||||
|
||||
#Testing for minimum version for compilers
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.2)
|
||||
message(FATAL_ERROR "Clang version must be at least 3.2!")
|
||||
endif()
|
||||
target_compile_options(slsProjectWarnings INTERFACE -Wshadow) #Clag does not warn on constructor
|
||||
# clang does not support -Wno-misleading-indentation
|
||||
# add any special clang flags
|
||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
|
||||
message(FATAL_ERROR "GCC version must be at least 4.8!")
|
||||
endif()
|
||||
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5)
|
||||
target_compile_options(slsProjectWarnings INTERFACE
|
||||
-Wno-missing-field-initializers)
|
||||
endif()
|
||||
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0)
|
||||
target_compile_options(slsProjectWarnings INTERFACE
|
||||
-Wno-misleading-indentation # mostly in rapidjson remove using clang format
|
||||
-Wduplicated-cond
|
||||
-Wnull-dereference )
|
||||
|
||||
endif()
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.0)
|
||||
target_compile_options(slsProjectWarnings INTERFACE
|
||||
-Wno-class-memaccess )
|
||||
|
||||
endif()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-misleading-indentation")
|
||||
endif ()
|
||||
endif()
|
||||
|
||||
|
||||
if(SLS_USE_SANITIZER)
|
||||
target_compile_options(slsProjectOptions INTERFACE -fsanitize=address,undefined -fno-omit-frame-pointer)
|
||||
#target_compile_options(slsProjectOptions INTERFACE -fsanitize=address,undefined)
|
||||
target_link_libraries(slsProjectOptions INTERFACE -fsanitize=address,undefined)
|
||||
# target_compile_options(slsProjectOptions INTERFACE -fsanitize=thread)
|
||||
# target_link_libraries(slsProjectOptions INTERFACE -fsanitize=thread)
|
||||
endif()
|
||||
find_package(Qt4)
|
||||
find_package(Qwt 6)
|
||||
find_package(CBF)
|
||||
find_package(Doxygen)
|
||||
# find_package(PNG REQUIRED)
|
||||
|
||||
#rapidjson
|
||||
add_library(rapidjson INTERFACE)
|
||||
target_include_directories(rapidjson INTERFACE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/libs/rapidjson>
|
||||
)
|
||||
|
||||
# Install fake the libraries
|
||||
install(TARGETS slsProjectOptions slsProjectWarnings rapidjson
|
||||
EXPORT "${TARGETS_EXPORT_NAME}"
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
)
|
||||
if (SLS_USE_HDF5)
|
||||
find_package(HDF5 1.10 COMPONENTS CXX)
|
||||
endif (SLS_USE_HDF5)
|
||||
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
set(CMAKE_INSTALL_RPATH "$ORIGIN")
|
||||
# set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
|
||||
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
||||
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
|
||||
|
||||
|
||||
|
||||
find_package(ZeroMQ 4 REQUIRED)
|
||||
|
||||
if (SLS_USE_TESTS)
|
||||
enable_testing()
|
||||
add_subdirectory(tests)
|
||||
endif(SLS_USE_TESTS)
|
||||
|
||||
|
||||
|
||||
|
||||
# Common functionallity to detector and receiver
|
||||
add_subdirectory(slsSupportLib)
|
||||
|
||||
if (SLS_USE_TEXTCLIENT)
|
||||
add_subdirectory(slsDetectorSoftware)
|
||||
endif (SLS_USE_TEXTCLIENT)
|
||||
|
||||
|
||||
if (SLS_USE_RECEIVER)
|
||||
if (SLS_USE_HDF5)
|
||||
find_package(HDF5 1.10 COMPONENTS CXX REQUIRED)
|
||||
endif (SLS_USE_HDF5)
|
||||
add_subdirectory(slsReceiverSoftware)
|
||||
add_subdirectory(manual/manual-api)
|
||||
endif (SLS_USE_RECEIVER)
|
||||
|
||||
|
||||
if (SLS_USE_GUI)
|
||||
find_package(Qt4 REQUIRED)
|
||||
find_package(Qwt 6 REQUIRED)
|
||||
if (QT4_FOUND AND QWT_FOUND)
|
||||
add_subdirectory(slsDetectorGui)
|
||||
endif()
|
||||
endif (SLS_USE_GUI)
|
||||
|
||||
if (SLS_USE_SIMULATOR)
|
||||
add_subdirectory(slsDetectorServers)
|
||||
endif (SLS_USE_SIMULATOR)
|
||||
if (SLS_MASTER_PROJECT)
|
||||
# Set targets export name (otherwise set by upstream project)
|
||||
set(TARGETS_EXPORT_NAME "slsdetector-targets")
|
||||
endif (SLS_MASTER_PROJECT)
|
||||
|
||||
if (SLS_USE_INTEGRATION_TESTS)
|
||||
add_subdirectory(integrationTests)
|
||||
endif (SLS_USE_INTEGRATION_TESTS)
|
||||
|
||||
if (SLS_USE_PYTHON)
|
||||
add_subdirectory(libs/pybind11)
|
||||
add_subdirectory(python)
|
||||
endif(SLS_USE_PYTHON)
|
||||
|
||||
configure_file( .clang-tidy
|
||||
${CMAKE_BINARY_DIR}/.clang-tidy
|
||||
)
|
||||
|
||||
|
||||
add_subdirectory(sample)
|
||||
|
||||
add_subdirectory(docs)
|
||||
|
||||
|
||||
|
||||
|
||||
if(SLS_MASTER_PROJECT)
|
||||
# Set install dir CMake packages
|
||||
set(CMAKE_INSTALL_DIR ${CMAKE_INSTALL_DATADIR}/cmake/sls)
|
||||
# Set the list of exported targets
|
||||
set(PROJECT_LIBRARIES slsSupportLib slsDetectorShared slsReceiverShared)
|
||||
# Generate and install package config file and version
|
||||
include(cmake/package_config.cmake)
|
||||
endif()
|
||||
if (CALIBRATE)
|
||||
if (DEFINED ENV{ROOTSYS})
|
||||
find_package(ROOT)
|
||||
if (ROOT_FOUND)
|
||||
add_subdirectory(calibrationWizards)
|
||||
endif()
|
||||
endif()
|
||||
endif(CALIBRATE)
|
||||
|
235
Makefile
Executable file
235
Makefile
Executable file
@ -0,0 +1,235 @@
|
||||
# do not change below this line#
|
||||
|
||||
# Include common definitions
|
||||
include Makefile.include
|
||||
|
||||
INSTALLROOT ?= $(PWD)
|
||||
BINDIR ?= $(INSTALLROOT)/bin
|
||||
DOCDIR ?= $(INSTALLROOT)/manual/docs
|
||||
LIBDIR ?= $(INSTALLROOT)/bin
|
||||
INCDIR ?= $(INSTALLROOT)/include
|
||||
DETAILDOC ?= $(INSTALLROOT)/docs
|
||||
|
||||
WD = $(shell pwd)
|
||||
LIBRARYDIR = $(WD)/slsDetectorSoftware
|
||||
LIBRARYRXRDIR = $(WD)/slsReceiverSoftware
|
||||
CLIENTDIR = $(LIBRARYDIR)/slsDetectorClient
|
||||
GUIDIR = $(WD)/slsDetectorGui
|
||||
RECEIVERDIR = $(LIBRARYRXRDIR)
|
||||
CALWIZDIR = $(WD)/calibrationWizards
|
||||
MANDIR = $(WD)/manual
|
||||
CALIBDIR = $(WD)/slsDetectorCalibration
|
||||
MANAPIDIR = $(MANDIR)/manual-api
|
||||
|
||||
TABSPACE := "\t"
|
||||
|
||||
|
||||
INCLUDES=-I. -I$(LIBRARYDIR)/commonFiles -I$(LIBRARYDIR)/slsDetector -I$(LIBRARYDIR)/usersFunctions -I$(LIBRARYDIR)/multiSlsDetector -I$(LIBRARYDIR)/slsDetectorUtils -I$(LIBRARYDIR)/slsDetectorCommand -I$(LIBRARYDIR)/slsDetectorAnalysis -I$(LIBRARYDIR)/slsReceiverInterface -I$(LIBRARYRXRDIR)/include -I$(LIBRARYDIR)/threadFiles -I$(LIBRARYDIR)/sharedMemory -I$(ASM)
|
||||
|
||||
INCLUDESRXR += -I. -I$(LIBRARYRXRDIR)/include -I$(CALIBDIR) -I$(ASM)
|
||||
#LIBFLAGRXR +=
|
||||
|
||||
$(info )
|
||||
$(info #######################################)
|
||||
$(info # In slsDetectorsPackage Makefile #)
|
||||
$(info #######################################)
|
||||
$(info )
|
||||
|
||||
|
||||
.PHONY: all nonstatic static lib libreceiver textclient receiver gui stextclient sreceiver
|
||||
|
||||
#all: lib textclient receiver gui
|
||||
all: textclient receiver gui
|
||||
|
||||
nonstatic: lib libreceiver textclient receiver gui
|
||||
|
||||
static: lib libreceiver stextclient sreceiver gui
|
||||
|
||||
|
||||
lib:
|
||||
cd $(LIBRARYDIR) && $(MAKE) FLAGS='$(FLAGS)' DESTDIR='$(LIBDIR)' LIBRARYDIR='$(LIBRARYDIR)' LIBS='$(LDFLAGDET)' INCLUDES='$(INCLUDES)' LIBDIR='$(LIBDIR)'
|
||||
|
||||
libreceiver:
|
||||
cd $(LIBRARYRXRDIR) && $(MAKE) FLAGS='$(FLAGS)' DESTDIR='$(LIBDIR)' LIBS='$(LDFLAGRXR)' INCLUDES='$(INCLUDESRXR)' LIBDIR='$(LIBDIR)'
|
||||
|
||||
|
||||
stextclient: slsDetectorClient_static
|
||||
|
||||
slsDetectorClient: textclient
|
||||
|
||||
slsDetectorClient_static: #lib
|
||||
cd $(CLIENTDIR) && $(MAKE) static_clients FLAGS='$(FLAGS)' DESTDIR='$(BINDIR)' LIBRARYDIR='$(LIBRARYDIR)' LIBS='$(LDFLAGDET)' INCLUDES='$(INCLUDES)' LIBDIR='$(LIBDIR)'
|
||||
@echo ""
|
||||
@echo "#######################################"
|
||||
@echo "# Back in slsDetectorPackage Makefile #"
|
||||
@echo "#######################################"
|
||||
@echo ""
|
||||
|
||||
textclient: #lib
|
||||
cd $(CLIENTDIR) && $(MAKE) FLAGS='$(FLAGS)' DESTDIR='$(BINDIR)' LIBRARYDIR='$(LIBRARYDIR)' LIBS='$(LDFLAGDET)' INCLUDES='$(INCLUDES)' LIBDIR='$(LIBDIR)'
|
||||
@echo ""
|
||||
@echo "#######################################"
|
||||
@echo "# Back in slsDetectorPackage Makefile #"
|
||||
@echo "#######################################"
|
||||
@echo ""
|
||||
|
||||
slsReceiver: receiver
|
||||
|
||||
slsReceiver_static: receiver
|
||||
|
||||
receiver: #libreceiver
|
||||
# cd $(RECEIVERDIR) && $(MAKE) receiver FLAGS='$(FLAGS)' DESTDIR='$(BINDIR)' LIBS='$(LDFLAGRXR)' INCLUDES='$(INCLUDESRXR)' LIBDIR='$(LIBDIR)'
|
||||
cd $(RECEIVERDIR) && $(MAKE) FLAGS='$(FLAGS)' DESTDIR='$(BINDIR)' LIBS='$(LDFLAGRXR)' INCLUDES='$(INCLUDESRXR)' LIBDIR='$(LIBDIR)'
|
||||
cd $(MANAPIDIR) && $(MAKE) slsMultiReceiver
|
||||
@echo ""
|
||||
@echo "#######################################"
|
||||
@echo "# Back in slsDetectorPackage Makefile #"
|
||||
@echo "#######################################"
|
||||
@echo ""
|
||||
|
||||
sreceiver: #libreceiver
|
||||
cd $(RECEIVERDIR) && $(MAKE) static_receiver FLAGS='$(FLAGS)' DESTDIR='$(BINDIR)' LIBS='$(LDFLAGRXR)' INCLUDES='$(INCLUDESRXR)' LIBDIR='$(LIBDIR)'
|
||||
@echo ""
|
||||
@echo "#######################################"
|
||||
@echo "# Back in slsDetectorPackage Makefile #"
|
||||
@echo "#######################################"
|
||||
@echo ""
|
||||
|
||||
slsDetectorGUI: #lib
|
||||
cd $(GUIDIR) && $(MAKE) DESTDIR='$(BINDIR)' LIBRARYDIR='$(LIBRARYDIR)' INCLUDES='$(INCLUDES)' LDFLAGDET='$(LDFLAGDETONLY)' LIBDIR='$(LIBDIR)'
|
||||
@echo ""
|
||||
@echo "#######################################"
|
||||
@echo "# Back in slsDetectorPackage Makefile #"
|
||||
@echo "#######################################"
|
||||
@echo ""
|
||||
|
||||
calWiz:
|
||||
cd $(CALWIZDIR) && $(MAKE) DESTDIR=$(BINDIR) #FLAGS=$(FLAGS) LDFLAGDET=$(LDFLAGDET) INCLUDES=$(INCLUDES)
|
||||
|
||||
|
||||
|
||||
gui: slsDetectorGUI
|
||||
|
||||
|
||||
doc:
|
||||
$(shell test -d $(DOCDIR) || mkdir -p $(DOCDIR))
|
||||
cd manual && make all DESTDIR=$(DOCDIR)
|
||||
|
||||
htmldoc:
|
||||
make doc
|
||||
$(shell test -d $(DOCDIR) || mkdir -p $(DOCDIR))
|
||||
cd manual && make html DESTDIR=$(DOCDIR)
|
||||
|
||||
detaildoc: createdocs docspdf docshtml removedocs
|
||||
|
||||
createdocs: $(LIBRARYDIR)/doxy.config
|
||||
doxygen $(LIBRARYDIR)/doxy.config
|
||||
|
||||
docspdf:
|
||||
cd slsDetectorPackageDocs/latex && make
|
||||
$(shell test -d $(DETAILDOC) || mkdir -p $(DETAILDOC))
|
||||
$(shell test -d $(DETAILDOC)/pdf || mkdir -p $(DETAILDOC)/pdf)
|
||||
mv slsDetectorPackageDocs/latex/refman.pdf $(DETAILDOC)/pdf/slsDetectorPackageDocs.pdf
|
||||
|
||||
docshtml:
|
||||
$(shell test -d $(DETAILDOC) || mkdir -p $(DETAILDOC))
|
||||
$(shell test -d $(DETAILDOC)/html || mkdir -p $(DETAILDOC)/html)
|
||||
$(shell test -d $(DETAILDOC)/html/slsDetectorPackageDocs && rm -r $(DETAILDOC)/html/slsDetectorPackageDocs)
|
||||
mv slsDetectorPackageDocs/html $(DETAILDOC)/html/slsDetectorPackageDocs
|
||||
|
||||
removedocs:
|
||||
rm -rf slsDetectorPackageDocs;
|
||||
|
||||
|
||||
clean:
|
||||
cd $(BINDIR) && rm -rf sls_detector_* slsDetectorGui slsReceiver angularCalibrationWizard energyCalibrationWizard
|
||||
cd $(LIBDIR) && rm -rf libSlsDetector.so libSlsDetector.a libSlsReceiver.so libSlsReceiver.a
|
||||
cd $(LIBRARYDIR) && $(MAKE) clean
|
||||
cd $(LIBRARYRXRDIR) && $(MAKE) clean
|
||||
cd $(CLIENTDIR) && $(MAKE) clean
|
||||
cd $(GUIDIR) && $(MAKE) clean
|
||||
cd $(CALWIZDIR) && $(MAKE) clean
|
||||
cd manual && $(MAKE) clean
|
||||
cd $(DOCDIR) && rm -rf *
|
||||
rm -rf slsDetectorPackageDocs;
|
||||
rm -rf $(DETAILDOC)
|
||||
rm -rf $(MANAPIDIR)/slsMultiReceiver
|
||||
|
||||
|
||||
#install_lib:
|
||||
# cd $(LIBRARYDIR) && $(MAKE) install DESTDIR=$(LIBDIR) INCLUDES=$(INCLUDES)
|
||||
# cd $(LIBRARYDIR) && $(MAKE) install_inc DESTDIR=$(INCDIR)
|
||||
|
||||
mythen_virtual:
|
||||
cd $(LIBRARYDIR) && $(MAKE) mythenVirtualServer DESTDIR=$(BINDIR)
|
||||
|
||||
|
||||
gotthard_virtual:
|
||||
cd $(LIBRARYDIR) && $(MAKE) gotthardVirtualServer DESTDIR=$(BINDIR)
|
||||
|
||||
|
||||
install_client: textclient slsReceiver
|
||||
|
||||
install_gui: gui
|
||||
|
||||
confinstall:
|
||||
make conf;\
|
||||
make install
|
||||
|
||||
install_lib:
|
||||
make lib;\
|
||||
make libreceiver; \
|
||||
make textclient; \
|
||||
make slsReceiver; \
|
||||
make doc; \
|
||||
make htmldoc; \
|
||||
cd $(LIBRARYDIR) && $(MAKE) install_inc DESTDIR=$(INCDIR); \
|
||||
cd $(LIBRARYRXRDIR) && $(MAKE) install_inc DESTDIR=$(INCDIR);
|
||||
|
||||
install:
|
||||
make install_lib; \
|
||||
make gui; \
|
||||
make calWiz; \
|
||||
cd $(LIBRARYDIR) && $(MAKE) install_inc DESTDIR=$(INCDIR);\
|
||||
cd $(LIBRARYRXRDIR) && $(MAKE) install_inc DESTDIR=$(INCDIR);
|
||||
|
||||
conf:
|
||||
set -e; \
|
||||
. ./configure; \
|
||||
@echo "INSTALLROOT is $(INSTALLROOT)"
|
||||
@echo "BINDIR is $(BINDIR)"
|
||||
@echo "LIBDIR is $(LIBDIR)"
|
||||
@echo "INCDIR is $(INCDIR)"
|
||||
@echo "DOCDIR is $(DOCDIR)"
|
||||
|
||||
|
||||
help:
|
||||
@echo "Targets:"
|
||||
@echo "make all compile library, text clients, data reciever"
|
||||
@echo "make lib compile library"
|
||||
@echo "make libreceiver compile receiver library"
|
||||
@echo "make textclient compile the slsDetectorClient dynamically linking the libraries"
|
||||
@echo "make stextclient compile slsDetectorClient statically linking the libraries"
|
||||
@echo "make receiver compile the slsReciever dynamically linking the libraries"
|
||||
@echo "make sreceiver compile the slsReciever statically linking the libraries"
|
||||
@echo "make gui compile slsDetectorGUI - requires a working Qt4 and Qwt installation"
|
||||
@echo "make calWiz compile the calibration wizards - requires a working Root installation"
|
||||
@echo "make doc compile pdf documentation"
|
||||
@echo "make htmldoc compile html (and pdf) documentation"
|
||||
@echo "make install_lib installs the libraries, the text clients, the documentation and the includes for the API"
|
||||
@echo "make install installs all software, including the gui, the cal wizards and the includes for the API"
|
||||
@echo "make confinstall installs all software, including the gui, the cal wizards and the includes for the API, prompting for the install paths"
|
||||
@echo "make clean remove object files and executables"
|
||||
@echo "make help lists possible targets"
|
||||
@echo ""
|
||||
@echo ""
|
||||
@echo "Makefile variables"
|
||||
@echo "DEBUG=1,2 set debug level to 1 (VERBOSE) or 2 (VERYVERBOSE)"
|
||||
@echo ""
|
||||
@echo ""
|
||||
@echo "Variables - to change them run <source configure> :"
|
||||
@echo "INSTALLROOT=<yourdir>: installation root di r, default $PWD"
|
||||
@echo "BINDIR=<yourbin>: binary installation dir below INSTALLROOT, default bin"
|
||||
@echo "LIBDIR=<yourlib>: library installation dir below INSTALLROOT, default lib"
|
||||
@echo "INCDIR=<yourincludes>: header installation dir below INSTALLROOT, default include"
|
||||
@echo "DOCDIR=<yourdoc>: documentation installation dir below INSTALLROOT, default doc"
|
58
Makefile.include
Executable file
58
Makefile.include
Executable file
@ -0,0 +1,58 @@
|
||||
##############################################################
|
||||
# Generic
|
||||
##############################################################
|
||||
|
||||
CC = g++
|
||||
CXX = $(CC)
|
||||
ASM=$(shell echo "/lib/modules/`uname -r`/build/include")
|
||||
LDFLAGDETONLY = -L$(LIBDIR) -Wl,-rpath=$(LIBDIR) -lSlsDetector
|
||||
LDFLAGDET = -L$(LIBDIR) -Wl,-rpath=$(LIBDIR) -lSlsDetector -L/usr/lib64/ -pthread
|
||||
LDFLAGRXR = -L$(LIBDIR) -Wl,-rpath=$(LIBDIR) -lSlsReceiver -L/usr/lib64/ -pthread
|
||||
FLAGS= -Wall -pthread #-DEIGER_DEBUG2
|
||||
# -DVERBOSE
|
||||
|
||||
# Setting up the verbose flags
|
||||
ifeq ($(DEBUG),1)
|
||||
FLAGS = -Wall -DVERBOSE
|
||||
endif
|
||||
ifeq ($(DEBUG),2)
|
||||
FLAGS = -Wall -DVERYVERBOSE
|
||||
endif
|
||||
|
||||
##############################################################
|
||||
# HDF5 specific. Set this to yes, if you want to compile
|
||||
# HDF5 code: in this case, you need HDF5 libraries
|
||||
##############################################################
|
||||
|
||||
HDF5 = no
|
||||
HDF5_DIR = /opt/hdf5v1.10.0
|
||||
|
||||
ifeq ($(HDF5),yes)
|
||||
LDFLAGRXR = -L$(LIBDIR) -Wl,-rpath=$(LIBDIR) -lSlsReceiver -L$(HDF5_DIR)/lib -Wl,-rpath=$(HDF5_DIR)/lib -lhdf5 -lhdf5_cpp -lsz -lz -DHDF5C -L/usr/lib64/ -pthread
|
||||
INCLUDESRXR = -I$(HDF5_DIR)/include
|
||||
endif
|
||||
|
||||
|
||||
##############################################################
|
||||
# ROOTSLS specific. Set this to yes, if you want to compile
|
||||
# ROOTSLS code: in this case, you need also root libraries
|
||||
##############################################################
|
||||
|
||||
ROOTSLS = no
|
||||
|
||||
ROOTFLAGS = $(shell root-config --cflags --glibs) -DMYROOT1 #-DALLFILE_DEBUG #-DMYROOT1
|
||||
|
||||
ifeq ($(ROOTSLS),yes)
|
||||
LDFLAGRXR = -L$(LIBDIR) -lSlsReceiver $(ROOTFLAGS) -DROOTSLS
|
||||
endif
|
||||
|
||||
|
||||
define colorecho
|
||||
@tput setaf 6
|
||||
@echo $1
|
||||
@tput sgr0
|
||||
endef
|
||||
|
||||
|
||||
|
||||
|
201
RELEASE.txt
Executable file → Normal file
201
RELEASE.txt
Executable file → Normal file
@ -0,0 +1,201 @@
|
||||
SLS Detector Package 4.0.1 released on 08.02.2018 (Bug Fix Release)
|
||||
===================================================================
|
||||
|
||||
|
||||
This document describes the differences between 4.0.1 and 4.0.0 releases.
|
||||
|
||||
CONTENTS
|
||||
--------
|
||||
1. Topics Concerning
|
||||
2. Resolved Issues
|
||||
3. Known Issues
|
||||
4. Firmware Requirements
|
||||
5. Download, Documentation & Support
|
||||
|
||||
|
||||
|
||||
1. Topics Concerning
|
||||
====================
|
||||
|
||||
- Jungfrau server (new firmware mapped)
|
||||
- Eiger server (measuredPeriod, reg)
|
||||
- Gotthard server(ADC channel shift, ROI, 25um slave packets)
|
||||
- Receiver (padding, releasing resources segfault, gappixels)
|
||||
- Users class (detectorSize, ROI, versions, status)
|
||||
- API (config error, ROI)
|
||||
- Compile (Options prefix, static libraries, Makefile for API)
|
||||
- Gui (multi module)
|
||||
|
||||
|
||||
|
||||
2. Resolved Issues
|
||||
==================
|
||||
|
||||
Detector Server
|
||||
---------------
|
||||
|
||||
1. (Jungfrau): Latest Jungfrau firmware release mapped.
|
||||
|
||||
2. (Eiger): Measured subperiod initially wrapped around 4.29s. Now, upto 42.9s.
|
||||
|
||||
Advanced command "reg" was writing only to right FPGA.
|
||||
|
||||
3. (Gotthard 25/50um): Since Gotthard only sends packet numbers, one had to
|
||||
remember to take even number of images in ROI mode, if they wanted to
|
||||
switch back to non ROI mode.
|
||||
This is fixed now, but temporary fix involves sending an image during
|
||||
configuration, which will not be captured by the receiver. Hence, it takes
|
||||
longer to configure. Permanent fix will require a firmware update.
|
||||
|
||||
The detector output is shifted by 1 for every 32 channels. This is fixed now.
|
||||
|
||||
|
||||
Receiver
|
||||
--------
|
||||
|
||||
1. Receiver padding was enabled only if deactivated padding was also enabled.
|
||||
Receiver padding enable and receiver deactivated padding enable are independent now.
|
||||
|
||||
2. Starting and stopping receiver without listening resulted in seg faults.
|
||||
|
||||
3. Gappixels in receiver bug fix.
|
||||
|
||||
|
||||
Client
|
||||
------
|
||||
|
||||
1. (Users class): DetectorSize modified to set/get ROI if ROI is only 1 in number.
|
||||
|
||||
Allowed setting/getting ROI at single detector level via API.
|
||||
(ROI for Gotthard only). Added them to the users class as setROI and getROI.
|
||||
|
||||
Retrieving versions at module level is possible now.
|
||||
|
||||
Added "stopped" as status in getRunStatus list.
|
||||
|
||||
2. (API): Incorrect mac address in config file will set error flag in API and not just
|
||||
print the error.
|
||||
|
||||
ROI possible at module level.
|
||||
|
||||
|
||||
Compile
|
||||
-------
|
||||
|
||||
1. CMake options now have a prefix 'SLS_'.
|
||||
|
||||
2. Static libraries removed.
|
||||
|
||||
2. slsDetectorPackage/manual/manual-api/Makefile modified to use libraries
|
||||
from slsDetectorPackage/bin as the main Makefile copies the libraries there.
|
||||
No effect when using CMakeFiles.
|
||||
|
||||
|
||||
Gui
|
||||
---
|
||||
|
||||
1. Adding multiple detectors in x and y direction incremented number of detectors
|
||||
in y direction incorrectly. Effect seen only in GUI (segfault) if
|
||||
detsizechan has multi detectors in both direction. Fixed.
|
||||
|
||||
|
||||
|
||||
3. Known Issues
|
||||
===============
|
||||
|
||||
Detector Specific
|
||||
-----------------
|
||||
|
||||
1. (Gotthard 25 um): Slave misses or captures an extra frame. Occurs irregularly.
|
||||
|
||||
2. (Gotthard 25/50um): Using ROI (2 chips, 256 channels) missses last pixel
|
||||
of that ADC.
|
||||
|
||||
|
||||
|
||||
4. Firmware Requirements
|
||||
========================
|
||||
|
||||
Gotthard
|
||||
========
|
||||
Minimum compatible version : 11.01.2013
|
||||
Latest compatible version : 08.02.2018 (50um and 25um Master)
|
||||
09.02.2018 (25 um Slave)
|
||||
Eiger
|
||||
=====
|
||||
Minimum compatible version : 23
|
||||
Latest compatible version : 23
|
||||
|
||||
Jungfrau
|
||||
========
|
||||
Minimum compatible version : 26.02.2018
|
||||
Latest compatible version : 06.12.2018
|
||||
|
||||
|
||||
Detector Upgrade
|
||||
================
|
||||
Gotthard Cannot be upgraded remotely. Requires programming via USB blaster
|
||||
Eiger Can be upgraded remotely via bit files
|
||||
Jungfrau Can be upgraded remotely using sls_detector_put programfpga <pof>
|
||||
|
||||
Instructions available at
|
||||
https://www.psi.ch/detectors/installation-instructions
|
||||
under Detector Upgrade -> [Detector Type] -> Firmware.
|
||||
|
||||
|
||||
Please refer to the link below for more details on the firmware versions.
|
||||
https://www.psi.ch/detectors/firmware.
|
||||
|
||||
|
||||
|
||||
5. Download, Documentation & Support
|
||||
====================================
|
||||
|
||||
Download
|
||||
--------
|
||||
|
||||
The Source Code (Default C++ API):
|
||||
https://github.com/slsdetectorgroup/slsDetectorPackage
|
||||
|
||||
The Conda Lib Package:
|
||||
https://github.com/slsdetectorgroup/sls_detector_lib
|
||||
|
||||
The Conda GUI Package:
|
||||
https://github.com/slsdetectorgroup/sls_detector_gui
|
||||
|
||||
The Python Interface (including the package):
|
||||
https://github.com/slsdetectorgroup/sls_detector
|
||||
|
||||
|
||||
Documentation
|
||||
-------------
|
||||
|
||||
Manual (HTML & PDF):
|
||||
https://www.psi.ch/detectors/documentation
|
||||
slsDetectorPackage/manual/docs/
|
||||
|
||||
Command Line Documentation:
|
||||
manual/docs/html/slsDetectorClientDocs/index.html
|
||||
manual/docs/pdf/slsDetectorClientDocs.pdf
|
||||
|
||||
C++ API Documentation:
|
||||
manual/docs/html/slsDetectorUsersDocs/index.html
|
||||
manual/docs/pdf/slsDetectorUsersDocs.pdf
|
||||
|
||||
C++ API Example:
|
||||
manual/manual-api/mainClient.cpp
|
||||
manual/manual-api/mainReceiver.cpp
|
||||
|
||||
Python API Documentation:
|
||||
https://slsdetectorgroup.github.io/sls_detector/
|
||||
|
||||
Further Documentation:
|
||||
https://www.psi.ch/detectors/users-support
|
||||
|
||||
|
||||
Support
|
||||
-------
|
||||
|
||||
dhanya.thattil@psi.ch
|
||||
erik.frojdh@psi.ch
|
||||
anna.bergamaschi@psi.ch
|
||||
|
1
cleansharedmemory.sh
Normal file
1
cleansharedmemory.sh
Normal file
@ -0,0 +1 @@
|
||||
rm /dev/shm/slsDetectorPackage*;
|
@ -1,175 +0,0 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
#[=======================================================================[.rst:
|
||||
Catch
|
||||
-----
|
||||
|
||||
This module defines a function to help use the Catch test framework.
|
||||
|
||||
The :command:`catch_discover_tests` discovers tests by asking the compiled test
|
||||
executable to enumerate its tests. This does not require CMake to be re-run
|
||||
when tests change. However, it may not work in a cross-compiling environment,
|
||||
and setting test properties is less convenient.
|
||||
|
||||
This command is intended to replace use of :command:`add_test` to register
|
||||
tests, and will create a separate CTest test for each Catch test case. Note
|
||||
that this is in some cases less efficient, as common set-up and tear-down logic
|
||||
cannot be shared by multiple test cases executing in the same instance.
|
||||
However, it provides more fine-grained pass/fail information to CTest, which is
|
||||
usually considered as more beneficial. By default, the CTest test name is the
|
||||
same as the Catch name; see also ``TEST_PREFIX`` and ``TEST_SUFFIX``.
|
||||
|
||||
.. command:: catch_discover_tests
|
||||
|
||||
Automatically add tests with CTest by querying the compiled test executable
|
||||
for available tests::
|
||||
|
||||
catch_discover_tests(target
|
||||
[TEST_SPEC arg1...]
|
||||
[EXTRA_ARGS arg1...]
|
||||
[WORKING_DIRECTORY dir]
|
||||
[TEST_PREFIX prefix]
|
||||
[TEST_SUFFIX suffix]
|
||||
[PROPERTIES name1 value1...]
|
||||
[TEST_LIST var]
|
||||
)
|
||||
|
||||
``catch_discover_tests`` sets up a post-build command on the test executable
|
||||
that generates the list of tests by parsing the output from running the test
|
||||
with the ``--list-test-names-only`` argument. This ensures that the full
|
||||
list of tests is obtained. Since test discovery occurs at build time, it is
|
||||
not necessary to re-run CMake when the list of tests changes.
|
||||
However, it requires that :prop_tgt:`CROSSCOMPILING_EMULATOR` is properly set
|
||||
in order to function in a cross-compiling environment.
|
||||
|
||||
Additionally, setting properties on tests is somewhat less convenient, since
|
||||
the tests are not available at CMake time. Additional test properties may be
|
||||
assigned to the set of tests as a whole using the ``PROPERTIES`` option. If
|
||||
more fine-grained test control is needed, custom content may be provided
|
||||
through an external CTest script using the :prop_dir:`TEST_INCLUDE_FILES`
|
||||
directory property. The set of discovered tests is made accessible to such a
|
||||
script via the ``<target>_TESTS`` variable.
|
||||
|
||||
The options are:
|
||||
|
||||
``target``
|
||||
Specifies the Catch executable, which must be a known CMake executable
|
||||
target. CMake will substitute the location of the built executable when
|
||||
running the test.
|
||||
|
||||
``TEST_SPEC arg1...``
|
||||
Specifies test cases, wildcarded test cases, tags and tag expressions to
|
||||
pass to the Catch executable with the ``--list-test-names-only`` argument.
|
||||
|
||||
``EXTRA_ARGS arg1...``
|
||||
Any extra arguments to pass on the command line to each test case.
|
||||
|
||||
``WORKING_DIRECTORY dir``
|
||||
Specifies the directory in which to run the discovered test cases. If this
|
||||
option is not provided, the current binary directory is used.
|
||||
|
||||
``TEST_PREFIX prefix``
|
||||
Specifies a ``prefix`` to be prepended to the name of each discovered test
|
||||
case. This can be useful when the same test executable is being used in
|
||||
multiple calls to ``catch_discover_tests()`` but with different
|
||||
``TEST_SPEC`` or ``EXTRA_ARGS``.
|
||||
|
||||
``TEST_SUFFIX suffix``
|
||||
Similar to ``TEST_PREFIX`` except the ``suffix`` is appended to the name of
|
||||
every discovered test case. Both ``TEST_PREFIX`` and ``TEST_SUFFIX`` may
|
||||
be specified.
|
||||
|
||||
``PROPERTIES name1 value1...``
|
||||
Specifies additional properties to be set on all tests discovered by this
|
||||
invocation of ``catch_discover_tests``.
|
||||
|
||||
``TEST_LIST var``
|
||||
Make the list of tests available in the variable ``var``, rather than the
|
||||
default ``<target>_TESTS``. This can be useful when the same test
|
||||
executable is being used in multiple calls to ``catch_discover_tests()``.
|
||||
Note that this variable is only available in CTest.
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
function(catch_discover_tests TARGET)
|
||||
cmake_parse_arguments(
|
||||
""
|
||||
""
|
||||
"TEST_PREFIX;TEST_SUFFIX;WORKING_DIRECTORY;TEST_LIST"
|
||||
"TEST_SPEC;EXTRA_ARGS;PROPERTIES"
|
||||
${ARGN}
|
||||
)
|
||||
|
||||
if(NOT _WORKING_DIRECTORY)
|
||||
set(_WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
endif()
|
||||
if(NOT _TEST_LIST)
|
||||
set(_TEST_LIST ${TARGET}_TESTS)
|
||||
endif()
|
||||
|
||||
## Generate a unique name based on the extra arguments
|
||||
string(SHA1 args_hash "${_TEST_SPEC} ${_EXTRA_ARGS}")
|
||||
string(SUBSTRING ${args_hash} 0 7 args_hash)
|
||||
|
||||
# Define rule to generate test list for aforementioned test executable
|
||||
set(ctest_include_file "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_include-${args_hash}.cmake")
|
||||
set(ctest_tests_file "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_tests-${args_hash}.cmake")
|
||||
get_property(crosscompiling_emulator
|
||||
TARGET ${TARGET}
|
||||
PROPERTY CROSSCOMPILING_EMULATOR
|
||||
)
|
||||
add_custom_command(
|
||||
TARGET ${TARGET} POST_BUILD
|
||||
BYPRODUCTS "${ctest_tests_file}"
|
||||
COMMAND "${CMAKE_COMMAND}"
|
||||
-D "TEST_TARGET=${TARGET}"
|
||||
-D "TEST_EXECUTABLE=$<TARGET_FILE:${TARGET}>"
|
||||
-D "TEST_EXECUTOR=${crosscompiling_emulator}"
|
||||
-D "TEST_WORKING_DIR=${_WORKING_DIRECTORY}"
|
||||
-D "TEST_SPEC=${_TEST_SPEC}"
|
||||
-D "TEST_EXTRA_ARGS=${_EXTRA_ARGS}"
|
||||
-D "TEST_PROPERTIES=${_PROPERTIES}"
|
||||
-D "TEST_PREFIX=${_TEST_PREFIX}"
|
||||
-D "TEST_SUFFIX=${_TEST_SUFFIX}"
|
||||
-D "TEST_LIST=${_TEST_LIST}"
|
||||
-D "CTEST_FILE=${ctest_tests_file}"
|
||||
-P "${_CATCH_DISCOVER_TESTS_SCRIPT}"
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
file(WRITE "${ctest_include_file}"
|
||||
"if(EXISTS \"${ctest_tests_file}\")\n"
|
||||
" include(\"${ctest_tests_file}\")\n"
|
||||
"else()\n"
|
||||
" add_test(${TARGET}_NOT_BUILT-${args_hash} ${TARGET}_NOT_BUILT-${args_hash})\n"
|
||||
"endif()\n"
|
||||
)
|
||||
|
||||
if(NOT ${CMAKE_VERSION} VERSION_LESS "3.10.0")
|
||||
# Add discovered tests to directory TEST_INCLUDE_FILES
|
||||
set_property(DIRECTORY
|
||||
APPEND PROPERTY TEST_INCLUDE_FILES "${ctest_include_file}"
|
||||
)
|
||||
else()
|
||||
# Add discovered tests as directory TEST_INCLUDE_FILE if possible
|
||||
get_property(test_include_file_set DIRECTORY PROPERTY TEST_INCLUDE_FILE SET)
|
||||
if (NOT ${test_include_file_set})
|
||||
set_property(DIRECTORY
|
||||
PROPERTY TEST_INCLUDE_FILE "${ctest_include_file}"
|
||||
)
|
||||
else()
|
||||
message(FATAL_ERROR
|
||||
"Cannot set more than one TEST_INCLUDE_FILE"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
endfunction()
|
||||
|
||||
###############################################################################
|
||||
|
||||
set(_CATCH_DISCOVER_TESTS_SCRIPT
|
||||
${CMAKE_CURRENT_LIST_DIR}/CatchAddTests.cmake
|
||||
)
|
@ -1,78 +0,0 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
set(prefix "${TEST_PREFIX}")
|
||||
set(suffix "${TEST_SUFFIX}")
|
||||
set(spec ${TEST_SPEC})
|
||||
set(extra_args ${TEST_EXTRA_ARGS})
|
||||
set(properties ${TEST_PROPERTIES})
|
||||
set(script)
|
||||
set(suite)
|
||||
set(tests)
|
||||
|
||||
function(add_command NAME)
|
||||
set(_args "")
|
||||
foreach(_arg ${ARGN})
|
||||
if(_arg MATCHES "[^-./:a-zA-Z0-9_]")
|
||||
set(_args "${_args} [==[${_arg}]==]") # form a bracket_argument
|
||||
else()
|
||||
set(_args "${_args} ${_arg}")
|
||||
endif()
|
||||
endforeach()
|
||||
set(script "${script}${NAME}(${_args})\n" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# Run test executable to get list of available tests
|
||||
if(NOT EXISTS "${TEST_EXECUTABLE}")
|
||||
message(FATAL_ERROR
|
||||
"Specified test executable '${TEST_EXECUTABLE}' does not exist"
|
||||
)
|
||||
endif()
|
||||
execute_process(
|
||||
COMMAND ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" ${spec} --list-test-names-only
|
||||
OUTPUT_VARIABLE output
|
||||
RESULT_VARIABLE result
|
||||
)
|
||||
# Catch --list-test-names-only reports the number of tests, so 0 is... surprising
|
||||
if(${result} EQUAL 0)
|
||||
message(WARNING
|
||||
"Test executable '${TEST_EXECUTABLE}' contains no tests!\n"
|
||||
)
|
||||
elseif(${result} LESS 0)
|
||||
message(FATAL_ERROR
|
||||
"Error running test executable '${TEST_EXECUTABLE}':\n"
|
||||
" Result: ${result}\n"
|
||||
" Output: ${output}\n"
|
||||
)
|
||||
endif()
|
||||
|
||||
string(REPLACE "\n" ";" output "${output}")
|
||||
|
||||
# Parse output
|
||||
foreach(line ${output})
|
||||
set(test ${line})
|
||||
# use escape commas to handle properly test cases with commans inside the name
|
||||
string(REPLACE "," "\\," test_name ${test})
|
||||
# ...and add to script
|
||||
add_command(add_test
|
||||
"${prefix}${test}${suffix}"
|
||||
${TEST_EXECUTOR}
|
||||
"${TEST_EXECUTABLE}"
|
||||
"${test_name}"
|
||||
${extra_args}
|
||||
)
|
||||
add_command(set_tests_properties
|
||||
"${prefix}${test}${suffix}"
|
||||
PROPERTIES
|
||||
WORKING_DIRECTORY "${TEST_WORKING_DIR}"
|
||||
${properties}
|
||||
)
|
||||
list(APPEND tests "${prefix}${test}${suffix}")
|
||||
endforeach()
|
||||
|
||||
# Create a list of all discovered tests, which users may use to e.g. set
|
||||
# properties on the tests
|
||||
add_command(set ${TEST_LIST} ${tests})
|
||||
|
||||
# Write CTest script
|
||||
file(WRITE "${CTEST_FILE}" "${script}")
|
0
cmake/FindCBF.cmake
Executable file → Normal file
0
cmake/FindCBF.cmake
Executable file → Normal file
0
cmake/FindQwt.cmake
Executable file → Normal file
0
cmake/FindQwt.cmake
Executable file → Normal file
0
cmake/FindROOT.cmake
Executable file → Normal file
0
cmake/FindROOT.cmake
Executable file → Normal file
@ -1,11 +0,0 @@
|
||||
#Look for an executable called sphinx-build
|
||||
find_program(SPHINX_EXECUTABLE
|
||||
NAMES sphinx-build
|
||||
DOC "Path to sphinx-build executable")
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
#Handle standard arguments to find_package like REQUIRED and QUIET
|
||||
find_package_handle_standard_args(Sphinx
|
||||
"Failed to find sphinx-build executable"
|
||||
SPHINX_EXECUTABLE)
|
@ -1,112 +0,0 @@
|
||||
|
||||
# This file is originally from https://github.com/zeromq/azmq and distributed
|
||||
# under Boost Software Lincese 1.0
|
||||
# Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
# Permission is hereby granted, free of charge, to any person or organization
|
||||
# obtaining a copy of the software and accompanying documentation covered by
|
||||
# this license (the "Software") to use, reproduce, display, distribute,
|
||||
# execute, and transmit the Software, and to prepare derivative works of the
|
||||
# Software, and to permit third-parties to whom the Software is furnished to
|
||||
# do so, all subject to the following:
|
||||
|
||||
# The copyright notices in the Software and this entire statement, including
|
||||
# the above license grant, this restriction and the following disclaimer,
|
||||
# must be included in all copies of the Software, in whole or in part, and
|
||||
# all derivative works of the Software, unless such copies or derivative
|
||||
# works are solely in the form of machine-executable object code generated by
|
||||
# a source language processor.
|
||||
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
# SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
# FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
# DEALINGS IN THE SOFTWARE.
|
||||
# --------------------------------------------------------------------------------
|
||||
|
||||
# Find ZeroMQ Headers/Libs
|
||||
|
||||
# Variables
|
||||
# ZMQ_ROOT - set this to a location where ZeroMQ may be found
|
||||
#
|
||||
# ZeroMQ_FOUND - True of ZeroMQ found
|
||||
# ZeroMQ_INCLUDE_DIRS - Location of ZeroMQ includes
|
||||
# ZeroMQ_LIBRARIES - ZeroMQ libraries
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
if (NOT ZMQ_ROOT)
|
||||
set(ZMQ_ROOT "$ENV{ZMQ_ROOT}")
|
||||
endif()
|
||||
|
||||
if (NOT ZMQ_ROOT)
|
||||
find_path(_ZeroMQ_ROOT NAMES include/zmq.h)
|
||||
else()
|
||||
set(_ZeroMQ_ROOT "${ZMQ_ROOT}")
|
||||
endif()
|
||||
|
||||
find_path(ZeroMQ_INCLUDE_DIRS NAMES zmq.h HINTS ${_ZeroMQ_ROOT}/include)
|
||||
|
||||
if (ZeroMQ_INCLUDE_DIRS)
|
||||
set(_ZeroMQ_H ${ZeroMQ_INCLUDE_DIRS}/zmq.h)
|
||||
|
||||
function(_zmqver_EXTRACT _ZeroMQ_VER_COMPONENT _ZeroMQ_VER_OUTPUT)
|
||||
set(CMAKE_MATCH_1 "0")
|
||||
set(_ZeroMQ_expr "^[ \\t]*#define[ \\t]+${_ZeroMQ_VER_COMPONENT}[ \\t]+([0-9]+)$")
|
||||
file(STRINGS "${_ZeroMQ_H}" _ZeroMQ_ver REGEX "${_ZeroMQ_expr}")
|
||||
string(REGEX MATCH "${_ZeroMQ_expr}" ZeroMQ_ver "${_ZeroMQ_ver}")
|
||||
set(${_ZeroMQ_VER_OUTPUT} "${CMAKE_MATCH_1}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
_zmqver_EXTRACT("ZMQ_VERSION_MAJOR" ZeroMQ_VERSION_MAJOR)
|
||||
_zmqver_EXTRACT("ZMQ_VERSION_MINOR" ZeroMQ_VERSION_MINOR)
|
||||
_zmqver_EXTRACT("ZMQ_VERSION_PATCH" ZeroMQ_VERSION_PATCH)
|
||||
|
||||
message(STATUS "ZeroMQ version: ${ZeroMQ_VERSION_MAJOR}.${ZeroMQ_VERSION_MINOR}.${ZeroMQ_VERSION_PATCH}")
|
||||
|
||||
# We should provide version to find_package_handle_standard_args in the same format as it was requested,
|
||||
# otherwise it can't check whether version matches exactly.
|
||||
if (ZeroMQ_FIND_VERSION_COUNT GREATER 2)
|
||||
set(ZeroMQ_VERSION "${ZeroMQ_VERSION_MAJOR}.${ZeroMQ_VERSION_MINOR}.${ZeroMQ_VERSION_PATCH}")
|
||||
else()
|
||||
# User has requested ZeroMQ version without patch part => user is not interested in specific patch =>
|
||||
# any patch should be an exact match.
|
||||
set(ZeroMQ_VERSION "${ZeroMQ_VERSION_MAJOR}.${ZeroMQ_VERSION_MINOR}")
|
||||
endif()
|
||||
|
||||
if (NOT ${CMAKE_CXX_PLATFORM_ID} STREQUAL "Windows")
|
||||
find_library(ZeroMQ_LIBRARIES NAMES zmq HINTS ${_ZeroMQ_ROOT}/lib)
|
||||
else()
|
||||
find_library(
|
||||
ZeroMQ_LIBRARY_RELEASE
|
||||
NAMES
|
||||
libzmq
|
||||
"libzmq-${CMAKE_VS_PLATFORM_TOOLSET}-mt-${ZeroMQ_VERSION_MAJOR}_${ZeroMQ_VERSION_MINOR}_${ZeroMQ_VERSION_PATCH}"
|
||||
HINTS
|
||||
${_ZeroMQ_ROOT}/lib
|
||||
)
|
||||
|
||||
find_library(
|
||||
ZeroMQ_LIBRARY_DEBUG
|
||||
NAMES
|
||||
libzmq_d
|
||||
"libzmq-${CMAKE_VS_PLATFORM_TOOLSET}-mt-gd-${ZeroMQ_VERSION_MAJOR}_${ZeroMQ_VERSION_MINOR}_${ZeroMQ_VERSION_PATCH}"
|
||||
HINTS
|
||||
${_ZeroMQ_ROOT}/lib)
|
||||
|
||||
# On Windows we have to use corresponding version (i.e. Release or Debug) of ZeroMQ because of `errno` CRT global variable
|
||||
# See more at http://www.drdobbs.com/avoiding-the-visual-c-runtime-library/184416623
|
||||
set(ZeroMQ_LIBRARIES optimized "${ZeroMQ_LIBRARY_RELEASE}" debug "${ZeroMQ_LIBRARY_DEBUG}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_package_handle_standard_args(ZeroMQ FOUND_VAR ZeroMQ_FOUND
|
||||
REQUIRED_VARS ZeroMQ_INCLUDE_DIRS ZeroMQ_LIBRARIES
|
||||
VERSION_VAR ZeroMQ_VERSION)
|
||||
|
||||
if (ZeroMQ_FOUND)
|
||||
mark_as_advanced(ZeroMQ_INCLUDE_DIRS ZeroMQ_LIBRARIES ZeroMQ_VERSION
|
||||
ZeroMQ_VERSION_MAJOR ZeroMQ_VERSION_MINOR ZeroMQ_VERSION_PATCH)
|
||||
endif()
|
@ -1,203 +0,0 @@
|
||||
#==================================================================================================#
|
||||
# supported macros #
|
||||
# - TEST_CASE, #
|
||||
# - SCENARIO, #
|
||||
# - TEST_CASE_METHOD, #
|
||||
# - CATCH_TEST_CASE, #
|
||||
# - CATCH_SCENARIO, #
|
||||
# - CATCH_TEST_CASE_METHOD. #
|
||||
# #
|
||||
# Usage #
|
||||
# 1. make sure this module is in the path or add this otherwise: #
|
||||
# set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake.modules/") #
|
||||
# 2. make sure that you've enabled testing option for the project by the call: #
|
||||
# enable_testing() #
|
||||
# 3. add the lines to the script for testing target (sample CMakeLists.txt): #
|
||||
# project(testing_target) #
|
||||
# set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake.modules/") #
|
||||
# enable_testing() #
|
||||
# #
|
||||
# find_path(CATCH_INCLUDE_DIR "catch.hpp") #
|
||||
# include_directories(${INCLUDE_DIRECTORIES} ${CATCH_INCLUDE_DIR}) #
|
||||
# #
|
||||
# file(GLOB SOURCE_FILES "*.cpp") #
|
||||
# add_executable(${PROJECT_NAME} ${SOURCE_FILES}) #
|
||||
# #
|
||||
# include(ParseAndAddCatchTests) #
|
||||
# ParseAndAddCatchTests(${PROJECT_NAME}) #
|
||||
# #
|
||||
# The following variables affect the behavior of the script: #
|
||||
# #
|
||||
# PARSE_CATCH_TESTS_VERBOSE (Default OFF) #
|
||||
# -- enables debug messages #
|
||||
# PARSE_CATCH_TESTS_NO_HIDDEN_TESTS (Default OFF) #
|
||||
# -- excludes tests marked with [!hide], [.] or [.foo] tags #
|
||||
# PARSE_CATCH_TESTS_ADD_FIXTURE_IN_TEST_NAME (Default ON) #
|
||||
# -- adds fixture class name to the test name #
|
||||
# PARSE_CATCH_TESTS_ADD_TARGET_IN_TEST_NAME (Default ON) #
|
||||
# -- adds cmake target name to the test name #
|
||||
# PARSE_CATCH_TESTS_ADD_TO_CONFIGURE_DEPENDS (Default OFF) #
|
||||
# -- causes CMake to rerun when file with tests changes so that new tests will be discovered #
|
||||
# #
|
||||
# One can also set (locally) the optional variable OptionalCatchTestLauncher to precise the way #
|
||||
# a test should be run. For instance to use test MPI, one can write #
|
||||
# set(OptionalCatchTestLauncher ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${NUMPROC}) #
|
||||
# just before calling this ParseAndAddCatchTests function #
|
||||
# #
|
||||
#==================================================================================================#
|
||||
|
||||
cmake_minimum_required(VERSION 2.8.8)
|
||||
|
||||
option(PARSE_CATCH_TESTS_VERBOSE "Print Catch to CTest parser debug messages" OFF)
|
||||
option(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS "Exclude tests with [!hide], [.] or [.foo] tags" OFF)
|
||||
option(PARSE_CATCH_TESTS_ADD_FIXTURE_IN_TEST_NAME "Add fixture class name to the test name" ON)
|
||||
option(PARSE_CATCH_TESTS_ADD_TARGET_IN_TEST_NAME "Add target name to the test name" ON)
|
||||
option(PARSE_CATCH_TESTS_ADD_TO_CONFIGURE_DEPENDS "Add test file to CMAKE_CONFIGURE_DEPENDS property" OFF)
|
||||
|
||||
function(PrintDebugMessage)
|
||||
if(PARSE_CATCH_TESTS_VERBOSE)
|
||||
message(STATUS "ParseAndAddCatchTests: ${ARGV}")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# This removes the contents between
|
||||
# - block comments (i.e. /* ... */)
|
||||
# - full line comments (i.e. // ... )
|
||||
# contents have been read into '${CppCode}'.
|
||||
# !keep partial line comments
|
||||
function(RemoveComments CppCode)
|
||||
string(ASCII 2 CMakeBeginBlockComment)
|
||||
string(ASCII 3 CMakeEndBlockComment)
|
||||
string(REGEX REPLACE "/\\*" "${CMakeBeginBlockComment}" ${CppCode} "${${CppCode}}")
|
||||
string(REGEX REPLACE "\\*/" "${CMakeEndBlockComment}" ${CppCode} "${${CppCode}}")
|
||||
string(REGEX REPLACE "${CMakeBeginBlockComment}[^${CMakeEndBlockComment}]*${CMakeEndBlockComment}" "" ${CppCode} "${${CppCode}}")
|
||||
string(REGEX REPLACE "\n[ \t]*//+[^\n]+" "\n" ${CppCode} "${${CppCode}}")
|
||||
|
||||
set(${CppCode} "${${CppCode}}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# Worker function
|
||||
function(ParseFile SourceFile TestTarget)
|
||||
# According to CMake docs EXISTS behavior is well-defined only for full paths.
|
||||
get_filename_component(SourceFile ${SourceFile} ABSOLUTE)
|
||||
if(NOT EXISTS ${SourceFile})
|
||||
message(WARNING "Cannot find source file: ${SourceFile}")
|
||||
return()
|
||||
endif()
|
||||
PrintDebugMessage("parsing ${SourceFile}")
|
||||
file(STRINGS ${SourceFile} Contents NEWLINE_CONSUME)
|
||||
|
||||
# Remove block and fullline comments
|
||||
RemoveComments(Contents)
|
||||
|
||||
# Find definition of test names
|
||||
string(REGEX MATCHALL "[ \t]*(CATCH_)?(TEST_CASE_METHOD|SCENARIO|TEST_CASE)[ \t]*\\([^\)]+\\)+[ \t\n]*{+[ \t]*(//[^\n]*[Tt][Ii][Mm][Ee][Oo][Uu][Tt][ \t]*[0-9]+)*" Tests "${Contents}")
|
||||
|
||||
if(PARSE_CATCH_TESTS_ADD_TO_CONFIGURE_DEPENDS AND Tests)
|
||||
PrintDebugMessage("Adding ${SourceFile} to CMAKE_CONFIGURE_DEPENDS property")
|
||||
set_property(
|
||||
DIRECTORY
|
||||
APPEND
|
||||
PROPERTY CMAKE_CONFIGURE_DEPENDS ${SourceFile}
|
||||
)
|
||||
endif()
|
||||
|
||||
foreach(TestName ${Tests})
|
||||
# Strip newlines
|
||||
string(REGEX REPLACE "\\\\\n|\n" "" TestName "${TestName}")
|
||||
|
||||
# Get test type and fixture if applicable
|
||||
string(REGEX MATCH "(CATCH_)?(TEST_CASE_METHOD|SCENARIO|TEST_CASE)[ \t]*\\([^,^\"]*" TestTypeAndFixture "${TestName}")
|
||||
string(REGEX MATCH "(CATCH_)?(TEST_CASE_METHOD|SCENARIO|TEST_CASE)" TestType "${TestTypeAndFixture}")
|
||||
string(REGEX REPLACE "${TestType}\\([ \t]*" "" TestFixture "${TestTypeAndFixture}")
|
||||
|
||||
# Get string parts of test definition
|
||||
string(REGEX MATCHALL "\"+([^\\^\"]|\\\\\")+\"+" TestStrings "${TestName}")
|
||||
|
||||
# Strip wrapping quotation marks
|
||||
string(REGEX REPLACE "^\"(.*)\"$" "\\1" TestStrings "${TestStrings}")
|
||||
string(REPLACE "\";\"" ";" TestStrings "${TestStrings}")
|
||||
|
||||
# Validate that a test name and tags have been provided
|
||||
list(LENGTH TestStrings TestStringsLength)
|
||||
if(TestStringsLength GREATER 2 OR TestStringsLength LESS 1)
|
||||
message(FATAL_ERROR "You must provide a valid test name and tags for all tests in ${SourceFile}")
|
||||
endif()
|
||||
|
||||
# Assign name and tags
|
||||
list(GET TestStrings 0 Name)
|
||||
if("${TestType}" STREQUAL "SCENARIO")
|
||||
set(Name "Scenario: ${Name}")
|
||||
endif()
|
||||
if(PARSE_CATCH_TESTS_ADD_FIXTURE_IN_TEST_NAME AND TestFixture)
|
||||
set(CTestName "${TestFixture}:${Name}")
|
||||
else()
|
||||
set(CTestName "${Name}")
|
||||
endif()
|
||||
if(PARSE_CATCH_TESTS_ADD_TARGET_IN_TEST_NAME)
|
||||
set(CTestName "${TestTarget}:${CTestName}")
|
||||
endif()
|
||||
# add target to labels to enable running all tests added from this target
|
||||
set(Labels ${TestTarget})
|
||||
if(TestStringsLength EQUAL 2)
|
||||
list(GET TestStrings 1 Tags)
|
||||
string(TOLOWER "${Tags}" Tags)
|
||||
# remove target from labels if the test is hidden
|
||||
if("${Tags}" MATCHES ".*\\[!?(hide|\\.)\\].*")
|
||||
list(REMOVE_ITEM Labels ${TestTarget})
|
||||
endif()
|
||||
string(REPLACE "]" ";" Tags "${Tags}")
|
||||
string(REPLACE "[" "" Tags "${Tags}")
|
||||
else()
|
||||
# unset tags variable from previous loop
|
||||
unset(Tags)
|
||||
endif()
|
||||
|
||||
list(APPEND Labels ${Tags})
|
||||
|
||||
list(FIND Labels "!hide" IndexOfHideLabel)
|
||||
set(HiddenTagFound OFF)
|
||||
foreach(label ${Labels})
|
||||
string(REGEX MATCH "^!hide|^\\." result ${label})
|
||||
if(result)
|
||||
set(HiddenTagFound ON)
|
||||
break()
|
||||
endif(result)
|
||||
endforeach(label)
|
||||
if(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS AND ${HiddenTagFound} AND ${CMAKE_VERSION} VERSION_LESS "3.9")
|
||||
PrintDebugMessage("Skipping test \"${CTestName}\" as it has [!hide], [.] or [.foo] label")
|
||||
else()
|
||||
PrintDebugMessage("Adding test \"${CTestName}\"")
|
||||
if(Labels)
|
||||
PrintDebugMessage("Setting labels to ${Labels}")
|
||||
endif()
|
||||
|
||||
# Escape commas in the test spec
|
||||
string(REPLACE "," "\\," Name ${Name})
|
||||
|
||||
# Add the test and set its properties
|
||||
add_test(NAME "\"${CTestName}\"" COMMAND ${OptionalCatchTestLauncher} ${TestTarget} ${Name} ${AdditionalCatchParameters})
|
||||
# Old CMake versions do not document VERSION_GREATER_EQUAL, so we use VERSION_GREATER with 3.8 instead
|
||||
if(PARSE_CATCH_TESTS_NO_HIDDEN_TESTS AND ${HiddenTagFound} AND ${CMAKE_VERSION} VERSION_GREATER "3.8")
|
||||
PrintDebugMessage("Setting DISABLED test property")
|
||||
set_tests_properties("\"${CTestName}\"" PROPERTIES DISABLED ON)
|
||||
else()
|
||||
set_tests_properties("\"${CTestName}\"" PROPERTIES FAIL_REGULAR_EXPRESSION "No tests ran"
|
||||
LABELS "${Labels}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
# entry point
|
||||
function(ParseAndAddCatchTests TestTarget)
|
||||
PrintDebugMessage("Started parsing ${TestTarget}")
|
||||
get_target_property(SourceFiles ${TestTarget} SOURCES)
|
||||
PrintDebugMessage("Found the following sources: ${SourceFiles}")
|
||||
foreach(SourceFile ${SourceFiles})
|
||||
ParseFile(${SourceFile} ${TestTarget})
|
||||
endforeach()
|
||||
PrintDebugMessage("Finished parsing ${TestTarget}")
|
||||
endfunction()
|
@ -1,31 +0,0 @@
|
||||
# This cmake code creates the configuration that is found and used by
|
||||
# find_package() of another cmake project
|
||||
|
||||
# get lower and upper case project name for the configuration files
|
||||
|
||||
# configure and install the configuration files
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
configure_package_config_file(
|
||||
"${CMAKE_SOURCE_DIR}/cmake/project-config.cmake.in"
|
||||
"${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}-config.cmake"
|
||||
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME_LOWER}
|
||||
PATH_VARS CMAKE_INSTALL_DIR)
|
||||
|
||||
write_basic_package_version_file(
|
||||
"${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}-config-version.cmake"
|
||||
VERSION ${PROJECT_VERSION}
|
||||
COMPATIBILITY SameMajorVersion)
|
||||
|
||||
install(FILES
|
||||
"${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}-config.cmake"
|
||||
"${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}-config-version.cmake"
|
||||
COMPONENT devel
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME_LOWER})
|
||||
|
||||
if (PROJECT_LIBRARIES OR PROJECT_STATIC_LIBRARIES)
|
||||
install(
|
||||
EXPORT "${TARGETS_EXPORT_NAME}"
|
||||
FILE ${PROJECT_NAME_LOWER}-targets.cmake
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME_LOWER})
|
||||
endif ()
|
@ -1,24 +0,0 @@
|
||||
# Config file for @PROJECT_NAME_LOWER@
|
||||
#
|
||||
# It defines the following variables:
|
||||
#
|
||||
# @PROJECT_NAME_UPPER@_INCLUDE_DIRS - include directory
|
||||
# @PROJECT_NAME_UPPER@_LIBRARIES - all dynamic libraries
|
||||
# @PROJECT_NAME_UPPER@_STATIC_LIBRARIES - all static libraries
|
||||
|
||||
@PACKAGE_INIT@
|
||||
|
||||
include(CMakeFindDependencyMacro)
|
||||
|
||||
set(SLS_USE_HDF5 "@SLS_USE_HDF5@")
|
||||
|
||||
# Add optional dependencies here
|
||||
find_dependency(Threads)
|
||||
if (SLS_USE_HDF5)
|
||||
find_dependency(HDF5)
|
||||
endif ()
|
||||
|
||||
set_and_check(@PROJECT_NAME_UPPER@_CMAKE_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_DIR@")
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
|
||||
check_required_components("@PROJECT_NAME@")
|
@ -1,14 +0,0 @@
|
||||
#include "project_version.h"
|
||||
/// project version as major.minor.patch string
|
||||
const char* @PROJECT_NAME@_runtime_project_version(){ return "@PROJECT_VERSION@"; }
|
||||
/// package version as string, possibly with git commit: v1.2.3+4+g56789abc
|
||||
const char* @PROJECT_NAME@_runtime_package_version(){ return "@PACKAGE_VERSION@"; }
|
||||
/// project version as integer: major * 10000 + minor * 100 + patch
|
||||
int @PROJECT_NAME@_runtime_version_int() { return @PROJECT_VERSION_INT@; }
|
||||
/// project version as integer: major
|
||||
int @PROJECT_NAME@_runtime_version_major(){ return @PACKAGE_VERSION_MAJOR@; }
|
||||
/// project version as integer: minor
|
||||
int @PROJECT_NAME@_runtime_version_minor(){ return @PACKAGE_VERSION_MINOR@; }
|
||||
/// project version as integer: patch
|
||||
int @PROJECT_NAME@_runtime_version_patch(){ return @PACKAGE_VERSION_PATCH@; }
|
||||
|
@ -1,154 +0,0 @@
|
||||
#
|
||||
# Sets PROJECT_VERSION and PACKAGE_VERSION
|
||||
#
|
||||
|
||||
# Don't set PROJECT_VERSION to empty string when no VERSION is given to project() command.
|
||||
#if(POLICY CMP0048)
|
||||
# cmake_policy(SET CMP0048 OLD)
|
||||
#endif()
|
||||
|
||||
# Split a version number into separate components
|
||||
# version the version number to split
|
||||
# major variable name to store the major version in
|
||||
# minor variable name to store the minor version in
|
||||
# patch variable name to store the patch version in
|
||||
# extra variable name to store a version suffix in
|
||||
function(version_split version major minor patch extra)
|
||||
string(REGEX MATCH "([0-9]+)\\.([0-9]+)\\.([0-9]+)(.*)?" version_valid ${version})
|
||||
if(version_valid)
|
||||
string(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)(.*)?" "\\1;\\2;\\3;\\4" VERSION_MATCHES ${version})
|
||||
list(GET VERSION_MATCHES 0 version_major)
|
||||
set(${major} ${version_major} PARENT_SCOPE)
|
||||
list(GET VERSION_MATCHES 1 version_minor)
|
||||
set(${minor} ${version_minor} PARENT_SCOPE)
|
||||
list(GET VERSION_MATCHES 2 version_patch)
|
||||
set(${patch} ${version_patch} PARENT_SCOPE)
|
||||
list(GET VERSION_MATCHES 3 version_extra)
|
||||
set(${extra} ${version_extra} PARENT_SCOPE)
|
||||
else(version_valid)
|
||||
message(AUTHOR_WARNING "Bad version ${version}; falling back to 0 (have you made an initial release?)")
|
||||
set(${major} "0" PARENT_SCOPE)
|
||||
set(${minor} "0" PARENT_SCOPE)
|
||||
set(${patch} "0" PARENT_SCOPE)
|
||||
set(${extra} "" PARENT_SCOPE)
|
||||
endif(version_valid)
|
||||
endfunction(version_split)
|
||||
|
||||
##############################
|
||||
# get PROJECT_VERSION from git
|
||||
##############################
|
||||
find_program(GIT_CMD git)
|
||||
mark_as_advanced(GIT_CMD)
|
||||
if (GIT_CMD)
|
||||
execute_process(COMMAND ${GIT_CMD} rev-parse --show-toplevel
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE GIT_TOPLEVEL
|
||||
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
endif()
|
||||
if (GIT_CMD AND NOT "${GIT_TOPLEVEL}" STREQUAL "")
|
||||
execute_process(COMMAND ${GIT_CMD} rev-parse --short HEAD
|
||||
WORKING_DIRECTORY ${GIT_TOPLEVEL}
|
||||
OUTPUT_VARIABLE GIT_SHA1
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
#message(STATUS "GIT_SHA1: " ${GIT_SHA1})
|
||||
execute_process(COMMAND ${GIT_CMD} describe --match "*[0-9].[0-9]*" HEAD
|
||||
WORKING_DIRECTORY ${GIT_TOPLEVEL}
|
||||
OUTPUT_VARIABLE GIT_DESCRIBE
|
||||
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
#message(STATUS "GIT_DESCRIBE: " ${GIT_DESCRIBE})
|
||||
|
||||
# if (GIT_DESCRIBE)
|
||||
# string(REGEX REPLACE "v?([0-9.]+).*" "\\1" GIT_VERSION ${GIT_DESCRIBE})
|
||||
# message(STATUS "GIT_VERSION: " ${GIT_VERSION})
|
||||
|
||||
# # as package version we use the full version from git describe: 1.7.1+7+ge324c81
|
||||
# if (GIT_DESCRIBE MATCHES ".*-g.*")
|
||||
# # convert a git describe string to usable debian version, e.g. v1.7.1-7-ge324c81 to 1.7.1+7+ge324c81
|
||||
# string(REGEX REPLACE "v?([0-9]*.[0-9.]*).*-([0-9]*)-([a-g0-9]*)" "\\1+\\2+\\3" GIT_FULL_VERSION ${GIT_DESCRIBE})
|
||||
# else()
|
||||
# # current HEAD is git tag (i.e. releaase), directly use the version
|
||||
# set(GIT_FULL_VERSION ${GIT_VERSION})
|
||||
# endif()
|
||||
# else ()
|
||||
# # no (suitable) tag found
|
||||
# set(GIT_VERSION "0.0.0")
|
||||
# # get number of commits in repo
|
||||
# execute_process(COMMAND ${GIT_CMD} rev-list --count HEAD
|
||||
# WORKING_DIRECTORY ${GIT_TOPLEVEL}
|
||||
# OUTPUT_VARIABLE GIT_COMMIT_COUNT
|
||||
# OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
# set(GIT_FULL_VERSION 0.0.0+${GIT_COMMIT_COUNT}+g${GIT_SHA1})
|
||||
# endif ()
|
||||
endif ()
|
||||
|
||||
# get version from package.xml if it exists
|
||||
if (EXISTS "${PROJECT_SOURCE_DIR}/package.xml")
|
||||
file(STRINGS "${PROJECT_SOURCE_DIR}/package.xml" PACKAGE_XML_VERSION_LINE REGEX <version>[0-9.]*</version>)
|
||||
string(REGEX REPLACE .*<version>\([0-9.]*\)</version>.* \\1 PACKAGE_XML_VERSION "${PACKAGE_XML_VERSION_LINE}")
|
||||
MESSAGE(STATUS "PACKAGE_XML_VERSION: " ${PACKAGE_XML_VERSION})
|
||||
endif ()
|
||||
|
||||
# set version (if not already manually specified)
|
||||
# check versions from different sources and set actually used version
|
||||
if (NOT PROJECT_VERSION)
|
||||
# set PROJECT_VERSION to MAJOR.MINOR.PATCH
|
||||
# PACKAGE_VERSION can have extra info
|
||||
if (GIT_VERSION)
|
||||
set(PROJECT_VERSION ${GIT_VERSION})
|
||||
set(PACKAGE_VERSION ${GIT_FULL_VERSION})
|
||||
elseif (PACKAGE_XML_VERSION)
|
||||
set(PROJECT_VERSION ${PACKAGE_XML_VERSION})
|
||||
set(PACKAGE_VERSION ${PROJECT_VERSION})
|
||||
else ()
|
||||
message(WARNING "PROJECT_VERSION not set. Defaulting to 0.0.0")
|
||||
set(PROJECT_VERSION "0.0.0")
|
||||
endif ()
|
||||
endif ()
|
||||
# if (NOT PACKAGE_VERSION)
|
||||
# message(WARNING "PACKAGE_VERSION not set! Falling back to (${PROJECT_VERSION})")
|
||||
set(PACKAGE_VERSION ${PROJECT_VERSION})
|
||||
# endif ()
|
||||
|
||||
# warn if versions don't match
|
||||
if (GIT_VERSION AND NOT GIT_VERSION MATCHES ${PROJECT_VERSION})
|
||||
message(WARNING "Version from git (${GIT_VERSION}) doesn't match PROJECT_VERSION (${PROJECT_VERSION})")
|
||||
endif()
|
||||
if (PACKAGE_XML_VERSION AND NOT PACKAGE_XML_VERSION MATCHES ${PROJECT_VERSION})
|
||||
message(WARNING "Version from package.xml (${PACKAGE_XML_VERSION}) doesn't match PROJECT_VERSION (${PROJECT_VERSION})")
|
||||
endif()
|
||||
|
||||
message(STATUS "PROJECT_VERSION: " ${PROJECT_VERSION})
|
||||
message(STATUS "PACKAGE_VERSION: " ${PACKAGE_VERSION})
|
||||
|
||||
|
||||
version_split(${PROJECT_VERSION} PACKAGE_VERSION_MAJOR PACKAGE_VERSION_MINOR PACKAGE_VERSION_PATCH extra)
|
||||
#message(STATUS "PACKAGE_VERSION_MAJOR: " ${PACKAGE_VERSION_MAJOR})
|
||||
#message(STATUS "PACKAGE_VERSION_MINOR: " ${PACKAGE_VERSION_MINOR})
|
||||
#message(STATUS "PACKAGE_VERSION_PATCH: " ${PACKAGE_VERSION_PATCH})
|
||||
|
||||
# generate an integer version number: major * 10000 + minor * 100 + patch
|
||||
math(EXPR PROJECT_VERSION_INT "${PACKAGE_VERSION_MAJOR} * 10000 + ${PACKAGE_VERSION_MINOR} * 100 + ${PACKAGE_VERSION_PATCH}")
|
||||
|
||||
# make PROJECT_VERSION available as define in the project source
|
||||
#add_definitions(-DPROJECT_VERSION="${PROJECT_VERSION}")
|
||||
#add_definitions(-DPROJECT_VERSION_INT=${PROJECT_VERSION_INT})
|
||||
#add_definitions(-DPACKAGE_VERSION="${PACKAGE_VERSION}")
|
||||
#add_definitions(-DPACKAGE_VERSION_MAJOR=${PACKAGE_VERSION_MAJOR})
|
||||
#add_definitions(-DPACKAGE_VERSION_MINOR=${PACKAGE_VERSION_MINOR})
|
||||
#add_definitions(-DPACKAGE_VERSION_PATCH=${PACKAGE_VERSION_PATCH})
|
||||
|
||||
# set ABI version to major.minor, which will be used for the SOVERSION
|
||||
set(abiversion "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}")
|
||||
|
||||
# generate a version.h file in the binary output dir, don't forget to install it...
|
||||
string(TOUPPER "${PROJECT_NAME}" PROJECT_NAME_UPPER)
|
||||
|
||||
# These files provide compile-time and runtime version information about your project.
|
||||
# To offer the version info to the users of your library, you need to
|
||||
# adapt the following lines in your respective CMakeLists.txt:
|
||||
# add_library(<yourlibraryname> SHARED <your code files> ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/project_version.cc)
|
||||
# install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/project_version.h COMPONENT dev DESTINATION include/<your-include-dir>)
|
||||
# To use it within your library or tests you need to add the include directory:
|
||||
# > target_include_directories(yourtarget PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME})
|
||||
configure_file(${CMAKE_CURRENT_LIST_DIR}/project_version.h.in ${PROJECT_NAME}/project_version.h @ONLY)
|
||||
configure_file(${CMAKE_CURRENT_LIST_DIR}/project_version.cc.in ${PROJECT_NAME}/project_version.cc @ONLY)
|
@ -1,34 +0,0 @@
|
||||
#ifndef @PROJECT_NAME_UPPER@_VERSION_H_
|
||||
#define @PROJECT_NAME_UPPER@_VERSION_H_
|
||||
|
||||
/// project version as major.minor.patch string
|
||||
#define @PROJECT_NAME_UPPER@_VERSION "@PROJECT_VERSION@"
|
||||
/// project version as integer: major * 10000 + minor * 100 + patch
|
||||
#define @PROJECT_NAME_UPPER@_VERSION_INT @PROJECT_VERSION_INT@
|
||||
#define @PROJECT_NAME_UPPER@_VERSION_MAJOR @PACKAGE_VERSION_MAJOR@
|
||||
#define @PROJECT_NAME_UPPER@_VERSION_MINOR @PACKAGE_VERSION_MINOR@
|
||||
#define @PROJECT_NAME_UPPER@_VERSION_PATCH @PACKAGE_VERSION_PATCH@
|
||||
/// package version as string, possibly with git commit: v1.2.3+4+g56789abc
|
||||
#define @PROJECT_NAME_UPPER@_PACKAGE_VERSION "@PACKAGE_VERSION@"
|
||||
|
||||
///runtime versions, where the above values are linked into a lib and therefore reflect the version
|
||||
///of the library itself (not the version of the header at compile time of the user code)
|
||||
const char* @PROJECT_NAME@_runtime_project_version();
|
||||
const char* @PROJECT_NAME@_runtime_package_version();
|
||||
int @PROJECT_NAME@_runtime_version_int();
|
||||
int @PROJECT_NAME@_runtime_version_major();
|
||||
int @PROJECT_NAME@_runtime_version_minor();
|
||||
int @PROJECT_NAME@_runtime_version_patch();
|
||||
|
||||
///Check consistency of runtime vs compile-time version number. I.e. the header used
|
||||
///for compilation was from the same version as the linked library.
|
||||
inline bool @PROJECT_NAME@_check_version_consistency(bool major_minor_only)
|
||||
{
|
||||
return @PROJECT_NAME@_runtime_version_major() == @PROJECT_NAME_UPPER@_VERSION_MAJOR &&
|
||||
@PROJECT_NAME@_runtime_version_minor() == @PROJECT_NAME_UPPER@_VERSION_MINOR &&
|
||||
(major_minor_only ||
|
||||
@PROJECT_NAME@_runtime_version_patch() == @PROJECT_NAME_UPPER@_VERSION_PATCH);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
67
cmk.sh
67
cmk.sh
@ -7,9 +7,6 @@ TEXTCLIENT=0
|
||||
RECEIVER=0
|
||||
GUI=0
|
||||
DEBUG=0
|
||||
PYTHON=0
|
||||
TESTS=0
|
||||
SIMULATOR=0
|
||||
|
||||
|
||||
CLEAN=0
|
||||
@ -18,26 +15,17 @@ CMAKE_PRE=""
|
||||
CMAKE_POST=""
|
||||
|
||||
usage() { echo -e "
|
||||
Usage: $0 [-c] [-b] [-p] [e] [t] [r] [g] [s] [i] [-h] [-d <HDF5 directory>] [-j] <Number of threads>
|
||||
Usage: $0 [-c] [-b] [-h] [-d <HDF5 directory>] [-j]
|
||||
-[no option]: only make
|
||||
-c: Clean
|
||||
-b: Builds/Rebuilds CMake files normal mode
|
||||
-p: Builds/Rebuilds Python API
|
||||
-h: Builds/Rebuilds Cmake files with HDF5 package
|
||||
-d: HDF5 Custom Directory
|
||||
-t: Build/Rebuilds only text client
|
||||
-r: Build/Rebuilds only receiver
|
||||
-g: Build/Rebuilds only gui
|
||||
-s: Simulator
|
||||
-j: Number of threads to compile through
|
||||
-e: Debug mode
|
||||
-i: Builds tests
|
||||
|
||||
Rebuild when you switch to a new build and compile in parallel:
|
||||
./cmk.sh -bj5
|
||||
|
||||
Rebuild python
|
||||
./cmk.sh -p
|
||||
|
||||
For only make:
|
||||
./cmk.sh
|
||||
@ -67,17 +55,12 @@ For rebuilding only certain sections
|
||||
|
||||
" ; exit 1; }
|
||||
|
||||
while getopts ":bpchd:j:trgeis" opt ; do
|
||||
while getopts ":bchd:j:trge" opt ; do
|
||||
case $opt in
|
||||
b)
|
||||
echo "Building of CMake files Required"
|
||||
REBUILD=1
|
||||
;;
|
||||
p)
|
||||
echo "Compiling Options: Python"
|
||||
PYTHON=1
|
||||
REBUILD=1
|
||||
;;
|
||||
c)
|
||||
echo "Clean Required"
|
||||
CLEAN=1
|
||||
@ -114,14 +97,6 @@ while getopts ":bpchd:j:trgeis" opt ; do
|
||||
echo "Compiling Options: Debug"
|
||||
DEBUG=1
|
||||
;;
|
||||
i)
|
||||
echo "Compiling Options: Tests"
|
||||
TESTS=1
|
||||
;;
|
||||
s)
|
||||
echo "Compiling Options: Simulator"
|
||||
SIMULATOR=1
|
||||
;;
|
||||
\?)
|
||||
echo "Invalid option: -$OPTARG"
|
||||
usage
|
||||
@ -136,29 +111,26 @@ while getopts ":bpchd:j:trgeis" opt ; do
|
||||
done
|
||||
|
||||
|
||||
#python
|
||||
if [ $PYTHON -eq 1 ]; then
|
||||
CMAKE_POST+=" -DSLS_USE_PYTHON=ON "
|
||||
echo "Enabling Compile Option: Python"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
if [ $TEXTCLIENT -eq 0 ] && [ $RECEIVER -eq 0 ] && [ $GUI -eq 0 ]; then
|
||||
#CMAKE_POST+=" -DSLS_USE_TEXTCLIENT=ON -DSLS_USE_RECEIVER=ON -DSLS_USE_GUI=ON "
|
||||
CMAKE_POST+=" -DSLS_USE_TEXTCLIENT=ON -DSLS_USE_RECEIVER=ON -DSLS_USE_GUI=OFF "
|
||||
echo "Enabling Compile Option: TextClient, Receiver and GUI"
|
||||
CMAKE_POST+=" -DSLS_USE_TEXTCLIENT=ON -DSLS_USE_RECEIVER=ON -DSLS_USE_GUI=ON "
|
||||
echo "Compile Option: TextClient, Receiver and GUI"
|
||||
else
|
||||
if [ $TEXTCLIENT -eq 1 ]; then
|
||||
CMAKE_POST+=" -DSLS_USE_TEXTCLIENT=ON "
|
||||
echo "Enabling Compile Option: TextClient"
|
||||
echo "Compile Option: TextClient"
|
||||
fi
|
||||
if [ $RECEIVER -eq 1 ]; then
|
||||
CMAKE_POST+=" -DSLS_USE_RECEIVER=ON "
|
||||
echo "Enabling Compile Option: Receiver"
|
||||
echo "Compile Option: Receiver"
|
||||
fi
|
||||
|
||||
if [ $GUI -eq 1 ]; then
|
||||
CMAKE_POST+=" -DSLS_USE_GUI=ON "
|
||||
echo "Enabling Compile Option: GUI"
|
||||
echo "Compile Option: GUI"
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -182,28 +154,13 @@ fi
|
||||
#Debug
|
||||
if [ $DEBUG -eq 1 ]; then
|
||||
CMAKE_POST+=" -DCMAKE_BUILD_TYPE=Debug "
|
||||
# CMAKE_POST+=" -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_SANITIZER=ON "
|
||||
echo "Debug Option enabled"
|
||||
fi
|
||||
|
||||
#Simulator
|
||||
if [ $SIMULATOR -eq 1 ]; then
|
||||
CMAKE_POST+=" -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_SIMULATOR=ON "
|
||||
echo "Simulator Option enabled"
|
||||
fi
|
||||
|
||||
|
||||
#Tests
|
||||
if [ $TESTS -eq 1 ]; then
|
||||
CMAKE_POST+=" -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_TESTS=ON -DSLS_USE_INTEGRATION_TESTS=ON"
|
||||
echo "Tests Option enabled"
|
||||
fi
|
||||
|
||||
|
||||
#hdf5 rebuild
|
||||
if [ $HDF5 -eq 1 ]; then
|
||||
# CMAKE_PRE+="HDF5_ROOT="$HDF5DIR
|
||||
CMAKE_POST+=" -DCMAKE_INSTALL_PREFIX="$HDF5DIR
|
||||
CMAKE_PRE+="HDF5_ROOT="$HDF5DIR
|
||||
CMAKE_POST+=" -DSLS_USE_HDF5=ON "
|
||||
#normal mode rebuild
|
||||
else
|
||||
@ -220,7 +177,7 @@ echo "in "$PWD
|
||||
#cmake
|
||||
if [ $REBUILD -eq 1 ]; then
|
||||
rm -f CMakeCache.txt
|
||||
BUILDCOMMAND="$CMAKE_PRE cmake3 $CMAKE_POST .."
|
||||
BUILDCOMMAND="$CMAKE_PRE cmake $CMAKE_POST .."
|
||||
echo $BUILDCOMMAND
|
||||
eval $BUILDCOMMAND
|
||||
fi
|
||||
|
15
commitVersions.sh
Normal file
15
commitVersions.sh
Normal file
@ -0,0 +1,15 @@
|
||||
sh updateSvnVersion.sh
|
||||
|
||||
cd slsDetectorGui
|
||||
git commit -a -m "updating versions"
|
||||
git push origin developer:developer
|
||||
|
||||
cd ../slsDetectorSoftware
|
||||
git commit -a -m "updating versions"
|
||||
git push origin developer:developer
|
||||
|
||||
cd ../slsReceiverSoftware
|
||||
git commit -a -m "updating versions"
|
||||
git push origin developer:developer
|
||||
|
||||
cd ..
|
@ -1,14 +0,0 @@
|
||||
|
||||
# mkdir $PREFIX/lib
|
||||
# mkdir $PREFIX/include
|
||||
|
||||
|
||||
# #Shared and static libraries
|
||||
# cp build/bin/_sls_detector* $PREFIX/lib/.
|
||||
|
||||
|
||||
# #Binaries
|
||||
# cp -r build/bin/sls_detector $PREFIX/lib/.
|
||||
|
||||
cd python
|
||||
${PYTHON} setup.py install
|
@ -1,120 +0,0 @@
|
||||
|
||||
package:
|
||||
name: sls_detector_software
|
||||
version: "filip1"
|
||||
|
||||
source:
|
||||
- path: ..
|
||||
|
||||
build:
|
||||
number: 1
|
||||
rpaths:
|
||||
- lib/
|
||||
|
||||
requirements:
|
||||
build:
|
||||
- {{ compiler('c') }}
|
||||
- {{compiler('cxx')}}
|
||||
- cmake
|
||||
# - qwt 6.* #require qt5 investigate befor activating gui
|
||||
# - qt=4.8.7=7
|
||||
- zeromq=4.2.5=hfc679d8_5
|
||||
- pyzmq
|
||||
- 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]
|
||||
|
||||
host:
|
||||
- libstdcxx-ng
|
||||
- libgcc-ng
|
||||
- xorg-libx11
|
||||
- xorg-libice
|
||||
- xorg-libxext
|
||||
- xorg-libsm
|
||||
- xorg-libxau
|
||||
- xorg-libxrender
|
||||
- xorg-libxfixes
|
||||
|
||||
run:
|
||||
- libstdcxx-ng
|
||||
- libgcc-ng
|
||||
|
||||
|
||||
outputs:
|
||||
- name: sls_detector_lib
|
||||
script: copy_lib.sh
|
||||
|
||||
- name: sls_detector
|
||||
script: build_pylib.sh
|
||||
|
||||
requirements:
|
||||
build:
|
||||
- {{ compiler('c') }}
|
||||
- {{compiler('cxx')}}
|
||||
- python {{ python }}
|
||||
- setuptools
|
||||
- sls_detector_lib
|
||||
- pyzmq
|
||||
- pybind11 2.2
|
||||
host:
|
||||
- python
|
||||
- pybind11 2.2
|
||||
- pyzmq
|
||||
- sls_detector_lib
|
||||
- libstdcxx-ng
|
||||
- libgcc-ng
|
||||
run:
|
||||
- python
|
||||
- numpy
|
||||
- sls_detector_lib=filip1
|
||||
- pyzmq
|
||||
- libstdcxx-ng
|
||||
- libgcc-ng
|
||||
test:
|
||||
imports:
|
||||
- sls_detector
|
||||
|
||||
# requirements:
|
||||
# build:
|
||||
# - {{ compiler('c') }}
|
||||
# - {{compiler('cxx')}}
|
||||
|
||||
# - name: sls_detector_gui
|
||||
# version: "refactor"
|
||||
# script: copy_gui.sh
|
||||
# requirements:
|
||||
# build:
|
||||
# - {{ compiler('c') }}
|
||||
# - {{compiler('cxx')}}
|
||||
# - cmake
|
||||
# - qwt 6.*
|
||||
# - qt=4.8.7=7
|
||||
# - zeromq=4.2.5=hfc679d8_5
|
||||
# - pyzmq
|
||||
# - 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]
|
||||
# run:
|
||||
# - sls_detector_lib=refactor
|
||||
# - qwt 6.*
|
||||
# - qt=4.8.7=7
|
@ -1 +0,0 @@
|
||||
ctest -j2
|
58
configure
vendored
Executable file
58
configure
vendored
Executable file
@ -0,0 +1,58 @@
|
||||
##!/bin/bash
|
||||
|
||||
: ${INSTALLROOT=$PWD}
|
||||
read -p "Installation directory [default:\"$INSTALLROOT\"]:" -e t3
|
||||
if [ -z "$t3" ]
|
||||
then
|
||||
echo
|
||||
else
|
||||
INSTALLROOT=$t3
|
||||
fi
|
||||
echo "INSTALLROOT will be \"$INSTALLROOT\""
|
||||
export INSTALLROOT
|
||||
|
||||
: ${BINDIR="bin"}
|
||||
read -p "Binaries directory [default:\"$BINDIR\"]:" -e t4
|
||||
if [ -z "$t4" ]
|
||||
then
|
||||
BINDIR=$INSTALLROOT/$BINDIR
|
||||
else
|
||||
BINDIR=$INSTALLROOT/$t4
|
||||
fi
|
||||
echo "BINDIR will be \"$BINDIR\""
|
||||
export BINDIR
|
||||
|
||||
: ${LIBDIR="bin"}
|
||||
read -p "Libraries directory [default:\"$LIBDIR\"]:" -e t5
|
||||
if [ -z "$t5" ]
|
||||
then
|
||||
LIBDIR=$INSTALLROOT/$LIBDIR
|
||||
else
|
||||
LIBDIR=$INSTALLROOT/$t5
|
||||
fi
|
||||
echo "LIBDIR will be \"$LIBDIR\""
|
||||
export LIBDIR
|
||||
|
||||
: ${INCDIR="include"}
|
||||
read -p "Includes directory [default:\"$INCDIR\"]:" -e t6
|
||||
if [ -z "$t6" ]
|
||||
then
|
||||
INCDIR=$INSTALLROOT/$INCDIR
|
||||
else
|
||||
INCDIR=$INSTALLROOT/$t6
|
||||
fi
|
||||
echo "INCDIR will be \"$INCDIR\""
|
||||
export INCDIR
|
||||
|
||||
: ${DOCDIR="doc"}
|
||||
read -p "Documentation directory [default:\"$DOCDIR\"]:" -e t7
|
||||
if [ -z "$t7" ]
|
||||
then
|
||||
DOCDIR=$INSTALLROOT/$DOCDIR
|
||||
else
|
||||
DOCDIR=$INSTALLROOT/$t7
|
||||
fi
|
||||
echo "DOCDIR will be \"$DOCDIR\""
|
||||
export DOCDIR
|
||||
|
||||
|
@ -1,44 +0,0 @@
|
||||
|
||||
|
||||
INCS=ctbMain.h ctbDacs.h ctbPattern.h ctbSignals.h ctbAdcs.h ctbAcquisition.h ctbPowers.h ctbSlowAdcs.h
|
||||
SRC= $(SRC:.h=.cpp) ctbDict.cpp
|
||||
LINKDEF=ctbLinkDef.h
|
||||
ZMQLIB=../slsReceiverSoftware/include
|
||||
LIBRARYCBF=$(CBFLIBDIR)/lib/*.o
|
||||
|
||||
INCDIR=-I../slsReceiverSoftware/include/ -I../slsDetectorSoftware/include/ -I../slsSupportLib/include/ -I../slsDetectorCalibration -I../slsDetectorCalibration/dataStructures -I$(CBFLIBDIR)/include -I../slsDetectorCalibration/interpolations
|
||||
LDFLAG=-L../bin -lSlsDetector -lSlsSupport -L/usr/lib64/ -lpthread -lm -lstdc++ -lzmq -pthread -lrt -ltiff -L$(ZMQLIB) -L$(CBFLIBDIR)/lib/ -std=c++11
|
||||
#
|
||||
MAIN=ctbGui.cpp
|
||||
|
||||
DESTDIR?=../bin
|
||||
|
||||
|
||||
OBJS = $(SRC:.cpp=.o) $(MAIN:.cpp=.o)
|
||||
|
||||
all: $(DESTDIR)/ctbGui
|
||||
|
||||
|
||||
doc:
|
||||
cd manual && make DESTDIR=$(DESTDIR)
|
||||
|
||||
htmldoc:
|
||||
cd manual && make html DESTDIR=$(DESTDIR)
|
||||
|
||||
ctbDict.cpp: $(INCS) $(LINKDEF)
|
||||
rootcint -f ctbDict.cpp -c $(INCS) $(LINKDEF)
|
||||
|
||||
%.o : %.cpp
|
||||
echo $@
|
||||
g++ -DMYROOT `source root-config --cflags --glibs` -lMinuit -DCTB $(LDFLAG) -o $@ -c $< $(INCDIR)
|
||||
#$(CXX) -o $@ -c $< $(INCLUDES) $(DFLAGS) -fPIC $(EPICSFLAGS) -lpthread #$(FLAGS)
|
||||
|
||||
|
||||
|
||||
$(DESTDIR)/ctbGui: $(OBJS) $(LINKDEF)
|
||||
g++ -DMYROOT `source root-config --cflags --glibs` -lMinuit -DCTB $(LDFLAG) -o ctbGui $(INCDIR) $(OBJS) ../slsDetectorCalibration/tiffIO.cpp
|
||||
mv ctbGui $(DESTDIR)
|
||||
|
||||
clean:
|
||||
rm -f $(DESTDIR)/ctbGui *.o ctbDict.* $(OBJS)
|
||||
|
@ -1,46 +0,0 @@
|
||||
|
||||
|
||||
INCS=ctbMain.h ctbDacs.h ctbPattern.h ctbSignals.h ctbAdcs.h ctbAcquisition.h ctbPowers.h ctbSlowAdcs.h
|
||||
SRC= $(INCS:.h=.cpp) ctbDict.cpp
|
||||
LINKDEF=ctbLinkDef.h
|
||||
#ctbActions.h
|
||||
ZMQLIB=../slsReceiverSoftware/include
|
||||
LIBRARYCBF=$(CBFLIBDIR)/lib/*.o
|
||||
|
||||
INCDIR=-I../slsReceiverSoftware/include/ -I../slsDetectorSoftware/include/ -I../slsSupportLib/include/ -I../slsDetectorCalibration -I../slsDetectorCalibration/dataStructures -I$(CBFLIBDIR)/include -I../slsDetectorCalibration/interpolations
|
||||
|
||||
LDFLAG=-L../build/bin -lSlsDetector -lSlsSupport -L/usr/lib64/ -lpthread -lm -lstdc++ -lzmq -pthread -lrt -ltiff -L$(ZMQLIB) -L$(CBFLIBDIR)/lib/ -std=c++11
|
||||
#
|
||||
MAIN=ctbGui.cpp
|
||||
|
||||
DESTDIR?=../build/bin
|
||||
|
||||
|
||||
OBJS = $(SRC:.cpp=.o) $(MAIN:.cpp=.o)
|
||||
|
||||
all: $(DESTDIR)/ctbGui
|
||||
|
||||
|
||||
doc:
|
||||
cd manual && make DESTDIR=$(DESTDIR)
|
||||
|
||||
htmldoc:
|
||||
cd manual && make html DESTDIR=$(DESTDIR)
|
||||
|
||||
ctbDict.cpp: $(INCS) $(LINKDEF)
|
||||
rootcling -f ctbDict.cpp -c $(INCS) $(LINKDEF)
|
||||
|
||||
%.o : %.cpp
|
||||
echo $@
|
||||
g++ -DMYROOT `source root-config --cflags --glibs` -lMinuit -DCTB $(LDFLAG) -o $@ -c $< $(INCDIR)
|
||||
#$(CXX) -o $@ -c $< $(INCLUDES) $(DFLAGS) -fPIC $(EPICSFLAGS) -lpthread #$(FLAGS)
|
||||
|
||||
|
||||
|
||||
$(DESTDIR)/ctbGui: $(OBJS) $(LINKDEF)
|
||||
g++ -DMYROOT `source root-config --cflags --glibs` -lMinuit -DCTB $(LDFLAG) -o ctbGui $(INCDIR) $(OBJS) ../slsDetectorCalibration/tiffIO.cpp
|
||||
mv ctbGui $(DESTDIR)
|
||||
|
||||
clean:
|
||||
rm -f $(DESTDIR)/ctbGui *.o ctbDict.* $(OBJS)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,238 +0,0 @@
|
||||
#ifndef CTBACQUISITION_H
|
||||
#define CTBACQUISITION_H
|
||||
#include <TGFrame.h>
|
||||
|
||||
#include "ctbAdcs.h"
|
||||
#include "ctbSignals.h"
|
||||
#include "ctbPattern.h"
|
||||
class TGTextEntry;
|
||||
class TGLabel;
|
||||
class TGNumberEntry;
|
||||
class TGCheckButton;
|
||||
class TThread;
|
||||
class TGraph;
|
||||
class TMultiGraph;
|
||||
class THStack;
|
||||
class TGButtonGroup;
|
||||
class TGRadioButton;
|
||||
class TGComboBox;
|
||||
class TTimer;
|
||||
class TCanvas;
|
||||
class TH2F;
|
||||
class TH1F;
|
||||
class TGLabel;
|
||||
class TGTextButton;
|
||||
|
||||
class multiSlsDetector;
|
||||
class detectorData;
|
||||
|
||||
template <class dataType> class slsDetectorData;
|
||||
|
||||
class singlePhotonDetector;
|
||||
//class singlePhotonDetector;
|
||||
class commonModeSubtraction;
|
||||
|
||||
#include <string>
|
||||
#include <stdint.h>
|
||||
using namespace std;
|
||||
|
||||
class ctbAcquisition : public TGGroupFrame {
|
||||
|
||||
|
||||
enum {DESERIALIZER, MOENCH04, MOENCH02, ADCSAR2, MYTHEN301, MYTHEN302};
|
||||
|
||||
|
||||
private:
|
||||
TGTextEntry *eOutdir;
|
||||
TGTextEntry *eFname;
|
||||
TGNumberEntry *eFindex;
|
||||
TGCheckButton *cFileSave;
|
||||
|
||||
|
||||
TGNumberEntry *eSerOff;
|
||||
TGNumberEntry *eDynRange;
|
||||
TGNumberEntry *eNumCount;
|
||||
|
||||
|
||||
TGNumberEntry *eFitADC;
|
||||
TGNumberEntry *eBitPlot;
|
||||
TGNumberEntry *eMinRaw;
|
||||
TGNumberEntry *eMaxRaw;
|
||||
TGNumberEntry *eMinPedSub;
|
||||
TGNumberEntry *eMaxPedSub;
|
||||
TGCheckButton *cMinMaxRaw;
|
||||
TGCheckButton *cMinMaxPedSub;
|
||||
|
||||
|
||||
|
||||
|
||||
TGNumberEntry *eMeasurements;
|
||||
|
||||
|
||||
|
||||
TGTextButton *bStatus;
|
||||
// TGTextButton
|
||||
TGCheckButton *cCompile;
|
||||
TGTextButton *cLoad;
|
||||
// TGCheckButton *cRun;
|
||||
|
||||
TThread *acqThread;
|
||||
|
||||
|
||||
THStack *adcStack;
|
||||
THStack *bitStack;
|
||||
THStack *countsStack;
|
||||
|
||||
|
||||
TH1F *adcHisto[NADCS];
|
||||
TH1F *countsHisto[NADCS];
|
||||
|
||||
TH1F *bitHisto[NSIGNALS];
|
||||
float bitOffset[NSIGNALS];
|
||||
|
||||
// int enableFlag[NADCS+4];
|
||||
int roMode;
|
||||
|
||||
int dBitOffset;
|
||||
|
||||
|
||||
|
||||
TH1F *adcFit;
|
||||
TH1F *bitPlot;
|
||||
TH1F *countsFit;
|
||||
|
||||
|
||||
|
||||
TH2F *h2DMapAn; // for 2D detectors
|
||||
TH2F *h2DMapDig; // for 2D detectors
|
||||
TH1F *h1DMap; //for 1D detectors
|
||||
|
||||
// TH2F *h2Scan; // for 2D detectors
|
||||
// TMultiGraph *mgAdcs;
|
||||
// TH1I *plotAdc[NADCS];
|
||||
|
||||
|
||||
multiSlsDetector* myDet;
|
||||
|
||||
int plotFlag[NADCS];
|
||||
int bitPlotFlag[NSIGNALS];
|
||||
|
||||
int ip;
|
||||
// int nChannels;
|
||||
// int chanEnable;
|
||||
//int nADCs;
|
||||
|
||||
std::vector <int> dbitlist;
|
||||
std::vector <int> adclist;
|
||||
|
||||
TGButtonGroup *bgPlot;// = new TGVButtonGroup(main_frame);
|
||||
TGRadioButton *rbPlotOff;
|
||||
TGRadioButton *rbWaveform;
|
||||
TGRadioButton *rbDistribution;
|
||||
TGRadioButton *rb2D;
|
||||
// TGRadioButton *rbScan;
|
||||
TGComboBox *cbDetType;
|
||||
TGCheckButton *cbGetPedestal;
|
||||
TGCheckButton *cbSubtractPedestal;
|
||||
TGCheckButton *cbCommonMode;
|
||||
TGTextButton *bResetPedestal;
|
||||
|
||||
TGLabel *lClickX;
|
||||
TGLabel *lClickY;
|
||||
TGLabel *lClickValue;
|
||||
|
||||
|
||||
TCanvas *myCanvas;
|
||||
TTimer *plotTimer;
|
||||
|
||||
char patternFile[10000];
|
||||
char patternCompiler[10000];
|
||||
|
||||
int globalPlot;
|
||||
int adcPlot;
|
||||
int dbitPlot;
|
||||
|
||||
int nAnalogSamples, nDigitalSamples;
|
||||
// int iScanStep;
|
||||
|
||||
slsDetectorData<uint16_t> *dataStructure;
|
||||
singlePhotonDetector *photonFinder;
|
||||
//singlePhotonDetector *photonFinder;
|
||||
commonModeSubtraction *commonMode;
|
||||
int cmSub;
|
||||
|
||||
int stop;
|
||||
|
||||
uint64_t dBitMask;
|
||||
|
||||
int deserializer;
|
||||
|
||||
public:
|
||||
ctbAcquisition(TGVerticalFrame*, multiSlsDetector*);
|
||||
void setOutdir();
|
||||
void setFname();
|
||||
void setMeasurements();
|
||||
void setFsave(Bool_t);
|
||||
void changePlot(Int_t);
|
||||
void changeDetector(Int_t);
|
||||
void changePlot();
|
||||
void changeDetector();
|
||||
void setFindex();
|
||||
void Draw();
|
||||
void setCanvas(TCanvas*);
|
||||
|
||||
void toggleAcquisition();
|
||||
void loadPattern();
|
||||
static void* ThreadHandle(void *arg);
|
||||
void update();
|
||||
void acquisitionFinished();
|
||||
// string getParameters();
|
||||
|
||||
void setGraph (int i ,int en, Pixel_t col);
|
||||
void setBitGraph (int i ,int en, Pixel_t col);
|
||||
void startAcquisition();
|
||||
static void progressCallback(double,void*);
|
||||
static void dataCallback(detectorData*, long unsigned int, unsigned int, void*);
|
||||
int StopFlag;
|
||||
|
||||
int plotData(detectorData*, int);
|
||||
|
||||
void setPatternFile(const char* t);
|
||||
|
||||
void setPatternCompiler(const char* t);
|
||||
|
||||
void setAnalogSamples(int);
|
||||
void setDigitalSamples(int);
|
||||
|
||||
void setADCEnable(Int_t);
|
||||
void setDbitEnable(Int_t);
|
||||
void setReadoutMode(int);
|
||||
void updateChans();
|
||||
|
||||
void resetPedestal();
|
||||
|
||||
void ToggleCommonMode(Bool_t);
|
||||
void TogglePedSub(Bool_t);
|
||||
void ChangeHistoLimitsPedSub(Long_t );
|
||||
void ChangeHistoLimitsRaw(Long_t);
|
||||
void ChangeHistoLimitsPedSub( );
|
||||
void ChangeHistoLimitsRaw();
|
||||
void ChangeHistoLimitsPedSub(Bool_t );
|
||||
void ChangeHistoLimitsRaw(Bool_t);
|
||||
|
||||
|
||||
void ChangeSerialOffset();
|
||||
void ChangeSerialOffset(Long_t);
|
||||
void ChangeNumberOfChannels();
|
||||
void ChangeNumberOfChannels(Long_t);
|
||||
void ChangeDynamicRange();
|
||||
void ChangeDynamicRange(Long_t);
|
||||
|
||||
|
||||
void canvasClicked();
|
||||
void FitADC();
|
||||
void plotBit();
|
||||
ClassDef(ctbAcquisition,0)
|
||||
};
|
||||
|
||||
#endif
|
@ -1,731 +0,0 @@
|
||||
#include <TApplication.h>
|
||||
#include <TGClient.h>
|
||||
#include <TCanvas.h>
|
||||
#include <TF1.h>
|
||||
#include <TRandom.h>
|
||||
#include <TGButton.h>
|
||||
#include <TRootEmbeddedCanvas.h>
|
||||
#include <TGButtonGroup.h>
|
||||
#include <TGNumberEntry.h>
|
||||
#include <TGLabel.h>
|
||||
#include <TList.h>
|
||||
#include <TGFileDialog.h>
|
||||
#include <TGComboBox.h>
|
||||
#include <TH2F.h>
|
||||
#include <TColor.h>
|
||||
#include <TH1F.h>
|
||||
#include <TGraphErrors.h>
|
||||
#include <TGColorSelect.h>
|
||||
#include <THStack.h>
|
||||
#include <TGTab.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
#include "ctbAdcs.h"
|
||||
#include "multiSlsDetector.h"
|
||||
#include "slsDetectorCommand.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
|
||||
ctbAdc::ctbAdc(TGVerticalFrame *page, int i, multiSlsDetector *det)
|
||||
: TGHorizontalFrame(page, 800,800), id(i), myDet(det) {
|
||||
|
||||
TGHorizontalFrame *hframe=this;
|
||||
char tit[100];
|
||||
|
||||
page->AddFrame(hframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
|
||||
hframe->MapWindow();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
sprintf(tit, "ADC%d", id);
|
||||
|
||||
sAdcLabel= new TGLabel(hframe, tit);
|
||||
hframe->AddFrame(sAdcLabel,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 1, 1, 1, 1));
|
||||
sAdcLabel->MapWindow();
|
||||
sAdcLabel->SetTextJustify(kTextLeft);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
sAdcInvert= new TGCheckButton(hframe, "Inv");
|
||||
hframe->AddFrame( sAdcInvert,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 1, 1, 1, 1));
|
||||
sAdcInvert->MapWindow();
|
||||
sAdcInvert->Connect("Toggled(Bool_t)","ctbAdc",this,"ToggledInvert(Bool_t)");
|
||||
|
||||
|
||||
sAdcEnable= new TGCheckButton(hframe, "En");
|
||||
hframe->AddFrame( sAdcEnable,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 1, 1, 1, 1));
|
||||
sAdcEnable->MapWindow();
|
||||
// sAdcEnable->SetOn(kTRUE);
|
||||
// sAdcEnable->SetEnabled(kFALSE);
|
||||
sAdcEnable->Connect("Toggled(Bool_t)","ctbAdc",this,"ToggledEnable(Bool_t)");
|
||||
|
||||
|
||||
|
||||
sAdcPlot= new TGCheckButton(hframe, "Plot");
|
||||
hframe->AddFrame( sAdcPlot,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 1, 1, 1, 1));
|
||||
sAdcPlot->MapWindow();
|
||||
|
||||
|
||||
sAdcPlot->Connect("Toggled(Bool_t)","ctbAdc",this,"ToggledPlot(Bool_t)");
|
||||
|
||||
|
||||
|
||||
fColorSel = new TGColorSelect(hframe, id+1, 0);
|
||||
|
||||
fColorSel->Connect("ColorSelected(Pixel_t)","ctbAdc",this,"ColorChanged(Pixel_t)");
|
||||
hframe->AddFrame(fColorSel, new TGLayoutHints(kLHintsTop |
|
||||
kLHintsLeft, 2, 0, 2, 2));
|
||||
|
||||
|
||||
fColorSel->SetColor(TColor::Number2Pixel(id+1));
|
||||
// sprintf(tit,"adc%d",id);
|
||||
// gADC=new TGraph();
|
||||
// gADC->SetName(tit);
|
||||
// gADC->SetLineColor(id+1);
|
||||
// gADC->SetMarkerColor(id+1);
|
||||
|
||||
|
||||
|
||||
};
|
||||
Pixel_t ctbAdc::getColor(){
|
||||
return fColorSel->GetColor();
|
||||
}
|
||||
Bool_t ctbAdc::getEnabled(){
|
||||
return getPlot();
|
||||
}
|
||||
Bool_t ctbAdc::getPlot(){
|
||||
return sAdcPlot->IsOn();
|
||||
}
|
||||
Bool_t ctbAdc::getInverted(){
|
||||
return sAdcInvert->IsOn();
|
||||
}
|
||||
|
||||
Bool_t ctbAdc::getEnable(){
|
||||
return sAdcEnable->IsOn();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ctbAdc::setInverted(Bool_t b){
|
||||
// cout << id << "set enabled " << b << endl;
|
||||
if (b)
|
||||
sAdcInvert->SetOn(kTRUE,kTRUE);
|
||||
else
|
||||
sAdcInvert->SetOn(kFALSE,kTRUE);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void ctbAdc::setEnable(Bool_t b){
|
||||
// cout << id << "set enabled " << b << endl;
|
||||
if (b)
|
||||
sAdcEnable->SetOn(kTRUE,kFALSE);
|
||||
else
|
||||
sAdcEnable->SetOn(kFALSE,kFALSE);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void ctbAdc::setAdcAlias(char *tit, int plot, int color) {
|
||||
if (tit)
|
||||
sAdcLabel->SetText(tit);
|
||||
if (plot>0)
|
||||
sAdcPlot->SetOn(kTRUE,kTRUE);
|
||||
else if (plot==0)
|
||||
sAdcPlot->SetOn(kFALSE,kTRUE);
|
||||
if (color>=0)
|
||||
fColorSel->SetColor(color);
|
||||
fColorSel->SetEnabled(sAdcPlot->IsOn());
|
||||
}
|
||||
|
||||
|
||||
string ctbAdc::getAdcAlias() {
|
||||
|
||||
char line[1000];
|
||||
sprintf(line,"ADC%d %s %d %x\n",id,sAdcLabel->GetText()->Data(),sAdcPlot->IsOn(),fColorSel->GetColor());
|
||||
return string(line);
|
||||
}
|
||||
|
||||
void ctbAdc::update() {
|
||||
|
||||
|
||||
//Emit("ToggledAdcEnable(Int_t)", id);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void ctbAdc::ToggledPlot(Bool_t b){
|
||||
|
||||
// Long_t mask=b<<id;
|
||||
// ToggledAdcPlot(mask);
|
||||
cout << "Colsel " << id << " enable " << b << endl;
|
||||
if (b)
|
||||
fColorSel->SetEnabled(kTRUE);
|
||||
else
|
||||
fColorSel->SetEnabled(kFALSE);
|
||||
|
||||
// fColorSel->SetEnabled(sAdcPlot->IsOn());
|
||||
Emit("ToggledAdcPlot(Int_t)", id);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ctbAdc::ToggledInvert(Bool_t b){
|
||||
|
||||
|
||||
// fColorSel->SetEnabled(sAdcPlot->IsOn());
|
||||
Emit("ToggledAdcInvert(Int_t)", id);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ctbAdc::ToggledEnable(Bool_t b){
|
||||
|
||||
|
||||
fColorSel->SetEnabled(sAdcPlot->IsOn());
|
||||
Emit("ToggledAdcEnable(Int_t)", id);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void ctbAdc::ColorChanged(Pixel_t) {
|
||||
|
||||
Emit("ToggledAdcPlot(Int_t)", id);
|
||||
|
||||
}
|
||||
|
||||
void ctbAdc::ToggledAdcPlot(Int_t b){
|
||||
|
||||
|
||||
Emit("ToggledAdcPlot(Int_t)", id);
|
||||
|
||||
}
|
||||
|
||||
void ctbAdc::ToggledAdcInvert(Int_t b){
|
||||
|
||||
|
||||
Emit("ToggledAdcInvert(Int_t)", id);
|
||||
|
||||
}
|
||||
|
||||
void ctbAdc::ToggledAdcEnable(Int_t b){
|
||||
|
||||
|
||||
Emit("ToggledAdcEnable(Int_t)", id);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void ctbAdc::setEnabled(Bool_t b){
|
||||
// cout << id << "set enabled " << b << endl;
|
||||
if (b)
|
||||
sAdcPlot->SetOn(kTRUE,kFALSE);
|
||||
else
|
||||
sAdcPlot->SetOn(kFALSE,kFALSE);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ctbAdc::setPlot(Bool_t b){
|
||||
// cout << id << "set enabled " << b << endl;
|
||||
if (b)
|
||||
sAdcPlot->SetOn(kTRUE,kTRUE);
|
||||
else
|
||||
sAdcPlot->SetOn(kFALSE,kTRUE);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ctbAdcs::ctbAdcs(TGVerticalFrame *page, multiSlsDetector *det)
|
||||
: TGGroupFrame(page,"Adcs",kVerticalFrame), myDet(det) {
|
||||
|
||||
|
||||
SetTitlePos(TGGroupFrame::kLeft);
|
||||
page->AddFrame(this,new TGLayoutHints( kLHintsTop | kLHintsExpandX , 10,10,10,10));
|
||||
MapWindow();
|
||||
|
||||
char tit[100];
|
||||
|
||||
|
||||
TGHorizontalFrame* hframe=new TGHorizontalFrame(this, 800,800);
|
||||
AddFrame(hframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
|
||||
hframe->MapWindow();
|
||||
|
||||
|
||||
|
||||
|
||||
int idac=0;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
TGHorizontalFrame* hhframe=new TGHorizontalFrame(this, 800,800);
|
||||
AddFrame(hhframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
|
||||
hhframe->MapWindow();
|
||||
|
||||
TGVerticalFrame *vframe;
|
||||
|
||||
|
||||
|
||||
|
||||
for (idac=0; idac<NADCS; idac++) {
|
||||
if (idac%16==0) {
|
||||
|
||||
|
||||
vframe=new TGVerticalFrame(hhframe, 400,800);
|
||||
hhframe->AddFrame(vframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
|
||||
vframe->MapWindow();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
sAdc[idac]=new ctbAdc(vframe,idac,myDet);
|
||||
|
||||
|
||||
sAdc[idac]->Connect("ToggledAdcPlot(Int_t)","ctbAdcs",this,"ToggledAdcPlot(Int_t)");
|
||||
sAdc[idac]->Connect("ToggledAdcInvert(Int_t)","ctbAdcs",this,"ToggledAdcInvert(Int_t)");
|
||||
sAdc[idac]->Connect("ToggledAdcEnable(Int_t)","ctbAdcs",this,"ToggledAdcEnable(Int_t)");
|
||||
|
||||
}
|
||||
|
||||
hframe=new TGHorizontalFrame(this, 800,800);
|
||||
AddFrame(hframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
|
||||
hframe->MapWindow();
|
||||
|
||||
|
||||
bCheckHalf[0]=new TGTextButton(hframe, "All 0-15");
|
||||
hframe->AddFrame(bCheckHalf[0],new TGLayoutHints(kLHintsTop | kLHintsExpandX, 5, 5, 5, 5));
|
||||
bCheckHalf[0]->MapWindow();
|
||||
bCheckHalf[0]->Connect("Clicked()","ctbAdcs",this,"CheckHalf0()");
|
||||
|
||||
|
||||
bRemoveHalf[0]=new TGTextButton(hframe, "None 0-15");
|
||||
hframe->AddFrame(bRemoveHalf[0],new TGLayoutHints(kLHintsBottom | kLHintsExpandX, 5, 5, 5, 5));
|
||||
bRemoveHalf[0]->MapWindow();
|
||||
bRemoveHalf[0]->Connect("Clicked()","ctbAdcs",this,"RemoveHalf0()");
|
||||
|
||||
|
||||
bCheckHalf[1]=new TGTextButton(hframe, "All 16-23");
|
||||
hframe->AddFrame(bCheckHalf[1],new TGLayoutHints(kLHintsTop | kLHintsExpandX, 5, 5, 5, 5));
|
||||
bCheckHalf[1]->MapWindow();
|
||||
bCheckHalf[1]->Connect("Clicked()","ctbAdcs",this,"CheckHalf1()");
|
||||
// bCheckAll->Connect("Clicked()","ctbAdcs",this,"CheckAll()");
|
||||
|
||||
|
||||
bRemoveHalf[1]=new TGTextButton(hframe, "None 16-23");
|
||||
hframe->AddFrame(bRemoveHalf[1],new TGLayoutHints(kLHintsBottom | kLHintsExpandX, 5, 5, 5, 5));
|
||||
bRemoveHalf[1]->MapWindow();
|
||||
bRemoveHalf[1]->Connect("Clicked()","ctbAdcs",this,"RemoveHalf1()");
|
||||
// bRemoveAll->Connect("Clicked()","ctbAdcs",this,"RemoveAll()");
|
||||
|
||||
|
||||
|
||||
|
||||
hframe=new TGHorizontalFrame(this, 800,800);
|
||||
AddFrame(hframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
|
||||
hframe->MapWindow();
|
||||
|
||||
|
||||
bCheckAll=new TGTextButton(hframe, "All");
|
||||
hframe->AddFrame(bCheckAll,new TGLayoutHints(kLHintsTop | kLHintsExpandX, 5, 5, 5, 5));
|
||||
bCheckAll->MapWindow();
|
||||
bCheckAll->Connect("Clicked()","ctbAdcs",this,"CheckAll()");
|
||||
|
||||
|
||||
bRemoveAll=new TGTextButton(hframe, "None");
|
||||
hframe->AddFrame(bRemoveAll,new TGLayoutHints(kLHintsBottom | kLHintsExpandX, 5, 5, 5, 5));
|
||||
bRemoveAll->MapWindow();
|
||||
bRemoveAll->Connect("Clicked()","ctbAdcs",this,"RemoveAll()");
|
||||
|
||||
|
||||
|
||||
hframe=new TGHorizontalFrame(this, 800,50);
|
||||
AddFrame(hframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
|
||||
hframe->MapWindow();
|
||||
|
||||
|
||||
TGLabel *label= new TGLabel(hframe, "Inversion mask: ");
|
||||
hframe->AddFrame(label,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 1, 1, 1, 1));
|
||||
label->MapWindow();
|
||||
label->SetTextJustify(kTextLeft);
|
||||
|
||||
|
||||
eInversionMask = new TGNumberEntry(hframe, 0, 16,999, TGNumberFormat::kNESHex,
|
||||
TGNumberFormat::kNEANonNegative,
|
||||
TGNumberFormat::kNELNoLimits);
|
||||
|
||||
hframe->AddFrame(eInversionMask,new TGLayoutHints(kLHintsTop | kLHintsExpandX, 1, 1, 1, 1));
|
||||
eInversionMask->MapWindow();
|
||||
eInversionMask->Resize(150,30);
|
||||
eInversionMask->SetState(kFALSE);
|
||||
|
||||
|
||||
hframe=new TGHorizontalFrame(this, 800,50);
|
||||
AddFrame(hframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
|
||||
hframe->MapWindow();
|
||||
|
||||
|
||||
label= new TGLabel(hframe, "Enable mask: ");
|
||||
hframe->AddFrame(label,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 1, 1, 1, 1));
|
||||
label->MapWindow();
|
||||
label->SetTextJustify(kTextLeft);
|
||||
|
||||
|
||||
eEnableMask = new TGNumberEntry(hframe, 0, 16,999, TGNumberFormat::kNESHex,
|
||||
TGNumberFormat::kNEANonNegative,
|
||||
TGNumberFormat::kNELNoLimits);
|
||||
|
||||
hframe->AddFrame(eEnableMask,new TGLayoutHints(kLHintsTop | kLHintsExpandX, 1, 1, 1, 1));
|
||||
eEnableMask->MapWindow();
|
||||
eEnableMask->Resize(150,30);
|
||||
eEnableMask->SetState(kFALSE);
|
||||
|
||||
}
|
||||
|
||||
|
||||
int ctbAdcs::setEnable(int reg) {
|
||||
|
||||
// char aargs[10][100];
|
||||
// char *args[10];
|
||||
string retval;
|
||||
int retreg;
|
||||
|
||||
// for (int i=0; i<10; i++) args[i]=aargs[i];
|
||||
|
||||
// sprintf(args[0],"adcenable");
|
||||
// sprintf(args[1],"%x",reg);
|
||||
// slsDetectorCommand *cmd=new slsDetectorCommand(myDet);
|
||||
// if (reg>-1) {
|
||||
// retval=cmd->executeLine(1,args,slsDetectorDefs::PUT_ACTION);
|
||||
// }
|
||||
if (reg>-1) {
|
||||
try {
|
||||
myDet->setADCEnableMask(reg);
|
||||
} catch (...) {
|
||||
|
||||
cout << "Do nothing for this error" << endl;
|
||||
}
|
||||
|
||||
}
|
||||
// retval=cmd->executeLine(1,args,slsDetectorDefs::GET_ACTION);
|
||||
// cout <<"enable: " << retval << endl;;
|
||||
// delete cmd;
|
||||
|
||||
// sscanf(retval.c_str(),"%x",&retreg);
|
||||
try {
|
||||
retreg=myDet->getADCEnableMask();
|
||||
} catch (...) {
|
||||
|
||||
cout << "Do nothing for this error" << endl;
|
||||
}
|
||||
|
||||
eEnableMask->SetHexNumber(retreg);
|
||||
|
||||
return retreg;
|
||||
}
|
||||
|
||||
int ctbAdcs::setInvert(int reg) {
|
||||
|
||||
// char aargs[10][100];
|
||||
// char *args[10];
|
||||
string retval;
|
||||
int retreg;
|
||||
|
||||
// for (int i=0; i<10; i++) args[i]=aargs[i];
|
||||
|
||||
//sprint// f(args[0],"adcinvert");
|
||||
// sprintf(args[1],"%x",reg);
|
||||
// slsDetectorCommand *cmd=new slsDetectorCommand(myDet);
|
||||
|
||||
if (reg>-1) {
|
||||
try {
|
||||
myDet->setADCInvert(reg);
|
||||
} catch (...) {
|
||||
|
||||
cout << "Do nothing for this error" << endl;
|
||||
}
|
||||
|
||||
//retval=cmd->executeLine(1,args,slsDetectorDefs::PUT_ACTION);
|
||||
}
|
||||
try {
|
||||
retreg=myDet->getADCInvert();
|
||||
} catch (...) {
|
||||
|
||||
cout << "Do nothing for this error" << endl;
|
||||
}
|
||||
|
||||
// retval=cmd->executeLine(1,args,slsDetectorDefs::GET_ACTION);
|
||||
// cout <<"invert: " << retval << endl;;
|
||||
// delete cmd;
|
||||
|
||||
// sscanf(retval.c_str(),"%x",&retreg);
|
||||
eInversionMask->SetHexNumber(retreg);
|
||||
return retreg;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ctbAdcs::update() {
|
||||
Int_t invreg;//=myDet->readRegister(67);//(120);
|
||||
Int_t disreg;//=myDet->readRegister(120);//(94);
|
||||
// for (int i=0; i<10; i++)
|
||||
// args[i]=aargs[i];
|
||||
|
||||
// string retval;
|
||||
// sprintf(args[0],"adcenable");
|
||||
// slsDetectorCommand *cmd=new slsDetectorCommand(myDet);
|
||||
// retval=cmd->executeLine(1,args,slsDetectorDefs::GET_ACTION);
|
||||
// delete cmd;
|
||||
// // cout << retval << endl;
|
||||
|
||||
// sscanf(retval.c_str(),"adcenable %x",&disreg);
|
||||
|
||||
// eInversionMask->SetHexNumber(invreg);
|
||||
// eEnableMask->SetHexNumber(disreg);
|
||||
|
||||
disreg=setEnable();
|
||||
invreg=setInvert();
|
||||
|
||||
|
||||
for (int is=0; is<NADCS; is++) {
|
||||
sAdc[is]->setAdcAlias(NULL,-1,-1);
|
||||
if (invreg & (1<<is) )
|
||||
sAdc[is]->setInverted(kTRUE);
|
||||
else
|
||||
sAdc[is]->setInverted(kFALSE);
|
||||
|
||||
if (disreg & (1<<is) )
|
||||
sAdc[is]->setEnable(kTRUE);
|
||||
else
|
||||
sAdc[is]->setEnable(kFALSE);
|
||||
|
||||
|
||||
}
|
||||
|
||||
Emit("AdcEnable(Int_t)", disreg);
|
||||
|
||||
}
|
||||
string ctbAdcs::getAdcParameters() {
|
||||
|
||||
ostringstream line;
|
||||
|
||||
line << "reg "<< hex << setInvert() << "# ADC invert reg" << dec << endl;
|
||||
line << "reg "<< hex << setEnable() << " # ADC enable reg"<< dec << endl;
|
||||
// line << "reg "<< hex << 67 << " " << myDet->readRegister(67) << "# ADC invert reg" << dec << endl;
|
||||
// line << "reg "<< hex << 120 << " " << myDet->readRegister(120) << " # ADC enable reg"<< dec << endl;
|
||||
// // line << "reg "<< hex << 94 << " " << myDet->readRegister(94) << " # ADC enable reg"<< dec << endl;
|
||||
return line.str();
|
||||
|
||||
}
|
||||
|
||||
|
||||
void ctbAdcs::CheckAll() {
|
||||
|
||||
|
||||
for (int is=0; is<NADCS; is++){
|
||||
sAdc[is]->setPlot(kTRUE);
|
||||
// sAdc[is]->setEnabled(kTRUE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ctbAdcs::RemoveAll() {
|
||||
|
||||
|
||||
for (int is=0; is<NADCS; is++) {
|
||||
// sAdc[is]->setEnabled(kFALSE);
|
||||
sAdc[is]->setPlot(kFALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ctbAdcs::CheckHalf0() {
|
||||
|
||||
|
||||
for (int is=0; is<NADCS/2; is++) {
|
||||
sAdc[is]->setPlot(kTRUE);
|
||||
// sAdc[is]->setEnabled(kTRUE)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ctbAdcs::RemoveHalf0() {
|
||||
|
||||
|
||||
for (int is=0; is<NADCS/2; is++){
|
||||
// sAdc[is]->setEnabled(kFALSE);
|
||||
sAdc[is]->setPlot(kFALSE);
|
||||
}
|
||||
}
|
||||
|
||||
void ctbAdcs::CheckHalf1() {
|
||||
|
||||
|
||||
for (int is=NADCS/2; is<NADCS; is++){
|
||||
sAdc[is]->setPlot(kTRUE);
|
||||
// sAdc[is]->setEnabled(kTRUE)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ctbAdcs::RemoveHalf1() {
|
||||
|
||||
|
||||
for (int is=NADCS/2; is<NADCS; is++){
|
||||
// sAdc[is]->setEnabled(kFALSE);
|
||||
sAdc[is]->setPlot(kFALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// TGraph* ctbAdcs::getGraph(int i) {
|
||||
|
||||
// if (i>=0 && i<NADCS)
|
||||
// return sAdc[i]->getGraph();
|
||||
// return NULL;
|
||||
// }
|
||||
|
||||
int ctbAdcs::setAdcAlias(string line) {
|
||||
|
||||
int is=-1, plot=0, color=-1;
|
||||
char tit[100];
|
||||
int narg=sscanf(line.c_str(),"ADC%d %s %d %x",&is,tit,&plot, &color);
|
||||
if (narg<2)
|
||||
return -1;
|
||||
if (narg!=3)
|
||||
color=-1;
|
||||
if (is>=0 && is<NADCS) {
|
||||
sAdc[is]->setAdcAlias(tit,plot,color);
|
||||
}
|
||||
return is;
|
||||
|
||||
}
|
||||
|
||||
string ctbAdcs::getAdcAlias() {
|
||||
|
||||
ostringstream line;
|
||||
|
||||
for (int is=0; is<NADCS; is++)
|
||||
line << sAdc[is]->getAdcAlias();
|
||||
|
||||
return line.str();
|
||||
}
|
||||
|
||||
|
||||
void ctbAdcs::ToggledAdcPlot(Int_t b){
|
||||
|
||||
|
||||
Emit("ToggledAdcPlot(Int_t)", b);
|
||||
|
||||
}
|
||||
|
||||
void ctbAdcs::AdcEnable(Int_t b){
|
||||
Emit("AdcEnable(Int_t)", b);
|
||||
}
|
||||
|
||||
|
||||
void ctbAdcs::ToggledAdcEnable(Int_t b){
|
||||
|
||||
|
||||
Int_t oreg=setEnable();//myDet->readRegister(67);
|
||||
Int_t m=1<<b;
|
||||
|
||||
|
||||
if (sAdc[b]->getEnable())
|
||||
oreg|=m;
|
||||
else
|
||||
oreg&=~m;
|
||||
|
||||
// cout << dec << sizeof(Long64_t) << " " << mask << " " << hex << m << " ioreg " << oreg << endl;
|
||||
|
||||
setEnable(oreg);//)writeRegister(67, oreg);
|
||||
//oreg=setEnable();//myDet->readRegister(67);
|
||||
|
||||
|
||||
Emit("AdcEnable(Int_t)", oreg);
|
||||
//cout << "enable!" << endl;
|
||||
// Emit("ToggledAdcPlot(Int_t)", b);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void ctbAdcs::ToggledAdcInvert(Int_t b){
|
||||
|
||||
// char val[1000];
|
||||
Int_t oreg=setInvert();//myDet->readRegister(67);
|
||||
Int_t m=1<<b;
|
||||
|
||||
|
||||
if (sAdc[b]->getInverted())
|
||||
oreg|=m;
|
||||
else
|
||||
oreg&=~m;
|
||||
|
||||
// cout << dec << sizeof(Long64_t) << " " << mask << " " << hex << m << " ioreg " << oreg << endl;
|
||||
|
||||
setInvert(oreg);//)writeRegister(67, oreg);
|
||||
// oreg=setInvert();//myDet->readRegister(67);
|
||||
|
||||
// cout << dec << sizeof(Long64_t) << " " << mask << " " << hex << m << " ioreg " << oreg << endl;
|
||||
|
||||
//sprintf(val,"%X",oreg);
|
||||
//eInversionMask->SetHexNumber(oreg);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Pixel_t ctbAdcs::getColor(int i){
|
||||
if (i>=0 && i<NADCS)
|
||||
return sAdc[i]->getColor();
|
||||
}
|
||||
|
||||
Bool_t ctbAdcs::getEnabled(int i){
|
||||
if (i>=0 && i<NADCS)
|
||||
return sAdc[i]->getEnabled();
|
||||
|
||||
}
|
||||
|
||||
Bool_t ctbAdcs::getEnable(int i){
|
||||
if (i>=0 && i<NADCS)
|
||||
return sAdc[i]->getEnable();
|
||||
|
||||
}
|
||||
|
||||
Bool_t ctbAdcs::getPlot(int i){
|
||||
if (i>=0 && i<NADCS)
|
||||
return sAdc[i]->getPlot();
|
||||
|
||||
}
|
152
ctbGui/ctbAdcs.h
152
ctbGui/ctbAdcs.h
@ -1,152 +0,0 @@
|
||||
|
||||
|
||||
|
||||
#ifndef CTBADCS_H
|
||||
#define CTBADCS_H
|
||||
#include <TGFrame.h>
|
||||
|
||||
|
||||
#define NADCS 32
|
||||
|
||||
class TRootEmbeddedCanvas;
|
||||
class TGButtonGroup;
|
||||
class TGVerticalFrame;
|
||||
class TGHorizontalFrame;
|
||||
class TGTextEntry;
|
||||
class TGLabel;
|
||||
class TGNumberEntry;
|
||||
class TH2F;
|
||||
class TGComboBox;
|
||||
class TGCheckButton;
|
||||
class TGColorSelect;
|
||||
class TColor;
|
||||
|
||||
class THStack;
|
||||
class TGraphErrors;
|
||||
class TGTextButton;
|
||||
class TGTab;
|
||||
|
||||
class TGraph;
|
||||
|
||||
class multiSlsDetector;
|
||||
|
||||
#include <string>
|
||||
using namespace std;
|
||||
|
||||
class ctbAdc : public TGHorizontalFrame {
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
TGLabel *sAdcLabel;
|
||||
TGCheckButton *sAdcEnable;
|
||||
TGCheckButton *sAdcPlot;
|
||||
TGCheckButton *sAdcInvert;
|
||||
|
||||
TGColorSelect *fColorSel;
|
||||
|
||||
// TGraph *gADC;
|
||||
|
||||
int id;
|
||||
multiSlsDetector *myDet;
|
||||
|
||||
public:
|
||||
ctbAdc(TGVerticalFrame *page, int i, multiSlsDetector *det);
|
||||
|
||||
|
||||
void setAdcAlias(char *tit, int plot, int color);
|
||||
string getAdcAlias();
|
||||
void ToggledAdcPlot(Int_t b);
|
||||
void ToggledAdcEnable(Int_t b);
|
||||
void ToggledAdcInvert(Int_t b);
|
||||
|
||||
|
||||
void ToggledPlot(Bool_t b);
|
||||
void ToggledEnable(Bool_t b);
|
||||
void ToggledInvert(Bool_t b);
|
||||
void ColorChanged(Pixel_t);
|
||||
void setEnabled(Bool_t b);
|
||||
Bool_t getEnabled();
|
||||
// TGraph *getGraph();
|
||||
void update();
|
||||
|
||||
Pixel_t getColor();
|
||||
|
||||
Bool_t getEnable();
|
||||
void setEnable(Bool_t);
|
||||
void setPlot(Bool_t);
|
||||
Bool_t getInverted();
|
||||
Bool_t getPlot();
|
||||
void setInverted(Bool_t);
|
||||
|
||||
ClassDef(ctbAdc,0)
|
||||
};
|
||||
|
||||
|
||||
|
||||
class ctbAdcs : public TGGroupFrame {
|
||||
private:
|
||||
|
||||
ctbAdc *sAdc[NADCS];
|
||||
multiSlsDetector *myDet;
|
||||
|
||||
|
||||
TGTextButton *bCheckAll;
|
||||
TGTextButton *bRemoveAll;
|
||||
TGTextButton *bCheckHalf[2];
|
||||
TGTextButton *bRemoveHalf[2];
|
||||
TGNumberEntry *eInversionMask;
|
||||
TGNumberEntry *eEnableMask;
|
||||
|
||||
|
||||
/* TGTextButton *bPlotSelected; */
|
||||
/* TGNumberEntry *eMinX; */
|
||||
/* TGNumberEntry *eMaxX; */
|
||||
/* TGNumberEntry *eMinY; */
|
||||
/* TGNumberEntry *eMaxY; */
|
||||
|
||||
|
||||
|
||||
/* TGTextButton *bGetPixel; */
|
||||
/* TGNumberEntry *ePixelX; */
|
||||
/* TGNumberEntry *ePixelY; */
|
||||
/* TGLabel *lPixelValue; */
|
||||
|
||||
public:
|
||||
|
||||
ctbAdcs(TGVerticalFrame *page, multiSlsDetector *det);
|
||||
int setAdcAlias(string line);
|
||||
string getAdcAlias();
|
||||
string getAdcParameters();
|
||||
void ToggledAdcPlot(Int_t);
|
||||
void ToggledAdcInvert(Int_t);
|
||||
void ToggledAdcEnable(Int_t);
|
||||
void AdcEnable(Int_t b);
|
||||
// TGraph *getGraph(int i);
|
||||
void CheckAll();
|
||||
void RemoveAll();
|
||||
void update();
|
||||
|
||||
int setInvert(int reg=-1);
|
||||
int setEnable(int reg=-1);
|
||||
|
||||
|
||||
Pixel_t getColor(int i);
|
||||
Bool_t getEnabled(int i);
|
||||
Bool_t getPlot(int i);
|
||||
Bool_t getEnable(int i);
|
||||
|
||||
void CheckHalf0();
|
||||
void RemoveHalf0();
|
||||
|
||||
void CheckHalf1();
|
||||
void RemoveHalf1();
|
||||
|
||||
|
||||
ClassDef(ctbAdcs,0)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -1,251 +0,0 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
#include <TGTextEntry.h>
|
||||
#include <TGLabel.h>
|
||||
#include <TGNumberEntry.h>
|
||||
#include <TGButton.h>
|
||||
|
||||
#include "ctbDacs.h"
|
||||
#include "multiSlsDetector.h"
|
||||
#include "sls_detector_defs.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ctbDac::ctbDac(TGGroupFrame *page, int idac, multiSlsDetector *det) : TGHorizontalFrame(page, 800,50) , id(idac), myDet(det) {
|
||||
|
||||
|
||||
TGHorizontalFrame *hframe=this;
|
||||
|
||||
page->AddFrame(hframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
|
||||
MapWindow();
|
||||
|
||||
char tit[100];
|
||||
|
||||
|
||||
sprintf(tit, "DAC %d:",idac);
|
||||
|
||||
dacsLabel= new TGCheckButton(hframe, tit);// new TGLabel(hframe, tit);
|
||||
dacsLabel->SetOn(kTRUE, kTRUE);
|
||||
|
||||
dacsLabel->Connect("Toggled(Bool_t)","ctbDac",this,"setOn(Bool_t)");
|
||||
|
||||
|
||||
hframe->AddFrame(dacsLabel,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 5, 5, 5, 5));
|
||||
dacsLabel->MapWindow();
|
||||
dacsLabel->SetTextJustify(kTextLeft);
|
||||
|
||||
|
||||
dacsEntry = new TGNumberEntry(hframe, 0, 9,999, TGNumberFormat::kNESInteger,
|
||||
TGNumberFormat::kNEANonNegative,
|
||||
TGNumberFormat::kNELLimitMinMax,
|
||||
0, 65535);
|
||||
|
||||
hframe->AddFrame(dacsEntry,new TGLayoutHints(kLHintsTop | kLHintsExpandX, 5, 5, 5, 5));
|
||||
dacsEntry->MapWindow();
|
||||
dacsEntry->Resize(150,30);
|
||||
|
||||
|
||||
dacsUnit= new TGCheckButton(hframe, "mV");
|
||||
// if (idac!=slsDetectorDefs::ADC_VPP) {
|
||||
hframe->AddFrame( dacsUnit,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 5, 5, 5, 5));
|
||||
dacsUnit->MapWindow();
|
||||
if (idac==slsDetectorDefs::ADC_VPP) {
|
||||
dacsUnit->SetEnabled(kFALSE);
|
||||
hframe->HideFrame(dacsUnit);
|
||||
dacsUnit->MapWindow();
|
||||
cout << "hiding!" << endl;
|
||||
}
|
||||
if (idac==slsDetectorDefs::HIGH_VOLTAGE) {
|
||||
dacsUnit->SetText("V");
|
||||
dacsUnit->SetOn(kTRUE,kTRUE);
|
||||
dacsUnit->SetEnabled(kFALSE);
|
||||
}
|
||||
//}
|
||||
|
||||
|
||||
|
||||
sprintf(tit, "xxx");
|
||||
dacsValue= new TGLabel(hframe, tit);
|
||||
hframe->AddFrame( dacsValue,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 5, 5, 5, 5));
|
||||
dacsValue->MapWindow();
|
||||
dacsValue->SetTextJustify(kTextLeft);
|
||||
|
||||
TGTextEntry *e=dacsEntry->TGNumberEntry::GetNumberEntry();
|
||||
e->Connect("ReturnPressed()","ctbDac",this,"setValue()");
|
||||
// e->Connect("ValueSet(Long_t)","ctbDac",this,"setValue(Long_t)");
|
||||
dacsEntry->Connect("ValueSet(Long_t)","ctbDac",this,"setValue(Long_t)");
|
||||
// cout << "(((((((((((((((((((((((((((((((" << dacsEntry->GetListOfSignals()->At(0)->IsA() << endl;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
int ctbDac::setLabel(char *tit, int mv) {
|
||||
if(tit)
|
||||
dacsLabel->SetText(tit);
|
||||
if (mv==1)
|
||||
dacsUnit->SetOn(kTRUE,kTRUE);
|
||||
else if (mv==0)
|
||||
dacsUnit->SetOn(kFALSE,kTRUE);
|
||||
// else if (mv==2) {
|
||||
// ;}
|
||||
// else if (mv==3)
|
||||
// ;
|
||||
return id;
|
||||
|
||||
}
|
||||
|
||||
string ctbDac::getLabel() {
|
||||
|
||||
ostringstream line;
|
||||
line << dacsLabel->GetText() << " " << dacsUnit->IsOn() << endl;
|
||||
|
||||
// line << "DAC" << dec << id << " " << dacsUnit->IsOn() << endl;
|
||||
|
||||
return line.str();
|
||||
|
||||
}
|
||||
|
||||
|
||||
void ctbDac::setValue(Long_t a) {setValue();}
|
||||
|
||||
void ctbDac::setValue() {
|
||||
|
||||
|
||||
|
||||
cout << "setting dac! "<< id << " value " << dacsEntry->GetIntNumber() << " units " << dacsUnit->IsOn() << endl;
|
||||
try {
|
||||
myDet->setDAC(dacsEntry->GetIntNumber(), (slsDetectorDefs::dacIndex)id, dacsUnit->IsOn()); } catch (...) {
|
||||
cout << "Do nothing for this error" << endl;
|
||||
}
|
||||
|
||||
getValue();
|
||||
|
||||
}
|
||||
|
||||
void ctbDac::setOn(Bool_t b) {
|
||||
|
||||
|
||||
|
||||
// cout << "setting dac! "<< id << endl;
|
||||
|
||||
if ( dacsLabel->IsOn()) {
|
||||
setValue();
|
||||
} else {
|
||||
try {
|
||||
myDet->setDAC(-100, (slsDetectorDefs::dacIndex)id, 0);
|
||||
} catch (...) {
|
||||
cout << "Do nothing for this error" << endl;
|
||||
}
|
||||
}
|
||||
getValue();
|
||||
|
||||
}
|
||||
|
||||
int ctbDac::getValue() {
|
||||
int val;
|
||||
try {
|
||||
val=myDet->setDAC(-1,(slsDetectorDefs::dacIndex)id, dacsUnit->IsOn());
|
||||
} catch (...) {
|
||||
cout << "Do nothing for this error" << endl;
|
||||
}
|
||||
char s[100];
|
||||
cout << "dac " << id << " " << val << endl;
|
||||
sprintf(s,"%d",val);
|
||||
dacsValue->SetText(s);
|
||||
if (val>=0) {
|
||||
dacsLabel->SetOn(kTRUE);
|
||||
} else {
|
||||
dacsLabel->SetOn(kFALSE);
|
||||
}
|
||||
|
||||
|
||||
return val;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ctbDacs::ctbDacs(TGVerticalFrame *page, multiSlsDetector *det) : TGGroupFrame(page,"DACs",kVerticalFrame) , myDet(det){
|
||||
|
||||
|
||||
SetTitlePos(TGGroupFrame::kLeft);
|
||||
page->AddFrame(this,new TGLayoutHints( kLHintsTop | kLHintsExpandX , 10,10,10,10));
|
||||
MapWindow();
|
||||
|
||||
// cout << "window mapped " << endl;
|
||||
|
||||
for (int idac=0; idac<NDACS; idac++) {
|
||||
|
||||
dacs[idac]=new ctbDac(this, idac, myDet);
|
||||
|
||||
}
|
||||
dacs[NDACS]=new ctbDac(this, slsDetectorDefs::ADC_VPP, myDet);
|
||||
dacs[NDACS+1]=new ctbDac(this, slsDetectorDefs::HIGH_VOLTAGE, myDet);
|
||||
dacs[NDACS]->setLabel("ADC Vpp",2);
|
||||
dacs[NDACS+1]->setLabel("High Voltage",3);
|
||||
|
||||
}
|
||||
|
||||
|
||||
int ctbDacs::setDacAlias(string line) {
|
||||
|
||||
int is=-1, mv=0;
|
||||
char tit[100];
|
||||
int narg=sscanf(line.c_str(),"DAC%d %s %d",&is,tit,&mv);
|
||||
if (narg<2)
|
||||
return -1;
|
||||
if (is>=0 && is<NDACS)
|
||||
dacs[is]->setLabel(tit,mv);
|
||||
return is;
|
||||
|
||||
}
|
||||
|
||||
string ctbDacs::getDacAlias() {
|
||||
ostringstream line;
|
||||
|
||||
for (int i=0; i<NDACS; i++)
|
||||
line << dacs[i]->getLabel() << endl;
|
||||
return line.str();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
string ctbDacs::getDacParameters() {
|
||||
|
||||
|
||||
ostringstream line;
|
||||
|
||||
for (int i=0; i<NDACS; i++) {
|
||||
//line << "dacs:" << i << " " << dacs[i]->getValue << endl;
|
||||
line << "dac:" << i << " " << dacs[i]->getValue() << endl;
|
||||
}
|
||||
return line.str();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ctbDacs::update() {
|
||||
|
||||
for (int idac=0; idac<NDACS+1; idac++) {
|
||||
dacs[idac]->getValue();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,74 +0,0 @@
|
||||
|
||||
|
||||
#ifndef CTBDACS_H
|
||||
#define CTBDACS_H
|
||||
#include <TGFrame.h>
|
||||
|
||||
|
||||
#define NDACS 18
|
||||
//#define NDACS 16
|
||||
|
||||
|
||||
class TGTextEntry;
|
||||
class TGLabel;
|
||||
class TGNumberEntry;
|
||||
class TGCheckButton;
|
||||
|
||||
|
||||
class multiSlsDetector;
|
||||
|
||||
#include <string>
|
||||
using namespace std;
|
||||
|
||||
|
||||
class ctbDac : public TGHorizontalFrame {
|
||||
|
||||
|
||||
protected:
|
||||
// TGLabel *dacsLabel;
|
||||
TGNumberEntry *dacsEntry;
|
||||
TGCheckButton *dacsUnit;
|
||||
TGCheckButton *dacsLabel;
|
||||
TGLabel *dacsValue;
|
||||
int id;
|
||||
|
||||
multiSlsDetector* myDet;
|
||||
public:
|
||||
ctbDac(TGGroupFrame*, int , multiSlsDetector*);
|
||||
void setValue();
|
||||
void setValue(Long_t);
|
||||
int getValue();
|
||||
void setOn(Bool_t);
|
||||
|
||||
int setLabel(char *tit, int mv);
|
||||
string getLabel();
|
||||
|
||||
|
||||
|
||||
ClassDef(ctbDac,0)
|
||||
};
|
||||
|
||||
class ctbDacs : public TGGroupFrame {
|
||||
private:
|
||||
|
||||
|
||||
|
||||
ctbDac *dacs[NDACS+2];
|
||||
|
||||
multiSlsDetector* myDet;
|
||||
|
||||
public:
|
||||
ctbDacs(TGVerticalFrame *page, multiSlsDetector*);
|
||||
|
||||
int setDacAlias(string line);
|
||||
// int setDacAlias(string line);
|
||||
string getDacAlias();
|
||||
string getDacParameters();
|
||||
|
||||
void update();
|
||||
|
||||
ClassDef(ctbDacs,0)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -1,161 +0,0 @@
|
||||
#include <TApplication.h>
|
||||
#include <TColor.h>
|
||||
|
||||
#include <TStyle.h>
|
||||
#include <TROOT.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
|
||||
|
||||
#include "multiSlsDetector.h"
|
||||
#include "sls_detector_defs.h"
|
||||
//#include "sls_receiver_defs.h"
|
||||
#include "ctbMain.h"
|
||||
using namespace std;
|
||||
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
|
||||
|
||||
string afname, cfname, pfname;
|
||||
int id=0;
|
||||
|
||||
int af=0, cf=0, pf=0;
|
||||
|
||||
|
||||
cout << " *** " << argc << endl;
|
||||
for (int ia=0; ia<argc; ia++) {
|
||||
if (strcmp(argv[ia],"-alias")==0) {
|
||||
if (ia+1<argc) {
|
||||
afname=argv[ia+1];
|
||||
ia++;
|
||||
af=1;
|
||||
}
|
||||
|
||||
} else if (strcmp(argv[ia],"-config")==0) {
|
||||
if (ia+1<argc) {
|
||||
cfname=argv[ia+1];
|
||||
ia++;
|
||||
cf=1;
|
||||
}
|
||||
|
||||
|
||||
} else if (strcmp(argv[ia],"-par")==0) {
|
||||
if (ia+1<argc) {
|
||||
pfname=argv[ia+1];
|
||||
ia++;
|
||||
pf=1;
|
||||
}
|
||||
|
||||
|
||||
} else if (strcmp(argv[ia],"-id")==0) {
|
||||
if (ia+1<argc) {
|
||||
id=atoi(argv[ia+1]);
|
||||
ia++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
cout << " *** " << endl;
|
||||
|
||||
/****** Create detector ****************/
|
||||
multiSlsDetector *myDet=new multiSlsDetector(id);
|
||||
// myDet->setOnline(slsDetectorDefs::ONLINE_FLAG);
|
||||
|
||||
//cout << id << " " << myDet << " " << myDet->setOnline() << endl;
|
||||
if (cf) {
|
||||
myDet->readConfigurationFile(cfname);
|
||||
} else
|
||||
cout << "No config file specified" << endl;
|
||||
|
||||
cout << "aa" << endl;
|
||||
|
||||
cout << "Created multi detector id " << id << " hostname " << myDet->getHostname() << endl;
|
||||
|
||||
|
||||
cout << "bb" << endl;
|
||||
if (pf) {
|
||||
myDet->retrieveDetectorSetup(pfname);
|
||||
} else
|
||||
cout << "No parameter file specified" << endl;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/***********Create GUI stuff *******************/
|
||||
TApplication theApp("App",&argc,argv);
|
||||
|
||||
|
||||
gStyle->SetDrawBorder(0);
|
||||
gStyle->SetCanvasColor(kWhite);
|
||||
gStyle->SetCanvasDefH(800);
|
||||
gStyle->SetCanvasDefW(800);
|
||||
gStyle->SetCanvasBorderMode(0);
|
||||
gStyle->SetPadBorderMode(0);
|
||||
gStyle->SetPaintTextFormat("5.2f");
|
||||
gStyle->SetLineWidth(2);
|
||||
gStyle->SetTextSize(1.1);
|
||||
gStyle->SetLabelSize(0.04,"xy");
|
||||
gStyle->SetTitleSize(0.05,"xy");
|
||||
gStyle->SetTitleOffset(1.0,"x");
|
||||
gStyle->SetTitleOffset(1.1,"y");
|
||||
gStyle->SetPadTopMargin(0.15);
|
||||
gStyle->SetPadRightMargin(0.15);
|
||||
gStyle->SetPadBottomMargin(0.15);
|
||||
gStyle->SetPadLeftMargin(0.15);
|
||||
gStyle->SetLegendBorderSize(1);
|
||||
gStyle->SetFrameBorderMode(0);
|
||||
gStyle->SetFrameFillColor(kWhite);
|
||||
// gStyle->SetLegendFillColor(kWhite);
|
||||
gStyle->SetTitleFillColor(kWhite);
|
||||
gStyle->SetFillColor(kWhite);
|
||||
gStyle->SetStatFontSize(0.03);
|
||||
gStyle->SetStatBorderSize(1);
|
||||
gStyle->SetStatFormat("6.4g");
|
||||
gStyle->SetStatX(0.95);
|
||||
gStyle->SetStatY(0.95);
|
||||
gStyle->SetStatW(0.2);
|
||||
gStyle->SetStatH(0.2);
|
||||
gStyle->SetTitleX(0.1);
|
||||
gStyle->SetTitleY(0.95);
|
||||
gStyle->SetTitleBorderSize(0);
|
||||
gStyle->SetTitleFontSize(0.05);
|
||||
gROOT->SetStyle("Default");
|
||||
|
||||
|
||||
TColor::InitializeColors();
|
||||
const Int_t NRGBs = 5;
|
||||
const Int_t NCont = 90;
|
||||
|
||||
Double_t stops[NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
|
||||
Double_t red[NRGBs] = { 0.00, 0.00, 0.87, 1.00, 0.51 };
|
||||
Double_t green[NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00 };
|
||||
Double_t blue[NRGBs] = { 0.51, 1.00, 0.12, 0.00, 0.00 };
|
||||
TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
|
||||
gStyle->SetNumberContours(NCont);
|
||||
|
||||
|
||||
gROOT->ForceStyle();
|
||||
ctbMain *mf=new ctbMain(gClient->GetRoot(),myDet);
|
||||
|
||||
cout << " *** " << argc << endl;
|
||||
for (int ia=0; ia<argc; ia++)
|
||||
cout << argv[ia] << endl;
|
||||
|
||||
|
||||
cout << " *** " << endl;
|
||||
|
||||
if (af)
|
||||
mf->loadAlias(afname);
|
||||
else
|
||||
cout << "no alias specified" << endl;
|
||||
|
||||
theApp.Run();
|
||||
|
||||
return 0;
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
#pragma link C++ class ctbMain;
|
||||
#pragma link C++ class ctbDacs;
|
||||
#pragma link C++ class ctbDac;
|
||||
#pragma link C++ class ctbSignals;
|
||||
#pragma link C++ class ctbSignal;
|
||||
#pragma link C++ class ctbAdc;
|
||||
#pragma link C++ class ctbAdcs;
|
||||
#pragma link C++ class ctbLoop;
|
||||
#pragma link C++ class ctbWait;
|
||||
#pragma link C++ class ctbPattern;
|
||||
#pragma link C++ class ctbAcquisition;
|
||||
#pragma link C++ class ctbPower;
|
||||
#pragma link C++ class ctbPowers;
|
||||
#pragma link C++ class ctbSlowAdc;
|
||||
#pragma link C++ class ctbSlowAdcs;
|
@ -1,709 +0,0 @@
|
||||
#include <TApplication.h>
|
||||
#include <TGClient.h>
|
||||
#include <TCanvas.h>
|
||||
#include <TF1.h>
|
||||
#include <TRandom.h>
|
||||
#include <TGButton.h>
|
||||
#include <TRootEmbeddedCanvas.h>
|
||||
#include <TGButtonGroup.h>
|
||||
#include <TGNumberEntry.h>
|
||||
#include <TGLabel.h>
|
||||
#include <TList.h>
|
||||
#include <TGFileDialog.h>
|
||||
#include <TGComboBox.h>
|
||||
#include <TH2F.h>
|
||||
#include <TColor.h>
|
||||
#include <TH1F.h>
|
||||
#include <TGraphErrors.h>
|
||||
#include <THStack.h>
|
||||
#include <TGTab.h>
|
||||
#include <TApplication.h>
|
||||
#include <TGCanvas.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <TGMenu.h>
|
||||
#include <TGDockableFrame.h>
|
||||
//#include <TGMenuBar.h>
|
||||
//#include <TGPopupMenu.h>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
|
||||
#include "multiSlsDetector.h"
|
||||
#include "ctbMain.h"
|
||||
#include "ctbDacs.h"
|
||||
#include "ctbSlowAdcs.h"
|
||||
#include "ctbPowers.h"
|
||||
#include "ctbSignals.h"
|
||||
#include "ctbPattern.h"
|
||||
#include "ctbAdcs.h"
|
||||
#include "ctbAcquisition.h"
|
||||
//#include "ctbActions.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
|
||||
ctbMain::ctbMain(const TGWindow *p, multiSlsDetector *det)
|
||||
: TGMainFrame(p,800,800), pwrs(NULL), senses(NULL) {
|
||||
|
||||
myDet=det;
|
||||
|
||||
Connect("CloseWindow()", "ctbMain", this, "CloseWindow()");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// fMenuDock = new TGDockableFrame(this);
|
||||
// AddFrame(fMenuDock, new TGLayoutHints(kLHintsExpandX, 0, 0, 1, 0));
|
||||
// fMenuDock->SetWindowName("GuiTest Menu");
|
||||
|
||||
fMenuBarLayout = new TGLayoutHints(kLHintsTop | kLHintsExpandX);
|
||||
fMenuBarItemLayout = new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0);
|
||||
fMenuBarHelpLayout = new TGLayoutHints(kLHintsTop | kLHintsRight);
|
||||
|
||||
fMenuFile = new TGPopupMenu(gClient->GetRoot());
|
||||
int im=0;
|
||||
|
||||
fMenuFile->AddEntry("Open Alias", im++);
|
||||
fMenuFile->AddEntry("Save Alias", im++);
|
||||
fMenuFile->AddSeparator();
|
||||
fMenuFile->AddEntry("Open Parameters", im++);
|
||||
fMenuFile->AddEntry("Save Parameters", im++);
|
||||
fMenuFile->AddSeparator();
|
||||
fMenuFile->AddEntry("Open Configuration", im++);
|
||||
fMenuFile->AddEntry("Save Configuration", im++);
|
||||
fMenuFile->AddSeparator();
|
||||
fMenuFile->AddEntry("Open Pattern", im++);
|
||||
fMenuFile->AddEntry("Save Pattern", im++);
|
||||
fMenuFile->AddSeparator();
|
||||
fMenuFile->AddEntry("Exit", im++);
|
||||
|
||||
fMenuFile->Connect("Activated(Int_t)", "ctbMain", this,
|
||||
"HandleMenu(Int_t)");
|
||||
|
||||
|
||||
i_dacs=-1;
|
||||
i_pwrs=-1;
|
||||
i_senses=-1;
|
||||
i_sig=-1;
|
||||
i_adcs=-1;
|
||||
i_pat=-1;
|
||||
i_acq=-1;
|
||||
|
||||
int i_page=0;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
TGVerticalFrame *vframe=new TGVerticalFrame(this, 800,1200); //main frame
|
||||
|
||||
|
||||
|
||||
fMenuBar = new TGMenuBar(vframe, 1, 1, kHorizontalFrame);
|
||||
fMenuBar->AddPopup("&File", fMenuFile, fMenuBarItemLayout);
|
||||
// fMenuBar->AddPopup("&Test", fMenuTest, fMenuBarItemLayout);
|
||||
// fMenuBar->AddPopup("&View", fMenuView, fMenuBarItemLayout);
|
||||
// fMenuBar->AddPopup("&Help", fMenuHelp, fMenuBarHelpLayout);
|
||||
|
||||
vframe->AddFrame(fMenuBar, fMenuBarLayout);
|
||||
|
||||
TGHorizontalFrame* hpage=new TGHorizontalFrame(vframe, 800,1200); //horizontal frame. Inside there should be the tab and the canvas
|
||||
mtab=new TGTab(hpage, 1500, 1200); //tab!
|
||||
// page=new TGVerticalFrame(mtab, 1500,1200);
|
||||
|
||||
cout << "DACS" << endl;
|
||||
|
||||
TGCompositeFrame *tf = mtab->AddTab("DACs");
|
||||
TGVerticalFrame *page=new TGVerticalFrame(tf, 1500,1200);
|
||||
tf->AddFrame(page, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10,10,10,1));
|
||||
dacs=new ctbDacs(page, myDet);
|
||||
i_dacs=i_page++;
|
||||
|
||||
|
||||
cout << "power " << endl;
|
||||
tf = mtab->AddTab("Power Supplies");
|
||||
page=new TGVerticalFrame(tf, 1500,1200);
|
||||
tf->AddFrame(page, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10,10,10,1));
|
||||
pwrs=new ctbPowers(page, myDet);
|
||||
|
||||
i_pwrs=i_page++;
|
||||
|
||||
cout << "sense " << endl;
|
||||
tf = mtab->AddTab("Sense");
|
||||
page=new TGVerticalFrame(tf, 1500,1200);
|
||||
tf->AddFrame(page, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10,10,10,1));
|
||||
senses=new ctbSlowAdcs(page, myDet);
|
||||
|
||||
i_senses=i_page++;
|
||||
|
||||
|
||||
|
||||
cout << "signals " << endl;
|
||||
tf = mtab->AddTab("Signals");
|
||||
page=new TGVerticalFrame(tf, 1500,1200);
|
||||
tf->AddFrame(page, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10,10,10,1));
|
||||
sig=new ctbSignals(page, myDet);
|
||||
sig->Connect("ToggledSignalPlot(Int_t)","ctbMain",this,"setSignalPlot(Int_t)");
|
||||
|
||||
i_sig=i_page++;
|
||||
|
||||
cout << "adcs " << endl;
|
||||
tf = mtab->AddTab("ADCs");
|
||||
page=new TGVerticalFrame(tf, 1500,1200);
|
||||
tf->AddFrame(page, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10,10,10,1));
|
||||
adcs=new ctbAdcs(page, myDet);
|
||||
adcs->Connect("ToggledAdcPlot(Int_t)","ctbMain",this,"setADCPlot(Int_t)");
|
||||
adcs->Connect("AdcEnable(Int_t)","ctbMain",this,"setADCEnable(Int_t)");
|
||||
i_adcs=i_page++;
|
||||
|
||||
|
||||
cout << "pattern" << endl;
|
||||
|
||||
tf = mtab->AddTab("Pattern");
|
||||
page=new TGVerticalFrame(tf, 1500,1200);
|
||||
tf->AddFrame(page, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10,10,10,1));
|
||||
pat=new ctbPattern(page, myDet);
|
||||
pat->Connect("patternFileChanged(const char*)","ctbMain",this,"setPatternFile(const char*)");
|
||||
pat->Connect("patternCompilerChanged(const char*)","ctbMain",this,"setPatternCompiler(const char*)");
|
||||
pat->Connect("analogSamplesChanged(const int)","ctbMain",this,"setAnalogSamples(int)");
|
||||
pat->Connect("digitalSamplesChanged(const int)","ctbMain",this,"setDigitalSamples(int)");
|
||||
pat->Connect("readoutModeChanged(int)","ctbMain",this,"setReadoutMode(int)");
|
||||
|
||||
i_pat=i_page++;
|
||||
|
||||
cout << "acquisition" << endl;
|
||||
|
||||
tf = mtab->AddTab("Acquisition");
|
||||
page=new TGVerticalFrame(tf, 1500,1200);
|
||||
tf->AddFrame(page, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10,10,10,1));
|
||||
acq=new ctbAcquisition(page, myDet);
|
||||
|
||||
|
||||
i_acq=i_page++;
|
||||
|
||||
|
||||
// cout << "actions" << endl;
|
||||
// tf = mtab->AddTab("Actions");
|
||||
// page=new TGVerticalFrame(tf, 1500,1200);
|
||||
// tf->AddFrame(page, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10,10,10,1));
|
||||
// actions=new ctbActions(page, myDet);
|
||||
|
||||
|
||||
// i_actions=i_page++;
|
||||
|
||||
|
||||
|
||||
cout << "tabs finished" << endl;
|
||||
|
||||
hpage->AddFrame(mtab,new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10,10,10,1));
|
||||
|
||||
vframe->AddFrame(hpage,new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10,10,10,1));
|
||||
|
||||
AddFrame(vframe,new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10,10,10,1));
|
||||
vframe->MapWindow();
|
||||
hpage->MapWindow();
|
||||
mtab->MapWindow();
|
||||
page->MapWindow();
|
||||
|
||||
// Sets window name and shows the main frame
|
||||
cout << "dockabel" << endl;
|
||||
TGDockableFrame *fdock=new TGDockableFrame(hpage);
|
||||
hpage->AddFrame(fdock, new TGLayoutHints(kLHintsBottom | kLHintsCenterX | kLHintsExpandX | kLHintsExpandY, 10,10,10,10));
|
||||
fdock->MapWindow();
|
||||
|
||||
cout << "canvas" << endl;
|
||||
// // Creates widgets of the example
|
||||
|
||||
|
||||
fEcanvas = new TRootEmbeddedCanvas ("Ecanvas",fdock,800,800);//hpage,800,800);
|
||||
//fEcanvas = new TRootEmbeddedCanvas ("Ecanvas",this,800,800);//hpage,800,800);
|
||||
// fEcanvas->Resize();
|
||||
// fEcanvas->GetCanvas()->Update();
|
||||
//AddFrame(fEcanvas, new TGLayoutHints(kLHintsBottom | kLHintsCenterX | kLHintsExpandX | kLHintsExpandY, 10,10,10,10));
|
||||
|
||||
// // hpage->
|
||||
fdock->AddFrame(fEcanvas, new TGLayoutHints(kLHintsBottom | kLHintsCenterX | kLHintsExpandX | kLHintsExpandY, 10,10,10,10));
|
||||
|
||||
|
||||
fEcanvas->MapWindow();
|
||||
|
||||
acq->setCanvas(getCanvas());
|
||||
|
||||
|
||||
|
||||
hpage->MapSubwindows();
|
||||
mtab->Connect("Selected(Int_t)","ctbMain",this,"tabSelected(Int_t)");
|
||||
|
||||
|
||||
|
||||
cout << "connect mtab" << endl;
|
||||
|
||||
|
||||
setReadoutMode(pat->getReadoutMode());
|
||||
setADCEnable(adcs->setEnable());
|
||||
setAnalogSamples(pat->getAnalogSamples());
|
||||
setDigitalSamples(pat->getDigitalSamples());
|
||||
|
||||
tabSelected(0);
|
||||
|
||||
SetWindowName("CTB Gui");
|
||||
MapSubwindows();
|
||||
Resize(1500,1200);
|
||||
|
||||
MapWindow();
|
||||
}
|
||||
|
||||
void ctbMain::CloseWindow() {
|
||||
gApplication->Terminate();
|
||||
}
|
||||
|
||||
TCanvas* ctbMain::getCanvas() {
|
||||
return fEcanvas->GetCanvas();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ctbMain::HandleMenu(Int_t id)
|
||||
{
|
||||
// Handle menu items.
|
||||
|
||||
|
||||
|
||||
|
||||
switch (id) {
|
||||
|
||||
case 0: // fMenuFile->AddEntry("Open Alias", im++);
|
||||
cout << "Open Alias" << endl;
|
||||
{
|
||||
static TString dir(".");
|
||||
TGFileInfo fi;
|
||||
//fi.fFileTypes = filetypes;
|
||||
fi.fIniDir = StrDup(dir);
|
||||
printf("fIniDir = %s\n", fi.fIniDir);
|
||||
new TGFileDialog(gClient->GetRoot(), this, kFDOpen, &fi);
|
||||
printf("Open file: %s (dir: %s)\n", fi.fFilename);
|
||||
// dir = fi.fIniDir;
|
||||
if (fi.fFilename)
|
||||
loadAlias(fi.fFilename);
|
||||
}
|
||||
break;
|
||||
|
||||
case 1: // fMenuFile->AddEntry("Save Alias", im++);
|
||||
cout << "Save Alias" << endl;
|
||||
{
|
||||
static TString dir(".");
|
||||
TGFileInfo fi;
|
||||
//fi.fFileTypes = filetypes;
|
||||
fi.fIniDir = StrDup(dir);
|
||||
printf("fIniDir = %s\n", fi.fIniDir);
|
||||
new TGFileDialog(gClient->GetRoot(), this, kFDSave, &fi);
|
||||
printf("Save file: %s (dir: %s)\n", fi.fFilename);
|
||||
// dir = fi.fIniDir;
|
||||
if (fi.fFilename)
|
||||
saveAlias(fi.fFilename);
|
||||
}
|
||||
break;
|
||||
|
||||
case 2: //fMenuFile->AddEntry("Open Parameters", im++);
|
||||
cout << "Open Parameters" << endl;
|
||||
{
|
||||
static TString dir(".");
|
||||
TGFileInfo fi;
|
||||
//fi.fFileTypes = filetypes;
|
||||
fi.fIniDir = StrDup(dir);
|
||||
printf("fIniDir = %s\n", fi.fIniDir);
|
||||
new TGFileDialog(gClient->GetRoot(), this, kFDOpen, &fi);
|
||||
printf("Open file: %s (dir: %s)\n", fi.fFilename, fi.fIniDir);
|
||||
// dir = fi.fIniDir;
|
||||
if (fi.fFilename)
|
||||
loadParameters(fi.fFilename);
|
||||
}
|
||||
break;
|
||||
|
||||
case 3: //fMenuFile->AddEntry("Save Parameters", im++);
|
||||
cout << "Save Parameters" << endl;
|
||||
{
|
||||
static TString dir(".");
|
||||
TGFileInfo fi;
|
||||
//fi.fFileTypes = filetypes;
|
||||
fi.fIniDir = StrDup(dir);
|
||||
printf("fIniDir = %s\n", fi.fIniDir);
|
||||
new TGFileDialog(gClient->GetRoot(), this, kFDSave, &fi);
|
||||
printf("Open file: %s (dir: %s)\n", fi.fFilename, fi.fIniDir);
|
||||
// dir = fi.fIniDir;
|
||||
if (fi.fFilename)
|
||||
saveParameters(fi.fFilename);
|
||||
}
|
||||
break;
|
||||
|
||||
case 4: // fMenuFile->AddEntry("Open Configuration", im++);
|
||||
cout << "Open configuration" << endl;
|
||||
{
|
||||
static TString dir(".");
|
||||
TGFileInfo fi;
|
||||
//fi.fFileTypes = filetypes;
|
||||
fi.fIniDir = StrDup(dir);
|
||||
printf("fIniDir = %s\n", fi.fIniDir);
|
||||
new TGFileDialog(gClient->GetRoot(), this, kFDOpen, &fi);
|
||||
printf("Open file: %s (dir: %s)\n", fi.fFilename, fi.fIniDir);
|
||||
// dir = fi.fIniDir;
|
||||
if (fi.fFilename)
|
||||
loadConfiguration(fi.fFilename);
|
||||
}
|
||||
break;
|
||||
|
||||
case 5: // fMenuFile->AddEntry("Save Configuration", im++);
|
||||
cout << "Save configuration" << endl;
|
||||
{
|
||||
static TString dir(".");
|
||||
TGFileInfo fi;
|
||||
//fi.fFileTypes = filetypes;
|
||||
fi.fIniDir = StrDup(dir);
|
||||
printf("fIniDir = %s\n", fi.fIniDir);
|
||||
new TGFileDialog(gClient->GetRoot(), this, kFDSave, &fi);
|
||||
printf("Open file: %s (dir: %s)\n", fi.fFilename, fi.fIniDir);
|
||||
// dir = fi.fIniDir;
|
||||
if (fi.fFilename)
|
||||
saveConfiguration(fi.fFilename);
|
||||
}
|
||||
break;
|
||||
|
||||
case 6: //fMenuFile->AddEntry("Open Pattern", im++);
|
||||
cout << "Open pattern" << endl;
|
||||
{
|
||||
static TString dir(".");
|
||||
TGFileInfo fi;
|
||||
//fi.fFileTypes = filetypes;
|
||||
fi.fIniDir = StrDup(dir);
|
||||
printf("fIniDir = %s\n", fi.fIniDir);
|
||||
new TGFileDialog(gClient->GetRoot(), this, kFDOpen, &fi);
|
||||
printf("Open file: %s (dir: %s)\n", fi.fFilename, fi.fIniDir);
|
||||
// dir = fi.fIniDir;
|
||||
if (fi.fFilename)
|
||||
loadParameters(fi.fFilename);
|
||||
}
|
||||
break;
|
||||
|
||||
case 7: //fMenuFile->AddEntry("Save Pattern", im++);
|
||||
cout << "Save pattern" << endl;
|
||||
{
|
||||
static TString dir(".");
|
||||
TGFileInfo fi;
|
||||
//fi.fFileTypes = filetypes;
|
||||
fi.fIniDir = StrDup(dir);
|
||||
printf("fIniDir = %s\n", fi.fIniDir);
|
||||
new TGFileDialog(gClient->GetRoot(), this, kFDSave, &fi);
|
||||
printf("Open file: %s (dir: %s)\n", fi.fFilename, fi.fIniDir);
|
||||
// dir = fi.fIniDir;
|
||||
if (fi.fFilename)
|
||||
saveParameters(fi.fFilename);
|
||||
}
|
||||
break;
|
||||
|
||||
case 8: // fMenuFile->AddEntry("Exit", im++);
|
||||
CloseWindow();
|
||||
|
||||
default:
|
||||
printf("Menu item %d selected\n", id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
int ctbMain::setADCPlot(Int_t i) {
|
||||
|
||||
// cout << "ADC " << i << " plot or color toggled" << endl;
|
||||
// acq->setGraph(i,adcs->getGraph(i));
|
||||
acq->setGraph(i,adcs->getEnabled(i),adcs->getColor(i));
|
||||
|
||||
}
|
||||
|
||||
|
||||
int ctbMain::setSignalPlot(Int_t i) {
|
||||
|
||||
// cout << "ADC " << i << " plot or color toggled" << endl;
|
||||
// acq->setGraph(i,adcs->getGraph(i));
|
||||
acq->setBitGraph(i,sig->getPlot(i),sig->getColor(i));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
int ctbMain::loadConfiguration(string fname) {
|
||||
|
||||
myDet->readConfigurationFile(fname);
|
||||
|
||||
// string line;
|
||||
// int i;
|
||||
// ifstream myfile (fname.c_str());
|
||||
// if (myfile.is_open())
|
||||
// {
|
||||
// while ( getline (myfile,line) )
|
||||
// {
|
||||
|
||||
|
||||
|
||||
// }
|
||||
// myfile.close();
|
||||
// }
|
||||
|
||||
// else cout << "Unable to open file";
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
int ctbMain::saveConfiguration(string fname) {
|
||||
|
||||
|
||||
myDet->writeConfigurationFile(fname);
|
||||
// string line;
|
||||
// int i;
|
||||
// ofstream myfile (fname.c_str());
|
||||
// if (myfile.is_open())
|
||||
// {
|
||||
|
||||
|
||||
// myfile.close();
|
||||
// }
|
||||
|
||||
// else cout << "Unable to open file";
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
int ctbMain::loadParameters(string fname) {
|
||||
|
||||
myDet->retrieveDetectorSetup(fname);
|
||||
|
||||
// string line;
|
||||
// int i;
|
||||
// ifstream myfile (fname.c_str());
|
||||
// if (myfile.is_open())
|
||||
// {
|
||||
// while ( getline (myfile,line) )
|
||||
// {
|
||||
|
||||
|
||||
|
||||
// }
|
||||
// myfile.close();
|
||||
// }
|
||||
|
||||
// else cout << "Unable to open file";
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
int ctbMain::saveParameters(string fname) {
|
||||
|
||||
|
||||
string line;
|
||||
int i;
|
||||
myDet->dumpDetectorSetup(fname);
|
||||
// ofstream myfile (fname.c_str());
|
||||
// if (myfile.is_open())
|
||||
// {
|
||||
|
||||
// myfile << dacs->getDacParameters();
|
||||
// myfile << sig->getSignalParameters();
|
||||
// myfile << adcs->getAdcParameters();
|
||||
|
||||
// myfile.close();
|
||||
// }
|
||||
|
||||
// else cout << "Unable to open file";
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
int ctbMain::loadAlias(string fname) {
|
||||
|
||||
|
||||
string line;
|
||||
char aaaa[1000];
|
||||
int i;
|
||||
ifstream myfile (fname.c_str());
|
||||
if (myfile.is_open())
|
||||
{
|
||||
while ( getline (myfile,line) )
|
||||
{
|
||||
// cout << line ;
|
||||
if (sscanf(line.c_str(),"BIT%d",&i)>0) {
|
||||
//cout << "*******" << line<< endl;
|
||||
sig->setSignalAlias(line);
|
||||
// cout << line ;
|
||||
} else if (sscanf(line.c_str(),"DAC%d",&i)>0) {
|
||||
dacs->setDacAlias(line);
|
||||
// cout << "+++++++++" << line<< endl;
|
||||
} else if (sscanf(line.c_str(),"ADC%d",&i)>0) {
|
||||
adcs->setAdcAlias(line);
|
||||
// cout << "---------" << line<< endl;
|
||||
} // else
|
||||
// cout << "<<<<<<<" << line << endl;
|
||||
else if (sscanf(line.c_str(),"PAT%s",aaaa)>0) {
|
||||
pat->setPatternAlias(line);
|
||||
// cout << "---------" << line<< endl;
|
||||
} else if (sscanf(line.c_str(),"V%s",&i)>0) {
|
||||
if (pwrs) pwrs->setPwrAlias(line);
|
||||
// cout << "+++++++++" << line<< endl;
|
||||
} else if (sscanf(line.c_str(),"SENSE%d",&i)>0) {
|
||||
if (senses) senses->setSlowAdcAlias(line);
|
||||
// cout << "+++++++++" << line<< endl;
|
||||
}
|
||||
|
||||
}
|
||||
myfile.close();
|
||||
}
|
||||
|
||||
else cout << "Unable to open file";
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
int ctbMain::saveAlias(string fname) {
|
||||
|
||||
|
||||
string line;
|
||||
int i;
|
||||
ofstream myfile (fname.c_str());
|
||||
if (myfile.is_open())
|
||||
{
|
||||
//while ( getline (myfile,line) )
|
||||
// {
|
||||
// cout << line ;
|
||||
//if (sscanf(line.c_str(),"BIT%d",&i)>0) {
|
||||
//cout << "*******" << line<< endl;
|
||||
myfile << sig->getSignalAlias();
|
||||
// cout << line ;
|
||||
// } else if (sscanf(line.c_str(),"DAC%d",&i)>0) {
|
||||
myfile << dacs->getDacAlias();
|
||||
if (pwrs) myfile << pwrs->getPwrAlias();
|
||||
if (senses) myfile << senses->getSlowAdcAlias();
|
||||
// cout << "+++++++++" << line<< endl;
|
||||
// } else if (sscanf(line.c_str(),"ADC%d",&i)>0) {
|
||||
myfile << adcs->getAdcAlias();
|
||||
// cout << "---------" << line<< endl;
|
||||
// } // else
|
||||
// cout << "<<<<<<<" << line << endl;
|
||||
myfile << pat->getPatternAlias();
|
||||
|
||||
//}
|
||||
myfile.close();
|
||||
}
|
||||
|
||||
else cout << "Unable to open file";
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void ctbMain::tabSelected(Int_t i) {
|
||||
|
||||
// cout << "Selected tab " << i << endl;
|
||||
// cout << "Current tab is " << mtab->GetCurrent() << endl;
|
||||
|
||||
if (i==i_dacs) dacs->update();
|
||||
else if (i==i_pwrs) pwrs->update();
|
||||
else if (i==i_senses) ;//senses->update();
|
||||
else if (i==i_sig) sig->update();
|
||||
else if (i==i_adcs) adcs->update();
|
||||
else if (i==i_pat) pat->update();
|
||||
else if (i==i_acq) acq->update();
|
||||
else if (i==i_acq) acq->update();
|
||||
// else if (i==i_actions) actions->update();
|
||||
else cout << "Unknown tab " << i << endl;
|
||||
|
||||
|
||||
}
|
||||
|
||||
void ctbMain::setPatternFile(const char* t) {
|
||||
acq->setPatternFile(t);
|
||||
|
||||
}
|
||||
|
||||
void ctbMain::setPatternCompiler(const char* t) {
|
||||
acq->setPatternCompiler(t);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void ctbMain::setAnalogSamples(const int n) {
|
||||
acq->setAnalogSamples(n);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void ctbMain::setDigitalSamples(const int n) {
|
||||
acq->setDigitalSamples(n);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void ctbMain::setReadoutMode(int flags) {
|
||||
acq->setReadoutMode(flags);
|
||||
}
|
||||
|
||||
void ctbMain::setADCEnable(Int_t reg){
|
||||
acq->setADCEnable(reg);
|
||||
}
|
126
ctbGui/ctbMain.h
126
ctbGui/ctbMain.h
@ -1,126 +0,0 @@
|
||||
#ifndef CTBMAIN_H
|
||||
#define CTBMAIN_H
|
||||
#include <TGFrame.h>
|
||||
|
||||
|
||||
class TRootEmbeddedCanvas;
|
||||
class TGButtonGroup;
|
||||
class TGVerticalFrame;
|
||||
class TGHorizontalFrame;
|
||||
class TGTextEntry;
|
||||
class TGLabel;
|
||||
class TGNumberEntry;
|
||||
class TH2F;
|
||||
class TGComboBox;
|
||||
class TGCheckButton;
|
||||
|
||||
class THStack;
|
||||
class TGraphErrors;
|
||||
class TGTextButton;
|
||||
class TGTab;
|
||||
|
||||
class TGMenuBar;
|
||||
class TGPopupMenu;
|
||||
class TGDockableFrame;
|
||||
class TGLayoutHints;
|
||||
class TGCanvas;
|
||||
class TCanvas;
|
||||
|
||||
class ctbDacs;
|
||||
class ctbSlowAdcs;
|
||||
class ctbPowers;
|
||||
|
||||
|
||||
class ctbSignals;
|
||||
|
||||
class multiSlsDetector;
|
||||
|
||||
class ctbPattern;
|
||||
class ctbAdcs;
|
||||
class ctbAcquisition;
|
||||
//class ctbActions;
|
||||
|
||||
#include <string>
|
||||
using namespace std;
|
||||
|
||||
class ctbMain : public TGMainFrame {
|
||||
private:
|
||||
|
||||
|
||||
multiSlsDetector *myDet;
|
||||
|
||||
|
||||
|
||||
TRootEmbeddedCanvas *fEcanvas;
|
||||
TRootEmbeddedCanvas *fModulecanvas;
|
||||
TGButtonGroup *br;
|
||||
|
||||
TGTab *mtab;
|
||||
|
||||
|
||||
ctbDacs *dacs;
|
||||
int i_dacs;
|
||||
|
||||
ctbPowers *pwrs;
|
||||
int i_pwrs;
|
||||
|
||||
ctbSlowAdcs *senses;
|
||||
int i_senses;
|
||||
|
||||
|
||||
ctbSignals *sig;
|
||||
int i_sig;
|
||||
|
||||
|
||||
ctbAdcs *adcs;
|
||||
int i_adcs;
|
||||
|
||||
|
||||
ctbPattern *pat;
|
||||
int i_pat;
|
||||
|
||||
ctbAcquisition *acq;
|
||||
int i_acq;
|
||||
|
||||
// ctbActions *actions;
|
||||
int i_actions;
|
||||
|
||||
TGDockableFrame *fMenuDock;
|
||||
|
||||
TGMenuBar *fMenuBar;
|
||||
TGPopupMenu *fMenuFile, *fMenuTest, *fMenuView, *fMenuHelp;
|
||||
TGPopupMenu *fCascadeMenu, *fCascade1Menu, *fCascade2Menu;
|
||||
TGPopupMenu *fMenuNew1, *fMenuNew2;
|
||||
TGLayoutHints *fMenuBarLayout, *fMenuBarItemLayout, *fMenuBarHelpLayout;
|
||||
TGCanvas *myCanvas;
|
||||
|
||||
|
||||
public:
|
||||
ctbMain(const TGWindow *p, multiSlsDetector *det);
|
||||
|
||||
|
||||
int loadAlias(string fname);
|
||||
int saveAlias(string fname);
|
||||
int loadParameters(string fname);
|
||||
int saveParameters(string fname);
|
||||
int loadConfiguration(string fname);
|
||||
int saveConfiguration(string fname);
|
||||
void tabSelected(Int_t);
|
||||
int setADCPlot(Int_t);
|
||||
int setSignalPlot(Int_t);
|
||||
void CloseWindow();
|
||||
|
||||
void setPatternFile(const char* t);
|
||||
|
||||
void setPatternCompiler(const char* t);
|
||||
void setAnalogSamples(const int);
|
||||
void setDigitalSamples(const int);
|
||||
void setReadoutMode(int);
|
||||
void setADCEnable(Int_t);
|
||||
|
||||
void HandleMenu(Int_t);
|
||||
TCanvas* getCanvas();
|
||||
ClassDef(ctbMain,0)
|
||||
};
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
@ -1,176 +0,0 @@
|
||||
#ifndef CTBPATTERN_H
|
||||
#define CTBPATTERN_H
|
||||
#include <TGFrame.h>
|
||||
|
||||
|
||||
#define NLOOPS 3
|
||||
#define NWAITS 3
|
||||
#define NADCS 32
|
||||
#define PATLEN 1024
|
||||
|
||||
class TRootEmbeddedCanvas;
|
||||
class TGButtonGroup;
|
||||
class TGVerticalFrame;
|
||||
class TGHorizontalFrame;
|
||||
class TGTextEntry;
|
||||
class TGLabel;
|
||||
class TGNumberEntry;
|
||||
class TH2F;
|
||||
class TGComboBox;
|
||||
class TGCheckButton;
|
||||
class TGTextEntry;
|
||||
class TGCheckButton;
|
||||
|
||||
class THStack;
|
||||
class TGraphErrors;
|
||||
class energyCalibration;
|
||||
class TGTextButton;
|
||||
class TGTab;
|
||||
|
||||
class multiSlsDetector;
|
||||
|
||||
|
||||
#include <string>
|
||||
using namespace std;
|
||||
|
||||
|
||||
|
||||
class ctbLoop : public TGHorizontalFrame {
|
||||
|
||||
|
||||
private:
|
||||
|
||||
TGNumberEntry *eLoopStartAddr;
|
||||
TGNumberEntry *eLoopStopAddr;
|
||||
TGNumberEntry *eLoopNumber;
|
||||
|
||||
int id;
|
||||
|
||||
multiSlsDetector *myDet;
|
||||
|
||||
public:
|
||||
ctbLoop(TGGroupFrame *page, int i,multiSlsDetector *det);
|
||||
|
||||
void setNLoops();
|
||||
void update();
|
||||
|
||||
ClassDef(ctbLoop,0)
|
||||
};
|
||||
|
||||
class ctbWait : public TGHorizontalFrame {
|
||||
|
||||
|
||||
private:
|
||||
|
||||
TGNumberEntry *eWaitAddr;
|
||||
TGNumberEntry *eWaitTime;
|
||||
|
||||
int id;
|
||||
|
||||
multiSlsDetector *myDet;
|
||||
|
||||
public:
|
||||
ctbWait(TGGroupFrame *page, int i,multiSlsDetector *det);
|
||||
|
||||
void setWaitTime();
|
||||
void update();
|
||||
|
||||
ClassDef(ctbWait,0)
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class ctbPattern : public TGGroupFrame {
|
||||
private:
|
||||
|
||||
|
||||
TGNumberEntry *eAdcClkFreq;
|
||||
TGNumberEntry *eRunClkFreq;
|
||||
TGNumberEntry *eDBitClkFreq;
|
||||
TGNumberEntry *eAdcClkPhase;
|
||||
TGNumberEntry *eDBitClkPhase;
|
||||
//TGNumberEntry *eRunClkPhase;
|
||||
|
||||
TGNumberEntry *eStartAddr;
|
||||
TGNumberEntry *eStopAddr;
|
||||
TGNumberEntry *eFrames;
|
||||
TGNumberEntry *ePeriod;
|
||||
TGNumberEntry *eCycles;
|
||||
// TGNumberEntry *eMeasurements;
|
||||
TGNumberEntry *eAdcPipeline;
|
||||
TGNumberEntry *eDBitPipeline;
|
||||
|
||||
ctbLoop *eLoop[NLOOPS];
|
||||
ctbWait *eWait[NWAITS];
|
||||
|
||||
TGTextEntry *patternCompiler;
|
||||
TGTextEntry *patternFile;
|
||||
|
||||
TGTextButton *browseCompiler;
|
||||
TGTextButton *browseFile;
|
||||
|
||||
|
||||
TGNumberEntry *eAnalogSamples;
|
||||
TGNumberEntry *eDigitalSamples;
|
||||
|
||||
TGCheckButton *cbAnalog;
|
||||
TGCheckButton *cbDigital;
|
||||
|
||||
char pat[PATLEN*8];
|
||||
|
||||
multiSlsDetector *myDet;
|
||||
|
||||
public:
|
||||
|
||||
ctbPattern(TGVerticalFrame *page, multiSlsDetector *det);
|
||||
|
||||
void update();
|
||||
void setAdcFreq();
|
||||
void setRunFreq();
|
||||
void setDBitFreq();
|
||||
void setAdcPhase();
|
||||
void setDBitPhase();
|
||||
// void setRunPhase();
|
||||
void setAdcPipeline();
|
||||
void setDBitPipeline();
|
||||
void setFrames();
|
||||
void setCycles();
|
||||
// void setMeasurements();
|
||||
void setPeriod();
|
||||
|
||||
|
||||
void chooseCompiler();
|
||||
void choosePattern();
|
||||
|
||||
string getCompiler();
|
||||
string getPatternFile();
|
||||
|
||||
void setPatternAlias(string);
|
||||
string getPatternAlias();
|
||||
|
||||
|
||||
int getAnalogSamples();
|
||||
void setAnalogSamples();
|
||||
int getDigitalSamples();
|
||||
void setDigitalSamples();
|
||||
void setReadoutMode(Bool_t);
|
||||
int getReadoutMode();
|
||||
|
||||
|
||||
void setFile();
|
||||
void setCompiler();
|
||||
void patternFileChanged(const char*);
|
||||
void patternCompilerChanged(const char*);
|
||||
void analogSamplesChanged(const int t);
|
||||
void digitalSamplesChanged(const int t);
|
||||
void readoutModeChanged(int);
|
||||
|
||||
|
||||
ClassDef(ctbPattern,0)
|
||||
};
|
||||
|
||||
#endif
|
@ -1,243 +0,0 @@
|
||||
#include <TGFrame.h>
|
||||
|
||||
|
||||
#include <TGButtonGroup.h>
|
||||
#include <TGNumberEntry.h>
|
||||
#include <TGLabel.h>
|
||||
#include <TList.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
#include "ctbDacs.h"
|
||||
#include "ctbPowers.h"
|
||||
#include "multiSlsDetector.h"
|
||||
#include "sls_detector_defs.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
|
||||
ctbPower::ctbPower(TGGroupFrame* f, int i, multiSlsDetector* d)
|
||||
: ctbDac(f, i, d)
|
||||
{
|
||||
cout << "****************************************************************power " << i << endl;
|
||||
dacsUnit->SetOn(kTRUE);
|
||||
dacsUnit->SetEnabled(kFALSE);
|
||||
int ii=0;
|
||||
|
||||
switch(i) {
|
||||
case slsDetectorDefs::V_POWER_IO:
|
||||
dacsLabel->SetText("VIO");
|
||||
ii=slsDetectorDefs::I_POWER_IO;
|
||||
break;
|
||||
case slsDetectorDefs::V_POWER_A:
|
||||
dacsLabel->SetText("VA");
|
||||
ii=slsDetectorDefs::I_POWER_A;
|
||||
break;
|
||||
case slsDetectorDefs::V_POWER_B:
|
||||
dacsLabel->SetText("VB");
|
||||
ii=slsDetectorDefs::I_POWER_B;
|
||||
break;
|
||||
case slsDetectorDefs::V_POWER_C:
|
||||
dacsLabel->SetText("VC");
|
||||
ii=slsDetectorDefs::I_POWER_C;
|
||||
break;
|
||||
case slsDetectorDefs::V_POWER_D:
|
||||
dacsLabel->SetText("VD");
|
||||
ii=slsDetectorDefs::I_POWER_D;
|
||||
break;
|
||||
case slsDetectorDefs::V_POWER_CHIP:
|
||||
dacsLabel->SetText("VCHIP");
|
||||
dacsLabel->SetEnabled(kFALSE);
|
||||
ii=-1;
|
||||
break;
|
||||
default:
|
||||
dacsLabel->SetText("Bad index");
|
||||
ii=-1;
|
||||
break;
|
||||
};
|
||||
|
||||
// ctbSlowAdc *vm=new ctbSlowAdc(f,i,d);
|
||||
// vm->setLabel("V: ");
|
||||
// if (ii>=0) {
|
||||
// ctbSlowAdc *im=new ctbSlowAdc(f,ii,d);
|
||||
// im->setLabel("I: ");
|
||||
// }
|
||||
|
||||
TGTextEntry *e=dacsEntry->TGNumberEntry::GetNumberEntry();
|
||||
e->Disconnect ("ReturnPressed()");
|
||||
e->Disconnect ("ValueSet(Long_t)");
|
||||
|
||||
e->Connect("ReturnPressed()","ctbPower",this,"setValue()");
|
||||
dacsEntry->Connect("ValueSet(Long_t)","ctbPower",this,"setValue(Long_t)");
|
||||
};
|
||||
|
||||
|
||||
string ctbPower::getLabel() {
|
||||
|
||||
ostringstream line;
|
||||
switch (id) {
|
||||
case slsDetectorDefs::V_POWER_IO:
|
||||
line << "VIO";
|
||||
break;
|
||||
case slsDetectorDefs::V_POWER_A:
|
||||
line << "VA";
|
||||
break;
|
||||
case slsDetectorDefs::V_POWER_B:
|
||||
line << "VB";
|
||||
break;
|
||||
case slsDetectorDefs::V_POWER_C:
|
||||
line << "VC";
|
||||
break;
|
||||
case slsDetectorDefs::V_POWER_D:
|
||||
line << "VD";
|
||||
break;
|
||||
case slsDetectorDefs::V_POWER_CHIP:
|
||||
line << "VCHIP";
|
||||
break;
|
||||
default:
|
||||
line << "VBAD";
|
||||
break;
|
||||
|
||||
}
|
||||
line << " " << dacsLabel->GetText() << endl;
|
||||
return line.str();
|
||||
|
||||
}
|
||||
|
||||
|
||||
void ctbPower::setValue(Long_t a) {cout << "ssssssssss" << endl; ctbPower::setValue();}
|
||||
void ctbPower::setValue() {
|
||||
|
||||
|
||||
cout << "***************************Setting power " << dacsEntry->GetIntNumber() << " " << (slsDetectorDefs::dacIndex)id <<" " << 1 << endl;
|
||||
myDet->setDAC(dacsEntry->GetIntNumber(), (slsDetectorDefs::dacIndex)id, 1);
|
||||
|
||||
getValue();
|
||||
|
||||
}
|
||||
|
||||
|
||||
int ctbPower::getValue() {
|
||||
|
||||
int val=myDet->setDAC(-1, (slsDetectorDefs::dacIndex)id, 1);
|
||||
char s[100];
|
||||
cout << "****************************Getting power " << val << " " << (slsDetectorDefs::dacIndex)id <<" " << 1 << endl;
|
||||
sprintf(s,"%d",val);
|
||||
dacsValue->SetText(s);
|
||||
if (val>0) {
|
||||
if (id!=slsDetectorDefs::V_POWER_CHIP)
|
||||
dacsLabel->SetOn(kTRUE);
|
||||
} else {
|
||||
dacsLabel->SetOn(kFALSE);
|
||||
}
|
||||
|
||||
|
||||
return val;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
ctbPowers::ctbPowers(TGVerticalFrame* page, multiSlsDetector* det) : TGGroupFrame(page,"Power Supplies",kVerticalFrame) , myDet(det){
|
||||
|
||||
|
||||
SetTitlePos(TGGroupFrame::kLeft);
|
||||
page->AddFrame(this,new TGLayoutHints( kLHintsTop | kLHintsExpandX , 10,10,10,10));
|
||||
MapWindow();
|
||||
|
||||
// cout << "window mapped " << endl;
|
||||
|
||||
for (int idac=0; idac<NPOWERS; idac++) {
|
||||
dacs[idac]=new ctbPower(this, slsDetectorDefs::V_POWER_A+idac, myDet);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int ctbPowers::setPwrAlias(string line) {
|
||||
|
||||
int is=-1, mv=0;
|
||||
char tit[100];
|
||||
int narg;
|
||||
|
||||
if (sscanf(line.c_str(),"VA %s",tit)) {
|
||||
dacs[0]->setLabel(tit,1);
|
||||
is=0;
|
||||
}
|
||||
|
||||
if (sscanf(line.c_str(),"VB %s",tit)) {
|
||||
dacs[1]->setLabel(tit,1);
|
||||
is=1;
|
||||
}
|
||||
|
||||
if (sscanf(line.c_str(),"VC %s",tit)) {
|
||||
dacs[2]->setLabel(tit,1);
|
||||
is=2;
|
||||
}
|
||||
|
||||
if (sscanf(line.c_str(),"VD %s",tit)) {
|
||||
dacs[3]->setLabel(tit,1);
|
||||
is=3;
|
||||
}
|
||||
|
||||
if (sscanf(line.c_str(),"VIO %s",tit)) {
|
||||
dacs[4]->setLabel(tit,1);
|
||||
is=4;
|
||||
}
|
||||
|
||||
if (sscanf(line.c_str(),"VCHIP %s",tit)) {
|
||||
dacs[5]->setLabel(tit,1);
|
||||
is=5;
|
||||
}
|
||||
|
||||
return is;
|
||||
|
||||
}
|
||||
|
||||
string ctbPowers::getPwrAlias() {
|
||||
|
||||
ostringstream line;
|
||||
|
||||
for (int i=0; i<NPOWERS; i++)
|
||||
line << dacs[i]->getLabel() << endl;
|
||||
return line.str();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
string ctbPowers::getPwrParameters() {
|
||||
|
||||
|
||||
ostringstream line;
|
||||
line << "v_a" << " " << dacs[0]->getValue() << " mv" << endl;
|
||||
line << "v_b" << " " << dacs[1]->getValue() << " mv" << endl;
|
||||
line << "v_c" << " " << dacs[2]->getValue() << " mv" << endl;
|
||||
line << "v_d" << " " << dacs[3]->getValue() << " mv" << endl;
|
||||
line << "v_io" << " " << dacs[4]->getValue() << " mv" << endl;
|
||||
line << "v_chip" << " " << dacs[5]->getValue() << " mv" << endl;
|
||||
// for (int i=0; i<POWERS; i++) {
|
||||
// //line << "dacs:" << i << " " << dacs[i]->getValue << endl;
|
||||
// line << "dac:" << i << " " << dacs[i]->getValue() << endl;
|
||||
// }
|
||||
return line.str();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ctbPowers::update() {
|
||||
|
||||
for (int idac=0; idac<NPOWERS; idac++) {
|
||||
|
||||
dacs[idac]->getValue();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,72 +0,0 @@
|
||||
#ifndef CTBPOWERS_H
|
||||
#define CTBPOWERS_H
|
||||
|
||||
#include <TGFrame.h>
|
||||
|
||||
#ifndef CTB
|
||||
#define NPOWERS 0
|
||||
#else
|
||||
|
||||
#define NPOWERS 6
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class TGTextEntry;
|
||||
class TGLabel;
|
||||
class TGNumberEntry;
|
||||
class TGCheckButton;
|
||||
|
||||
|
||||
|
||||
|
||||
class multiSlsDetector;
|
||||
|
||||
|
||||
#include <string>
|
||||
using namespace std;
|
||||
|
||||
|
||||
class ctbPower : public ctbDac {
|
||||
|
||||
|
||||
|
||||
|
||||
public:
|
||||
|
||||
ctbPower(TGGroupFrame* f, int i, multiSlsDetector* d);
|
||||
|
||||
string getLabel();
|
||||
|
||||
int getValue();
|
||||
void setValue();
|
||||
void setValue(Long_t);
|
||||
|
||||
ClassDef(ctbPower,0)
|
||||
};
|
||||
|
||||
|
||||
class ctbPowers : public TGGroupFrame
|
||||
{
|
||||
private:
|
||||
|
||||
ctbPower *dacs[NPOWERS];
|
||||
|
||||
multiSlsDetector* myDet;
|
||||
|
||||
public:
|
||||
//ctbPowers();
|
||||
ctbPowers(TGVerticalFrame*, multiSlsDetector*);
|
||||
|
||||
int setPwrAlias(string);
|
||||
string getPwrAlias();
|
||||
string getPwrParameters();
|
||||
|
||||
void update();
|
||||
|
||||
ClassDef(ctbPowers,0)
|
||||
};
|
||||
|
||||
#endif
|
@ -1,548 +0,0 @@
|
||||
#include <TApplication.h>
|
||||
#include <TGClient.h>
|
||||
#include <TCanvas.h>
|
||||
#include <TF1.h>
|
||||
#include <TRandom.h>
|
||||
#include <TGButton.h>
|
||||
#include <TRootEmbeddedCanvas.h>
|
||||
#include <TGButtonGroup.h>
|
||||
#include <TGNumberEntry.h>
|
||||
#include <TGLabel.h>
|
||||
#include <TList.h>
|
||||
#include <TGFileDialog.h>
|
||||
#include <TGComboBox.h>
|
||||
#include <TH2F.h>
|
||||
#include <TColor.h>
|
||||
#include <TH1F.h>
|
||||
#include <TGraphErrors.h>
|
||||
#include <THStack.h>
|
||||
#include <TGTab.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <TGButton.h>
|
||||
#include <TRootEmbeddedCanvas.h>
|
||||
#include <TGButtonGroup.h>
|
||||
#include <TGNumberEntry.h>
|
||||
#include <TGLabel.h>
|
||||
#include <stdio.h>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <TColor.h>
|
||||
#include <TGColorSelect.h>
|
||||
|
||||
|
||||
#include "ctbSignals.h"
|
||||
#include "multiSlsDetector.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
|
||||
//#define DEFAULTFN "run_0.encal"
|
||||
|
||||
|
||||
ctbSignal::ctbSignal(TGFrame *page, int i, multiSlsDetector *det)
|
||||
: TGHorizontalFrame(page, 800,50), myDet(det), id(i), hsig(NULL) {
|
||||
|
||||
|
||||
TGHorizontalFrame *hframe=this;
|
||||
char tit[100];
|
||||
|
||||
|
||||
|
||||
sprintf(tit, "BIT%d ",id);
|
||||
|
||||
sLabel= new TGLabel(hframe, tit);
|
||||
hframe->AddFrame( sLabel,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 1, 1, 1, 1));
|
||||
sLabel->MapWindow();
|
||||
sLabel->SetTextJustify(kTextLeft);
|
||||
|
||||
|
||||
|
||||
sOutput= new TGCheckButton(hframe, "Out");
|
||||
hframe->AddFrame( sOutput,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 1, 1, 1, 1));
|
||||
sOutput->MapWindow();
|
||||
|
||||
|
||||
sOutput->Connect("Toggled(Bool_t)","ctbSignal",this,"ToggledOutput(Bool_t)");
|
||||
|
||||
sDbitList= new TGCheckButton(hframe, "DB List");
|
||||
hframe->AddFrame( sDbitList,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 1, 1, 1, 1));
|
||||
sDbitList->MapWindow();
|
||||
|
||||
sDbitList->Connect("Toggled(Bool_t)","ctbSignal",this,"ToggledDbitList(Bool_t)");
|
||||
|
||||
|
||||
sPlot= new TGCheckButton(hframe, "Plot");
|
||||
hframe->AddFrame( sPlot,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 1, 1, 1, 1));
|
||||
sPlot->MapWindow();
|
||||
|
||||
sPlot->Connect("Toggled(Bool_t)","ctbSignal",this,"ToggledPlot(Bool_t)");
|
||||
|
||||
fColorSel = new TGColorSelect(hframe, id+1, 0);
|
||||
fColorSel->Connect("ColorSelected(Pixel_t)","ctbSignal",this,"ColorChanged(Pixel_t)");
|
||||
hframe->AddFrame(fColorSel, new TGLayoutHints(kLHintsTop |
|
||||
kLHintsLeft, 2, 0, 2, 2));
|
||||
|
||||
|
||||
fColorSel->SetColor(TColor::Number2Pixel(id+1));
|
||||
|
||||
|
||||
ToggledOutput(kFALSE);
|
||||
|
||||
|
||||
ToggledPlot(kFALSE);
|
||||
|
||||
// if (id==63) {
|
||||
// sOutput->SetOn(kTRUE);
|
||||
// sOutput->SetEnabled(kFALSE);
|
||||
// }
|
||||
// #ifdef CTB
|
||||
// if (id==62) {
|
||||
// sOutput->SetOn(kTRUE);
|
||||
// sOutput->SetEnabled(kFALSE);
|
||||
// }
|
||||
|
||||
// // if (id>=32 && id<48)
|
||||
// // fixOutput(1);
|
||||
// // else if (id>=48 && id<64)
|
||||
// // fixOutput(0);
|
||||
|
||||
// #endif
|
||||
}
|
||||
int ctbSignal::setSignalAlias(char *tit, int plot, int col) {
|
||||
|
||||
if (tit)
|
||||
sLabel->SetText(tit);
|
||||
|
||||
if (plot>0) {
|
||||
sPlot->SetOn(kTRUE,kTRUE);
|
||||
} else if (plot==0)
|
||||
sPlot->SetOn(kFALSE,kTRUE);
|
||||
|
||||
if (col>=0)
|
||||
fColorSel->SetColor(col);//TColor::Number2Pixel(col+1));
|
||||
|
||||
fColorSel->SetEnabled(sPlot->IsOn());
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
string ctbSignal::getSignalAlias() {
|
||||
|
||||
|
||||
ostringstream oss;
|
||||
oss << "BIT" << dec << id << " " << sLabel->GetText()->Data() << " " << sPlot->IsOn() << hex << " " << fColorSel->GetColor() << endl;
|
||||
return oss.str();
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
int ctbSignal::setOutput(Long64_t r) {
|
||||
|
||||
|
||||
// cout << hex << r << dec <<endl;
|
||||
|
||||
Long64_t mask=((Long64_t)1<<id);
|
||||
|
||||
if (r&mask)
|
||||
sOutput->SetOn(kTRUE,kTRUE);
|
||||
else
|
||||
sOutput->SetOn(kFALSE,kTRUE);
|
||||
|
||||
return sOutput->IsOn();
|
||||
|
||||
}
|
||||
|
||||
int ctbSignal::fixOutput(int i) {
|
||||
|
||||
if (i) {
|
||||
sPlot->SetOn(kFALSE);
|
||||
//sClock->SetOn(kFALSE,kTRUE);
|
||||
sOutput->SetOn(kTRUE);
|
||||
// sPlot->SetEnabled(kFALSE);
|
||||
// sClock->SetEnabled(kTRUE);
|
||||
} else {
|
||||
sOutput->SetOn(kFALSE,kTRUE);
|
||||
// sClock->SetOn(kFALSE);
|
||||
// sClock->SetEnabled(kFALSE);
|
||||
sPlot->SetEnabled(kTRUE);
|
||||
}
|
||||
sOutput->SetEnabled(kFALSE);
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
int ctbSignal::setDbitList(Long64_t r) {
|
||||
|
||||
Long64_t mask=((Long64_t)1<<id);
|
||||
|
||||
// cout << hex << r << dec <<endl;
|
||||
|
||||
if (r)
|
||||
sDbitList->SetOn(kTRUE,kFALSE);
|
||||
else
|
||||
sDbitList->SetOn(kFALSE,kFALSE);
|
||||
|
||||
return sDbitList->IsOn();
|
||||
|
||||
}
|
||||
|
||||
int ctbSignal::isDbitList() { return sDbitList->IsOn();}
|
||||
int ctbSignal::isOutput() { return sOutput->IsOn();}
|
||||
int ctbSignal::isPlot() { return sPlot->IsOn();}
|
||||
Pixel_t ctbSignal::getColor(){return fColorSel->GetColor();}
|
||||
|
||||
void ctbSignal::ToggledOutput(Bool_t b) {
|
||||
Long_t mask=b<<id;
|
||||
ToggledSignalOutput(id);
|
||||
if (b) {
|
||||
// sClock->SetEnabled(kTRUE);
|
||||
sPlot->SetOn(kFALSE);
|
||||
// sPlot->SetEnabled(kFALSE);
|
||||
fColorSel->SetEnabled(kFALSE);
|
||||
} else {
|
||||
// sClock->SetEnabled(kFALSE);
|
||||
// sClock->SetOn(kFALSE);
|
||||
sPlot->SetEnabled(kTRUE);
|
||||
if ( sPlot->IsOn())
|
||||
fColorSel->SetEnabled(kFALSE);
|
||||
else
|
||||
fColorSel->SetEnabled(kTRUE);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void ctbSignal::ToggledDbitList(Bool_t b){
|
||||
Long_t mask=id;
|
||||
ToggledSignalDbitList(mask);
|
||||
}
|
||||
|
||||
|
||||
void ctbSignal::ToggledPlot(Bool_t b){
|
||||
Long_t mask=b<<id;
|
||||
ToggledSignalPlot(mask);
|
||||
fColorSel->SetEnabled(b);
|
||||
}
|
||||
|
||||
void ctbSignal::ColorChanged(Pixel_t p){
|
||||
ToggledSignalPlot(id);
|
||||
}
|
||||
|
||||
|
||||
void ctbSignal::ToggledSignalOutput(Int_t b) {
|
||||
cout << "Toggle signal " << id << " " << b << " " << sOutput->IsOn() <<endl;;
|
||||
Emit("ToggledSignalOutput(Int_t)", id);
|
||||
}
|
||||
|
||||
void ctbSignal::ToggledSignalDbitList(Int_t b){
|
||||
cout << "Toggle dbitlist " << id << " " << b << endl;;
|
||||
Emit("ToggledSignalDbitList(Int_t)", id);
|
||||
}
|
||||
|
||||
void ctbSignal::ToggledSignalPlot(Int_t b){
|
||||
Emit("ToggledSignalPlot(Int_t)", id);
|
||||
}
|
||||
|
||||
|
||||
ctbSignals::ctbSignals(TGVerticalFrame *page, multiSlsDetector *det)
|
||||
: TGGroupFrame(page,"IO Signals",kVerticalFrame), myDet(det) {
|
||||
|
||||
|
||||
SetTitlePos(TGGroupFrame::kLeft);
|
||||
page->AddFrame(this,new TGLayoutHints( kLHintsTop | kLHintsExpandX , 10,10,10,10));
|
||||
MapWindow();
|
||||
|
||||
|
||||
TGHorizontalFrame *hframe;
|
||||
char tit[100];
|
||||
|
||||
TGHorizontalFrame* hhframe=new TGHorizontalFrame(this, 800,800);
|
||||
AddFrame(hhframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
|
||||
hhframe->MapWindow();
|
||||
|
||||
TGVerticalFrame *vframe;
|
||||
|
||||
|
||||
|
||||
|
||||
int idac=0;
|
||||
for (idac=0; idac<NSIGNALS; idac++) {
|
||||
if (idac%((NSIGNALS+2)/2)==0) {
|
||||
vframe=new TGVerticalFrame(hhframe, 400,800);
|
||||
hhframe->AddFrame(vframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
|
||||
vframe->MapWindow();
|
||||
}
|
||||
|
||||
|
||||
signals[idac]=new ctbSignal(vframe,idac,myDet);
|
||||
signals[idac]->Connect("ToggledSignalOutput(Int_t)","ctbSignals",this,"ToggledOutReg(Int_t)");
|
||||
signals[idac]->Connect("ToggledSignalDbitList(Int_t)","ctbSignals",this,"ToggledDbitList(Int_t)");
|
||||
signals[idac]->Connect("ToggledSignalPlot(Int_t)","ctbSignals",this,"ToggledPlot(Int_t)");
|
||||
|
||||
vframe->AddFrame(signals[idac],new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
|
||||
signals[idac]->MapWindow();
|
||||
|
||||
|
||||
}
|
||||
|
||||
// #ifdef CTB
|
||||
// idac=62;
|
||||
// signals[idac]=new ctbSignal(vframe,idac,myDet);
|
||||
// vframe->AddFrame(signals[idac],new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
|
||||
// signals[idac]->MapWindow();
|
||||
// sprintf(tit,"DBIT Latch");
|
||||
|
||||
// signals[idac]->setSignalAlias(tit,-1,-1);
|
||||
|
||||
// signals[idac]->Connect("ToggledSignalOutput(Int_t)","ctbSignals",this,"ToggledOutReg(Int_t)");
|
||||
// signals[idac]->Connect("ToggledSignalDbitList(Int_t)","ctbSignals",this,"ToggledDbitList(Int_t)");
|
||||
// signals[idac]->Connect("ToggledSignalPlot(Int_t)","ctbSignals",this,"ToggledPlot(Int_t)");
|
||||
|
||||
|
||||
// #endif
|
||||
|
||||
|
||||
// idac=63;
|
||||
// signals[idac]=new ctbSignal(vframe,idac,myDet);
|
||||
// vframe->AddFrame(signals[idac],new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
|
||||
// signals[idac]->MapWindow();
|
||||
// sprintf(tit,"ADC Latch");
|
||||
|
||||
// signals[idac]->setSignalAlias(tit,-1,-1);
|
||||
|
||||
// signals[idac]->Connect("ToggledSignalOutput(Int_t)","ctbSignals",this,"ToggledOutReg(Int_t)");
|
||||
// signals[idac]->Connect("ToggledSignalDbitList(Int_t)","ctbSignals",this,"ToggledDbitList(Int_t)");
|
||||
// signals[idac]->Connect("ToggledSignalPlot(Int_t)","ctbSignals",this,"ToggledPlot(Int_t)");
|
||||
|
||||
|
||||
hframe=new TGHorizontalFrame(vframe, 800,50);
|
||||
vframe->AddFrame(hframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
|
||||
hframe->MapWindow();
|
||||
|
||||
|
||||
TGLabel *label= new TGLabel(hframe, "IO Control Register: ");
|
||||
hframe->AddFrame(label,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 1, 1, 1, 1));
|
||||
label->MapWindow();
|
||||
label->SetTextJustify(kTextLeft);
|
||||
|
||||
|
||||
eIOCntrlRegister = new TGNumberEntry(hframe, 0, 16,999, TGNumberFormat::kNESHex,
|
||||
TGNumberFormat::kNEANonNegative,
|
||||
TGNumberFormat::kNELNoLimits);
|
||||
|
||||
hframe->AddFrame(eIOCntrlRegister,new TGLayoutHints(kLHintsTop | kLHintsExpandX, 1, 1, 1, 1));
|
||||
eIOCntrlRegister->MapWindow();
|
||||
eIOCntrlRegister->Resize(150,30);
|
||||
|
||||
|
||||
|
||||
|
||||
hframe=new TGHorizontalFrame(vframe, 800,50);
|
||||
vframe->AddFrame(hframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
|
||||
hframe->MapWindow();
|
||||
|
||||
|
||||
label= new TGLabel(hframe, "DBit Offset: ");
|
||||
hframe->AddFrame(label,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 1, 1, 1, 1));
|
||||
label->MapWindow();
|
||||
label->SetTextJustify(kTextLeft);
|
||||
|
||||
|
||||
eDbitOffset = new TGNumberEntry(hframe, 0, 9,999, TGNumberFormat::kNESInteger,
|
||||
TGNumberFormat::kNEANonNegative,
|
||||
TGNumberFormat::kNELNoLimits);
|
||||
|
||||
hframe->AddFrame(eDbitOffset,new TGLayoutHints(kLHintsTop | kLHintsExpandX, 1, 1, 1, 1));
|
||||
eDbitOffset->MapWindow();
|
||||
eDbitOffset->Resize(150,30);
|
||||
|
||||
|
||||
TGTextEntry *e= eDbitOffset->TGNumberEntry::GetNumberEntry();
|
||||
e->Connect("ReturnPressed()","ctbSignals",this,"setDbitOffset()");
|
||||
|
||||
e->Connect("ValueSet(Long_t)","ctbSignals",this,"setDbitOffset(Long_t)");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int ctbSignals::setSignalAlias(string line) {
|
||||
|
||||
int is=-1, plot=0, col=-1;
|
||||
char tit[100];
|
||||
int narg=sscanf(line.c_str(),"BIT%d %s %d %d",&is,tit,&plot,&col);
|
||||
if (narg<2)
|
||||
return -1;
|
||||
if (is>=0 && is<NIOSIGNALS) {
|
||||
signals[is]->setSignalAlias(tit,plot,col);
|
||||
}
|
||||
return is;
|
||||
|
||||
}
|
||||
|
||||
string ctbSignals::getSignalAlias() {
|
||||
|
||||
ostringstream oss;
|
||||
for (int is=0; is<NIOSIGNALS; is++)
|
||||
oss << signals[is]->getSignalAlias() << endl;
|
||||
|
||||
|
||||
return oss.str();
|
||||
|
||||
}
|
||||
|
||||
|
||||
void ctbSignals::update() {
|
||||
Long64_t oreg=myDet->setPatternIOControl();//setCTBWord(-1,-1);
|
||||
// Long64_t creg=myDet->setPatternClockControl();//setCTBWord(-2,-1);
|
||||
|
||||
|
||||
char val[1000];
|
||||
cout << hex << oreg << dec << endl;
|
||||
// cout << hex << creg << dec << endl;
|
||||
|
||||
sprintf(val,"%llX",oreg);
|
||||
// eIOCntrlRegister->SetHexNumber(oreg);
|
||||
|
||||
|
||||
for (int idac=0; idac<NIOSIGNALS; idac++) {
|
||||
signals[idac]->setOutput(oreg);
|
||||
|
||||
}
|
||||
|
||||
Long64_t mask;
|
||||
std::vector <int> dbitlist=myDet->getReceiverDbitList();
|
||||
if (dbitlist.empty())
|
||||
for (int is=0; is<64; is++) {
|
||||
signals[is]->setDbitList(1);
|
||||
}
|
||||
else {
|
||||
for (int is=0; is<64; is++) signals[is]->setDbitList(0);
|
||||
for (const auto &value : dbitlist) {
|
||||
signals[value]->setDbitList(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
eDbitOffset->SetNumber(myDet->getReceiverDbitOffset());
|
||||
|
||||
}
|
||||
|
||||
|
||||
string ctbSignals::getSignalParameters() {
|
||||
|
||||
|
||||
ostringstream line;
|
||||
line << "patioctrl " << hex << myDet->setPatternIOControl() << dec << endl;//setCTBWord(-1,-1)
|
||||
return line.str();
|
||||
|
||||
|
||||
}
|
||||
|
||||
void ctbSignals::ToggledOutReg(Int_t mask) {
|
||||
|
||||
char val[1000];
|
||||
Long64_t oreg=myDet->setPatternIOControl();//setCTBWord(-1,-1);
|
||||
Long64_t m=((Long64_t)1)<<mask;
|
||||
|
||||
|
||||
cout << dec << sizeof(Long64_t) << " " << mask << " " << hex << m << " ioreg " << oreg;
|
||||
|
||||
|
||||
|
||||
if (signals[mask]->isOutput()) {
|
||||
cout << " or " << m ;
|
||||
oreg|=m;
|
||||
} else {
|
||||
cout << " not " << ~m ;
|
||||
oreg&=~m;
|
||||
}
|
||||
cout << " after " << oreg << endl;
|
||||
|
||||
myDet->setPatternIOControl(oreg);//setCTBWord(-1,oreg);
|
||||
oreg=myDet->setPatternIOControl();//myDet->setCTBWord(-1,-1);
|
||||
|
||||
cout << dec << sizeof(Long64_t) << " " << mask << " " << hex << m << " ioreg " << oreg << endl;
|
||||
|
||||
sprintf(val,"%llX",oreg);
|
||||
// eIOCntrlRegister->SetHexNumber(oreg);
|
||||
eIOCntrlRegister->SetText(val);
|
||||
// eIOCntrlRegister->SetNumber(oreg);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ctbSignals::ToggledDbitList(Int_t mask){
|
||||
|
||||
|
||||
|
||||
cout << "************* Here" << endl;
|
||||
|
||||
|
||||
|
||||
std::vector <int> new_dbitlist;
|
||||
std::vector <int> old_dbitlist=myDet->getReceiverDbitList();
|
||||
|
||||
char val[1000];
|
||||
Long64_t m=((Long64_t)1)<<mask;
|
||||
|
||||
if (old_dbitlist.empty() && signals[mask]->isDbitList())
|
||||
;
|
||||
else {
|
||||
int ns=0;
|
||||
for (int is=0; is<64; is++) {
|
||||
if (signals[is]->isDbitList()){
|
||||
new_dbitlist.push_back(is);
|
||||
ns++;
|
||||
cout << is << " " << ns << endl;
|
||||
}
|
||||
}
|
||||
if (ns>63) new_dbitlist.clear();
|
||||
myDet->setReceiverDbitList(new_dbitlist);
|
||||
}
|
||||
std::vector <int> dbitlist=myDet->getReceiverDbitList();
|
||||
if (dbitlist.empty())
|
||||
for (int is=0; is<64; is++) signals[is]->setDbitList(1);
|
||||
else
|
||||
for (int is=0; is<64; is++) signals[is]->setDbitList(0);
|
||||
for (const auto &value : dbitlist) signals[value]->setDbitList(1);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void ctbSignals::ToggledPlot(Int_t b) {
|
||||
|
||||
Emit("ToggledSignalPlot(Int_t)", b);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void ctbSignals::ToggledSignalPlot(Int_t b) {
|
||||
|
||||
Emit("ToggledSignalPlot(Int_t)", b);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Pixel_t ctbSignals::getColor(int i){
|
||||
if (i>=0 && i<NSIGNALS) return signals[i]->getColor();
|
||||
}
|
||||
|
||||
int ctbSignals::getPlot(int i){
|
||||
if (i>=0 && i<NSIGNALS) return signals[i]->isPlot();
|
||||
};
|
||||
|
||||
void ctbSignals::setDbitOffset(Long_t) {
|
||||
setDbitOffset();
|
||||
}
|
||||
void ctbSignals::setDbitOffset(){
|
||||
myDet->setReceiverDbitOffset(eDbitOffset->GetNumber());
|
||||
}
|
@ -1,118 +0,0 @@
|
||||
#ifndef CTBSIGNALS_H
|
||||
#define CTBSIGNALS_H
|
||||
#include <TGFrame.h>
|
||||
|
||||
|
||||
#define NSIGNALS 64
|
||||
|
||||
#define NIOSIGNALS 64 //for moench board was 52
|
||||
|
||||
|
||||
#define ADCLATCH 63
|
||||
#define DIGSIGLATCH 62
|
||||
|
||||
|
||||
|
||||
|
||||
class TGTextEntry;
|
||||
class TGLabel;
|
||||
class TGNumberEntry;
|
||||
class TGCheckButton;
|
||||
class TH1I;
|
||||
class TGTextButton;
|
||||
class TGColorSelect;
|
||||
|
||||
|
||||
|
||||
class TGNumberEntry;
|
||||
class multiSlsDetector;
|
||||
class ctbSignal;
|
||||
|
||||
#include <string>
|
||||
using namespace std;
|
||||
|
||||
class ctbSignal : public TGHorizontalFrame {
|
||||
|
||||
// RQ_OBJECT("ctbSignal")
|
||||
|
||||
private:
|
||||
|
||||
TGLabel *sLabel;
|
||||
TGCheckButton *sOutput;
|
||||
TGCheckButton *sDbitList;
|
||||
TGCheckButton *sPlot;
|
||||
TGLabel *sValue;
|
||||
TGNumberEntry *sEntry;
|
||||
TGColorSelect *fColorSel;
|
||||
|
||||
multiSlsDetector *myDet;
|
||||
Int_t id;
|
||||
|
||||
TH1I *hsig;
|
||||
|
||||
public:
|
||||
|
||||
ctbSignal(TGFrame *page, int i, multiSlsDetector *det);
|
||||
int setSignalAlias(char *tit, int plot, int col);
|
||||
string getSignalAlias();
|
||||
|
||||
TH1I *getPlot() {return hsig;};
|
||||
int setOutput(Long64_t);
|
||||
int fixOutput(int);
|
||||
int setDbitList(Long64_t);
|
||||
|
||||
void ToggledOutput(Bool_t);
|
||||
void ToggledDbitList(Bool_t);
|
||||
void ToggledPlot(Bool_t);
|
||||
void ColorChanged(Pixel_t);
|
||||
|
||||
int isDbitList();
|
||||
int isOutput();
|
||||
int isPlot();
|
||||
Pixel_t getColor();
|
||||
|
||||
|
||||
void ToggledSignalOutput(Int_t); //*SIGNAL*
|
||||
void ToggledSignalDbitList(Int_t); //*SIGNAL*
|
||||
void ToggledSignalPlot(Int_t); //*SIGNAL*
|
||||
|
||||
|
||||
|
||||
ClassDef(ctbSignal,0)
|
||||
};
|
||||
|
||||
class ctbSignals : public TGGroupFrame {
|
||||
private:
|
||||
|
||||
ctbSignal *signals[NSIGNALS];
|
||||
|
||||
TGNumberEntry *eIOCntrlRegister;
|
||||
TGNumberEntry *eDbitOffset;
|
||||
|
||||
multiSlsDetector *myDet;
|
||||
|
||||
public:
|
||||
ctbSignals(TGVerticalFrame *page, multiSlsDetector *det);
|
||||
int setSignalAlias(string line);
|
||||
string getSignalAlias();
|
||||
|
||||
int getPlot(int);
|
||||
Pixel_t getColor(int);
|
||||
|
||||
void update();
|
||||
// void saveParameters();
|
||||
string getSignalParameters();
|
||||
|
||||
//void setDbitList(Int_t);
|
||||
void setDbitOffset(Long_t);
|
||||
void setDbitOffset();
|
||||
|
||||
void ToggledOutReg(Int_t);
|
||||
void ToggledDbitList(Int_t);
|
||||
void ToggledPlot(Int_t);
|
||||
void ToggledSignalPlot(Int_t); //*SIGNAL*
|
||||
|
||||
ClassDef(ctbSignals,0)
|
||||
};
|
||||
|
||||
#endif
|
@ -1,185 +0,0 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
#include <TGTextEntry.h>
|
||||
#include <TGLabel.h>
|
||||
#include <TGNumberEntry.h>
|
||||
#include <TGButton.h>
|
||||
|
||||
#include "ctbSlowAdcs.h"
|
||||
#include "multiSlsDetector.h"
|
||||
#include "sls_detector_defs.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
|
||||
|
||||
ctbSlowAdc::ctbSlowAdc(TGGroupFrame *page, int idac, multiSlsDetector *det) : TGHorizontalFrame(page, 800,50) , id(idac), myDet(det) {
|
||||
|
||||
|
||||
TGHorizontalFrame *hframe=this;
|
||||
|
||||
page->AddFrame(hframe,new TGLayoutHints(kLHintsTop | kLHintsExpandX , 1,1,1,1));
|
||||
MapWindow();
|
||||
|
||||
char tit[100];
|
||||
|
||||
|
||||
sprintf(tit, "SENSE %d:",idac-1000);
|
||||
|
||||
dacsLabel= new TGLabel(hframe, tit);// new TGLabel(hframe, tit);
|
||||
|
||||
|
||||
|
||||
hframe->AddFrame(dacsLabel,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 5, 5, 5, 5));
|
||||
dacsLabel->MapWindow();
|
||||
dacsLabel->SetTextJustify(kTextLeft);
|
||||
|
||||
|
||||
|
||||
|
||||
sprintf(tit, "xxx");
|
||||
dacsValue= new TGLabel(hframe, tit);
|
||||
hframe->AddFrame( dacsValue,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 5, 5, 5, 5));
|
||||
dacsValue->MapWindow();
|
||||
dacsValue->SetTextJustify(kTextLeft);
|
||||
|
||||
|
||||
|
||||
TGTextButton *b= new TGTextButton(hframe, "Update");
|
||||
hframe->AddFrame( b,new TGLayoutHints(kLHintsTop | kLHintsLeft| kLHintsExpandX, 5, 5, 5, 5));
|
||||
b->MapWindow();
|
||||
b->SetTextJustify(kTextLeft);
|
||||
|
||||
b->Connect("Clicked()","ctbSlowAdc",this,"getValue()");
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
int ctbSlowAdc::setLabel(char *tit) {
|
||||
if(tit)
|
||||
dacsLabel->SetText(tit);
|
||||
|
||||
|
||||
return id;
|
||||
|
||||
}
|
||||
|
||||
string ctbSlowAdc::getLabel() {
|
||||
|
||||
ostringstream line;
|
||||
line << dacsLabel->GetText() << endl;
|
||||
|
||||
// line << "DAC" << dec << id << " " << dacsUnit->IsOn() << endl;
|
||||
|
||||
return line.str();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
int ctbSlowAdc::getValue() {
|
||||
|
||||
int val=myDet->getADC((slsDetectorDefs::dacIndex)id);
|
||||
char s[100];
|
||||
cout << "adc " << id << " " << val << endl;
|
||||
sprintf(s,"%d mV",val);
|
||||
if (id==999)
|
||||
sprintf(s,"%d <20>C",val);
|
||||
dacsValue->SetText(s);
|
||||
|
||||
|
||||
|
||||
return val;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ctbSlowAdcs::ctbSlowAdcs(TGVerticalFrame *page, multiSlsDetector *det) : TGGroupFrame(page,"Sense",kVerticalFrame) , myDet(det){
|
||||
|
||||
|
||||
SetTitlePos(TGGroupFrame::kLeft);
|
||||
page->AddFrame(this,new TGLayoutHints( kLHintsTop | kLHintsExpandX , 10,10,10,10));
|
||||
MapWindow();
|
||||
|
||||
// cout << "window mapped " << endl;
|
||||
|
||||
|
||||
for (int idac=0; idac<NSLOWADCS; idac++) {
|
||||
|
||||
adcs[idac]=new ctbSlowAdc(this, idac+1000, myDet);
|
||||
|
||||
}
|
||||
adcs[NSLOWADCS]=new ctbSlowAdc(this, 999, myDet);
|
||||
adcs[NSLOWADCS]->setLabel("Temperature");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int ctbSlowAdcs::setSlowAdcAlias(string line) {
|
||||
|
||||
int is=-1, mv=0;
|
||||
char tit[100];
|
||||
int narg=sscanf(line.c_str(),"SENSE%d %s",&is,tit,&mv);
|
||||
if (narg<2)
|
||||
return -1;
|
||||
if (is>=0 && is<NSLOWADCS)
|
||||
adcs[is]->setLabel(tit);
|
||||
return is;
|
||||
|
||||
}
|
||||
|
||||
string ctbSlowAdcs::getSlowAdcAlias() {
|
||||
|
||||
ostringstream line;
|
||||
|
||||
for (int i=0; i<NSLOWADCS; i++)
|
||||
line << adcs[i]->getLabel() << endl;
|
||||
return line.str();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
string ctbSlowAdcs::getAdcParameters() {
|
||||
|
||||
|
||||
ostringstream line;
|
||||
|
||||
for (int i=0; i<NSLOWADCS; i++) {
|
||||
//line << "dacs:" << i << " " << dacs[i]->getValue << endl;
|
||||
line << "adc:" << i << " " << adcs[i]->getValue() << endl;
|
||||
}
|
||||
line << "adc:-1" << adcs[NSLOWADCS]->getValue() << endl;
|
||||
return line.str();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ctbSlowAdcs::update() {
|
||||
|
||||
|
||||
for (int idac=0; idac<NSLOWADCS+1; idac++) {
|
||||
|
||||
adcs[idac]->getValue();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,75 +0,0 @@
|
||||
|
||||
|
||||
#ifndef CTBSLOWADCS_H
|
||||
#define CTBSLOWADCS_H
|
||||
#include <TGFrame.h>
|
||||
|
||||
|
||||
//#define NDACS 16
|
||||
#define NSLOWADCS 8
|
||||
|
||||
|
||||
|
||||
|
||||
class TGTextEntry;
|
||||
class TGLabel;
|
||||
class TGNumberEntry;
|
||||
class TGCheckButton;
|
||||
class TGTextButton;
|
||||
|
||||
|
||||
|
||||
class multiSlsDetector;
|
||||
|
||||
#include <string>
|
||||
using namespace std;
|
||||
|
||||
class ctbSlowAdc : public TGHorizontalFrame {
|
||||
|
||||
|
||||
protected:
|
||||
// TGLabel *dacsLabel;
|
||||
// TGNumberEntry *dacsEntry;
|
||||
// TGCheckButton *dacsUnit;
|
||||
TGLabel *dacsLabel;
|
||||
TGLabel *dacsValue;
|
||||
int id;
|
||||
|
||||
multiSlsDetector* myDet;
|
||||
public:
|
||||
ctbSlowAdc(TGGroupFrame*, int , multiSlsDetector*);
|
||||
int getValue();
|
||||
|
||||
int setLabel(char *tit);
|
||||
string getLabel();
|
||||
|
||||
|
||||
|
||||
ClassDef(ctbSlowAdc,0)
|
||||
};
|
||||
|
||||
|
||||
class ctbSlowAdcs : public TGGroupFrame {
|
||||
private:
|
||||
|
||||
|
||||
|
||||
ctbSlowAdc *adcs[NSLOWADCS+1];
|
||||
|
||||
multiSlsDetector* myDet;
|
||||
|
||||
public:
|
||||
ctbSlowAdcs(TGVerticalFrame *page, multiSlsDetector*);
|
||||
|
||||
int setSlowAdcAlias(string line);
|
||||
// int setDacAlias(string line);
|
||||
string getSlowAdcAlias();
|
||||
string getAdcParameters();
|
||||
|
||||
void update();
|
||||
|
||||
ClassDef(ctbSlowAdcs,0)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -1,110 +0,0 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <sys/utsname.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
#include <math.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
int iarg;
|
||||
char fname[10000];
|
||||
uint64_t word;
|
||||
int val[64];
|
||||
int bit[64];
|
||||
FILE *fdin;
|
||||
|
||||
int nb=2;
|
||||
int off=0;
|
||||
int ioff=0;
|
||||
int dr=24;
|
||||
int idr=0;
|
||||
int ib=0;
|
||||
int iw=0;
|
||||
bit[0]=19;
|
||||
bit[1]=8;
|
||||
// for (iarg=0; iarg<argc; iarg++) printf("%d %s\n",iarg, argv[iarg]);
|
||||
|
||||
if (argc<2) printf("Error: usage is %s fname [dr off b0 b1 bn]\n");
|
||||
|
||||
if (argc>2) dr=atoi(argv[2]);
|
||||
if (argc>3) off=atoi(argv[3]);
|
||||
if (argc>4) {
|
||||
for (ib=0; ib<64; ib++) {
|
||||
if (argc>4+ib) {
|
||||
bit[ib]=atoi(argv[4+ib]);
|
||||
nb++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
idr=0;
|
||||
for (ib=0; ib<nb; ib++) {
|
||||
val[ib]=0;
|
||||
}
|
||||
|
||||
|
||||
fdin=fopen(argv[1],"rb");
|
||||
if (fdin==NULL) {
|
||||
printf("Cannot open input file %s for reading\n",argv[1]);
|
||||
return 200;
|
||||
}
|
||||
|
||||
while (fread((void*)&word, 8, 1, fdin)) {
|
||||
// printf("%llx\n",word);
|
||||
if (ioff<off) ioff++;
|
||||
else {
|
||||
|
||||
for (ib=0; ib<nb; ib++) {
|
||||
if (word&(1<<bit[ib])) val[ib]|=(1<<idr);
|
||||
}
|
||||
idr++;
|
||||
if (idr==dr) {
|
||||
idr=0;
|
||||
fprintf(stdout,"%d\t",iw++);
|
||||
for (ib=0; ib<nb; ib++) {
|
||||
#ifdef HEX
|
||||
fprintf(stdout,"%08llx\t",val[ib]);
|
||||
#else
|
||||
fprintf(stdout,"%lld\t",val[ib]);
|
||||
|
||||
#endif
|
||||
|
||||
val[ib]=0;
|
||||
}
|
||||
fprintf(stdout,"\n");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
if (idr!=0) {
|
||||
fprintf(stdout,"%d\t",iw++);
|
||||
for (ib=0; ib<nb; ib++) {
|
||||
#ifdef HEX
|
||||
fprintf(stdout,"%08llx\t",val[ib]);
|
||||
#else
|
||||
fprintf(stdout,"%lld\t",val[ib]);
|
||||
|
||||
#endif
|
||||
|
||||
val[ib]=0;
|
||||
}
|
||||
fprintf(stdout,"\n");
|
||||
}
|
||||
|
||||
fclose(fdin);
|
||||
|
||||
return 0;
|
||||
}
|
@ -1,67 +0,0 @@
|
||||
find_package(Doxygen)
|
||||
find_package(Sphinx)
|
||||
|
||||
|
||||
if (DOXYGEN_FOUND AND SPHINX_FOUND)
|
||||
|
||||
# #Utility to generate command line documentation
|
||||
add_executable(gendoc src/gendoc.cpp)
|
||||
target_link_libraries(gendoc PRIVATE
|
||||
slsDetectorShared
|
||||
)
|
||||
set_target_properties(gendoc PROPERTIES
|
||||
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
#Doxygen
|
||||
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
|
||||
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
|
||||
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
|
||||
|
||||
#Sphinx
|
||||
set(SPHINX_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
||||
set(SPHINX_BUILD ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
set(SPHINX_SOURCE_FILES
|
||||
src/commandline.rst
|
||||
src/container_utils.rst
|
||||
src/dependencies.rst
|
||||
src/detector.rst
|
||||
src/index.rst
|
||||
src/installation.rst
|
||||
src/pydetector.rst
|
||||
src/pyenums.rst
|
||||
src/pyexamples.rst
|
||||
src/receiver.rst
|
||||
src/result.rst
|
||||
src/type_traits.rst
|
||||
src/ToString.rst
|
||||
|
||||
)
|
||||
|
||||
foreach(filename ${SPHINX_SOURCE_FILES})
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${filename}
|
||||
"${SPHINX_BUILD}/${filename}")
|
||||
endforeach(filename ${SPHINX_SOURCE_FILES})
|
||||
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in"
|
||||
"${SPHINX_BUILD}/conf.py"
|
||||
@ONLY)
|
||||
|
||||
add_custom_target(docs
|
||||
gendoc
|
||||
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
|
||||
COMMAND ${SPHINX_EXECUTABLE} -a -b html
|
||||
-Dbreathe_projects.slsDetectorPackage=${CMAKE_CURRENT_BINARY_DIR}/xml
|
||||
-c "${SPHINX_BUILD}"
|
||||
${SPHINX_BUILD}/src
|
||||
${SPHINX_BUILD}/html
|
||||
COMMENT "Generating documentation with Sphinx")
|
||||
|
||||
else (DOXYGEN_FOUND AND SPHINX_FOUND)
|
||||
message("Doxygen and Sphinx are needed to build documentation")
|
||||
endif (DOXYGEN_FOUND AND SPHINX_FOUND)
|
2482
docs/Doxyfile.in
2482
docs/Doxyfile.in
File diff suppressed because it is too large
Load Diff
@ -1,62 +0,0 @@
|
||||
# Configuration file for the Sphinx documentation builder.
|
||||
#
|
||||
# This file only contains a selection of the most common options. For a full
|
||||
# list see the documentation:
|
||||
# http://www.sphinx-doc.org/en/master/config
|
||||
|
||||
# -- Path setup --------------------------------------------------------------
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
#
|
||||
import os
|
||||
import sys
|
||||
# sys.path.insert(0, os.path.abspath('.'))
|
||||
sys.path.insert(0, os.path.abspath('../bin/'))
|
||||
#sys.path.insert(0, '/home/l_frojdh/sls/build/bin')
|
||||
#sys.path.insert(0, @CMAKE_CURRENT_BINARY_DIR@)
|
||||
print(sys.path)
|
||||
|
||||
# -- Project information -----------------------------------------------------
|
||||
|
||||
project = 'slsDetectorPackage'
|
||||
copyright = '2019, PSD Detector Group'
|
||||
author = 'PSD Detector Group'
|
||||
version = '@PROJECT_VERSION@'
|
||||
|
||||
# -- General configuration ---------------------------------------------------
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
# ones.
|
||||
extensions = ['breathe',
|
||||
'sphinx_rtd_theme',
|
||||
'sphinx.ext.autodoc',
|
||||
'sphinx.ext.napoleon',
|
||||
]
|
||||
|
||||
breathe_default_project = "slsDetectorPackage"
|
||||
napoleon_use_ivar = True
|
||||
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
# This pattern also affects html_static_path and html_extra_path.
|
||||
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
|
||||
|
||||
|
||||
# -- Options for HTML output -------------------------------------------------
|
||||
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
#
|
||||
html_theme = "sphinx_rtd_theme"
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
#html_static_path = ['_static']
|
@ -1,6 +0,0 @@
|
||||
ToString
|
||||
==============
|
||||
|
||||
String conversion
|
||||
|
||||
.. doxygenfile:: ToString.h
|
@ -1,16 +0,0 @@
|
||||
Command line interface
|
||||
==============================================
|
||||
|
||||
Usage
|
||||
-------------
|
||||
|
||||
Commands can be uses either with sls_detector_get or sls_detector_put
|
||||
|
||||
.. code-block::
|
||||
|
||||
sls_detector_get vrf
|
||||
|
||||
Commands
|
||||
-----------
|
||||
|
||||
.. include:: ../commands.rst
|
@ -1,14 +0,0 @@
|
||||
ContainerUtils
|
||||
==================
|
||||
|
||||
Helper functions to handle standard container compliant
|
||||
containers. Supports array, vector, sls::Result etc.
|
||||
|
||||
While not a part of the public API we aim not to change this
|
||||
interface too much. However, we don't give the same strong
|
||||
guarantees as for Detector etc.
|
||||
|
||||
Any reoccurring container operation should probably be added to
|
||||
this file.
|
||||
|
||||
.. doxygenfile:: container_utils.h
|
@ -1,53 +0,0 @@
|
||||
Dependencies
|
||||
=========================
|
||||
|
||||
While we value few dependencies some libraries are required in
|
||||
order to not have to reinvent the wheel. Due to the state of package
|
||||
management in C++ we decided to bundle some of them with our source
|
||||
code. These are found in the libs/ directory.
|
||||
|
||||
-----------------------
|
||||
Core
|
||||
-----------------------
|
||||
To use the basic building blocks, meaning sls_detector_get/put and
|
||||
the shared libraries these are needed:
|
||||
|
||||
* Linux, preferably recent kernel (currently no cross platform support)
|
||||
* CMake > 3.9
|
||||
* C++11 compatible compiler. (We test with gcc and clang)
|
||||
* ZeroMQ version 4
|
||||
|
||||
-----------------------
|
||||
GUI
|
||||
-----------------------
|
||||
|
||||
The GUI is currently using Qt4 but watch out for an upgrade to 5.
|
||||
|
||||
* Qt 4.8
|
||||
* Qwt 6
|
||||
|
||||
-----------------------
|
||||
Python bindings
|
||||
-----------------------
|
||||
|
||||
* Python > 3.6
|
||||
* pybind11 (packaged in libs/)
|
||||
|
||||
|
||||
-----------------------
|
||||
Documentation
|
||||
-----------------------
|
||||
|
||||
The documentation that you are reading now is built with
|
||||
|
||||
* Doxygen (to extract C++ classes etc.)
|
||||
* Breathe (Sphinx plugin to handle doxygen xml)
|
||||
* Sphinx
|
||||
|
||||
-----------------------
|
||||
Packaged in libs/
|
||||
-----------------------
|
||||
|
||||
* catch2 (unit testing)
|
||||
* rapidjson (streaming from receiver)
|
||||
* pybind11 (python bindings)
|
@ -1,16 +0,0 @@
|
||||
Detector
|
||||
==============================================
|
||||
|
||||
The sls::Detector is the new public API to control
|
||||
detectors from C++. This API is also used internally
|
||||
for the Python bindings and the command line interface.
|
||||
If a receiver has been configured this is also controlled
|
||||
through this class.
|
||||
|
||||
Most, if not all, functions are called in parallel
|
||||
and the return value is a thin std::vector wrapper
|
||||
containing results from all modules. (Result<T>)
|
||||
|
||||
.. doxygenclass:: sls::Detector
|
||||
:members:
|
||||
:undoc-members:
|
@ -1,56 +0,0 @@
|
||||
/**
|
||||
* Utility program to generate input files for the command line
|
||||
* documentation. Uses the string returned from sls_detector_help cmd
|
||||
*
|
||||
*/
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
|
||||
#include "CmdProxy.h"
|
||||
#include "Detector.h"
|
||||
#include "sls_detector_defs.h"
|
||||
|
||||
std::string replace_all(const std::string &src, const std::string &from,
|
||||
const std::string &to) {
|
||||
|
||||
std::string results;
|
||||
std::string::const_iterator end = src.end();
|
||||
std::string::const_iterator current = src.begin();
|
||||
std::string::const_iterator next =
|
||||
std::search(current, end, from.begin(), from.end());
|
||||
while (next != end) {
|
||||
results.append(current, next);
|
||||
results.append(to);
|
||||
current = next + from.size();
|
||||
next = std::search(current, end, from.begin(), from.end());
|
||||
}
|
||||
results.append(current, next);
|
||||
return results;
|
||||
}
|
||||
|
||||
int main() {
|
||||
|
||||
std::cout << "Generating command line documentation!\n";
|
||||
|
||||
sls::CmdProxy<sls::Detector> proxy(nullptr);
|
||||
auto commands = proxy.GetProxyCommands();
|
||||
|
||||
std::ofstream fs("commands.rst");
|
||||
fs << ".. glossary::\n";
|
||||
|
||||
for (const auto &cmd : commands) {
|
||||
std::ostringstream os;
|
||||
proxy.Call(cmd, {}, -1, slsDetectorDefs::HELP_ACTION, os);
|
||||
|
||||
auto tmp = os.str().erase(0, cmd.size());
|
||||
auto usage = tmp.substr(0, tmp.find_first_of('\n'));
|
||||
tmp.erase(0, usage.size());
|
||||
auto help = replace_all(tmp, "\n\t", "\n\t\t");
|
||||
fs << '\t' << cmd << usage << help << "\n";
|
||||
}
|
||||
|
||||
}
|
@ -1,50 +0,0 @@
|
||||
.. slsDetectorPackage documentation master file, created by
|
||||
sphinx-quickstart on Mon Jul 29 17:38:15 2019.
|
||||
You can adapt this file completely to your liking, but it should at least
|
||||
contain the root `toctree` directive.
|
||||
|
||||
Welcome to slsDetectorPackage's documentation!
|
||||
==============================================
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:caption: Installation:
|
||||
|
||||
installation
|
||||
dependencies
|
||||
|
||||
.. toctree::
|
||||
:caption: C++ API
|
||||
:maxdepth: 2
|
||||
|
||||
detector
|
||||
result
|
||||
receiver
|
||||
|
||||
.. toctree::
|
||||
:caption: Python API
|
||||
:maxdepth: 2
|
||||
|
||||
pydetector
|
||||
pyenums
|
||||
pyexamples
|
||||
|
||||
.. toctree::
|
||||
:caption: Command line
|
||||
:maxdepth: 2
|
||||
|
||||
commandline
|
||||
|
||||
.. toctree::
|
||||
:caption: Developer
|
||||
|
||||
container_utils
|
||||
type_traits
|
||||
ToString
|
||||
|
||||
.. Indices and tables
|
||||
.. ==================
|
||||
|
||||
.. * :ref:`genindex`
|
||||
.. * :ref:`modindex`
|
||||
.. * :ref:`search`
|
@ -1,5 +0,0 @@
|
||||
|
||||
Installation
|
||||
==============================================
|
||||
|
||||
get the source etc.
|
@ -1,9 +0,0 @@
|
||||
Detector
|
||||
=====================================================
|
||||
|
||||
.. py:currentmodule:: sls_detector
|
||||
|
||||
.. autoclass:: ExperimentalDetector
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
@ -1,12 +0,0 @@
|
||||
Enums
|
||||
===========
|
||||
|
||||
These enums are defined in slsDetectorDefs in the C++ package and
|
||||
exposed to Python through pybind11.
|
||||
|
||||
.. py:currentmodule:: sls_detector
|
||||
|
||||
.. autoclass:: runStatus
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
@ -1,143 +0,0 @@
|
||||
Examples
|
||||
================
|
||||
|
||||
Some short hints on how to use the detector
|
||||
|
||||
------------------------
|
||||
Simple threshold scan
|
||||
------------------------
|
||||
|
||||
Assuming you have set up your detector with exposure time, period, enabled
|
||||
file writing etc.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from sls_detector import Eiger
|
||||
|
||||
d = Eiger()
|
||||
threshold = range(0, 2000, 200)
|
||||
for th in threshold:
|
||||
d.vthreshold = th
|
||||
d.acquire()
|
||||
|
||||
|
||||
If we want to control the shutter of for example, the big X-ray box we can add
|
||||
this line in our code. It then opens the shutter just before the measurement
|
||||
and closes is afterwards.
|
||||
|
||||
::
|
||||
|
||||
with xrf_shutter_open(box, 'Fe'):
|
||||
for th in threshold:
|
||||
d.vthreshold = th
|
||||
d.acquire()
|
||||
|
||||
|
||||
-----------------------
|
||||
Reading temperatures
|
||||
-----------------------
|
||||
|
||||
::
|
||||
|
||||
d.temp
|
||||
>>
|
||||
temp_fpga : 43.19°C, 51.83°C
|
||||
temp_fpgaext : 38.50°C, 38.50°C
|
||||
temp_10ge : 39.50°C, 39.50°C
|
||||
temp_dcdc : 42.50°C, 42.50°C
|
||||
temp_sodl : 39.50°C, 40.50°C
|
||||
temp_sodr : 39.50°C, 40.50°C
|
||||
temp_fpgafl : 40.87°C, 37.61°C
|
||||
temp_fpgafr : 34.51°C, 35.63°C
|
||||
|
||||
d.temp.fpga
|
||||
>> temp_fpga : 40.84°C, 39.31°C
|
||||
|
||||
t = d.temp.fpga[0]
|
||||
t
|
||||
>> 40.551
|
||||
|
||||
t = d.temp.fpga[:]
|
||||
t
|
||||
>> [40.566, 39.128]
|
||||
|
||||
|
||||
-----------------------
|
||||
Non blocking acquire
|
||||
-----------------------
|
||||
|
||||
There are mainly two ways to achieve a non blocking acquire when calling from the Python API. One is to manually start
|
||||
the detector and the second one is to launch the normal acquire from a different process. Depending on your measurement
|
||||
it might also be better to run the other task in a seperate process and use acq in the main thread.
|
||||
But lets start looking at the at the manual way:
|
||||
|
||||
::
|
||||
|
||||
import time
|
||||
from sls_detector import Eiger
|
||||
d = Eiger()
|
||||
|
||||
n = 10
|
||||
t = 1
|
||||
|
||||
d.exposure_time = t
|
||||
d.n_frames = n
|
||||
d.reset_frames_caught()
|
||||
|
||||
#Start the measurement
|
||||
t0 = time.time()
|
||||
d.start_receiver()
|
||||
d.start_detector()
|
||||
|
||||
#Wait for the detector to be ready or do other important stuff
|
||||
time.sleep(t*n)
|
||||
|
||||
#check if the detector is ready otherwise wait a bit longer
|
||||
while d.status != 'idle':
|
||||
time.sleep(0.1)
|
||||
|
||||
#Stop the receiver after we got the frames
|
||||
#Detector is already idle so we don't need to stop it
|
||||
d.stop_receiver()
|
||||
|
||||
lost = d.frames_caught - n
|
||||
print(f'{n} frames of {t}s took {time.time()-t0:{.3}}s with {lost} frames lost ')
|
||||
|
||||
#Reset to not interfere with a potential next measurement
|
||||
d.reset_frames_caught()
|
||||
|
||||
Instead launching d.acq() from a different process is a bit easier since the control of receiver and detector
|
||||
is handled in the acq call. However, you need to join the process used otherwise a lot of zombie processes would
|
||||
hang around until the main process exits.
|
||||
|
||||
::
|
||||
|
||||
import time
|
||||
from multiprocessing import Process
|
||||
from sls_detector import Eiger
|
||||
|
||||
def acquire():
|
||||
"""
|
||||
Create a new Eiger object that still referes to the same actual detector
|
||||
and same shared memory. Then launch acq.
|
||||
"""
|
||||
detector = Eiger()
|
||||
detector.acq()
|
||||
|
||||
#This is the detector we use throughout the session
|
||||
d = Eiger()
|
||||
|
||||
#Process to run acquire
|
||||
p = Process(target=acquire)
|
||||
|
||||
#Start the thread and short sleep to allow the acq to start
|
||||
p.start()
|
||||
time.sleep(0.01)
|
||||
|
||||
#Do some other work
|
||||
while d.busy is True:
|
||||
print(d.busy)
|
||||
time.sleep(0.1)
|
||||
|
||||
#Join the process
|
||||
p.join()
|
@ -1,6 +0,0 @@
|
||||
Receiver
|
||||
==============================================
|
||||
|
||||
.. doxygenclass:: slsReceiver
|
||||
:members:
|
||||
.. :undoc-members:
|
@ -1,4 +0,0 @@
|
||||
Result
|
||||
==============================================
|
||||
|
||||
.. doxygenfile:: Result.h
|
@ -1,7 +0,0 @@
|
||||
TypeTraits
|
||||
==============
|
||||
|
||||
Template meta functions in the same spirit as type_traits
|
||||
from the standard library.
|
||||
|
||||
.. doxygenfile:: TypeTraits.h
|
0
evalVersionVariables.sh
Executable file → Normal file
0
evalVersionVariables.sh
Executable file → Normal file
24
examples/ang.off
Executable file
24
examples/ang.off
Executable file
@ -0,0 +1,24 @@
|
||||
module 0 center 6.395E+02 +- 0.00E+00 conversion 6.5660E-05 +- 7.10E-09 offset 0.00000 +- 0.00015
|
||||
module 1 center 6.395E+02 +- 0.00E+00 conversion 6.5650E-05 +- 7.09E-09 offset 5.00211 +- 0.00015
|
||||
module 2 center 6.395E+02 +- 0.00E+00 conversion 6.5625E-05 +- 7.09E-09 offset 10.00733 +- 0.00015
|
||||
module 3 center 6.395E+02 +- 0.00E+00 conversion 6.5618E-05 +- 7.09E-09 offset 15.00742 +- 0.00015
|
||||
module 4 center 6.395E+02 +- 0.00E+00 conversion 6.5642E-05 +- 7.15E-09 offset 20.00620 +- 0.00015
|
||||
module 5 center 6.395E+02 +- 0.00E+00 conversion 6.5612E-05 +- 7.09E-09 offset 25.00281 +- 0.00015
|
||||
module 6 center 6.395E+02 +- 0.00E+00 conversion 6.5623E-05 +- 6.93E-09 offset 30.00704 +- 0.00015
|
||||
module 7 center 6.395E+02 +- 0.00E+00 conversion 6.5605E-05 +- 7.10E-09 offset 34.99715 +- 0.00015
|
||||
module 8 center 6.395E+02 +- 0.00E+00 conversion 6.5643E-05 +- 7.21E-09 offset 39.99533 +- 0.00015
|
||||
module 9 center 6.395E+02 +- 0.00E+00 conversion 6.5638E-05 +- 7.09E-09 offset 44.99969 +- 0.00015
|
||||
module 10 center 6.395E+02 +- 0.00E+00 conversion 6.5638E-05 +- 6.94E-09 offset 49.99859 +- 0.00015
|
||||
module 11 center 6.395E+02 +- 0.00E+00 conversion 6.5644E-05 +- 7.10E-09 offset 54.99499 +- 0.00015
|
||||
module 12 center 6.395E+02 +- 0.00E+00 conversion 6.5618E-05 +- 7.09E-09 offset 59.99120 +- 0.00015
|
||||
module 13 center 6.395E+02 +- 0.00E+00 conversion 6.5607E-05 +- 7.11E-09 offset 64.98880 +- 0.00015
|
||||
module 14 center 6.395E+02 +- 0.00E+00 conversion 6.5609E-05 +- 7.09E-09 offset 69.98205 +- 0.00015
|
||||
module 15 center 6.395E+02 +- 0.00E+00 conversion 6.5611E-05 +- 7.09E-09 offset 74.98379 +- 0.00015
|
||||
module 16 center 6.395E+02 +- 0.00E+00 conversion 6.5619E-05 +- 4.72E-09 offset 79.98559 +- 0.00015
|
||||
module 17 center 6.395E+02 +- 0.00E+00 conversion 6.5604E-05 +- 7.09E-09 offset 84.98376 +- 0.00015
|
||||
module 18 center 6.395E+02 +- 0.00E+00 conversion 6.5605E-05 +- 7.09E-09 offset 89.98307 +- 0.00015
|
||||
module 19 center 6.395E+02 +- 0.00E+00 conversion 6.5616E-05 +- 7.09E-09 offset 94.98907 +- 0.00015
|
||||
module 20 center 6.395E+02 +- 0.00E+00 conversion 6.5634E-05 +- 7.08E-09 offset 99.97965 +- 0.00015
|
||||
module 21 center 6.395E+02 +- 0.00E+00 conversion 6.5608E-05 +- 4.16E-09 offset 104.99732 +- 0.00016
|
||||
module 22 center 6.395E+02 +- 0.00E+00 conversion 6.5608E-05 +- 7.09E-09 offset 109.98646 +- 0.00015
|
||||
module 23 center 6.395E+02 +- 0.00E+00 conversion 6.5649E-05 +- 7.09E-09 offset 114.98765 +- 0.00015
|
5
examples/bad.chans
Normal file
5
examples/bad.chans
Normal file
@ -0,0 +1,5 @@
|
||||
15
|
||||
1528
|
||||
5000
|
||||
6513
|
||||
|
0
examples/config_gen_script/beb_31_25.config_gen
Executable file → Normal file
0
examples/config_gen_script/beb_31_25.config_gen
Executable file → Normal file
0
examples/config_gen_script/eiger_2m_1gb.config_gen
Executable file → Normal file
0
examples/config_gen_script/eiger_2m_1gb.config_gen
Executable file → Normal file
@ -1,39 +0,0 @@
|
||||
hostname hostname1+hostname2+hostname3+hostname55+
|
||||
header_var1 wow
|
||||
header_var2 great
|
||||
header_var3 very nice
|
||||
|
||||
0:counter1 100
|
||||
0:counter2 1024
|
||||
0:counter3 1500
|
||||
0:forallmodules val_mod1
|
||||
0:constant1 const1
|
||||
0:constant2 const2
|
||||
0:constant3 const3 /path/to/something
|
||||
|
||||
1:counter1 101
|
||||
1:counter2 1036
|
||||
1:counter3 1503
|
||||
1:forallmodules val_mod2
|
||||
1:constant1 const1
|
||||
1:constant2 const2
|
||||
1:constant3 const3 /path/to/something
|
||||
|
||||
2:counter1 102
|
||||
2:counter2 1048
|
||||
2:counter3 1506
|
||||
2:forallmodules val_mod3
|
||||
2:constant1 const1
|
||||
2:constant2 const2
|
||||
2:constant3 const3 /path/to/something
|
||||
|
||||
3:counter1 103
|
||||
3:counter2 1060
|
||||
3:counter3 1509
|
||||
3:forallmodules val_mod4
|
||||
3:constant1 const1
|
||||
3:constant2 const2
|
||||
3:constant3 const3 /path/to/something
|
||||
|
||||
footer1 foot1
|
||||
footer2 somethingelseathebottom
|
@ -1,47 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# local variables
|
||||
a_variable=/path/to/something
|
||||
|
||||
# HOSTNAMES is special
|
||||
# Beside of the hostname line it also defines the amount of modules
|
||||
# for the body part
|
||||
# take care for the last space
|
||||
HOSTNAMES="hostname1 hostname2 hostname3 hostname55 "
|
||||
|
||||
## header contains constant values at the beginning of the file
|
||||
header=(
|
||||
header_var1="wow"
|
||||
header_var2="great"
|
||||
header_var3="very nice"
|
||||
)
|
||||
|
||||
## the body part is for each half module
|
||||
# counters will count automatically
|
||||
# the number behind ':' indicates the incrementation value
|
||||
|
||||
counters=(
|
||||
counter1="100:1"
|
||||
counter2="1024:12"
|
||||
counter3="1500:3"
|
||||
)
|
||||
|
||||
# constant values
|
||||
constants=(
|
||||
constant1="const1"
|
||||
constant2="const2"
|
||||
constant3="const3 ${a_variable}"
|
||||
)
|
||||
|
||||
# lists contains space separated lists each value for each half module
|
||||
lists=(
|
||||
forallmodules="val_mod1 val_mod2 val_mod3 val_mod4"
|
||||
)
|
||||
|
||||
|
||||
## footer contains constant values for the end of the file
|
||||
footer=(
|
||||
footer1=foot1
|
||||
footer2=somethingelseathebottom
|
||||
)
|
||||
|
0
examples/eiger_10Gb.config
Executable file → Normal file
0
examples/eiger_10Gb.config
Executable file → Normal file
0
examples/eiger_1Gb.config
Executable file → Normal file
0
examples/eiger_1Gb.config
Executable file → Normal file
0
examples/gotthard.config
Executable file → Normal file
0
examples/gotthard.config
Executable file → Normal file
0
examples/gotthard_setup.det
Executable file → Normal file
0
examples/gotthard_setup.det
Executable file → Normal file
@ -1,57 +0,0 @@
|
||||
detsizechan 2560 1
|
||||
|
||||
hostname bchip074+bchip075+
|
||||
|
||||
|
||||
0:extsig:0 trigger_in_rising_edge
|
||||
0:rx_tcpport 1954
|
||||
0:rx_udpport 50001
|
||||
0:vhighvoltage 0
|
||||
|
||||
1:extsig:0 trigger_in_rising_edge
|
||||
1:rx_tcpport 1955
|
||||
1:rx_udpport 50002
|
||||
1:vhighvoltage 0
|
||||
|
||||
##############################################################################
|
||||
#########
|
||||
######### Uncomment this part to use the gotthard25umZmq process
|
||||
#########
|
||||
##############################################################################
|
||||
|
||||
# #replace my_receiver_hostname with the hostname of IP of the machine where the receiver runs
|
||||
#0:rx_zmqip my_receiver_hostname
|
||||
#0:rx_zmqport 30003
|
||||
# #replace my_client_hostname with the hostname of IP of the machine where the client/GUI or softIOC runs
|
||||
#0:zmqip my_client_hostname
|
||||
#0:zmqport 40003
|
||||
|
||||
# #replace my_receiver_hostname with the hostname of IP of the machine where the receiver runs
|
||||
#1:rx_zmqip my_receiver_hostname
|
||||
#1:rx_zmqport 30004
|
||||
# #replace my_client_hostname with the hostname of IP of the machine where the client/GUI or softIOC runs
|
||||
#1:zmqip my_client_hostname
|
||||
#1:zmqport 40004
|
||||
|
||||
##############################################################################
|
||||
#########
|
||||
######### until here
|
||||
#########
|
||||
##############################################################################
|
||||
|
||||
|
||||
r_readfreq 1
|
||||
rx_datastream 1
|
||||
|
||||
#replace my_receiver_hostname with the hostname of 1Gb IP of the machine where the receiver runs
|
||||
rx_hostname my_receiver_hostname
|
||||
rx_datastream 1
|
||||
outdir /tmp/
|
||||
|
||||
|
||||
settings veryhighgain
|
||||
exptime 0.000005
|
||||
period 0.0001
|
||||
|
||||
vhighvoltage 90
|
||||
|
@ -1,13 +0,0 @@
|
||||
Turn on the two receivers:
|
||||
slsReceiver -t1954 &
|
||||
slsReceiver -t1955 &
|
||||
|
||||
Switch on the photon conversion on the receiver machine (replace my_receiver_hostname):
|
||||
gotthard25umZmq my_receiver_hostname 30003 my_receiver_hostname 40003 &
|
||||
|
||||
Run the configuration file:
|
||||
sls_detector_put config bchip2modules.config
|
||||
|
||||
|
||||
Start your measurements using the command line, the slsDetectorGui or the EPICS driver
|
||||
|
13
examples/jungfrau.config
Executable file → Normal file
13
examples/jungfrau.config
Executable file → Normal file
@ -1,16 +1,15 @@
|
||||
hostname localhost
|
||||
hostname bchip038+
|
||||
|
||||
0:rx_udpport 50004
|
||||
0:rx_udpip 172.24.8.84
|
||||
0:detectorip 172.24.8.254
|
||||
rx_hostname localhost
|
||||
0:rx_udpip 10.1.1.100
|
||||
0:detectorip 10.1.1.10
|
||||
rx_hostname pcmoench01
|
||||
|
||||
#powerchip 1
|
||||
#vhighvoltage 200
|
||||
powerchip 1
|
||||
|
||||
#extsig:0 trigger_in_rising_edge
|
||||
#timing trigger
|
||||
|
||||
outdir /tmp/slsdetector
|
||||
outdir /external_pool/jungfrau_data/softwaretest
|
||||
|
||||
|
||||
|
1
examples/jungfrau_two.config
Executable file → Normal file
1
examples/jungfrau_two.config
Executable file → Normal file
@ -17,7 +17,6 @@ hostname bchip048+bchip052+
|
||||
rx_hostname pcmoench01
|
||||
|
||||
powerchip 1
|
||||
vhighvoltage 200
|
||||
#extsig:0 trigger_in_rising_edge
|
||||
#timing trigger
|
||||
|
||||
|
@ -1,491 +0,0 @@
|
||||
hostname bchip085+
|
||||
|
||||
patword 0000 0000000000000000
|
||||
patword 0001 0000000000000000
|
||||
patword 0002 0008000900080000
|
||||
patword 0003 0008000900080000
|
||||
patword 0004 0008000900080000
|
||||
patword 0005 0008000900080000
|
||||
patword 0006 0008000900080000
|
||||
patword 0007 0008000900080000
|
||||
patword 0008 0008000900080000
|
||||
patword 0009 0008000900080000
|
||||
patword 000a 0008000900080000
|
||||
patword 000b 0008000900080000
|
||||
patword 000c 0008000900080000
|
||||
patword 000d 0008000900080000
|
||||
patword 000e 0008000900080000
|
||||
patword 000f 0008000900080000
|
||||
patword 0010 0008000900080000
|
||||
patword 0011 0008000900080000
|
||||
patword 0012 0008000900080000
|
||||
patword 0013 0008000900080000
|
||||
patword 0014 0008000900080000
|
||||
patword 0015 0008000900080000
|
||||
patword 0016 0008400900080020
|
||||
patword 0017 0008400900080020
|
||||
patword 0018 0008599f0418503a
|
||||
patword 0019 0008599f0418503a
|
||||
patword 001a 0108599f0418503a
|
||||
patword 001b 0108599f0418503a
|
||||
patword 001c 0108599f0418503a
|
||||
patword 001d 0108599f0418503a
|
||||
patword 001e 0108599f0418503a
|
||||
patword 001f 0108599f0418503a
|
||||
patword 0020 0108599f0418503a
|
||||
patword 0021 0108599f0418503a
|
||||
patword 0022 0108599f0418503a
|
||||
patword 0023 0108599f0418503a
|
||||
patword 0024 0108599f0418503a
|
||||
patword 0025 0108599f0418503a
|
||||
patword 0026 0108599f0418503a
|
||||
patword 0027 0108599f0418503a
|
||||
patword 0028 0108599f0418503a
|
||||
patword 0029 0108599f0418503a
|
||||
patword 002a 0108599f0418503a
|
||||
patword 002b 0108599f0418503a
|
||||
patword 002c 0108599f0418503a
|
||||
patword 002d 0108599f0418503a
|
||||
patword 002e 0108599f0418503a
|
||||
patword 002f 0108599f0418503a
|
||||
patword 0030 0108599f0418503a
|
||||
patword 0031 0108599f0418503a
|
||||
patword 0032 0108599f0418503a
|
||||
patword 0033 0108599f0418503a
|
||||
patword 0034 0108599f0418503a
|
||||
patword 0035 0108599f0418503a
|
||||
patword 0036 0108599f0418503a
|
||||
patword 0037 0108599f0418503a
|
||||
patword 0038 0108599f0418503a
|
||||
patword 0039 0108599f0418503a
|
||||
patword 003a 0108599f0418503a
|
||||
patword 003b 0108599f0418503a
|
||||
patword 003c 0108599f0418503a
|
||||
patword 003d 0108599f0418503a
|
||||
patword 003e 0108599f0418503a
|
||||
patword 003f 0108599f0418503a
|
||||
patword 0040 0108599f0418503a
|
||||
patword 0041 0108599f0418503a
|
||||
patword 0042 0108599f0418503a
|
||||
patword 0043 0108599f0418503a
|
||||
patword 0044 0108599f0418503a
|
||||
patword 0045 0108599f0418503a
|
||||
patword 0046 0108599f0418503a
|
||||
patword 0047 0108599f0418503a
|
||||
patword 0048 0108599f0418503a
|
||||
patword 0049 0108599f0418503a
|
||||
patword 004a 0108599f0418503a
|
||||
patword 004b 0108599f0418503a
|
||||
patword 004c 0108599f0418503a
|
||||
patword 004d 0108599f0418503a
|
||||
patword 004e 0108599f0418503a
|
||||
patword 004f 0108599f0418503a
|
||||
patword 0050 0108599f0418503a
|
||||
patword 0051 0108599f0418503a
|
||||
patword 0052 0108599f0418503a
|
||||
patword 0053 0108599f0418503a
|
||||
patword 0054 0108599f0418503a
|
||||
patword 0055 0108599f0418503a
|
||||
patword 0056 0108599f0418503a
|
||||
patword 0057 0108599f0418503a
|
||||
patword 0058 0108599f0418503a
|
||||
patword 0059 0108599f0418503a
|
||||
patword 005a 0108599f0418503a
|
||||
patword 005b 0108599f0418503a
|
||||
patword 005c 0108599f0418503a
|
||||
patword 005d 0108599f0418503a
|
||||
patword 005e 0108599f0418503a
|
||||
patword 005f 0108599f0418503a
|
||||
patword 0060 0108599f0418503a
|
||||
patword 0061 0108599f0418503a
|
||||
patword 0062 0108599f0418503a
|
||||
patword 0063 0108599f0418503a
|
||||
patword 0064 0108599f0418503a
|
||||
patword 0065 0108599f0418503a
|
||||
patword 0066 0108599f0418503a
|
||||
patword 0067 0108599f0418503a
|
||||
patword 0068 0108599f0418503a
|
||||
patword 0069 0108599f0418503a
|
||||
patword 006a 0108599f0418503a
|
||||
patword 006b 0108599f0418503a
|
||||
patword 006c 0108599f0418503a
|
||||
patword 006d 0108599f0418503a
|
||||
patword 006e 0108599f0418503a
|
||||
patword 006f 0108599f0418503a
|
||||
patword 0070 0108599f0418503a
|
||||
patword 0071 0108599f0418503a
|
||||
patword 0072 0108599f0418503a
|
||||
patword 0073 0108599f0418503a
|
||||
patword 0074 0108599f0418503a
|
||||
patword 0075 0108599f0418503a
|
||||
patword 0076 0108599f0418503a
|
||||
patword 0077 0108599f0418503a
|
||||
patword 0078 0108599f0418503a
|
||||
patword 0079 0108599f0418503a
|
||||
patword 007a 0108599f0418503a
|
||||
patword 007b 0108599f0418503a
|
||||
patword 007c 0108599f0418503a
|
||||
patword 007d 0108599f0418503a
|
||||
patword 007e 010859960418503a
|
||||
patword 007f 010859960418503a
|
||||
patword 0080 010859960418503a
|
||||
patword 0081 010859960418503a
|
||||
patword 0082 010859960418503a
|
||||
patword 0083 010859960418503a
|
||||
patword 0084 010859960418503a
|
||||
patword 0085 010859960418503a
|
||||
patword 0086 010859960418503a
|
||||
patword 0087 010859960418503a
|
||||
patword 0088 010859960418503a
|
||||
patword 0089 010859960418503a
|
||||
patword 008a 010859960418503a
|
||||
patword 008b 010859960418503a
|
||||
patword 008c 010859960418503a
|
||||
patword 008d 010859960418503a
|
||||
patword 008e 010859960418503a
|
||||
patword 008f 010859960418503a
|
||||
patword 0090 010859960418503a
|
||||
patword 0091 010859960418503a
|
||||
patword 0092 010819960418501a
|
||||
patword 0093 010819960418501a
|
||||
patword 0094 010819960418501a
|
||||
patword 0095 010819960418501a
|
||||
patword 0096 030819960418501a
|
||||
patword 0097 030819960418501a
|
||||
patword 0098 030819960418501a
|
||||
patword 0099 030819960418501a
|
||||
patword 009a 030819960418501a
|
||||
patword 009b 030819960418501a
|
||||
patword 009c 030819960418501a
|
||||
patword 009d 030819960418501a
|
||||
patword 009e 030819960418501a
|
||||
patword 009f 030819960418501a
|
||||
patword 00a0 030819960418501a
|
||||
patword 00a1 030819960418501a
|
||||
patword 00a2 030819960418501a
|
||||
patword 00a3 030819960418501a
|
||||
patword 00a4 030819960418501a
|
||||
patword 00a5 030819960418501a
|
||||
patword 00a6 030819960418501a
|
||||
patword 00a7 030819960418501a
|
||||
patword 00a8 030819960418501a
|
||||
patword 00a9 030819960418501a
|
||||
patword 00aa 030819960418501a
|
||||
patword 00ab 030819960418501a
|
||||
patword 00ac 030819960008501a
|
||||
patword 00ad 030819960008501a
|
||||
patword 00ae 030819960008501a
|
||||
patword 00af 030819960008501a
|
||||
patword 00b0 030819960008501a
|
||||
patword 00b1 030819960008501a
|
||||
patword 00b2 030819960008501a
|
||||
patword 00b3 030819960008501a
|
||||
patword 00b4 030819960008501a
|
||||
patword 00b5 030819960008501a
|
||||
patword 00b6 030819960008501a
|
||||
patword 00b7 030819960008501a
|
||||
patword 00b8 030819960008501a
|
||||
patword 00b9 030819960008501a
|
||||
patword 00ba 030819960008501a
|
||||
patword 00bb 030819960008501a
|
||||
patword 00bc 030819960008501a
|
||||
patword 00bd 030819960008501a
|
||||
patword 00be 030819960008501a
|
||||
patword 00bf 030819960008501a
|
||||
patword 00c0 0308199f0008501a
|
||||
patword 00c1 0308199f0008501a
|
||||
patword 00c2 0308199f0008501a
|
||||
patword 00c3 0308199f0008501a
|
||||
patword 00c4 0308199f0008501a
|
||||
patword 00c5 0308199f0008501a
|
||||
patword 00c6 0308199f0008501a
|
||||
patword 00c7 0308199f0008501a
|
||||
patword 00c8 0308199f0008501a
|
||||
patword 00c9 0308199f0008501a
|
||||
patword 00ca 0308199f0008501a
|
||||
patword 00cb 0308199f0008501a
|
||||
patword 00cc 0308199f0008501a
|
||||
patword 00cd 0308199f0008501a
|
||||
patword 00ce 0308199f0008501a
|
||||
patword 00cf 0308199f0008501a
|
||||
patword 00d0 0308199f0008501a
|
||||
patword 00d1 0308199f0008501a
|
||||
patword 00d2 0308199f0008501a
|
||||
patword 00d3 0308199f0008501a
|
||||
patword 00d4 0308599f0008503a
|
||||
patword 00d5 0308599f0008503a
|
||||
patword 00d6 030c599f000850ba
|
||||
patword 00d7 030c599f000850ba
|
||||
patword 00d8 030c599f000850ba
|
||||
patword 00d9 030c599f000850ba
|
||||
patword 00da 030c599f000850ba
|
||||
patword 00db 030c599f000850ba
|
||||
patword 00dc 030c599f000850ba
|
||||
patword 00dd 030c599f000850ba
|
||||
patword 00de 030c599f000850ba
|
||||
patword 00df 030c599f000850ba
|
||||
patword 00e0 030c599f000850ba
|
||||
patword 00e1 030c599f000850ba
|
||||
patword 00e2 030c599f000850ba
|
||||
patword 00e3 030c599f000850ba
|
||||
patword 00e4 030c599f000850ba
|
||||
patword 00e5 030c599f000850ba
|
||||
patword 00e6 030c599f000850ba
|
||||
patword 00e7 030c599f000850ba
|
||||
patword 00e8 030c599f000850ba
|
||||
patword 00e9 030c599f000850ba
|
||||
patword 00ea 030c799f010858ba
|
||||
patword 00eb 030c799f010858ba
|
||||
patword 00ec 030c599f000850ba
|
||||
patword 00ed 030c599f000850ba
|
||||
patword 00ee 030c599f000850ba
|
||||
patword 00ef 030c599f000850ba
|
||||
patword 00f0 030c599f000850ba
|
||||
patword 00f1 030c599f000850ba
|
||||
patword 00f2 030c599f000850ba
|
||||
patword 00f3 030c599f000850ba
|
||||
patword 00f4 030c599f000850ba
|
||||
patword 00f5 030c599f000850ba
|
||||
patword 00f6 030c599f000850ba
|
||||
patword 00f7 030c599f000850ba
|
||||
patword 00f8 030c599f000850ba
|
||||
patword 00f9 030c599f000850ba
|
||||
patword 00fa 030c599f000850ba
|
||||
patword 00fb 030c599f000850ba
|
||||
patword 00fc 030c599f000850ba
|
||||
patword 00fd 030c599f000850ba
|
||||
patword 00fe 030c599f000850ba
|
||||
patword 00ff 030c599f000850ba
|
||||
patword 0100 030c599f000850ba
|
||||
patword 0101 030c599f000850ba
|
||||
patword 0102 030c599f400850ba
|
||||
patword 0103 030c599f400850ba
|
||||
patword 0104 030c599f600850ba
|
||||
patword 0105 030c599f400850ba
|
||||
patword 0106 030c599f400850ba
|
||||
patword 0107 030c599f400850ba
|
||||
patword 0108 870c599f682e50ba
|
||||
patword 0109 870c599f482850ba
|
||||
patword 010a 870c599f000e50ba
|
||||
patword 010b 870c599f000850ba
|
||||
patword 010c 870c599f000e50ba
|
||||
patword 010d 870c599f000850ba
|
||||
patword 010e 870c599f000e50ba
|
||||
patword 010f 870c599f000850ba
|
||||
patword 0110 870c599f000e50ba
|
||||
patword 0111 870c599f000850ba
|
||||
patword 0112 870c599f000e50ba
|
||||
patword 0113 870c599f000850ba
|
||||
patword 0114 870c599f000e50ba
|
||||
patword 0115 870c599f000850ba
|
||||
patword 0116 870c599f000e50ba
|
||||
patword 0117 870c599f000850ba
|
||||
patword 0118 870c599f000e50ba
|
||||
patword 0119 870c599f000850ba
|
||||
patword 011a 870c599f000e50ba
|
||||
patword 011b 870c599f000850ba
|
||||
patword 011c 870c599f000e50ba
|
||||
patword 011d 870c599f000850ba
|
||||
patword 011e 870c599f000e50ba
|
||||
patword 011f 870c599f000850ba
|
||||
patword 0120 870c599f000e50ba
|
||||
patword 0121 870c599f000850ba
|
||||
patword 0122 870c599f200e50ba
|
||||
patword 0123 870c599f000850ba
|
||||
patword 0124 870c599f000e50ba
|
||||
patword 0125 870c599f000850ba
|
||||
patword 0126 870c599f000e50ba
|
||||
patword 0127 870c599f000850ba
|
||||
patword 0128 870c599f000e50ba
|
||||
patword 0129 870c599f000850ba
|
||||
patword 012a 870c599f000e50ba
|
||||
patword 012b 870c599f000850ba
|
||||
patword 012c 870c599f000e50ba
|
||||
patword 012d 870c599f000850ba
|
||||
patword 012e 870c599f000e50ba
|
||||
patword 012f 870c599f000850ba
|
||||
patword 0130 870c599f000e50ba
|
||||
patword 0131 870c599f000850ba
|
||||
patword 0132 870c599f000e50ba
|
||||
patword 0133 870c599f000850ba
|
||||
patword 0134 870c599f000e50ba
|
||||
patword 0135 870c599f000850ba
|
||||
patword 0136 870c599f000e50ba
|
||||
patword 0137 870c599f000850ba
|
||||
patword 0138 870c599f000e50ba
|
||||
patword 0139 870c599f000850ba
|
||||
patword 013a 870c599f282e50ba
|
||||
patword 013b 870c599f082850ba
|
||||
patword 013c 870c599f000e50ba
|
||||
patword 013d 870c599f000850ba
|
||||
patword 013e 870c599f000e50ba
|
||||
patword 013f 870c599f000850ba
|
||||
patword 0140 870c599f000e50ba
|
||||
patword 0141 870c599f000850ba
|
||||
patword 0142 870c599f000e50ba
|
||||
patword 0143 870c599f000850ba
|
||||
patword 0144 870c599f000e50ba
|
||||
patword 0145 870c599f000850ba
|
||||
patword 0146 870c599f000e50ba
|
||||
patword 0147 870c599f000850ba
|
||||
patword 0148 870c599f000e50ba
|
||||
patword 0149 870c599f000850ba
|
||||
patword 014a 870c599f000e50ba
|
||||
patword 014b 870c599f000850ba
|
||||
patword 014c 870c599f000e50ba
|
||||
patword 014d 870c599f000850ba
|
||||
patword 014e 870c599f000e50ba
|
||||
patword 014f 870c599f000850ba
|
||||
patword 0150 870c599f000e50ba
|
||||
patword 0151 870c599f000850ba
|
||||
patword 0152 870c599f000e50ba
|
||||
patword 0153 870c599f000850ba
|
||||
patword 0154 870c599f200e50ba
|
||||
patword 0155 870c599f000850ba
|
||||
patword 0156 870c599f000e50ba
|
||||
patword 0157 870c599f000850ba
|
||||
patword 0158 870c599f000e50ba
|
||||
patword 0159 870c599f000850ba
|
||||
patword 015a 870c599f000e50ba
|
||||
patword 015b 870c599f000850ba
|
||||
patword 015c 870c599f000e50ba
|
||||
patword 015d 870c599f000850ba
|
||||
patword 015e 870c599f000e50ba
|
||||
patword 015f 870c599f000850ba
|
||||
patword 0160 870c599f000e50ba
|
||||
patword 0161 870c599f000850ba
|
||||
patword 0162 870c599f000e50ba
|
||||
patword 0163 870c599f000850ba
|
||||
patword 0164 870c599f000e50ba
|
||||
patword 0165 870c599f000850ba
|
||||
patword 0166 870c599f000e50ba
|
||||
patword 0167 870c599f000850ba
|
||||
patword 0168 870c599f000e50ba
|
||||
patword 0169 870c599f000850ba
|
||||
patword 016a 870c599f000e50ba
|
||||
patword 016b 870c599f000850ba
|
||||
patword 016c 070c599f000850ba
|
||||
patword 016d 070c599f000850ba
|
||||
patword 016e 000c599f000850ba
|
||||
patword 016f 000c599f000850ba
|
||||
patword 0170 0008599f200e503a
|
||||
patword 0171 0008599f0008503a
|
||||
patword 0172 0008599f200e503a
|
||||
patword 0173 0008599f0008503a
|
||||
patword 0174 0008599f0008503a
|
||||
patword 0175 0008599f0008503a
|
||||
patword 0176 0008599f0008503a
|
||||
patword 0177 0008599f0008503a
|
||||
patword 0178 0008599f0008503a
|
||||
patword 0179 0008599f0008503a
|
||||
patword 017a 0008599f0008503a
|
||||
patword 017b 0008599f0008503a
|
||||
patword 017c 0008599f0008503a
|
||||
patword 017d 0008599f0008503a
|
||||
patword 017e 0008599f0008503a
|
||||
patword 017f 0008599f0008503a
|
||||
patword 0180 0008599f0008503a
|
||||
patword 0181 0008599f0008503a
|
||||
patword 0182 0008599f0008503a
|
||||
patword 0183 0008599f0008503a
|
||||
patword 0184 0008599f0008503a
|
||||
patword 0185 0008599f0008503a
|
||||
patword 0186 0008599f0008503a
|
||||
patword 0187 0008599f0008503a
|
||||
patword 0188 0008599f0008503a
|
||||
patword 0189 0008599f0008503a
|
||||
patword 018a 0008599f0008503a
|
||||
patword 018b 0008599f0008503a
|
||||
patword 018c 0008599f0008503a
|
||||
patword 018d 0008599f0008503a
|
||||
patioctrl 8f0effff6dbffdbf
|
||||
patclkctrl 0000000000000000
|
||||
patlimits 0000 018c
|
||||
patloop0 013a 016b
|
||||
patnloop0 199
|
||||
patloop1 0400 0400
|
||||
patnloop1 0
|
||||
patloop2 0400 0400
|
||||
patnloop2 0
|
||||
patwait0 00aa
|
||||
patwaittime0 40000
|
||||
patwait1 0400
|
||||
patwaittime1 0
|
||||
patwait2 0400
|
||||
patwaittime2 0
|
||||
|
||||
|
||||
####mcp2011
|
||||
#0:rx_udpip 10.1.1.102
|
||||
#0:detectorip 10.1.1.19
|
||||
#0:rx_udpport 32410
|
||||
####gui listening to
|
||||
#zmqip 129.129.202.131
|
||||
#zmqport 30001
|
||||
####data streaming out of
|
||||
#rx_zmqip 10.1.2.103
|
||||
#rx_zmqport 30003
|
||||
#0:rx_hostname mpc2011
|
||||
|
||||
####mx-test-1
|
||||
0:rx_udpip 10.1.1.100
|
||||
0:detectorip 10.1.1.19
|
||||
0:rx_udpport 32410
|
||||
####gui listening to (on receiver pc)
|
||||
zmqip 129.129.202.92
|
||||
zmqport 30001
|
||||
####data streaming out of
|
||||
rx_zmqip 10.1.1.100
|
||||
rx_zmqport 30003
|
||||
0:rx_hostname pcmoench01
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#turn on datastream from commandline
|
||||
rx_datastream 1
|
||||
|
||||
r_readfreq 1
|
||||
|
||||
#0:configuremac -1
|
||||
rx_datastream 1
|
||||
|
||||
r_readfreq 1
|
||||
|
||||
|
||||
dac:6 800
|
||||
dac:0 1300
|
||||
dac:4 1428
|
||||
dac:1 1000
|
||||
dac:7 900
|
||||
dac:3 680
|
||||
dac:2 1400
|
||||
dac:5 1200
|
||||
adcinvert 4a342593
|
||||
samples 5000
|
||||
adcphase 90
|
||||
adcpipeline 15
|
||||
adcreg 14 40
|
||||
powerchip 1
|
||||
vhighvoltage 90
|
||||
period 0.005
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
frames 100
|
||||
period 0.1
|
||||
outdir /scratch/
|
||||
enablefwrite 0
|
||||
|
||||
|
||||
|
32
examples/mythen.config
Normal file
32
examples/mythen.config
Normal file
@ -0,0 +1,32 @@
|
||||
type Mythen+
|
||||
0:hostname mcs1x21
|
||||
0:port 1952
|
||||
0:stopport 1953
|
||||
0:settingsdir /afs/psi.ch/user/b/bergamaschi
|
||||
0:outdir /afs/psi.ch/user/b/bergamaschi
|
||||
0:angdir 1.000000
|
||||
0:moveflag 1.000000
|
||||
0:lock 0
|
||||
0:caldir /afs/psi.ch/user/b/bergamaschi
|
||||
0:ffdir /afs/psi.ch/user/b/bergamaschi
|
||||
0:nmod 1
|
||||
0:waitstates 13
|
||||
0:setlength 3
|
||||
0:clkdivider 6
|
||||
0:extsig:0 gate_in_active_high
|
||||
0:extsig:1 trigger_in_rising_edge
|
||||
0:extsig:2 off
|
||||
0:extsig:3 off
|
||||
master -1
|
||||
sync none
|
||||
outdir /afs/psi.ch/user/b/bergamaschi
|
||||
ffdir /afs/psi.ch/user/b/bergamaschi
|
||||
headerbefore none
|
||||
headerafter none
|
||||
headerbeforepar none
|
||||
headerafterpar none
|
||||
badchannels none
|
||||
angconv none
|
||||
globaloff 0.000000
|
||||
binsize 0.001000
|
||||
threaded 1
|
1
examples/receiver.config
Normal file
1
examples/receiver.config
Normal file
@ -0,0 +1 @@
|
||||
dataport 1955
|
0
examples/scripts/.parab
Executable file → Normal file
0
examples/scripts/.parab
Executable file → Normal file
142
examples/scripts/HeaderBeforeAfter.awk
Executable file
142
examples/scripts/HeaderBeforeAfter.awk
Executable file
@ -0,0 +1,142 @@
|
||||
#! /bin/awk -f
|
||||
|
||||
# this is an awk script to start a run
|
||||
# you first need to run inimodule.awk to initialize
|
||||
# the pattern, set Vc and set the trimbits
|
||||
#
|
||||
|
||||
#####################################################################
|
||||
# revision history #
|
||||
#####################################################################
|
||||
# 31.10.2001 first version #
|
||||
#####################################################################
|
||||
# #
|
||||
# Bernd Schmitt #
|
||||
# #
|
||||
# bernd.schmitt@psi.ch #
|
||||
# #
|
||||
#####################################################################
|
||||
# #
|
||||
# modifications: #
|
||||
# #
|
||||
# 1.3.2002 BS adapted for use with DCB #
|
||||
# #
|
||||
# 25.5.2002 BS adapted to new convert program #
|
||||
# #
|
||||
# 29.5.2002 sleep -> usleep for meas. time , TS #
|
||||
# #
|
||||
#####################################################################
|
||||
|
||||
BEGIN {
|
||||
|
||||
# initialize variables
|
||||
NPAR=3
|
||||
|
||||
PAR[1]="nrun"
|
||||
PAR[2]="fn"
|
||||
PAR[3]="par"
|
||||
|
||||
# initialize default values
|
||||
|
||||
|
||||
|
||||
PARVAL[1] = 100
|
||||
PARVAL[2] = "microstrip_july2007"
|
||||
PARVAL[3]=0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
printf("\n\nnumber of command line arguments: %i (incl. command)\n\n", ARGC);
|
||||
|
||||
# read command line defined variables
|
||||
if (ARGC>1) {
|
||||
printf("\n\nnumber of command line arguments: %i (incl. command)\n\n", ARGC);
|
||||
for (i=1; i<=ARGC; i++) {
|
||||
printf("%s \n", ARGV[i]);
|
||||
nsplit=split(ARGV[i],array,"=")
|
||||
VAR = array[1];
|
||||
VAL = array[2];
|
||||
|
||||
for (j=1; j<=NPAR; j++) {
|
||||
if ( VAR==PAR[j] ) {
|
||||
PARVAL[j] = VAL
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
run=PARVAL[1]
|
||||
fn=PARVAL[2]
|
||||
par=PARVAL[3]
|
||||
|
||||
|
||||
# print command line arguments
|
||||
for (i=1; i<=NPAR; i++){
|
||||
printf("\t... %2i.\t%7s = %s\n", i, PAR[i], PARVAL[i] );
|
||||
}
|
||||
printf("\n\n");
|
||||
|
||||
# generate parameter file
|
||||
|
||||
fnamep=fn".parab"
|
||||
printf("header before\n")>> fnamep
|
||||
system("date >>"fnamep)
|
||||
printf("run=%i \n", run ) >> fnamep
|
||||
|
||||
#print detector parameters to file
|
||||
if (par==1) {
|
||||
|
||||
command="sls_detector_get exptime| awk -F \" \" '{print $2}'"
|
||||
command | getline var
|
||||
printf("acquisition time = %11.6f second(s)\n", var) >> fnamep
|
||||
|
||||
command="sls_detector_get settings| awk -F \" \" '{print $2}'"
|
||||
command | getline var
|
||||
printf("settings = %s\n", var) >> fnamep;
|
||||
|
||||
command="sls_detector_get threshold| awk -F \" \" '{print $2}'"
|
||||
command | getline var
|
||||
printf("threshold energy = %d eV\n", var) >> fnamep;
|
||||
|
||||
command="sls_detector_get badchannels| awk -F \" \" '{print $2}'"
|
||||
command | getline var
|
||||
printf("bad channel list = %s\n",var) >> fnamep;
|
||||
|
||||
|
||||
command="sls_detector_get angconv| awk -F \" \" '{print $2}'"
|
||||
command | getline var
|
||||
printf("angle calibration conversion = %s\n",var) >> fnamep;
|
||||
|
||||
|
||||
command="sls_detector_get globaloff| awk -F \" \" '{print $2}'"
|
||||
command | getline var
|
||||
printf("beamline offset = %f deg\n", var) >> fnamep;
|
||||
|
||||
command="sls_detector_get fineoff| awk -F \" \" '{print $2}'"
|
||||
command | getline var
|
||||
printf("fine offset = %f deg\n", var) >> fnamep;
|
||||
|
||||
command="sls_detector_get flatfield| awk -F \" \" '{print $2}'"
|
||||
command | getline var
|
||||
printf("Flat field corrections = %s\n",var) >> fnamep;
|
||||
|
||||
command="sls_detector_get ratecorr| awk -F \" \" '{print $2}'"
|
||||
command | getline var
|
||||
printf("Dead time corrections tau = %d ns\n",var) >> fnamep;
|
||||
|
||||
}
|
||||
|
||||
|
||||
#print beamline parameters to file
|
||||
|
||||
#read detector position
|
||||
system("caget X04SA-ES2-TH2:RO.RBV >>"fnamep)
|
||||
#read I0
|
||||
system("caget X04SA-ES2-SC:CH6>>"fnamep)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
87
examples/scripts/ScanScript.awk
Executable file
87
examples/scripts/ScanScript.awk
Executable file
@ -0,0 +1,87 @@
|
||||
#! /bin/awk -f
|
||||
|
||||
# this is an awk script to start a run
|
||||
# you first need to run inimodule.awk to initialize
|
||||
# the pattern, set Vc and set the trimbits
|
||||
#
|
||||
|
||||
#####################################################################
|
||||
# revision history #
|
||||
#####################################################################
|
||||
# 31.10.2001 first version #
|
||||
#####################################################################
|
||||
# #
|
||||
# Bernd Schmitt #
|
||||
# #
|
||||
# bernd.schmitt@psi.ch #
|
||||
# #
|
||||
#####################################################################
|
||||
# #
|
||||
# modifications: #
|
||||
# #
|
||||
# 1.3.2002 BS adapted for use with DCB #
|
||||
# #
|
||||
# 25.5.2002 BS adapted to new convert program #
|
||||
# #
|
||||
# 29.5.2002 sleep -> usleep for meas. time , TS #
|
||||
# #
|
||||
#####################################################################
|
||||
|
||||
BEGIN {
|
||||
|
||||
# initialize variables
|
||||
NPAR=4
|
||||
|
||||
PAR[1]="nrun"
|
||||
PAR[2]="fn"
|
||||
PAR[3]="var"
|
||||
PAR[4]="par"
|
||||
|
||||
|
||||
# initialize default values
|
||||
PARVAL[1] = 100
|
||||
PARVAL[2] = "myfname"
|
||||
PARVAL[3] = 0
|
||||
PARVAL[2] = "none"
|
||||
|
||||
|
||||
|
||||
# read command line defined variables
|
||||
if (ARGC>1) {
|
||||
printf("\n\nnumber of command line arguments: %i (incl. command)\n\n", ARGC);
|
||||
for (i=1; i<=ARGC; i++) {
|
||||
|
||||
nsplit=split(ARGV[i],array,"=")
|
||||
VAR = array[1];
|
||||
VAL = array[2];
|
||||
|
||||
for (j=1; j<=NPAR; j++) {
|
||||
if ( VAR==PAR[j] ) {
|
||||
PARVAL[j] = VAL
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
run=PARVAL[1]
|
||||
fn=PARVAL[2]
|
||||
var=PARVAL[3]
|
||||
par=PARVAL[4]
|
||||
|
||||
|
||||
|
||||
|
||||
# print command line arguments
|
||||
for (i=1; i<=NPAR; i++){
|
||||
printf("\t... %2i.\t%7s = %s\n", i, PAR[i], PARVAL[i] );
|
||||
}
|
||||
|
||||
#execute you command hereafter e.g. change temperature etc.
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
100
examples/scripts/ScriptBeforeAfter.awk
Executable file
100
examples/scripts/ScriptBeforeAfter.awk
Executable file
@ -0,0 +1,100 @@
|
||||
#! /bin/awk -f
|
||||
|
||||
# this is an awk script to start a run
|
||||
# you first need to run inimodule.awk to initialize
|
||||
# the pattern, set Vc and set the trimbits
|
||||
#
|
||||
|
||||
#####################################################################
|
||||
# revision history #
|
||||
#####################################################################
|
||||
# 31.10.2001 first version #
|
||||
#####################################################################
|
||||
# #
|
||||
# Bernd Schmitt #
|
||||
# #
|
||||
# bernd.schmitt@psi.ch #
|
||||
# #
|
||||
#####################################################################
|
||||
# #
|
||||
# modifications: #
|
||||
# #
|
||||
# 1.3.2002 BS adapted for use with DCB #
|
||||
# #
|
||||
# 25.5.2002 BS adapted to new convert program #
|
||||
# #
|
||||
# 29.5.2002 sleep -> usleep for meas. time , TS #
|
||||
# #
|
||||
#####################################################################
|
||||
|
||||
BEGIN {
|
||||
|
||||
# initialize variables
|
||||
NPAR=7
|
||||
|
||||
PAR[1]="nrun"
|
||||
PAR[2]="fn"
|
||||
PAR[3]="par"
|
||||
PAR[4]="sv0"
|
||||
PAR[5]="sv1"
|
||||
PAR[6]="p0"
|
||||
PAR[7]="p1"
|
||||
|
||||
# initialize default values
|
||||
PARVAL[1] = 100
|
||||
PARVAL[2] = "myfname"
|
||||
PARVAL[3] = 1
|
||||
PARVAL[4] = 0
|
||||
PARVAL[5] = 0
|
||||
PARVAL[6] = "none"
|
||||
PARVAL[7] = "none"
|
||||
|
||||
|
||||
|
||||
# read command line defined variables
|
||||
if (ARGC>1) {
|
||||
printf("\n\nnumber of command line arguments: %i (incl. command)\n\n", ARGC);
|
||||
for (i=1; i<=ARGC; i++) {
|
||||
|
||||
nsplit=split(ARGV[i],array,"=")
|
||||
VAR = array[1];
|
||||
VAL = array[2];
|
||||
|
||||
for (j=1; j<=NPAR; j++) {
|
||||
if ( VAR==PAR[j] ) {
|
||||
PARVAL[j] = VAL
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
run=PARVAL[1]
|
||||
fn=PARVAL[2]
|
||||
"par"PAR[3]=
|
||||
sv0=PAR[4]
|
||||
sv1=PAR[5]
|
||||
p0=PAR[6]
|
||||
p1=PAR[7]
|
||||
|
||||
|
||||
|
||||
# print command line arguments
|
||||
for (i=1; i<=NPAR; i++){
|
||||
printf("\t... %2i.\t%7s = %s\n", i, PAR[i], PARVAL[i] );
|
||||
}
|
||||
# printf("\n\n");
|
||||
# system("close_shutter_g95")
|
||||
|
||||
# execute your actions hereafter
|
||||
if (par==1) {
|
||||
#open shutter
|
||||
} else {
|
||||
#close shutter
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
79
examples/scripts/StartStopScript.awk
Executable file
79
examples/scripts/StartStopScript.awk
Executable file
@ -0,0 +1,79 @@
|
||||
#! /bin/awk -f
|
||||
|
||||
# this is an awk script to start a run
|
||||
# you first need to run inimodule.awk to initialize
|
||||
# the pattern, set Vc and set the trimbits
|
||||
#
|
||||
|
||||
#####################################################################
|
||||
# revision history #
|
||||
#####################################################################
|
||||
# 31.10.2001 first version #
|
||||
#####################################################################
|
||||
# #
|
||||
# Bernd Schmitt #
|
||||
# #
|
||||
# bernd.schmitt@psi.ch #
|
||||
# #
|
||||
#####################################################################
|
||||
# #
|
||||
# modifications: #
|
||||
# #
|
||||
# 1.3.2002 BS adapted for use with DCB #
|
||||
# #
|
||||
# 25.5.2002 BS adapted to new convert program #
|
||||
# #
|
||||
# 29.5.2002 sleep -> usleep for meas. time , TS #
|
||||
# #
|
||||
#####################################################################
|
||||
|
||||
BEGIN {
|
||||
|
||||
# initialize variables
|
||||
NPAR=2
|
||||
|
||||
PAR[1]="nrun"
|
||||
PAR[2]="par"
|
||||
|
||||
|
||||
# initialize default values
|
||||
PARVAL[1] = 100
|
||||
PARVAL[2] = "none"
|
||||
|
||||
|
||||
|
||||
# read command line defined variables
|
||||
if (ARGC>1) {
|
||||
printf("\n\nnumber of command line arguments: %i (incl. command)\n\n", ARGC);
|
||||
for (i=1; i<=ARGC; i++) {
|
||||
|
||||
nsplit=split(ARGV[i],array,"=")
|
||||
VAR = array[1];
|
||||
VAL = array[2];
|
||||
|
||||
for (j=1; j<=NPAR; j++) {
|
||||
if ( VAR==PAR[j] ) {
|
||||
PARVAL[j] = VAL
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
run=PARVAL[1]
|
||||
par=PARVAL[2]
|
||||
|
||||
|
||||
|
||||
|
||||
# print command line arguments
|
||||
for (i=1; i<=NPAR; i++){
|
||||
printf("\t... %2i.\t%7s = %s\n", i, PAR[i], PARVAL[i] );
|
||||
}
|
||||
#execute action hereafter
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
0
examples/two_gotthard.config
Executable file → Normal file
0
examples/two_gotthard.config
Executable file → Normal file
64
examples/two_no_receiver.config
Normal file
64
examples/two_no_receiver.config
Normal file
@ -0,0 +1,64 @@
|
||||
#####Any line with a # is not read######
|
||||
|
||||
#type Gotthard+
|
||||
hostname bchip007+bchip009+
|
||||
|
||||
#0:hostname bchip007
|
||||
#0:port 1952
|
||||
#0:stopport 1953
|
||||
#0:rx_tcpport 1956
|
||||
0:settingsdir /home/l_msdetect/dhanya/slsDetectorsPackage/settingsdir/gotthard
|
||||
0:angdir 1.000000
|
||||
0:moveflag 0.000000
|
||||
0:lock 0
|
||||
0:caldir /home/l_msdetect/dhanya/slsDetectorsPackage/settingsdir/gotthard
|
||||
0:ffdir /home/l_msdetect
|
||||
0:extsig:0 off
|
||||
0:extsig:1 off
|
||||
0:extsig:2 off
|
||||
0:extsig:3 off
|
||||
#0:detectorip 10.1.1.2
|
||||
#0:detectormac 00:aa:bb:cc:dd:ee
|
||||
#0:rx_udpport 50001
|
||||
#0:rx_udpip 10.1.1.1
|
||||
#0:rx_hostname 129.129.202.134
|
||||
0:outdir /data/speedt
|
||||
0:vhighvoltage 120
|
||||
|
||||
|
||||
#1:hostname bchip009
|
||||
#1:port 1952
|
||||
#1:stopport 1953
|
||||
1:rx_tcpport 1957
|
||||
1:settingsdir /home/l_msdetect/dhanya/slsDetectorsPackage/settingsdir/gotthard
|
||||
1:angdir 1.000000
|
||||
1:moveflag 0.000000
|
||||
1:lock 0
|
||||
1:caldir /home/l_msdetect/dhanya/slsDetectorsPackage/settingsdir/gotthard
|
||||
1:ffdir /home/l_msdetect
|
||||
1:extsig:0 off
|
||||
1:extsig:1 off
|
||||
1:extsig:2 off
|
||||
1:extsig:3 off
|
||||
#1:detectorip 10.1.2.2
|
||||
#1:detectormac 00:aa:bb:cc:dd:ee
|
||||
#1:rx_udpport 50004
|
||||
#1:rx_udpip 10.1.2.1
|
||||
#1:rx_hostname 129.129.202.134
|
||||
1:outdir /data/speedt
|
||||
1:vhighvoltage 120
|
||||
|
||||
|
||||
master -1
|
||||
sync none
|
||||
outdir /data/speedt
|
||||
ffdir /home/l_msdetect
|
||||
headerbefore none
|
||||
headerafter none
|
||||
headerbeforepar none
|
||||
headerafterpar none
|
||||
badchannels none
|
||||
angconv none
|
||||
globaloff 0.000000
|
||||
binsize 0.001000
|
||||
threaded 1
|
@ -1,38 +0,0 @@
|
||||
# MESSAGE( STATUS "CMAKE_CURRENT_SOURCE_DIR: " ${CMAKE_CURRENT_SOURCE_DIR} )
|
||||
# MESSAGE( STATUS "PROJECT_SOURCE_DIR: " ${PROJECT_SOURCE_DIR} )
|
||||
|
||||
|
||||
|
||||
# include_directories(
|
||||
# ${PROJECT_SOURCE_DIR}/catch
|
||||
# )
|
||||
|
||||
# target_sources(tests PRIVATE
|
||||
# ${CMAKE_CURRENT_SOURCE_DIR}/test-integrationMulti.cpp
|
||||
# ${CMAKE_CURRENT_SOURCE_DIR}/test-integrationDectector.cpp
|
||||
# ${CMAKE_CURRENT_SOURCE_DIR}/test-eigerIntegration.cpp
|
||||
# )
|
||||
|
||||
# if(SLS_USE_TESTS)
|
||||
# set(TEST_SOURCES
|
||||
# src/test-slsDetector.cpp
|
||||
# src/test.cpp
|
||||
# )
|
||||
# add_executable(detector_test ${TEST_SOURCES})
|
||||
|
||||
# target_link_libraries(detector_test
|
||||
# slsDetectorShared
|
||||
# slsProjectOptions
|
||||
# slsProjectWarnings
|
||||
# slsSupportLib
|
||||
# pthread
|
||||
# rt
|
||||
# )
|
||||
# set_target_properties(detector_test PROPERTIES
|
||||
# RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
||||
# )
|
||||
|
||||
|
||||
|
||||
# endif()
|
||||
|
@ -1,198 +0,0 @@
|
||||
#include "catch.hpp"
|
||||
#include "multiSlsDetector.h"
|
||||
#include "string_utils.h"
|
||||
#include "tests/globals.h"
|
||||
#include <iostream>
|
||||
|
||||
class MultiDetectorFixture {
|
||||
protected:
|
||||
multiSlsDetector d;
|
||||
|
||||
public:
|
||||
MultiDetectorFixture() : d(0, true, true) {
|
||||
d.setHostname(test::hostname.c_str());
|
||||
if (test::my_ip != "undefined")
|
||||
d.setReceiverHostname(test::my_ip);
|
||||
}
|
||||
~MultiDetectorFixture() { d.freeSharedMemory(); }
|
||||
};
|
||||
|
||||
TEST_CASE_METHOD(MultiDetectorFixture, "Set and get dacs",
|
||||
"[.eigerintegration][cli]") {
|
||||
auto th = 1000;
|
||||
|
||||
// set and read back each individual dac of EIGER
|
||||
d.setDAC(0, di::E_SvP, 0);
|
||||
CHECK(d.setDAC(-1, di::E_SvP, 0) == 0);
|
||||
d.setDAC(4000, di::E_SvN, 0);
|
||||
CHECK(d.setDAC(-1, di::E_SvN, 0) == 4000);
|
||||
d.setDAC(2000, di::E_Vtr, 0);
|
||||
CHECK(d.setDAC(-1, di::E_Vtr, 0) == 2000);
|
||||
d.setDAC(3500, di::E_Vrf, 0);
|
||||
CHECK(d.setDAC(-1, di::E_Vrf, 0) == 3500);
|
||||
d.setDAC(1400, di::E_Vrs, 0);
|
||||
CHECK(d.setDAC(-1, di::E_Vrs, 0) == 1400);
|
||||
d.setDAC(2556, di::E_Vtgstv, 0);
|
||||
CHECK(d.setDAC(-1, di::E_Vtgstv, 0) == 2556);
|
||||
d.setDAC(1500, di::E_Vcmp_ll, 0);
|
||||
CHECK(d.setDAC(-1, di::E_Vcmp_ll, 0) == 1500);
|
||||
d.setDAC(1400, di::E_Vcmp_lr, 0);
|
||||
CHECK(d.setDAC(-1, di::E_Vcmp_lr, 0) == 1400);
|
||||
d.setDAC(4000, di::E_cal, 0);
|
||||
CHECK(d.setDAC(-1, di::E_cal, 0) == 4000);
|
||||
d.setDAC(1300, di::E_Vcmp_rl, 0);
|
||||
CHECK(d.setDAC(-1, di::E_Vcmp_rl, 0) == 1300);
|
||||
d.setDAC(1200, di::E_Vcmp_rr, 0);
|
||||
CHECK(d.setDAC(-1, di::E_Vcmp_rr, 0) == 1200);
|
||||
d.setDAC(1100, di::E_rxb_rb, 0);
|
||||
CHECK(d.setDAC(-1, di::E_rxb_rb, 0) == 1100);
|
||||
d.setDAC(1100, di::E_rxb_lb, 0);
|
||||
CHECK(d.setDAC(-1, di::E_rxb_lb, 0) == 1100);
|
||||
d.setDAC(1500, di::E_Vcp, 0);
|
||||
CHECK(d.setDAC(-1, di::E_Vcp, 0) == 1500);
|
||||
d.setDAC(2000, di::E_Vcn, 0);
|
||||
CHECK(d.setDAC(-1, di::E_Vcn, 0) == 2000);
|
||||
d.setDAC(1550, di::E_Vis, 0);
|
||||
CHECK(d.setDAC(-1, di::E_Vis, 0) == 1550);
|
||||
d.setDAC(660, di::IO_DELAY, 0);
|
||||
CHECK(d.setDAC(-1, di::IO_DELAY, 0) == 660);
|
||||
|
||||
// setting threshold sets all individual vcmp
|
||||
d.setDAC(th, di::THRESHOLD, 0);
|
||||
CHECK(d.setDAC(-1, di::THRESHOLD, 0) == th);
|
||||
CHECK(d.setDAC(-1, di::E_Vcmp_ll, 0) == th);
|
||||
CHECK(d.setDAC(-1, di::E_Vcmp_lr, 0) == th);
|
||||
CHECK(d.setDAC(-1, di::E_Vcmp_rl, 0) == th);
|
||||
CHECK(d.setDAC(-1, di::E_Vcmp_rr, 0) == th);
|
||||
|
||||
// different values gives -1
|
||||
if (d.getNumberOfDetectors() > 1) {
|
||||
d.setDAC(1600, di::E_Vcmp_ll, 0, 0);
|
||||
d.setDAC(1700, di::E_Vcmp_ll, 0, 1);
|
||||
CHECK(d.setDAC(-1, di::E_Vcmp_ll, 0, 0) == 1600);
|
||||
CHECK(d.setDAC(-1, di::E_Vcmp_ll, 0, 1) == 1700);
|
||||
CHECK(d.setDAC(-1, di::E_Vcmp_ll, 0) == -1);
|
||||
CHECK(d.setDAC(-1, di::THRESHOLD, 0) == -1);
|
||||
CHECK(d.setDAC(-1, di::THRESHOLD, 0, 0) == -1);
|
||||
CHECK(d.setDAC(-1, di::THRESHOLD, 0, 1) == -1);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE_METHOD(MultiDetectorFixture, "Read temperatures",
|
||||
"[.eigerintegration][cli]") {
|
||||
std::vector<di> tempindex{di::TEMPERATURE_FPGA, di::TEMPERATURE_FPGA2,
|
||||
di::TEMPERATURE_FPGA3};
|
||||
for (auto index : tempindex) {
|
||||
for (int i = 0; i != d.getNumberOfDetectors(); ++i) {
|
||||
double temp = static_cast<double>(d.getADC(index, 0)) / 1000;
|
||||
CHECK(temp > 20);
|
||||
CHECK(temp < 60);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int to_time(uint32_t reg) {
|
||||
uint32_t clocks = reg >> 3;
|
||||
uint32_t exponent = (reg & 0b111) + 1;
|
||||
return clocks * pow(10, exponent);
|
||||
}
|
||||
|
||||
TEST_CASE_METHOD(MultiDetectorFixture, "Read/write register",
|
||||
"[.eigerintegration][cli]") {
|
||||
d.setNumberOfFrames(1);
|
||||
d.setExposureTime(10000);
|
||||
d.acquire();
|
||||
CHECK(to_time(d.readRegister(0x4, 0)) == 10000);
|
||||
|
||||
d.writeRegister(0x4, 500);
|
||||
CHECK(d.readRegister(0x4) == 500);
|
||||
}
|
||||
|
||||
TEST_CASE_METHOD(MultiDetectorFixture, "Set dynamic range",
|
||||
"[.eigerintegration][cli][dr]") {
|
||||
std::vector<int> dynamic_range{4, 8, 16, 32};
|
||||
for (auto dr : dynamic_range) {
|
||||
d.setDynamicRange(dr);
|
||||
CHECK(d.setDynamicRange() == dr);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE_METHOD(MultiDetectorFixture, "Set clock divider",
|
||||
"[.eigerintegration][cli][this]") {
|
||||
for (int i = 0; i != 3; ++i) {
|
||||
d.setSpeed(sv::CLOCK_DIVIDER, i);
|
||||
CHECK(d.setSpeed(sv::CLOCK_DIVIDER) == i);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE_METHOD(MultiDetectorFixture, "Get time left",
|
||||
"[.eigerintegration][cli]") {
|
||||
CHECK_THROWS(d.getTimeLeft(ti::PROGRESS));
|
||||
}
|
||||
|
||||
TEST_CASE_METHOD(MultiDetectorFixture, "Get ID", "[.eigerintegration][cli]") {
|
||||
std::string hn = test::hostname;
|
||||
hn.erase(std::remove(begin(hn), end(hn), 'b'), end(hn));
|
||||
hn.erase(std::remove(begin(hn), end(hn), 'e'), end(hn));
|
||||
auto hostnames = sls::split(hn, '+');
|
||||
CHECK(hostnames.size() == d.getNumberOfDetectors());
|
||||
for (int i = 0; i != d.getNumberOfDetectors(); ++i) {
|
||||
CHECK(d.getId(defs::DETECTOR_SERIAL_NUMBER, 0) ==
|
||||
std::stoi(hostnames[0]));
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE_METHOD(MultiDetectorFixture, "Lock server",
|
||||
"[.eigerintegration][cli]") {
|
||||
|
||||
d.lockServer(1);
|
||||
CHECK(d.lockServer() == 1);
|
||||
d.lockServer(0);
|
||||
CHECK(d.lockServer() == 0);
|
||||
}
|
||||
|
||||
TEST_CASE_METHOD(MultiDetectorFixture, "Settings", "[.eigerintegration][cli]") {
|
||||
CHECK(d.setSettings(defs::STANDARD) == defs::STANDARD);
|
||||
}
|
||||
|
||||
TEST_CASE_METHOD(MultiDetectorFixture, "Set readout flags",
|
||||
"[.eigerintegration][cli]") {
|
||||
d.setReadOutFlags(defs::PARALLEL);
|
||||
CHECK((d.setReadOutFlags() & defs::PARALLEL));
|
||||
|
||||
d.setReadOutFlags(defs::NONPARALLEL);
|
||||
CHECK_FALSE((d.setReadOutFlags() & defs::PARALLEL));
|
||||
CHECK((d.setReadOutFlags() & defs::NONPARALLEL));
|
||||
}
|
||||
|
||||
// TEST_CASE_METHOD(MultiDetectorFixture, "Flow control and tengiga",
|
||||
// "[.eigerintegration][cli]") {
|
||||
// d.setFlowControl10G(1);
|
||||
// CHECK(d.setFlowControl10G() == 1);
|
||||
// d.setFlowControl10G(0);
|
||||
// CHECK(d.setFlowControl10G() == 0);
|
||||
|
||||
// d.enableTenGigabitEthernet(1);
|
||||
// CHECK(d.enableTenGigabitEthernet() == 1);
|
||||
// d.enableTenGigabitEthernet(0);
|
||||
// CHECK(d.enableTenGigabitEthernet() == 0);
|
||||
// }
|
||||
|
||||
TEST_CASE_METHOD(MultiDetectorFixture, "activate", "[.eigerintegration][cli]") {
|
||||
d.activate(0);
|
||||
CHECK(d.activate() == 0);
|
||||
d.activate(1);
|
||||
CHECK(d.activate() == 1);
|
||||
}
|
||||
|
||||
TEST_CASE_METHOD(MultiDetectorFixture, "all trimbits",
|
||||
"[.eigerintegration][cli]") {
|
||||
d.setAllTrimbits(32);
|
||||
CHECK(d.setAllTrimbits(-1) == 32);
|
||||
}
|
||||
|
||||
TEST_CASE_METHOD(MultiDetectorFixture, "rate correction",
|
||||
"[.eigerintegration][cli]") {
|
||||
d.setRateCorrection(200);
|
||||
CHECK(d.getRateCorrection() == 200);
|
||||
}
|
@ -1,529 +0,0 @@
|
||||
|
||||
#include "catch.hpp"
|
||||
|
||||
#include "ClientSocket.h"
|
||||
#include "logger.h"
|
||||
#include "multiSlsDetector.h"
|
||||
#include "slsDetector.h"
|
||||
#include "sls_detector_defs.h"
|
||||
|
||||
#include "Timer.h"
|
||||
#include "sls_detector_funcs.h"
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#define VERBOSE
|
||||
|
||||
// Header holding all configurations for different detectors
|
||||
#include "tests/config.h"
|
||||
#include "tests/globals.h"
|
||||
// using namespace test;
|
||||
// using dt = slsDetectorDefs::detectorType;
|
||||
// extern std::string hostname;
|
||||
// extern std::string detector_type;
|
||||
// extern dt type;
|
||||
|
||||
TEST_CASE("Single detector no receiver", "[.integration][.single]") {
|
||||
auto t = slsDetector::getTypeFromDetector(test::hostname);
|
||||
CHECK(t == test::type);
|
||||
|
||||
slsDetector d(t);
|
||||
CHECK(d.getDetectorTypeAsEnum() == t);
|
||||
CHECK(d.getDetectorTypeAsString() == test::detector_type);
|
||||
|
||||
d.setHostname(test::hostname);
|
||||
CHECK(d.getHostname() == test::hostname);
|
||||
|
||||
CHECK(d.setDetectorType() == test::type);
|
||||
|
||||
d.freeSharedMemory();
|
||||
}
|
||||
|
||||
TEST_CASE("Set control port then create a new object with this control port",
|
||||
"[.integration][.single]") {
|
||||
/*
|
||||
TODO!
|
||||
Standard port but should not be hardcoded
|
||||
Is this the best way to initialize the detectors
|
||||
Using braces to make the object go out of scope
|
||||
*/
|
||||
int old_cport = DEFAULT_PORTNO;
|
||||
int old_sport = DEFAULT_PORTNO + 1;
|
||||
int new_cport = 1993;
|
||||
int new_sport = 2000;
|
||||
{
|
||||
slsDetector d(test::type);
|
||||
d.setHostname(test::hostname);
|
||||
CHECK(d.getControlPort() == old_cport);
|
||||
d.setControlPort(new_cport);
|
||||
CHECK(d.getStopPort() == old_sport);
|
||||
d.setStopPort(new_sport);
|
||||
d.freeSharedMemory();
|
||||
}
|
||||
{
|
||||
slsDetector d(test::type);
|
||||
d.setHostname(test::hostname);
|
||||
d.setControlPort(new_cport);
|
||||
d.setStopPort(new_sport);
|
||||
CHECK(d.getControlPort() == new_cport);
|
||||
CHECK(d.getStopPort() == new_sport);
|
||||
|
||||
// Reset standard ports
|
||||
d.setControlPort(old_cport);
|
||||
d.setStopPort(old_sport);
|
||||
d.freeSharedMemory();
|
||||
}
|
||||
|
||||
slsDetector d(test::type);
|
||||
d.setHostname(test::hostname);
|
||||
CHECK(d.getStopPort() == DEFAULT_PORTNO + 1);
|
||||
d.freeSharedMemory();
|
||||
}
|
||||
|
||||
|
||||
TEST_CASE("single EIGER detector no receiver basic set and get",
|
||||
"[.integration][eiger]") {
|
||||
// TODO! this test should take command line arguments for config
|
||||
SingleDetectorConfig c;
|
||||
|
||||
// Read type by connecting to the detector
|
||||
auto type = slsDetector::getTypeFromDetector(c.hostname);
|
||||
CHECK(type == c.type_enum);
|
||||
|
||||
// Create slsDetector of said type and set hostname and detector online
|
||||
slsDetector d(type);
|
||||
CHECK(d.getDetectorTypeAsEnum() == type);
|
||||
CHECK(d.getDetectorTypeAsString() == c.type_string);
|
||||
|
||||
d.setHostname(c.hostname);
|
||||
CHECK(d.getHostname() == c.hostname);
|
||||
|
||||
CHECK(d.getUseReceiverFlag() == false);
|
||||
CHECK_NOTHROW(d.checkDetectorVersionCompatibility());
|
||||
|
||||
// Setting and reading exposure time
|
||||
auto t = 1000000000;
|
||||
d.setTimer(slsDetectorDefs::timerIndex::ACQUISITION_TIME, t);
|
||||
CHECK(d.setTimer(slsDetectorDefs::timerIndex::ACQUISITION_TIME) == t);
|
||||
|
||||
// size of an eiger half module with and without gap pixels
|
||||
CHECK(d.getTotalNumberOfChannels() == 256 * 256 * 4);
|
||||
CHECK(d.getTotalNumberOfChannels(slsDetectorDefs::dimension::X) == 1024);
|
||||
CHECK(d.getTotalNumberOfChannels(slsDetectorDefs::dimension::Y) == 256);
|
||||
// CHECK(d.getTotalNumberOfChannels(slsDetectorDefs::dimension::Z) == 1);
|
||||
CHECK(d.getTotalNumberOfChannelsInclGapPixels(
|
||||
slsDetectorDefs::dimension::X) == 1024);
|
||||
CHECK(d.getTotalNumberOfChannelsInclGapPixels(
|
||||
slsDetectorDefs::dimension::Y) == 256);
|
||||
// CHECK(d.getTotalNumberOfChannelsInclGapPixels(slsDetectorDefs::dimension::Z)
|
||||
// == 1);
|
||||
|
||||
CHECK(d.getNChans() == 256 * 256);
|
||||
CHECK(d.getNChans(slsDetectorDefs::dimension::X) == 256);
|
||||
CHECK(d.getNChans(slsDetectorDefs::dimension::Y) == 256);
|
||||
// CHECK(d.getNChans(slsDetectorDefs::dimension::Z) == 1);
|
||||
|
||||
CHECK(d.getNChips() == 4);
|
||||
CHECK(d.getNChips(slsDetectorDefs::dimension::X) == 4);
|
||||
CHECK(d.getNChips(slsDetectorDefs::dimension::Y) == 1);
|
||||
// CHECK(d.getNChips(slsDetectorDefs::dimension::Z) == 1);
|
||||
|
||||
d.freeSharedMemory();
|
||||
}
|
||||
|
||||
|
||||
|
||||
TEST_CASE("Locking mechanism and last ip", "[.integration][.single]") {
|
||||
slsDetector d(test::type);
|
||||
d.setHostname(test::hostname);
|
||||
|
||||
// Check that detector server is unlocked then lock
|
||||
CHECK(d.lockServer() == 0);
|
||||
d.lockServer(1);
|
||||
CHECK(d.lockServer() == 1);
|
||||
|
||||
// Can we still access the detector while it's locked
|
||||
auto t = 1300000000;
|
||||
d.setTimer(slsDetectorDefs::timerIndex::ACQUISITION_TIME, t);
|
||||
CHECK(d.setTimer(slsDetectorDefs::timerIndex::ACQUISITION_TIME) == t);
|
||||
|
||||
// unlock again and free
|
||||
d.lockServer(0);
|
||||
CHECK(d.lockServer() == 0);
|
||||
|
||||
CHECK(d.getLastClientIP() == test::my_ip);
|
||||
d.freeSharedMemory();
|
||||
}
|
||||
|
||||
TEST_CASE("Set settings", "[.integration][.single]"){
|
||||
slsDetector d(test::type);
|
||||
d.setHostname(test::hostname);
|
||||
CHECK(d.setSettings(defs::STANDARD) == defs::STANDARD);
|
||||
}
|
||||
|
||||
|
||||
TEST_CASE("Timer functions", "[.integration][cli]") {
|
||||
// FRAME_NUMBER, /**< number of real time frames: total number of
|
||||
// acquisitions is number or frames*number of cycles */ ACQUISITION_TIME,
|
||||
// /**< exposure time */ FRAME_PERIOD, /**< period between exposures */
|
||||
// DELAY_AFTER_TRIGGER, /**< delay between trigger and start of exposure or
|
||||
// readout (in triggered mode) */ GATES_NUMBER, /**< number of gates per
|
||||
// frame (in gated mode) */ CYCLES_NUMBER, /**< number of cycles: total
|
||||
// number of acquisitions is number or frames*number of cycles */
|
||||
// ACTUAL_TIME, /**< Actual time of the detector's internal timer */
|
||||
// MEASUREMENT_TIME, /**< Time of the measurement from the detector (fifo)
|
||||
// */
|
||||
|
||||
// PROGRESS, /**< fraction of measurement elapsed - only get! */
|
||||
// MEASUREMENTS_NUMBER,
|
||||
// FRAMES_FROM_START,
|
||||
// FRAMES_FROM_START_PG,
|
||||
// SAMPLES,
|
||||
// SUBFRAME_ACQUISITION_TIME, /**< subframe exposure time */
|
||||
// STORAGE_CELL_NUMBER, /**<number of storage cells */
|
||||
// SUBFRAME_DEADTIME, /**< subframe deadtime */
|
||||
// MEASURED_PERIOD, /**< measured period */
|
||||
// MEASURED_SUBPERIOD, /**< measured subperiod */
|
||||
// MAX_TIMERS
|
||||
|
||||
slsDetector d(test::type);
|
||||
d.setHostname(test::hostname);
|
||||
|
||||
// Number of frames
|
||||
auto frames = 5;
|
||||
d.setTimer(slsDetectorDefs::timerIndex::FRAME_NUMBER, frames);
|
||||
CHECK(d.setTimer(slsDetectorDefs::timerIndex::FRAME_NUMBER) == frames);
|
||||
|
||||
auto exptime = 2000000000;
|
||||
d.setTimer(slsDetectorDefs::timerIndex::ACQUISITION_TIME, exptime);
|
||||
CHECK(d.setTimer(slsDetectorDefs::timerIndex::ACQUISITION_TIME) == exptime);
|
||||
|
||||
auto period = 2000000000;
|
||||
d.setTimer(slsDetectorDefs::timerIndex::FRAME_PERIOD, period);
|
||||
CHECK(d.setTimer(slsDetectorDefs::timerIndex::FRAME_PERIOD) == period);
|
||||
|
||||
if (test::type != dt::EIGER) {
|
||||
auto delay = 10000;
|
||||
d.setTimer(slsDetectorDefs::timerIndex::DELAY_AFTER_TRIGGER, delay);
|
||||
CHECK(d.setTimer(slsDetectorDefs::timerIndex::DELAY_AFTER_TRIGGER) ==
|
||||
delay);
|
||||
}
|
||||
|
||||
if (test::type != dt::EIGER) {
|
||||
auto gates = 1;
|
||||
d.setTimer(slsDetectorDefs::timerIndex::GATES_NUMBER, gates);
|
||||
CHECK(d.setTimer(slsDetectorDefs::timerIndex::GATES_NUMBER) == gates);
|
||||
}
|
||||
|
||||
auto cycles = 2;
|
||||
d.setTimer(slsDetectorDefs::timerIndex::CYCLES_NUMBER, cycles);
|
||||
CHECK(d.setTimer(slsDetectorDefs::timerIndex::CYCLES_NUMBER) == cycles);
|
||||
|
||||
if (test::type == dt::EIGER) {
|
||||
auto subtime = 200;
|
||||
d.setTimer(slsDetectorDefs::timerIndex::SUBFRAME_ACQUISITION_TIME,
|
||||
subtime);
|
||||
CHECK(d.setTimer(
|
||||
slsDetectorDefs::timerIndex::SUBFRAME_ACQUISITION_TIME) ==
|
||||
subtime);
|
||||
}
|
||||
// for (int i =0; i!=frames; ++i)
|
||||
d.startAndReadAll();
|
||||
|
||||
d.freeSharedMemory();
|
||||
|
||||
// If we add a timer we should add tests for the timer
|
||||
CHECK(slsDetectorDefs::MAX_TIMERS == 19);
|
||||
}
|
||||
|
||||
// TEST_CASE("Aquire", "[.integration][eiger]"){
|
||||
// SingleDetectorConfig c;
|
||||
// auto type = slsDetector::getTypeFromDetector(c.hostname);
|
||||
// slsDetector d(type);
|
||||
// d.setHostname(c.hostname);
|
||||
|
||||
// auto period = 1000000000;
|
||||
// auto exptime = 100000000;
|
||||
// d.setTimer(slsDetectorDefs::timerIndex::FRAME_NUMBER, 5);
|
||||
// d.setTimer(slsDetectorDefs::timerIndex::ACQUISITION_TIME, exptime);
|
||||
// d.setTimer(slsDetectorDefs::timerIndex::FRAME_PERIOD, period);
|
||||
// d.startAndReadAll();
|
||||
|
||||
// auto rperiod =
|
||||
// d.getTimeLeft(slsDetectorDefs::timerIndex::MEASURED_PERIOD);
|
||||
// CHECK(rperiod == 0.1);
|
||||
|
||||
// d.freeSharedMemory();
|
||||
// }
|
||||
|
||||
TEST_CASE(
|
||||
"Eiger Dynamic Range with effect on rate correction and clock divider",
|
||||
"[.eigerintegration]") {
|
||||
SingleDetectorConfig c;
|
||||
|
||||
int ratecorr = 125;
|
||||
|
||||
// pick up multi detector from shm id 0
|
||||
multiSlsDetector m(0);
|
||||
|
||||
// ensure eiger detector type, hostname and online
|
||||
REQUIRE(m.getDetectorTypeAsEnum() == c.type_enum);
|
||||
REQUIRE(m.getHostname() == c.hostname);
|
||||
|
||||
// starting state with rate correction off
|
||||
m.setRateCorrection(0);
|
||||
|
||||
// dr 16: clk divider, no change for ratecorr
|
||||
CHECK(m.setDynamicRange(16) == 16);
|
||||
CHECK(m.setSpeed(slsDetectorDefs::CLOCK_DIVIDER) == 1);
|
||||
CHECK(m.getRateCorrection() == 0);
|
||||
|
||||
// dr 32: clk divider, no change for ratecorr
|
||||
CHECK(m.setDynamicRange(32) == 32);
|
||||
CHECK(m.setSpeed(slsDetectorDefs::CLOCK_DIVIDER) == 2);
|
||||
CHECK(m.getRateCorrection() == 0);
|
||||
|
||||
// other drs: no change for clk divider, no change for ratecorr
|
||||
CHECK(m.setDynamicRange(8) == 8);
|
||||
CHECK(m.setSpeed(slsDetectorDefs::CLOCK_DIVIDER) == 2);
|
||||
CHECK(m.getRateCorrection() == 0);
|
||||
CHECK(m.setDynamicRange(4) == 4);
|
||||
CHECK(m.setSpeed(slsDetectorDefs::CLOCK_DIVIDER) == 2);
|
||||
CHECK(m.getRateCorrection() == 0);
|
||||
|
||||
// switching on rate correction with dr 16, 32
|
||||
m.setDynamicRange(16);
|
||||
m.setRateCorrection(ratecorr);
|
||||
CHECK(m.getRateCorrection() == ratecorr);
|
||||
m.setDynamicRange(32);
|
||||
CHECK(m.getRateCorrection() == ratecorr);
|
||||
|
||||
// ratecorr fail with dr 4 or 8
|
||||
CHECK_THROWS_AS(m.setDynamicRange(8), sls::RuntimeError);
|
||||
CHECK(m.getRateCorrection() == 0);
|
||||
m.setDynamicRange(16);
|
||||
m.setDynamicRange(16);
|
||||
m.setRateCorrection(ratecorr);
|
||||
m.setDynamicRange(16);
|
||||
m.setRateCorrection(ratecorr);
|
||||
CHECK_THROWS_AS(m.setDynamicRange(4), sls::RuntimeError);
|
||||
CHECK(m.getRateCorrection() == 0);
|
||||
}
|
||||
|
||||
TEST_CASE("Chiptestboard Loading Patterns", "[.ctbintegration]") {
|
||||
SingleDetectorConfig c;
|
||||
|
||||
// pick up multi detector from shm id 0
|
||||
multiSlsDetector m(0);
|
||||
|
||||
// ensure ctb detector type, hostname and online
|
||||
REQUIRE(m.getDetectorTypeAsEnum() == c.type_enum);
|
||||
REQUIRE(m.getHostname() == c.hostname);
|
||||
|
||||
uint64_t word = 0;
|
||||
int addr = 0;
|
||||
int level = 0;
|
||||
const int MAX_ADDR = 0x7fff;
|
||||
|
||||
word = 0xc000000000f47ff;
|
||||
CHECK(m.setPatternIOControl(word) == word);
|
||||
CHECK(m.setPatternIOControl(-1) == word);
|
||||
CHECK(m.setPatternIOControl(0) == 0);
|
||||
|
||||
CHECK(m.setPatternClockControl(word) == word);
|
||||
CHECK(m.setPatternClockControl(-1) == word);
|
||||
CHECK(m.setPatternClockControl(0) == 0);
|
||||
|
||||
// testing pattern word will execute the pattern as well
|
||||
addr = 0;
|
||||
m.setPatternWord(addr, word);
|
||||
CHECK(m.setPatternWord(addr, -1) == word);
|
||||
addr = MAX_ADDR - 1;
|
||||
m.setPatternWord(addr, word);
|
||||
CHECK(m.setPatternWord(addr, -1) == word);
|
||||
addr = 0x2FF;
|
||||
m.setPatternWord(addr, word);
|
||||
CHECK(m.setPatternWord(addr, -1) == word);
|
||||
addr = MAX_ADDR;
|
||||
CHECK_THROWS_AS(m.setPatternWord(addr, word), sls::RuntimeError);
|
||||
CHECK_THROWS_WITH(m.setPatternWord(addr, word),
|
||||
Catch::Matchers::Contains("be between 0 and"));
|
||||
addr = -1;
|
||||
CHECK_THROWS_AS(m.setPatternWord(addr, word), sls::RuntimeError);
|
||||
CHECK_THROWS_WITH(m.setPatternWord(addr, word),
|
||||
Catch::Matchers::Contains("be between 0 and"));
|
||||
|
||||
addr = 0x2FF;
|
||||
for (level = 0; level < 3; ++level) {
|
||||
CHECK(m.setPatternWaitAddr(level, addr) == addr);
|
||||
CHECK(m.setPatternWaitAddr(level, -1) == addr);
|
||||
}
|
||||
CHECK_THROWS_WITH(m.setPatternWaitAddr(-1, addr),
|
||||
Catch::Matchers::Contains("be between 0 and"));
|
||||
CHECK_THROWS_WITH(m.setPatternWaitAddr(0, MAX_ADDR),
|
||||
Catch::Matchers::Contains("be between 0 and"));
|
||||
|
||||
for (level = 0; level < 3; ++level) {
|
||||
CHECK(m.setPatternWaitTime(level, word) == word);
|
||||
CHECK(m.setPatternWaitTime(level, -1) == word);
|
||||
}
|
||||
CHECK_THROWS_WITH(m.setPatternWaitTime(-1, word),
|
||||
Catch::Matchers::Contains("be between 0 and"));
|
||||
|
||||
{
|
||||
int startaddr = addr;
|
||||
int stopaddr = addr + 5;
|
||||
int nloops = 2;
|
||||
for (level = 0; level < 3; ++level) {
|
||||
m.setPatternLoops(level, startaddr, stopaddr, nloops);
|
||||
auto r = m.getPatternLoops(level);
|
||||
CHECK(r[0] == startaddr);
|
||||
CHECK(r[1] == stopaddr);
|
||||
CHECK(r[2] == nloops);
|
||||
}
|
||||
m.setPatternLoops(-1, startaddr, stopaddr, nloops);
|
||||
auto r = m.getPatternLoops(-1);
|
||||
CHECK(r[0] == startaddr);
|
||||
CHECK(r[1] == stopaddr);
|
||||
CHECK(r[2] == -1);
|
||||
|
||||
CHECK_THROWS_WITH(m.setPatternLoops(-1, startaddr, MAX_ADDR, nloops),
|
||||
Catch::Matchers::Contains("be less than"));
|
||||
CHECK_THROWS_WITH(m.setPatternLoops(-1, MAX_ADDR, stopaddr, nloops),
|
||||
Catch::Matchers::Contains("be less than"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
TEST_CASE("Chiptestboard Dbit offset, list, sampling, advinvert", "[.ctbintegration][dbit]") {
|
||||
SingleDetectorConfig c;
|
||||
|
||||
// pick up multi detector from shm id 0
|
||||
multiSlsDetector m(0);
|
||||
|
||||
// ensure ctb detector type, hostname and online
|
||||
REQUIRE(m.getDetectorTypeAsEnum() == c.type_enum);
|
||||
REQUIRE(m.getHostname() == c.hostname);
|
||||
|
||||
// dbit offset
|
||||
m.setReceiverDbitOffset(0);
|
||||
CHECK(m.getReceiverDbitOffset() == 0);
|
||||
m.setReceiverDbitOffset(-1);
|
||||
CHECK(m.getReceiverDbitOffset() == 0);
|
||||
m.setReceiverDbitOffset(5);
|
||||
CHECK(m.getReceiverDbitOffset() == 5);
|
||||
|
||||
// dbit list
|
||||
|
||||
std::vector <int> list = m.getReceiverDbitList();
|
||||
list.clear();
|
||||
for (int i = 0; i < 10; ++i)
|
||||
list.push_back(i);
|
||||
m.setReceiverDbitList(list);
|
||||
|
||||
CHECK(m.getReceiverDbitList().size() == 10);
|
||||
|
||||
list.push_back(64);
|
||||
CHECK_THROWS_AS(m.setReceiverDbitList(list), sls::RuntimeError);
|
||||
CHECK_THROWS_WITH(m.setReceiverDbitList(list),
|
||||
Catch::Matchers::Contains("be between 0 and 63"));
|
||||
|
||||
list.clear();
|
||||
for (int i = 0; i < 65; ++i)
|
||||
list.push_back(i);
|
||||
CHECK(list.size() == 65);
|
||||
CHECK_THROWS_WITH(m.setReceiverDbitList(list),
|
||||
Catch::Matchers::Contains("be greater than 64"));
|
||||
|
||||
list.clear();
|
||||
m.setReceiverDbitList(list);
|
||||
CHECK(m.getReceiverDbitList().empty());
|
||||
|
||||
// adcinvert
|
||||
m.setADCInvert(0);
|
||||
CHECK(m.getADCInvert() == 0);
|
||||
m.setADCInvert(5);
|
||||
CHECK(m.getADCInvert() == 5);
|
||||
m.setADCInvert(-1);
|
||||
CHECK(m.getADCInvert() == -1);
|
||||
|
||||
// ext sampling reg
|
||||
m.setExternalSamplingSource(0);
|
||||
CHECK(m.getExternalSamplingSource() == 0);
|
||||
m.setExternalSamplingSource(62);
|
||||
CHECK(m.getExternalSamplingSource() == 62);
|
||||
CHECK_THROWS_WITH(m.setExternalSamplingSource(64),
|
||||
Catch::Matchers::Contains("be 0-63"));
|
||||
CHECK(m.getExternalSamplingSource() == 62);
|
||||
m.setExternalSampling(1);
|
||||
CHECK(m.getExternalSampling() == 1);
|
||||
m.setExternalSampling(0);
|
||||
CHECK(m.getExternalSampling() == 0);
|
||||
m.setExternalSampling(1);
|
||||
CHECK(m.getExternalSampling() == 1);
|
||||
CHECK(m.readRegister(0x7b) == 0x1003E);
|
||||
|
||||
}
|
||||
|
||||
TEST_CASE("Eiger or Jungfrau startingfnum", "[.eigerintegration][.jungfrauintegration][startingfnum]") {
|
||||
SingleDetectorConfig c;
|
||||
|
||||
// pick up multi detector from shm id 0
|
||||
multiSlsDetector m(0);
|
||||
|
||||
// ensure ctb detector type, hostname and online
|
||||
REQUIRE(((m.getDetectorTypeAsEnum() == slsDetectorDefs::detectorType::EIGER) || (m.getDetectorTypeAsEnum() == slsDetectorDefs::detectorType::JUNGFRAU)));
|
||||
REQUIRE(m.getHostname() == c.hostname);
|
||||
|
||||
CHECK(m.setTimer(slsDetectorDefs::FRAME_NUMBER, 1) == 1);
|
||||
|
||||
// starting fnum
|
||||
uint64_t val = 8;
|
||||
|
||||
m.setStartingFrameNumber(val);
|
||||
CHECK(m.getStartingFrameNumber() == val);
|
||||
CHECK(m.acquire() == slsDetectorDefs::OK);
|
||||
CHECK(m.getReceiverCurrentFrameIndex() == val);
|
||||
|
||||
++val;
|
||||
CHECK(m.acquire() == slsDetectorDefs::OK);
|
||||
CHECK(m.getReceiverCurrentFrameIndex() == val);
|
||||
|
||||
CHECK_THROWS_AS(m.setStartingFrameNumber(0), sls::RuntimeError);
|
||||
|
||||
if (m.getDetectorTypeAsString() == "Eiger") {
|
||||
val = 281474976710655;
|
||||
} else if (m.getDetectorTypeAsString() == "Jungfrau") {
|
||||
val = 18446744073709551615;
|
||||
}
|
||||
m.setStartingFrameNumber(val);
|
||||
CHECK(m.getStartingFrameNumber() == val);
|
||||
CHECK(m.acquire() == slsDetectorDefs::OK);
|
||||
CHECK(m.getReceiverCurrentFrameIndex() == val);
|
||||
CHECK(m.getStartingFrameNumber() == (val + 1));
|
||||
}
|
||||
|
||||
TEST_CASE("Eiger readnlines", "[.eigerintegration][readnlines]") {
|
||||
SingleDetectorConfig c;
|
||||
|
||||
// pick up multi detector from shm id 0
|
||||
multiSlsDetector m(0);
|
||||
|
||||
// ensure detector type, hostname
|
||||
REQUIRE((m.getDetectorTypeAsEnum() == slsDetectorDefs::detectorType::EIGER));
|
||||
REQUIRE(m.getHostname() == c.hostname);
|
||||
|
||||
m.setDynamicRange(16);
|
||||
m.enableTenGigabitEthernet(0);
|
||||
m.setReadNLines(256);
|
||||
CHECK(m.getReadNLines() == 256);
|
||||
m.setReadNLines(1);
|
||||
CHECK(m.getReadNLines() == 1);
|
||||
|
||||
m.setDynamicRange(8);
|
||||
m.setReadNLines(256);
|
||||
CHECK(m.getReadNLines() == 256);
|
||||
CHECK_THROWS_AS(m.setReadNLines(1), sls::RuntimeError);
|
||||
CHECK(m.getReadNLines() == 256);
|
||||
CHECK_THROWS_AS(m.setReadNLines(0), sls::RuntimeError);
|
||||
m.setReadNLines(256);
|
||||
}
|
@ -1,106 +0,0 @@
|
||||
#include "catch.hpp"
|
||||
#include "multiSlsDetector.h"
|
||||
#include "string_utils.h"
|
||||
#include "tests/globals.h"
|
||||
#include <iostream>
|
||||
|
||||
using namespace Catch::literals;
|
||||
|
||||
TEST_CASE("Initialize a multi detector", "[.integration][.multi]") {
|
||||
auto hostnames = sls::split(test::hostname, '+');
|
||||
|
||||
multiSlsDetector d(0, true, true);
|
||||
d.setHostname(test::hostname.c_str());
|
||||
|
||||
CHECK(d.getHostname() == test::hostname);
|
||||
for (size_t i = 0; i != hostnames.size(); ++i) {
|
||||
CHECK(d.getHostname(i) == hostnames[i]);
|
||||
}
|
||||
|
||||
CHECK(d.getDetectorTypeAsEnum() == test::type);
|
||||
CHECK(d.getDetectorTypeAsString() == test::detector_type);
|
||||
|
||||
CHECK(d.getNumberOfDetectors() == hostnames.size());
|
||||
d.freeSharedMemory();
|
||||
}
|
||||
|
||||
|
||||
|
||||
TEST_CASE("Set and read timers", "[.integration][.multi]") {
|
||||
|
||||
multiSlsDetector d(0, true, true);
|
||||
d.setHostname(test::hostname.c_str());
|
||||
|
||||
// FRAME_NUMBER
|
||||
int n_frames = 3;
|
||||
d.setNumberOfFrames(n_frames);
|
||||
CHECK(d.setNumberOfFrames() == n_frames);
|
||||
|
||||
// ACQUISITION_TIME
|
||||
double exptime = 0.3;
|
||||
d.setExposureTime(exptime, true);
|
||||
CHECK(d.setExposureTime(-1, true) == Approx(exptime));
|
||||
CHECK(d.setExposureTime(-1) == Approx(exptime * 1E9));
|
||||
|
||||
// FRAME_PERIOD,
|
||||
double period = 0.5;
|
||||
d.setExposurePeriod(period, true);
|
||||
CHECK(d.setExposurePeriod(-1, true) == Approx(period));
|
||||
CHECK(d.setExposurePeriod(-1) == Approx(period * 1E9));
|
||||
|
||||
// DELAY_AFTER_TRIGGER,
|
||||
// GATES_NUMBER,
|
||||
// CYCLES_NUMBER,
|
||||
// ACTUAL_TIME
|
||||
// MEASUREMENT_TIME
|
||||
|
||||
// PROGRESS, /**< fraction of measurement elapsed - only get! */
|
||||
// MEASUREMENTS_NUMBER,
|
||||
|
||||
|
||||
// FRAMES_FROM_START,
|
||||
// FRAMES_FROM_START_PG,
|
||||
// SAMPLES,
|
||||
|
||||
// SUBFRAME_ACQUISITION_TIME, /**< subframe exposure time */
|
||||
double subframe_exposure = 2000000; // ns
|
||||
if (test::type == dt::EIGER) {
|
||||
d.setSubFrameExposureTime(subframe_exposure);
|
||||
CHECK(d.setSubFrameExposureTime(-1) == Approx(subframe_exposure));
|
||||
}
|
||||
|
||||
// STORAGE_CELL_NUMBER, /**<number of storage cells */
|
||||
|
||||
// SUBFRAME_DEADTIME, /**< subframe deadtime */
|
||||
double subframe_deadtime = 4000; // ns
|
||||
if (test::type == dt::EIGER) {
|
||||
d.setSubFrameExposureDeadTime(subframe_deadtime);
|
||||
CHECK(d.setSubFrameExposureDeadTime(-1) == Approx(subframe_deadtime));
|
||||
}
|
||||
|
||||
|
||||
if (test::type == dt::EIGER) {
|
||||
// 32bit is needed for subframe exposure
|
||||
d.setDynamicRange(32);
|
||||
CHECK(d.setDynamicRange(-1) == 32);
|
||||
d.setReadOutFlags(ro::PARALLEL);
|
||||
|
||||
// Needed to have measured values
|
||||
d.acquire();
|
||||
|
||||
// MEASURED_PERIOD, /**< measured period */
|
||||
for (int i = 0; i != d.getNumberOfDetectors(); ++i) {
|
||||
CHECK(d.getMeasuredPeriod(true, i) == Approx(period));
|
||||
}
|
||||
|
||||
// MEASURED_SUBPERIOD, /**< measured subperiod */
|
||||
for (int i = 0; i != d.getNumberOfDetectors(); ++i) {
|
||||
CHECK(d.getMeasuredSubFramePeriod(false, i) ==
|
||||
Approx(subframe_deadtime + subframe_exposure));
|
||||
}
|
||||
}
|
||||
|
||||
// MAX_TIMERS
|
||||
|
||||
d.freeSharedMemory();
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
// tests-main.cpp
|
||||
#define CATCH_CONFIG_MAIN
|
||||
#include "catch.hpp"
|
14934
libs/catch/catch.hpp
14934
libs/catch/catch.hpp
File diff suppressed because it is too large
Load Diff
1264
libs/catch/clara.hpp
1264
libs/catch/clara.hpp
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user