mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-18 15:57:13 +02:00
Compare commits
210 Commits
2020.04.08
...
2020.06.08
Author | SHA1 | Date | |
---|---|---|---|
6c95bf171b | |||
fd948f1a00 | |||
ff9811895f | |||
7f6d57d6ba | |||
099805ba8b | |||
1e2a3f2767 | |||
9a8300ca08 | |||
40257fc82d | |||
3bdc8e95ce | |||
223e24f924 | |||
4053594c4d | |||
f07e722d26 | |||
2ef8f2f046 | |||
0e514a470d | |||
294612b03c | |||
f223415f94 | |||
c6ff50d753 | |||
f0a318777c | |||
8aa7144252 | |||
15eea51f12 | |||
e884836f5c | |||
104d91e8c6 | |||
9ddebc4c09 | |||
0525e374b2 | |||
e727b97d75 | |||
5ca987ecbb | |||
2a64a9f6e0 | |||
a708da5455 | |||
e2eb1598d3 | |||
d175ba0936 | |||
6189fd157a | |||
6c753f3b50 | |||
098d3e6d98 | |||
4300e95a8e | |||
46daa7e2de | |||
754536898a | |||
20bfe92573 | |||
9493ae3da9 | |||
0fca9fba79 | |||
b543708d9d | |||
e0ea08332f | |||
e229fee6ba | |||
44a88893ba | |||
f4ba46c19b | |||
37cb0bb1c0 | |||
f293ba8c56 | |||
e9ca17f860 | |||
30391a2faf | |||
7ba877446c | |||
6bdc506a34 | |||
9592d1760f | |||
8ffb27c300 | |||
0a66605111 | |||
02d8b1fb5f | |||
457f31ed61 | |||
be3f095b56 | |||
174bb32744 | |||
07d90d127f | |||
0debd6a457 | |||
8f0ef68029 | |||
d71e40729a | |||
9475e01062 | |||
dc8f67cd7b | |||
3ebb1fca02 | |||
8973ef1aaa | |||
5690914048 | |||
fa768e584e | |||
62e69b900b | |||
30fc346e22 | |||
761f93d753 | |||
6d71d6cf9f | |||
e208d3ebe8 | |||
cd90f09a30 | |||
4570ffc8ad | |||
a7ce30391c | |||
c33c479ada | |||
c8eda1a458 | |||
ecc692ad9a | |||
00c1211c56 | |||
599625e6ed | |||
3514b14bc9 | |||
395b9f1b72 | |||
26dfccf77e | |||
50d2d21018 | |||
2c83abcac7 | |||
ea7cc9db8c | |||
0dd5a099c8 | |||
e6deccc2c6 | |||
ad42a61bae | |||
cbc2856c1c | |||
e34fbb4350 | |||
eea67014b7 | |||
3962714b48 | |||
f0f97f265a | |||
e730c124e3 | |||
f51c4e1d7c | |||
a62b650e24 | |||
af4b5bbf50 | |||
d8ca9bb6b5 | |||
9a1fdc4104 | |||
b3ebce378d | |||
46afcfe694 | |||
d7563fdd1a | |||
ccf1889113 | |||
88f801061f | |||
e3d3c88d74 | |||
80f4f115f9 | |||
9a7d15bbf6 | |||
e148a584df | |||
5aaefc8e00 | |||
ed8d606eb2 | |||
eff664e790 | |||
1ed1b5da86 | |||
353b8d0057 | |||
bbe9108fb9 | |||
1998f9541e | |||
6620027439 | |||
30078d6c1f | |||
13c1f7c2d6 | |||
28bafb012a | |||
9c7ff84b73 | |||
ab5cad4fde | |||
dac9998161 | |||
1dfac6ae6a | |||
2e75f36fa0 | |||
c1902c713d | |||
61f5564bb7 | |||
ec2f7db729 | |||
676055837f | |||
cce028b825 | |||
d468641138 | |||
01d1c86403 | |||
2ac7451a99 | |||
15b57b29fb | |||
902616a09d | |||
eb3971fedc | |||
64f0aa98ab | |||
61b86962bd | |||
0e5a96e1ed | |||
2f11dbc2c9 | |||
9b21f44d94 | |||
e56b431dc3 | |||
1741c84406 | |||
1623448086 | |||
1a39f92f8f | |||
4ea1f2c7e3 | |||
66d30cb2f1 | |||
8f021fe4ac | |||
7f42f5cadb | |||
999c548aa1 | |||
6872f24037 | |||
1a75170eed | |||
a12d47da36 | |||
c16411ba00 | |||
379b9b53b4 | |||
d76f43f5fd | |||
7d94ad51ab | |||
671cf45fd7 | |||
31ec3c8cf7 | |||
8ff9b0cdac | |||
ea4044e4b1 | |||
e599bb7c24 | |||
3618f6e5d3 | |||
959fd562d3 | |||
32662baef8 | |||
4e4f06560c | |||
efcb6cf480 | |||
9ae933b177 | |||
f87e8d3c19 | |||
903ebb2679 | |||
f41083842f | |||
9a87ba610a | |||
7224ad989a | |||
64f5c0f34b | |||
3238ecfc8d | |||
395d7ba98a | |||
96ec3b2123 | |||
b7805ae0d4 | |||
1f6b0b5887 | |||
b1cdc79bd4 | |||
f626db454e | |||
86b39853a3 | |||
e3044689dd | |||
337e56d9bf | |||
eb257154c6 | |||
c1ae67ac46 | |||
68f76e5356 | |||
8afa11ed33 | |||
bc389f4825 | |||
095ced153c | |||
a1a5a20845 | |||
c725a05ef8 | |||
815b6a37aa | |||
655a410d43 | |||
97ba81d923 | |||
3d00eed0f0 | |||
a7f5300455 | |||
2f33a1a479 | |||
39fa5e0185 | |||
ba4985ed4d | |||
f811c065d1 | |||
3a1d87728c | |||
0652ff6b5a | |||
373e177274 | |||
6dd6685e7d | |||
38c31fdada | |||
b3fe0e79bc | |||
215e4a56fd | |||
71a68c2022 | |||
55f8497eac |
@ -4,3 +4,4 @@ IndentWidth: 4
|
|||||||
UseTab: Never
|
UseTab: Never
|
||||||
ColumnLimit: 80
|
ColumnLimit: 80
|
||||||
AlignConsecutiveAssignments: false
|
AlignConsecutiveAssignments: false
|
||||||
|
AlignConsecutiveMacros: true
|
@ -45,6 +45,22 @@ option(SLS_USE_CTBGUI "ctb GUI" OFF)
|
|||||||
option(SLS_BUILD_DOCS "docs" OFF)
|
option(SLS_BUILD_DOCS "docs" OFF)
|
||||||
option(SLS_BUILD_EXAMPLES "examples" OFF)
|
option(SLS_BUILD_EXAMPLES "examples" OFF)
|
||||||
option(SLS_TUNE_LOCAL "tune to local machine" OFF)
|
option(SLS_TUNE_LOCAL "tune to local machine" OFF)
|
||||||
|
option(SLS_DEVEL_HEADERS "install headers for devel" OFF)
|
||||||
|
|
||||||
|
# set(ClangFormat_BIN_NAME clang-format)
|
||||||
|
set(ClangFormat_EXCLUDE_PATTERNS "build/"
|
||||||
|
"libs/"
|
||||||
|
"slsDetectorCalibration/"
|
||||||
|
"ctbGui/"
|
||||||
|
"manual/"
|
||||||
|
"python/"
|
||||||
|
"sample/"
|
||||||
|
${CMAKE_BINARY_DIR})
|
||||||
|
find_package(ClangFormat)
|
||||||
|
|
||||||
|
#Enable LTO if available
|
||||||
|
check_ipo_supported(RESULT SLS_LTO_AVAILABLE)
|
||||||
|
|
||||||
|
|
||||||
# Use ld.gold if it is available and isn't disabled explicitly
|
# Use ld.gold if it is available and isn't disabled explicitly
|
||||||
option(SLS_USE_LD_GOLD "Use GNU gold linker" ON)
|
option(SLS_USE_LD_GOLD "Use GNU gold linker" ON)
|
||||||
|
39
cmake/FindClangFormat.cmake
Normal file
39
cmake/FindClangFormat.cmake
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
# Find Clang format
|
||||||
|
if(NOT ClangFormat_BIN_NAME)
|
||||||
|
set(ClangFormat_BIN_NAME clang-format)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# if custom path check there first
|
||||||
|
if(ClangFormat_ROOT_DIR)
|
||||||
|
find_program(ClangFormat_BIN
|
||||||
|
NAMES
|
||||||
|
${ClangFormat_BIN_NAME}
|
||||||
|
PATHS
|
||||||
|
"${ClangFormat_ROOT_DIR}"
|
||||||
|
NO_DEFAULT_PATH)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_program(ClangFormat_BIN NAMES ${ClangFormat_BIN_NAME})
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
|
||||||
|
ClangFormat
|
||||||
|
DEFAULT_MSG
|
||||||
|
ClangFormat_BIN)
|
||||||
|
|
||||||
|
mark_as_advanced(
|
||||||
|
ClangFormat_BIN)
|
||||||
|
|
||||||
|
if(ClangFormat_FOUND)
|
||||||
|
exec_program(${ClangFormat_BIN} ${CMAKE_CURRENT_SOURCE_DIR} ARGS --version OUTPUT_VARIABLE CLANG_VERSION_TEXT)
|
||||||
|
string(REGEX MATCH "([0-9]+)\\.[0-9]+\\.[0-9]+" CLANG_VERSION ${CLANG_VERSION_TEXT})
|
||||||
|
if((${CLANG_VERSION} GREATER "9") OR (${CLANG_VERSION} EQUAL "9"))
|
||||||
|
# A CMake script to find all source files and setup clang-format targets for them
|
||||||
|
message(STATUS "found clang-format \"${CLANG_VERSION}\" adding formatting targets")
|
||||||
|
include(clang-format)
|
||||||
|
else()
|
||||||
|
message(STATUS "clang-format version \"${CLANG_VERSION}\" found but need at least 9. Not setting up format targets")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
message(STATUS "clang-format not found. Not setting up format targets")
|
||||||
|
endif()
|
47
cmake/clang-format.cmake
Normal file
47
cmake/clang-format.cmake
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
# A CMake script to find all source files and setup clang-format targets for them
|
||||||
|
|
||||||
|
# Find all source files
|
||||||
|
set(ClangFormat_CXX_FILE_EXTENSIONS ${ClangFormat_CXX_FILE_EXTENSIONS} *.cpp *.h *.cxx *.hxx *.hpp *.cc *.ipp *.c)
|
||||||
|
file(GLOB_RECURSE ALL_SOURCE_FILES ${ClangFormat_CXX_FILE_EXTENSIONS})
|
||||||
|
|
||||||
|
# Don't include some common build folders
|
||||||
|
set(ClangFormat_EXCLUDE_PATTERNS ${ClangFormat_EXCLUDE_PATTERNS} "/CMakeFiles/" "cmake")
|
||||||
|
|
||||||
|
# get all project files file
|
||||||
|
foreach (SOURCE_FILE ${ALL_SOURCE_FILES})
|
||||||
|
foreach (EXCLUDE_PATTERN ${ClangFormat_EXCLUDE_PATTERNS})
|
||||||
|
string(FIND ${SOURCE_FILE} ${EXCLUDE_PATTERN} EXCLUDE_FOUND)
|
||||||
|
if (NOT ${EXCLUDE_FOUND} EQUAL -1)
|
||||||
|
list(REMOVE_ITEM ALL_SOURCE_FILES ${SOURCE_FILE})
|
||||||
|
endif ()
|
||||||
|
endforeach ()
|
||||||
|
endforeach ()
|
||||||
|
|
||||||
|
#target for formatting soruce files
|
||||||
|
add_custom_target(format
|
||||||
|
COMMENT "Running clang-format to change files"
|
||||||
|
COMMAND ${ClangFormat_BIN}
|
||||||
|
-style=file
|
||||||
|
-i
|
||||||
|
${ALL_SOURCE_FILES}
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
#target to check format on source files
|
||||||
|
add_custom_target(format-check
|
||||||
|
COMMENT "Checking clang-format changes"
|
||||||
|
# Use ! to negate the result for correct output
|
||||||
|
COMMAND !
|
||||||
|
${ClangFormat_BIN}
|
||||||
|
-style=file
|
||||||
|
-output-replacements-xml
|
||||||
|
${ALL_SOURCE_FILES}
|
||||||
|
| grep -q "replacement offset"
|
||||||
|
)
|
||||||
|
|
||||||
|
# debug to check which file will be formatted
|
||||||
|
add_custom_target(
|
||||||
|
listformatfiles
|
||||||
|
COMMAND
|
||||||
|
echo ${ALL_SOURCE_FILES}
|
||||||
|
)
|
@ -21,6 +21,7 @@ if [ -f "$infile" ]
|
|||||||
then
|
then
|
||||||
gcc -DINFILE="\"$infile\"" -DOUTFILE="\"$outfile\"" -DOUTFILEBIN="\"$outfilebin\"" -o $exe generator.c ;
|
gcc -DINFILE="\"$infile\"" -DOUTFILE="\"$outfile\"" -DOUTFILEBIN="\"$outfilebin\"" -o $exe generator.c ;
|
||||||
echo compiling
|
echo compiling
|
||||||
|
echo gcc -DINFILE="\"$infile\"" -DOUTFILE="\"$outfile\"" -DOUTFILEBIN="\"$outfilebin\"" -o $exe generator.c ;
|
||||||
$exe ;
|
$exe ;
|
||||||
echo cleaning
|
echo cleaning
|
||||||
rm $exe
|
rm $exe
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
|
||||||
#include "CmdProxy.h"
|
#include "CmdProxy.h"
|
||||||
#include "Detector.h"
|
#include "Detector.h"
|
||||||
#include "sls_detector_defs.h"
|
#include "sls_detector_defs.h"
|
||||||
@ -52,5 +51,4 @@ int main() {
|
|||||||
auto help = replace_all(tmp, "\n\t", "\n\t\t");
|
auto help = replace_all(tmp, "\n\t", "\n\t\t");
|
||||||
fs << '\t' << cmd << usage << help << "\n";
|
fs << '\t' << cmd << usage << help << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
29
examples/gotthard_II.config
Normal file
29
examples/gotthard_II.config
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
hostname strip3
|
||||||
|
|
||||||
|
udp_srcip 10.1.1.184
|
||||||
|
udp_dstip 10.1.1.107
|
||||||
|
|
||||||
|
udp_dstport2 50084
|
||||||
|
udp_srcip2 10.1.1.185
|
||||||
|
udp_dstip2 10.1.1.107
|
||||||
|
|
||||||
|
rx_hostname pc12365:1954
|
||||||
|
#udp_dstmac 3c:fd:fe:d2:a4:25
|
||||||
|
fpath /tmp
|
||||||
|
fname run
|
||||||
|
fwrite 0
|
||||||
|
|
||||||
|
bursts 10
|
||||||
|
frames 2700
|
||||||
|
burstperiod 100ms
|
||||||
|
|
||||||
|
numinterfaces 2
|
||||||
|
veto 1
|
||||||
|
|
||||||
|
#fixing data looks
|
||||||
|
# Sampling pipeline 1 clk
|
||||||
|
reg 0x120 0x00000010
|
||||||
|
clkphase 1 135 deg
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
#include "catch.hpp"
|
|
||||||
#include "DetectorImpl.h"
|
#include "DetectorImpl.h"
|
||||||
|
#include "catch.hpp"
|
||||||
#include "string_utils.h"
|
#include "string_utils.h"
|
||||||
#include "tests/globals.h"
|
#include "tests/globals.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
30
integrationTests/test-integrationDectector.cpp
Executable file → Normal file
30
integrationTests/test-integrationDectector.cpp
Executable file → Normal file
@ -2,9 +2,9 @@
|
|||||||
#include "catch.hpp"
|
#include "catch.hpp"
|
||||||
|
|
||||||
#include "ClientSocket.h"
|
#include "ClientSocket.h"
|
||||||
#include "logger.h"
|
|
||||||
#include "DetectorImpl.h"
|
#include "DetectorImpl.h"
|
||||||
#include "Module.h"
|
#include "Module.h"
|
||||||
|
#include "logger.h"
|
||||||
#include "sls_detector_defs.h"
|
#include "sls_detector_defs.h"
|
||||||
|
|
||||||
#include "Timer.h"
|
#include "Timer.h"
|
||||||
@ -79,7 +79,6 @@ TEST_CASE("Set control port then create a new object with this control port",
|
|||||||
d.freeSharedMemory();
|
d.freeSharedMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TEST_CASE("single EIGER detector no receiver basic set and get",
|
TEST_CASE("single EIGER detector no receiver basic set and get",
|
||||||
"[.integration][eiger]") {
|
"[.integration][eiger]") {
|
||||||
// TODO! this test should take command line arguments for config
|
// TODO! this test should take command line arguments for config
|
||||||
@ -130,8 +129,6 @@ TEST_CASE("single EIGER detector no receiver basic set and get",
|
|||||||
d.freeSharedMemory();
|
d.freeSharedMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TEST_CASE("Locking mechanism and last ip", "[.integration][.single]") {
|
TEST_CASE("Locking mechanism and last ip", "[.integration][.single]") {
|
||||||
Module d(test::type);
|
Module d(test::type);
|
||||||
d.setHostname(test::hostname);
|
d.setHostname(test::hostname);
|
||||||
@ -154,13 +151,12 @@ TEST_CASE("Locking mechanism and last ip", "[.integration][.single]") {
|
|||||||
d.freeSharedMemory();
|
d.freeSharedMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("Set settings", "[.integration][.single]"){
|
TEST_CASE("Set settings", "[.integration][.single]") {
|
||||||
Module d(test::type);
|
Module d(test::type);
|
||||||
d.setHostname(test::hostname);
|
d.setHostname(test::hostname);
|
||||||
CHECK(d.setSettings(defs::STANDARD) == defs::STANDARD);
|
CHECK(d.setSettings(defs::STANDARD) == defs::STANDARD);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TEST_CASE("Timer functions", "[.integration][cli]") {
|
TEST_CASE("Timer functions", "[.integration][cli]") {
|
||||||
// FRAME_NUMBER, /**< number of real time frames: total number of
|
// FRAME_NUMBER, /**< number of real time frames: total number of
|
||||||
// acquisitions is number or frames*number of triggers */ ACQUISITION_TIME,
|
// acquisitions is number or frames*number of triggers */ ACQUISITION_TIME,
|
||||||
@ -204,8 +200,7 @@ TEST_CASE("Timer functions", "[.integration][cli]") {
|
|||||||
if (test::type != dt::EIGER) {
|
if (test::type != dt::EIGER) {
|
||||||
auto delay = 10000;
|
auto delay = 10000;
|
||||||
d.setDelayAfterTrigger(delay);
|
d.setDelayAfterTrigger(delay);
|
||||||
CHECK(d.getDelayAfterTrigger() ==
|
CHECK(d.getDelayAfterTrigger() == delay);
|
||||||
delay);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto triggers = 2;
|
auto triggers = 2;
|
||||||
@ -221,7 +216,6 @@ TEST_CASE("Timer functions", "[.integration][cli]") {
|
|||||||
d.startAndReadAll();
|
d.startAndReadAll();
|
||||||
|
|
||||||
d.freeSharedMemory();
|
d.freeSharedMemory();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TEST_CASE("Aquire", "[.integration][eiger]"){
|
// TEST_CASE("Aquire", "[.integration][eiger]"){
|
||||||
@ -382,8 +376,8 @@ TEST_CASE("Chiptestboard Loading Patterns", "[.ctbintegration]") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_CASE("Chiptestboard Dbit offset, list, sampling, advinvert",
|
||||||
TEST_CASE("Chiptestboard Dbit offset, list, sampling, advinvert", "[.ctbintegration][dbit]") {
|
"[.ctbintegration][dbit]") {
|
||||||
SingleDetectorConfig c;
|
SingleDetectorConfig c;
|
||||||
|
|
||||||
// pick up multi detector from shm id 0
|
// pick up multi detector from shm id 0
|
||||||
@ -403,7 +397,7 @@ TEST_CASE("Chiptestboard Dbit offset, list, sampling, advinvert", "[.ctbintegrat
|
|||||||
|
|
||||||
// dbit list
|
// dbit list
|
||||||
|
|
||||||
std::vector <int> list = m.getReceiverDbitList();
|
std::vector<int> list = m.getReceiverDbitList();
|
||||||
list.clear();
|
list.clear();
|
||||||
for (int i = 0; i < 10; ++i)
|
for (int i = 0; i < 10; ++i)
|
||||||
list.push_back(i);
|
list.push_back(i);
|
||||||
@ -450,17 +444,20 @@ TEST_CASE("Chiptestboard Dbit offset, list, sampling, advinvert", "[.ctbintegrat
|
|||||||
m.setExternalSampling(1);
|
m.setExternalSampling(1);
|
||||||
CHECK(m.getExternalSampling() == 1);
|
CHECK(m.getExternalSampling() == 1);
|
||||||
CHECK(m.readRegister(0x7b) == 0x1003E);
|
CHECK(m.readRegister(0x7b) == 0x1003E);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("Eiger or Jungfrau startingfnum", "[.eigerintegration][.jungfrauintegration][startingfnum]") {
|
TEST_CASE("Eiger or Jungfrau startingfnum",
|
||||||
|
"[.eigerintegration][.jungfrauintegration][startingfnum]") {
|
||||||
SingleDetectorConfig c;
|
SingleDetectorConfig c;
|
||||||
|
|
||||||
// pick up multi detector from shm id 0
|
// pick up multi detector from shm id 0
|
||||||
DetectorImpl m(0);
|
DetectorImpl m(0);
|
||||||
|
|
||||||
// ensure ctb detector type, hostname and online
|
// ensure ctb detector type, hostname and online
|
||||||
REQUIRE(((m.getDetectorTypeAsEnum() == slsDetectorDefs::detectorType::EIGER) || (m.getDetectorTypeAsEnum() == slsDetectorDefs::detectorType::JUNGFRAU)));
|
REQUIRE(
|
||||||
|
((m.getDetectorTypeAsEnum() == slsDetectorDefs::detectorType::EIGER) ||
|
||||||
|
(m.getDetectorTypeAsEnum() ==
|
||||||
|
slsDetectorDefs::detectorType::JUNGFRAU)));
|
||||||
REQUIRE(m.getHostname() == c.hostname);
|
REQUIRE(m.getHostname() == c.hostname);
|
||||||
|
|
||||||
CHECK(m.setNumberOfFrames(1) == 1);
|
CHECK(m.setNumberOfFrames(1) == 1);
|
||||||
@ -498,7 +495,8 @@ TEST_CASE("Eiger readnlines", "[.eigerintegration][readnlines]") {
|
|||||||
DetectorImpl m(0);
|
DetectorImpl m(0);
|
||||||
|
|
||||||
// ensure detector type, hostname
|
// ensure detector type, hostname
|
||||||
REQUIRE((m.getDetectorTypeAsEnum() == slsDetectorDefs::detectorType::EIGER));
|
REQUIRE(
|
||||||
|
(m.getDetectorTypeAsEnum() == slsDetectorDefs::detectorType::EIGER));
|
||||||
REQUIRE(m.getHostname() == c.hostname);
|
REQUIRE(m.getHostname() == c.hostname);
|
||||||
|
|
||||||
m.setDynamicRange(16);
|
m.setDynamicRange(16);
|
||||||
|
6
integrationTests/test-integrationMulti.cpp
Executable file → Normal file
6
integrationTests/test-integrationMulti.cpp
Executable file → Normal file
@ -1,5 +1,5 @@
|
|||||||
#include "catch.hpp"
|
|
||||||
#include "DetectorImpl.h"
|
#include "DetectorImpl.h"
|
||||||
|
#include "catch.hpp"
|
||||||
#include "string_utils.h"
|
#include "string_utils.h"
|
||||||
#include "tests/globals.h"
|
#include "tests/globals.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@ -24,8 +24,6 @@ TEST_CASE("Initialize a multi detector", "[.integration][.multi]") {
|
|||||||
d.freeSharedMemory();
|
d.freeSharedMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TEST_CASE("Set and read timers", "[.integration][.multi]") {
|
TEST_CASE("Set and read timers", "[.integration][.multi]") {
|
||||||
|
|
||||||
DetectorImpl d(0, true, true);
|
DetectorImpl d(0, true, true);
|
||||||
@ -57,7 +55,6 @@ TEST_CASE("Set and read timers", "[.integration][.multi]") {
|
|||||||
// PROGRESS, /**< fraction of measurement elapsed - only get! */
|
// PROGRESS, /**< fraction of measurement elapsed - only get! */
|
||||||
// MEASUREMENTS_NUMBER,
|
// MEASUREMENTS_NUMBER,
|
||||||
|
|
||||||
|
|
||||||
// FRAMES_FROM_START,
|
// FRAMES_FROM_START,
|
||||||
// FRAMES_FROM_START_PG,
|
// FRAMES_FROM_START_PG,
|
||||||
// SAMPLES,
|
// SAMPLES,
|
||||||
@ -78,7 +75,6 @@ TEST_CASE("Set and read timers", "[.integration][.multi]") {
|
|||||||
CHECK(d.setSubFrameExposureDeadTime(-1) == Approx(subframe_deadtime));
|
CHECK(d.setSubFrameExposureDeadTime(-1) == Approx(subframe_deadtime));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (test::type == dt::EIGER) {
|
if (test::type == dt::EIGER) {
|
||||||
// 32bit is needed for subframe exposure
|
// 32bit is needed for subframe exposure
|
||||||
d.setDynamicRange(32);
|
d.setDynamicRange(32);
|
||||||
|
82
python/api-tests/test_detector.py
Normal file
82
python/api-tests/test_detector.py
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
import pytest
|
||||||
|
import datetime as dt
|
||||||
|
from slsdet import Detector, timingMode, detectorType
|
||||||
|
|
||||||
|
not_eiger = pytest.mark.skipif(
|
||||||
|
Detector().type == detectorType.EIGER, reason="Does not work for eiger"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture
|
||||||
|
def det():
|
||||||
|
from slsdet import Detector
|
||||||
|
|
||||||
|
return Detector()
|
||||||
|
|
||||||
|
|
||||||
|
def test_frames(det):
|
||||||
|
for n in [1, 100, 3245, 10000]:
|
||||||
|
det.frames = n
|
||||||
|
assert det.frames == n
|
||||||
|
det.frames = 1
|
||||||
|
|
||||||
|
|
||||||
|
def test_triggers(det):
|
||||||
|
for n in [1, 100, 3245, 10000]:
|
||||||
|
det.triggers = n
|
||||||
|
assert det.triggers == n
|
||||||
|
det.triggers = 1
|
||||||
|
|
||||||
|
|
||||||
|
def test_exptime(det):
|
||||||
|
det.exptime = 1
|
||||||
|
assert det.exptime == 1
|
||||||
|
det.exptime = dt.timedelta(milliseconds=10)
|
||||||
|
assert det.exptime == 0.01
|
||||||
|
det.exptime = 1
|
||||||
|
|
||||||
|
|
||||||
|
def test_period(det):
|
||||||
|
det.period = 3.2
|
||||||
|
assert det.period == 3.2
|
||||||
|
|
||||||
|
p = dt.timedelta(microseconds=1020)
|
||||||
|
det.period = p
|
||||||
|
assert det.period == 0.001020
|
||||||
|
r = det.getPeriod()
|
||||||
|
assert r[0] == p
|
||||||
|
det.period = 0
|
||||||
|
assert det.period == 0
|
||||||
|
|
||||||
|
|
||||||
|
def test_lock(det):
|
||||||
|
for l in [True, False]:
|
||||||
|
det.lock = l
|
||||||
|
assert det.lock == l
|
||||||
|
|
||||||
|
|
||||||
|
def test_timing(det):
|
||||||
|
# auto and trigger is available for all det
|
||||||
|
for m in [timingMode.TRIGGER_EXPOSURE, timingMode.AUTO_TIMING]:
|
||||||
|
det.timing = m
|
||||||
|
assert det.timing == m
|
||||||
|
|
||||||
|
@not_eiger
|
||||||
|
def test_delay(det):
|
||||||
|
det.delay = 1
|
||||||
|
assert det.delay == 1
|
||||||
|
|
||||||
|
t = dt.timedelta(microseconds=1)
|
||||||
|
det.delay = t
|
||||||
|
assert det.delay == t.total_seconds()
|
||||||
|
|
||||||
|
r = det.getDelayAfterTrigger()[0]
|
||||||
|
assert r == t
|
||||||
|
|
||||||
|
det.delay = 0
|
||||||
|
assert det.delay == 0
|
||||||
|
|
||||||
|
|
||||||
|
@not_eiger
|
||||||
|
def test_delayl(det):
|
||||||
|
assert det.delayl == 0
|
89
python/api-tests/test_jungfrau.py
Normal file
89
python/api-tests/test_jungfrau.py
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
import pytest
|
||||||
|
import datetime as dt
|
||||||
|
from slsdet import Detector, detectorType
|
||||||
|
|
||||||
|
"""
|
||||||
|
These tests are designed to work the API and catch
|
||||||
|
any changes in behavior or naming. Tests are expected
|
||||||
|
to pass with a virtual detector or a real one
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture
|
||||||
|
def jf():
|
||||||
|
from slsdet import Jungfrau
|
||||||
|
return Jungfrau()
|
||||||
|
|
||||||
|
|
||||||
|
jungfrautest = pytest.mark.skipif(
|
||||||
|
Detector().type != detectorType.JUNGFRAU, reason="Only valid for Jungfrau"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@jungfrautest
|
||||||
|
def test_storagecells(jf):
|
||||||
|
for i in range(16):
|
||||||
|
jf.storagecells = i
|
||||||
|
assert jf.storagecells == i
|
||||||
|
jf.storagecells = 0 # default
|
||||||
|
|
||||||
|
@jungfrautest
|
||||||
|
def test_storagecell_start(jf):
|
||||||
|
for i in range(16):
|
||||||
|
jf.storagecell_start = i
|
||||||
|
assert jf.storagecell_start == i
|
||||||
|
jf.storagecells = 15 # default
|
||||||
|
|
||||||
|
@jungfrautest
|
||||||
|
def test_storagecell_delay(jf):
|
||||||
|
for t in [0.001, 0.0002, 0.0013]:
|
||||||
|
jf.storagecell_delay = t
|
||||||
|
assert jf.storagecell_delay == t
|
||||||
|
jf.storagecell_delay = 0 # default
|
||||||
|
|
||||||
|
@jungfrautest
|
||||||
|
def test_temp_event(jf):
|
||||||
|
# hard to test with virtual server
|
||||||
|
assert jf.temp_event == 0
|
||||||
|
|
||||||
|
@jungfrautest
|
||||||
|
def test_temp_threshold(jf):
|
||||||
|
for th in [0, 10, 43, 72]:
|
||||||
|
jf.temp_threshold = th
|
||||||
|
assert jf.temp_threshold == th
|
||||||
|
jf.temp_threshold = 0
|
||||||
|
|
||||||
|
@jungfrautest
|
||||||
|
def test_auto_comp_disable(jf):
|
||||||
|
for v in [True, False]:
|
||||||
|
jf.auto_comp_disable = v
|
||||||
|
assert jf.auto_comp_disable == v
|
||||||
|
|
||||||
|
@jungfrautest
|
||||||
|
def test_numinterfaces(jf):
|
||||||
|
for n in [2, 1]:
|
||||||
|
jf.numinterfaces = n
|
||||||
|
assert jf.numinterfaces == n
|
||||||
|
|
||||||
|
@jungfrautest
|
||||||
|
def test_dr(jf):
|
||||||
|
assert jf.dr == 16
|
||||||
|
|
||||||
|
@jungfrautest
|
||||||
|
def test_temp_control(jf):
|
||||||
|
for v in [True, False]:
|
||||||
|
jf.temp_control = v
|
||||||
|
assert jf.temp_control == v
|
||||||
|
|
||||||
|
@jungfrautest
|
||||||
|
def test_startingfnum(jf):
|
||||||
|
for n in [10, 127, 43321, 1]:
|
||||||
|
jf.startingfnum = n
|
||||||
|
assert jf.startingfnum == n
|
||||||
|
|
||||||
|
@jungfrautest
|
||||||
|
def test_selinterface(jf):
|
||||||
|
for i in [1, 0]:
|
||||||
|
jf.selinterface = i
|
||||||
|
assert jf.selinterface == i
|
@ -15,7 +15,7 @@ pycmd += ['vrf', 'vtr', 'vrs', 'vtgstv', 'vsvn', 'vtrim',
|
|||||||
'vpreamp', 'vref_comp', 'vref_comp_fe vref_ds', 'vref_h_adc',
|
'vpreamp', 'vref_comp', 'vref_comp_fe vref_ds', 'vref_h_adc',
|
||||||
'vref_l_adc', 'iodelay', 'list', 'vref_ds', 'vis', 'vpl',
|
'vref_l_adc', 'iodelay', 'list', 'vref_ds', 'vis', 'vpl',
|
||||||
'vref_comp_fe', 'vph', 'vout_cm', 'vcp', 'vcn', 'vcmp_ll', 'vcmp_lr'
|
'vref_comp_fe', 'vph', 'vout_cm', 'vcp', 'vcn', 'vcmp_ll', 'vcmp_lr'
|
||||||
, 'vcmp_rl', 'vcmp_rr']
|
, 'vcmp_rl', 'vcmp_rr', 'daclist', 'dacvalues', 'vcal', 'vcas']
|
||||||
|
|
||||||
missing = []
|
missing = []
|
||||||
for c in cmd:
|
for c in cmd:
|
||||||
|
@ -11,6 +11,10 @@ import subprocess
|
|||||||
|
|
||||||
from parse import remove_comments
|
from parse import remove_comments
|
||||||
|
|
||||||
|
def single_line_enum(line):
|
||||||
|
sub = line[line.find('{')+1:line.find('}')]
|
||||||
|
return sub.strip().split(',')
|
||||||
|
|
||||||
def extract_enums(lines):
|
def extract_enums(lines):
|
||||||
line_iter = iter(lines)
|
line_iter = iter(lines)
|
||||||
enums = {}
|
enums = {}
|
||||||
@ -18,8 +22,15 @@ def extract_enums(lines):
|
|||||||
m = re.search("(?<=enum )\w+(?= {)", line)
|
m = re.search("(?<=enum )\w+(?= {)", line)
|
||||||
if m:
|
if m:
|
||||||
enum_name = m.group()
|
enum_name = m.group()
|
||||||
# print(enum_name)
|
print(enum_name)
|
||||||
|
# print(line)
|
||||||
fields = []
|
fields = []
|
||||||
|
|
||||||
|
#deal with single line enums
|
||||||
|
if '};' in line:
|
||||||
|
fields = single_line_enum(line)
|
||||||
|
else:
|
||||||
|
#deal with multi line enums
|
||||||
while True:
|
while True:
|
||||||
l = next(line_iter)
|
l = next(line_iter)
|
||||||
if '};' in l:
|
if '};' in l:
|
||||||
|
@ -47,6 +47,8 @@ lines = []
|
|||||||
|
|
||||||
ag2 = []
|
ag2 = []
|
||||||
|
|
||||||
|
cn = []
|
||||||
|
|
||||||
def get_arguments(node):
|
def get_arguments(node):
|
||||||
args = [a.type.spelling for a in node.get_arguments()]
|
args = [a.type.spelling for a in node.get_arguments()]
|
||||||
args = [
|
args = [
|
||||||
@ -66,8 +68,12 @@ def get_fdec(node):
|
|||||||
else:
|
else:
|
||||||
return_type = 'void'
|
return_type = 'void'
|
||||||
|
|
||||||
|
if node.is_const_method():
|
||||||
|
const = 'const'
|
||||||
|
else:
|
||||||
|
const = ''
|
||||||
args = ", ".join(args)
|
args = ", ".join(args)
|
||||||
args = f'({return_type}(Detector::*)({args}))'
|
args = f'({return_type}(Detector::*)({args}){const})'
|
||||||
return args
|
return args
|
||||||
|
|
||||||
|
|
||||||
@ -85,6 +91,7 @@ def visit(node):
|
|||||||
lines.append(
|
lines.append(
|
||||||
f'.def("{child.spelling}",{fs} &Detector::{child.spelling}{args})'
|
f'.def("{child.spelling}",{fs} &Detector::{child.spelling}{args})'
|
||||||
)
|
)
|
||||||
|
cn.append(child)
|
||||||
for child in node.get_children():
|
for child in node.get_children():
|
||||||
visit(child)
|
visit(child)
|
||||||
|
|
||||||
|
@ -3,11 +3,14 @@ from _slsdet import slsDetectorDefs
|
|||||||
from _slsdet import IpAddr, MacAddr
|
from _slsdet import IpAddr, MacAddr
|
||||||
|
|
||||||
runStatus = slsDetectorDefs.runStatus
|
runStatus = slsDetectorDefs.runStatus
|
||||||
|
timingMode = slsDetectorDefs.timingMode
|
||||||
speedLevel = slsDetectorDefs.speedLevel
|
speedLevel = slsDetectorDefs.speedLevel
|
||||||
dacIndex = slsDetectorDefs.dacIndex
|
dacIndex = slsDetectorDefs.dacIndex
|
||||||
|
detectorType = slsDetectorDefs.detectorType
|
||||||
|
|
||||||
from .utils import element_if_equal, all_equal, get_set_bits, list_to_bitmask
|
from .utils import element_if_equal, all_equal, get_set_bits, list_to_bitmask
|
||||||
from .utils import Geometry, to_geo, element
|
from .utils import Geometry, to_geo, element, reduce_time, is_iterable
|
||||||
|
from . import utils as ut
|
||||||
from .registers import Register, Adc_register
|
from .registers import Register, Adc_register
|
||||||
import datetime as dt
|
import datetime as dt
|
||||||
|
|
||||||
@ -15,6 +18,7 @@ from functools import wraps
|
|||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
import socket
|
import socket
|
||||||
|
|
||||||
|
|
||||||
def freeze(cls):
|
def freeze(cls):
|
||||||
cls._frozen = False
|
cls._frozen = False
|
||||||
|
|
||||||
@ -59,15 +63,12 @@ class Detector(CppDetectorApi):
|
|||||||
self._register = Register(self)
|
self._register = Register(self)
|
||||||
self._adc_register = Adc_register(self)
|
self._adc_register = Adc_register(self)
|
||||||
|
|
||||||
|
|
||||||
# CONFIGURATION
|
# CONFIGURATION
|
||||||
def __len__(self):
|
def __len__(self):
|
||||||
return self.size()
|
return self.size()
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return '{}(id = {})'.format(self.__class__.__name__,
|
return "{}(id = {})".format(self.__class__.__name__, self.getShmId())
|
||||||
self.getShmId())
|
|
||||||
|
|
||||||
|
|
||||||
def free(self):
|
def free(self):
|
||||||
self.freeSharedMemory()
|
self.freeSharedMemory()
|
||||||
@ -90,7 +91,6 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def hostname(self):
|
def hostname(self):
|
||||||
print('getting host!')
|
|
||||||
return self.getHostname()
|
return self.getHostname()
|
||||||
|
|
||||||
@hostname.setter
|
@hostname.setter
|
||||||
@ -108,7 +108,7 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def server_version(self):
|
def server_version(self):
|
||||||
#TODO! handle hex print
|
# TODO! handle hex print
|
||||||
return element_if_equal(self.getDetectorServerVersion())
|
return element_if_equal(self.getDetectorServerVersion())
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -160,58 +160,48 @@ class Detector(CppDetectorApi):
|
|||||||
def frames(self, n_frames):
|
def frames(self, n_frames):
|
||||||
self.setNumberOfFrames(n_frames)
|
self.setNumberOfFrames(n_frames)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def triggers(self):
|
||||||
|
return element_if_equal(self.getNumberOfTriggers())
|
||||||
|
|
||||||
|
@triggers.setter
|
||||||
|
def triggers(self, n_triggers):
|
||||||
|
self.setNumberOfTriggers(n_triggers)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def exptime(self):
|
def exptime(self):
|
||||||
|
if self.type == detectorType.MYTHEN3:
|
||||||
|
res = self.getExptimeForAllGates()
|
||||||
|
else:
|
||||||
res = self.getExptime()
|
res = self.getExptime()
|
||||||
return element_if_equal([it.total_seconds() for it in res])
|
return reduce_time(res)
|
||||||
|
|
||||||
@exptime.setter
|
@exptime.setter
|
||||||
def exptime(self, t):
|
def exptime(self, t):
|
||||||
if isinstance(t, dt.timedelta):
|
self.setExptime(ut.make_timedelta(t))
|
||||||
self.setExptime(t)
|
|
||||||
else:
|
|
||||||
self.setExptime(dt.timedelta(seconds=t))
|
|
||||||
|
|
||||||
@property
|
|
||||||
def subexptime(self):
|
|
||||||
res = self.getSubExptime()
|
|
||||||
return element_if_equal([it.total_seconds() for it in res])
|
|
||||||
|
|
||||||
@subexptime.setter
|
|
||||||
def subexptime(self, t):
|
|
||||||
if isinstance(t, dt.timedelta):
|
|
||||||
self.setSubExptime(t)
|
|
||||||
else:
|
|
||||||
self.setSubExptime(dt.timedelta(seconds=t))
|
|
||||||
|
|
||||||
@property
|
|
||||||
def subdeadtime(self):
|
|
||||||
res = self.getSubDeadTime()
|
|
||||||
return element_if_equal([it.total_seconds() for it in res])
|
|
||||||
|
|
||||||
@subdeadtime.setter
|
|
||||||
def subdeadtime(self, t):
|
|
||||||
if isinstance(t, dt.timedelta):
|
|
||||||
self.setSubDeadTime(t)
|
|
||||||
else:
|
|
||||||
self.setSubDeadTime(dt.timedelta(seconds=t))
|
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def period(self):
|
def period(self):
|
||||||
res = self.getPeriod()
|
res = self.getPeriod()
|
||||||
return element_if_equal([it.total_seconds() for it in res])
|
return reduce_time(res)
|
||||||
|
|
||||||
@period.setter
|
@period.setter
|
||||||
def period(self, t):
|
def period(self, t):
|
||||||
if isinstance(t, dt.timedelta):
|
self.setPeriod(ut.make_timedelta(t))
|
||||||
self.setPeriod(t)
|
|
||||||
else:
|
|
||||||
self.setPeriod(dt.timedelta(seconds=t))
|
|
||||||
|
|
||||||
|
@property
|
||||||
|
@element
|
||||||
|
def delay(self):
|
||||||
|
return ut.reduce_time(self.getDelayAfterTrigger())
|
||||||
|
|
||||||
|
@delay.setter
|
||||||
|
def delay(self, t):
|
||||||
|
self.setDelayAfterTrigger(ut.make_timedelta(t))
|
||||||
|
|
||||||
|
@property
|
||||||
|
@element
|
||||||
|
def delayl(self):
|
||||||
|
return ut.reduce_time(self.getDelayAfterTriggerLeft())
|
||||||
|
|
||||||
|
|
||||||
# Time
|
# Time
|
||||||
@ -219,7 +209,6 @@ class Detector(CppDetectorApi):
|
|||||||
def rx_framescaught(self):
|
def rx_framescaught(self):
|
||||||
return element_if_equal(self.getFramesCaught())
|
return element_if_equal(self.getFramesCaught())
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def startingfnum(self):
|
def startingfnum(self):
|
||||||
return element_if_equal(self.getStartingFrameNumber())
|
return element_if_equal(self.getStartingFrameNumber())
|
||||||
@ -227,10 +216,7 @@ class Detector(CppDetectorApi):
|
|||||||
@startingfnum.setter
|
@startingfnum.setter
|
||||||
def startingfnum(self, value):
|
def startingfnum(self, value):
|
||||||
self.setStartingFrameNumber(value)
|
self.setStartingFrameNumber(value)
|
||||||
|
# TODO! add txdelay
|
||||||
|
|
||||||
|
|
||||||
#TODO! add txdelay
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def use_receiver(self):
|
def use_receiver(self):
|
||||||
@ -296,9 +282,16 @@ class Detector(CppDetectorApi):
|
|||||||
@property
|
@property
|
||||||
def rx_lastclient(self):
|
def rx_lastclient(self):
|
||||||
return element_if_equal(self.getRxLastClientIP())
|
return element_if_equal(self.getRxLastClientIP())
|
||||||
|
# FILE
|
||||||
|
|
||||||
|
@property
|
||||||
|
@element
|
||||||
|
def numinterfaces(self):
|
||||||
|
return self.getNumberofUDPInterfaces()
|
||||||
|
|
||||||
#FILE
|
@numinterfaces.setter
|
||||||
|
def numinterfaces(self, value):
|
||||||
|
self.setNumberofUDPInterfaces(value)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def fformat(self):
|
def fformat(self):
|
||||||
@ -414,14 +407,13 @@ class Detector(CppDetectorApi):
|
|||||||
def zmqip(self, ip):
|
def zmqip(self, ip):
|
||||||
self.setClientZmqIp(ip)
|
self.setClientZmqIp(ip)
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def udp_dstip(self):
|
def udp_dstip(self):
|
||||||
return element_if_equal(self.getDestinationUDPIP())
|
return element_if_equal(self.getDestinationUDPIP())
|
||||||
|
|
||||||
@udp_dstip.setter
|
@udp_dstip.setter
|
||||||
def udp_dstip(self, ip):
|
def udp_dstip(self, ip):
|
||||||
if ip == 'auto':
|
if ip == "auto":
|
||||||
ip = socket.gethostbyname(self.rx_hostname)
|
ip = socket.gethostbyname(self.rx_hostname)
|
||||||
self.setDestinationUDPIP(IpAddr(ip))
|
self.setDestinationUDPIP(IpAddr(ip))
|
||||||
|
|
||||||
@ -431,7 +423,7 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@udp_dstip2.setter
|
@udp_dstip2.setter
|
||||||
def udp_dstip2(self, ip):
|
def udp_dstip2(self, ip):
|
||||||
if ip == 'auto':
|
if ip == "auto":
|
||||||
ip = socket.gethostbyname(self.rx_hostname)
|
ip = socket.gethostbyname(self.rx_hostname)
|
||||||
self.setDestinationUDPIP2(IpAddr(ip))
|
self.setDestinationUDPIP2(IpAddr(ip))
|
||||||
|
|
||||||
@ -451,7 +443,6 @@ class Detector(CppDetectorApi):
|
|||||||
def udp_dstmac2(self, mac):
|
def udp_dstmac2(self, mac):
|
||||||
self.setDestinationUDPMAC2(MacAddr(mac))
|
self.setDestinationUDPMAC2(MacAddr(mac))
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def udp_srcip(self):
|
def udp_srcip(self):
|
||||||
return element_if_equal(self.getSourceUDPIP())
|
return element_if_equal(self.getSourceUDPIP())
|
||||||
@ -508,7 +499,6 @@ class Detector(CppDetectorApi):
|
|||||||
def src_udpip(self, ip):
|
def src_udpip(self, ip):
|
||||||
self.setSourceUDPIP(IpAddr(ip))
|
self.setSourceUDPIP(IpAddr(ip))
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def src_udpmac2(self):
|
def src_udpmac2(self):
|
||||||
return element_if_equal(self.getSourceUDPMAC2())
|
return element_if_equal(self.getSourceUDPMAC2())
|
||||||
@ -545,8 +535,6 @@ class Detector(CppDetectorApi):
|
|||||||
def rx_status(self):
|
def rx_status(self):
|
||||||
return element_if_equal(self.getReceiverStatus())
|
return element_if_equal(self.getReceiverStatus())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def rx_udpsocksize(self):
|
def rx_udpsocksize(self):
|
||||||
return element_if_equal(self.getRxUDPSocketBufferSize())
|
return element_if_equal(self.getRxUDPSocketBufferSize())
|
||||||
@ -561,7 +549,7 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def trimbits(self):
|
def trimbits(self):
|
||||||
return NotImplementedError('trimbits are set only')
|
return NotImplementedError("trimbits are set only")
|
||||||
|
|
||||||
@trimbits.setter
|
@trimbits.setter
|
||||||
def trimbits(self, fname):
|
def trimbits(self, fname):
|
||||||
@ -595,7 +583,6 @@ class Detector(CppDetectorApi):
|
|||||||
def adcreg(self):
|
def adcreg(self):
|
||||||
return self._adc_register
|
return self._adc_register
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def led(self):
|
def led(self):
|
||||||
return element_if_equal(self.getLEDEnable())
|
return element_if_equal(self.getLEDEnable())
|
||||||
@ -654,8 +641,6 @@ class Detector(CppDetectorApi):
|
|||||||
def vthreshold(self):
|
def vthreshold(self):
|
||||||
return element_if_equal(self.getDAC(dacIndex.THRESHOLD))
|
return element_if_equal(self.getDAC(dacIndex.THRESHOLD))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def type(self):
|
def type(self):
|
||||||
return element_if_equal(self.getDetectorType())
|
return element_if_equal(self.getDetectorType())
|
||||||
@ -668,10 +653,27 @@ class Detector(CppDetectorApi):
|
|||||||
def rx_missingpackets(self):
|
def rx_missingpackets(self):
|
||||||
return element_if_equal(self.getNumMissingPackets())
|
return element_if_equal(self.getNumMissingPackets())
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Some Eiger stuff, does this have to be here or can we move it to subclass?
|
Some Eiger stuff, does this have to be here or can we move it to subclass?
|
||||||
"""
|
"""
|
||||||
|
@property
|
||||||
|
def subexptime(self):
|
||||||
|
res = self.getSubExptime()
|
||||||
|
return reduce_time(res)
|
||||||
|
|
||||||
|
@subexptime.setter
|
||||||
|
def subexptime(self, t):
|
||||||
|
self.setSubExptime(ut.make_timedelta(t))
|
||||||
|
|
||||||
|
@property
|
||||||
|
def subdeadtime(self):
|
||||||
|
res = self.getSubDeadTime()
|
||||||
|
reduce_time(res)
|
||||||
|
|
||||||
|
@subdeadtime.setter
|
||||||
|
def subdeadtime(self, t):
|
||||||
|
self.setSubDeadTime(ut.make_timedelta(t))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def partialreset(self):
|
def partialreset(self):
|
||||||
return element_if_equal(self.getPartialReset())
|
return element_if_equal(self.getPartialReset())
|
||||||
@ -730,7 +732,6 @@ class Detector(CppDetectorApi):
|
|||||||
res = self.getMeasuredSubFramePeriod()
|
res = self.getMeasuredSubFramePeriod()
|
||||||
return element_if_equal([it.total_seconds() for it in res])
|
return element_if_equal([it.total_seconds() for it in res])
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def storeinram(self):
|
def storeinram(self):
|
||||||
return element_if_equal(self.getStoreInRamMode())
|
return element_if_equal(self.getStoreInRamMode())
|
||||||
@ -739,11 +740,116 @@ class Detector(CppDetectorApi):
|
|||||||
def storeinram(self, value):
|
def storeinram(self, value):
|
||||||
self.setStoreInRamMode(value)
|
self.setStoreInRamMode(value)
|
||||||
|
|
||||||
|
"""
|
||||||
|
Jungfrau specific
|
||||||
|
"""
|
||||||
|
|
||||||
|
@property
|
||||||
|
@element
|
||||||
|
def auto_comp_disable(self):
|
||||||
|
return self.getAutoCompDisable()
|
||||||
|
|
||||||
|
@auto_comp_disable.setter
|
||||||
|
def auto_comp_disable(self, value):
|
||||||
|
self.setAutoCompDisable(value)
|
||||||
|
|
||||||
|
@property
|
||||||
|
@element
|
||||||
|
def storagecells(self):
|
||||||
|
return self.getNumberOfAdditionalStorageCells()
|
||||||
|
|
||||||
|
@storagecells.setter
|
||||||
|
def storagecells(self, n_cells):
|
||||||
|
self.setNumberOfAdditionalStorageCells(n_cells)
|
||||||
|
|
||||||
|
@property
|
||||||
|
@element
|
||||||
|
def storagecell_start(self):
|
||||||
|
return self.getStorageCellStart()
|
||||||
|
|
||||||
|
@storagecell_start.setter
|
||||||
|
def storagecell_start(self, value):
|
||||||
|
self.setStorageCellStart(value)
|
||||||
|
|
||||||
|
@property
|
||||||
|
@element
|
||||||
|
def storagecell_delay(self):
|
||||||
|
return ut.reduce_time(self.getStorageCellDelay())
|
||||||
|
|
||||||
|
@storagecell_delay.setter
|
||||||
|
def storagecell_delay(self, t):
|
||||||
|
self.setStorageCellDelay(ut.make_timedelta(t))
|
||||||
|
|
||||||
|
@property
|
||||||
|
@element
|
||||||
|
def temp_threshold(self):
|
||||||
|
return self.getThresholdTemperature()
|
||||||
|
|
||||||
|
@temp_threshold.setter
|
||||||
|
def temp_threshold(self, value):
|
||||||
|
self.setThresholdTemperature(value)
|
||||||
|
|
||||||
|
@property
|
||||||
|
@element
|
||||||
|
def temp_event(self):
|
||||||
|
return self.getTemperatureEvent()
|
||||||
|
|
||||||
|
@temp_event.setter
|
||||||
|
def temp_event(self, value):
|
||||||
|
if value != 0:
|
||||||
|
raise ValueError("Value needs to be 0 for reset. Setting not allowed")
|
||||||
|
self.resetTemperatureEvent()
|
||||||
|
|
||||||
|
@property
|
||||||
|
@element
|
||||||
|
def temp_control(self):
|
||||||
|
return self.getTemperatureControl()
|
||||||
|
|
||||||
|
@temp_control.setter
|
||||||
|
def temp_control(self, value):
|
||||||
|
self.setTemperatureControl(value)
|
||||||
|
|
||||||
|
|
||||||
|
@property
|
||||||
|
@element
|
||||||
|
def selinterface(self):
|
||||||
|
return self.getSelectedUDPInterface()
|
||||||
|
|
||||||
|
@selinterface.setter
|
||||||
|
def selinterface(self, i):
|
||||||
|
self.selectUDPInterface(i)
|
||||||
|
|
||||||
|
"""
|
||||||
|
Gotthard2
|
||||||
|
"""
|
||||||
|
|
||||||
|
@property
|
||||||
|
@element
|
||||||
|
def veto(self):
|
||||||
|
return self.getVeto()
|
||||||
|
|
||||||
|
@veto.setter
|
||||||
|
def veto(self, value):
|
||||||
|
self.setVeto(value)
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Mythen3 specific
|
Mythen3 specific
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@property
|
||||||
|
def gatedelay(self):
|
||||||
|
return reduce_time(self.getGateDelayForAllGates())
|
||||||
|
|
||||||
|
@gatedelay.setter
|
||||||
|
def gatedelay(self, value):
|
||||||
|
if is_iterable(value):
|
||||||
|
if len(value) == 3:
|
||||||
|
for i, v in enumerate(value):
|
||||||
|
self.setGateDelay(i, ut.make_timedelta(v))
|
||||||
|
else:
|
||||||
|
self.setGateDelay(-1, ut.make_timedelta(value))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def counters(self):
|
def counters(self):
|
||||||
mask = self.getCounterMask()
|
mask = self.getCounterMask()
|
||||||
@ -753,7 +859,6 @@ class Detector(CppDetectorApi):
|
|||||||
else:
|
else:
|
||||||
return [get_set_bits(m) for m in mask]
|
return [get_set_bits(m) for m in mask]
|
||||||
|
|
||||||
|
|
||||||
@counters.setter
|
@counters.setter
|
||||||
def counters(self, values):
|
def counters(self, values):
|
||||||
self.setCounterMask(list_to_bitmask(values))
|
self.setCounterMask(list_to_bitmask(values))
|
||||||
@ -872,7 +977,7 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def pattern(self):
|
def pattern(self):
|
||||||
#TODO! Clean fix
|
# TODO! Clean fix
|
||||||
print("Set only")
|
print("Set only")
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
@ -961,7 +1066,6 @@ class Detector(CppDetectorApi):
|
|||||||
def patwaittime2(self, nclk):
|
def patwaittime2(self, nclk):
|
||||||
self.setPatternWaitTime(2, nclk)
|
self.setPatternWaitTime(2, nclk)
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def patloop0(self):
|
def patloop0(self):
|
||||||
return element_if_equal(self.getPatternLoopAddresses(0))
|
return element_if_equal(self.getPatternLoopAddresses(0))
|
||||||
@ -1010,7 +1114,6 @@ class Detector(CppDetectorApi):
|
|||||||
def patnloop2(self, n):
|
def patnloop2(self, n):
|
||||||
self.setPatternLoopCycles(2, n)
|
self.setPatternLoopCycles(2, n)
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@element
|
@element
|
||||||
def v_a(self):
|
def v_a(self):
|
||||||
|
@ -7,10 +7,17 @@ but not directly used in controlling the detector
|
|||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
import _slsdet #C++ lib
|
import _slsdet #C++ lib
|
||||||
import functools
|
import functools
|
||||||
|
import datetime as dt
|
||||||
|
|
||||||
Geometry = namedtuple('Geometry', ['x', 'y'])
|
Geometry = namedtuple('Geometry', ['x', 'y'])
|
||||||
|
|
||||||
|
def is_iterable(item):
|
||||||
|
try:
|
||||||
|
iter(item)
|
||||||
|
except TypeError:
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
def get_set_bits(mask):
|
def get_set_bits(mask):
|
||||||
"""
|
"""
|
||||||
Return a list of the set bits in a python integer
|
Return a list of the set bits in a python integer
|
||||||
@ -41,6 +48,9 @@ def all_equal(mylist):
|
|||||||
|
|
||||||
def element_if_equal(mylist):
|
def element_if_equal(mylist):
|
||||||
"""If all elements are equal return only one element"""
|
"""If all elements are equal return only one element"""
|
||||||
|
if not is_iterable(mylist):
|
||||||
|
return mylist
|
||||||
|
|
||||||
if all_equal(mylist):
|
if all_equal(mylist):
|
||||||
if len(mylist) == 0:
|
if len(mylist) == 0:
|
||||||
return None
|
return None
|
||||||
@ -49,6 +59,15 @@ def element_if_equal(mylist):
|
|||||||
else:
|
else:
|
||||||
return mylist
|
return mylist
|
||||||
|
|
||||||
|
def reduce_time(mylist):
|
||||||
|
res = element_if_equal(element_if_equal(mylist))
|
||||||
|
if isinstance(res, dt.timedelta):
|
||||||
|
return res.total_seconds()
|
||||||
|
elif isinstance(res[0], list):
|
||||||
|
return [[item.total_seconds() for item in subl] for subl in res]
|
||||||
|
else:
|
||||||
|
return [r.total_seconds() for r in res]
|
||||||
|
|
||||||
def element(func):
|
def element(func):
|
||||||
"""
|
"""
|
||||||
Wrapper to return either list or element
|
Wrapper to return either list or element
|
||||||
@ -69,3 +88,8 @@ def eiger_register_to_time(register):
|
|||||||
exponent = register & 0b111
|
exponent = register & 0b111
|
||||||
return clocks*10**exponent / 100e6
|
return clocks*10**exponent / 100e6
|
||||||
|
|
||||||
|
def make_timedelta(t):
|
||||||
|
if isinstance(t, dt.timedelta):
|
||||||
|
return t
|
||||||
|
else:
|
||||||
|
return dt.timedelta(seconds=t)
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -8,12 +8,17 @@
|
|||||||
#include "network_utils.h"
|
#include "network_utils.h"
|
||||||
#include "sls_detector_defs.h"
|
#include "sls_detector_defs.h"
|
||||||
#include "typecaster.h"
|
#include "typecaster.h"
|
||||||
|
|
||||||
|
#include "TimeHelper.h"
|
||||||
|
#include <array>
|
||||||
|
#include <chrono>
|
||||||
namespace py = pybind11;
|
namespace py = pybind11;
|
||||||
void init_det(py::module &m) {
|
void init_det(py::module &m) {
|
||||||
using sls::Detector;
|
using sls::Detector;
|
||||||
using sls::Positions;
|
using sls::Positions;
|
||||||
using sls::Result;
|
using sls::Result;
|
||||||
using sls::defs;
|
using sls::defs;
|
||||||
|
using sls::ns;
|
||||||
|
|
||||||
py::class_<Detector> CppDetectorApi(m, "CppDetectorApi");
|
py::class_<Detector> CppDetectorApi(m, "CppDetectorApi");
|
||||||
CppDetectorApi
|
CppDetectorApi
|
||||||
|
@ -65,38 +65,14 @@ void init_enums(py::module &m) {
|
|||||||
.export_values();
|
.export_values();
|
||||||
|
|
||||||
py::enum_<slsDetectorDefs::externalSignalFlag>(Defs, "externalSignalFlag")
|
py::enum_<slsDetectorDefs::externalSignalFlag>(Defs, "externalSignalFlag")
|
||||||
.value("GET_EXTERNAL_SIGNAL_FLAG",
|
|
||||||
slsDetectorDefs::externalSignalFlag::GET_EXTERNAL_SIGNAL_FLAG)
|
|
||||||
.value("SIGNAL_OFF", slsDetectorDefs::externalSignalFlag::SIGNAL_OFF)
|
|
||||||
.value("GATE_IN_ACTIVE_HIGH",
|
|
||||||
slsDetectorDefs::externalSignalFlag::GATE_IN_ACTIVE_HIGH)
|
|
||||||
.value("GATE_IN_ACTIVE_LOW",
|
|
||||||
slsDetectorDefs::externalSignalFlag::GATE_IN_ACTIVE_LOW)
|
|
||||||
.value("TRIGGER_IN_RISING_EDGE",
|
.value("TRIGGER_IN_RISING_EDGE",
|
||||||
slsDetectorDefs::externalSignalFlag::TRIGGER_IN_RISING_EDGE)
|
slsDetectorDefs::externalSignalFlag::TRIGGER_IN_RISING_EDGE)
|
||||||
.value("TRIGGER_IN_FALLING_EDGE",
|
.value("TRIGGER_IN_FALLING_EDGE",
|
||||||
slsDetectorDefs::externalSignalFlag::TRIGGER_IN_FALLING_EDGE)
|
slsDetectorDefs::externalSignalFlag::TRIGGER_IN_FALLING_EDGE)
|
||||||
.value("RO_TRIGGER_IN_RISING_EDGE",
|
.value("INVERSION_ON",
|
||||||
slsDetectorDefs::externalSignalFlag::RO_TRIGGER_IN_RISING_EDGE)
|
slsDetectorDefs::externalSignalFlag::INVERSION_ON)
|
||||||
.value("RO_TRIGGER_IN_FALLING_EDGE",
|
.value("INVERSION_OFF",
|
||||||
slsDetectorDefs::externalSignalFlag::RO_TRIGGER_IN_FALLING_EDGE)
|
slsDetectorDefs::externalSignalFlag::INVERSION_OFF)
|
||||||
.value("GATE_OUT_ACTIVE_HIGH",
|
|
||||||
slsDetectorDefs::externalSignalFlag::GATE_OUT_ACTIVE_HIGH)
|
|
||||||
.value("GATE_OUT_ACTIVE_LOW",
|
|
||||||
slsDetectorDefs::externalSignalFlag::GATE_OUT_ACTIVE_LOW)
|
|
||||||
.value("TRIGGER_OUT_RISING_EDGE",
|
|
||||||
slsDetectorDefs::externalSignalFlag::TRIGGER_OUT_RISING_EDGE)
|
|
||||||
.value("TRIGGER_OUT_FALLING_EDGE",
|
|
||||||
slsDetectorDefs::externalSignalFlag::TRIGGER_OUT_FALLING_EDGE)
|
|
||||||
.value("RO_TRIGGER_OUT_RISING_EDGE",
|
|
||||||
slsDetectorDefs::externalSignalFlag::RO_TRIGGER_OUT_RISING_EDGE)
|
|
||||||
.value("RO_TRIGGER_OUT_FALLING_EDGE",
|
|
||||||
slsDetectorDefs::externalSignalFlag::RO_TRIGGER_OUT_FALLING_EDGE)
|
|
||||||
.value("OUTPUT_LOW", slsDetectorDefs::externalSignalFlag::OUTPUT_LOW)
|
|
||||||
.value("OUTPUT_HIGH", slsDetectorDefs::externalSignalFlag::OUTPUT_HIGH)
|
|
||||||
.value(
|
|
||||||
"MASTER_SLAVE_SYNCHRONIZATION",
|
|
||||||
slsDetectorDefs::externalSignalFlag::MASTER_SLAVE_SYNCHRONIZATION)
|
|
||||||
.export_values();
|
.export_values();
|
||||||
|
|
||||||
py::enum_<slsDetectorDefs::timingMode>(Defs, "timingMode")
|
py::enum_<slsDetectorDefs::timingMode>(Defs, "timingMode")
|
||||||
@ -106,6 +82,9 @@ void init_enums(py::module &m) {
|
|||||||
slsDetectorDefs::timingMode::TRIGGER_EXPOSURE)
|
slsDetectorDefs::timingMode::TRIGGER_EXPOSURE)
|
||||||
.value("GATED", slsDetectorDefs::timingMode::GATED)
|
.value("GATED", slsDetectorDefs::timingMode::GATED)
|
||||||
.value("BURST_TRIGGER", slsDetectorDefs::timingMode::BURST_TRIGGER)
|
.value("BURST_TRIGGER", slsDetectorDefs::timingMode::BURST_TRIGGER)
|
||||||
|
.value("TRIGGER_GATED", slsDetectorDefs::timingMode::TRIGGER_GATED)
|
||||||
|
.value("NUM_TIMING_MODES",
|
||||||
|
slsDetectorDefs::timingMode::NUM_TIMING_MODES)
|
||||||
.export_values();
|
.export_values();
|
||||||
|
|
||||||
py::enum_<slsDetectorDefs::dacIndex>(Defs, "dacIndex")
|
py::enum_<slsDetectorDefs::dacIndex>(Defs, "dacIndex")
|
||||||
@ -248,22 +227,22 @@ void init_enums(py::module &m) {
|
|||||||
|
|
||||||
py::enum_<slsDetectorDefs::clockIndex>(Defs, "clockIndex")
|
py::enum_<slsDetectorDefs::clockIndex>(Defs, "clockIndex")
|
||||||
.value("ADC_CLOCK", slsDetectorDefs::clockIndex::ADC_CLOCK)
|
.value("ADC_CLOCK", slsDetectorDefs::clockIndex::ADC_CLOCK)
|
||||||
.value("DBIT_CLOCK", slsDetectorDefs::clockIndex::DBIT_CLOCK)
|
.value(" DBIT_CLOCK", slsDetectorDefs::clockIndex::DBIT_CLOCK)
|
||||||
.value("RUN_CLOCK", slsDetectorDefs::clockIndex::RUN_CLOCK)
|
.value(" RUN_CLOCK", slsDetectorDefs::clockIndex::RUN_CLOCK)
|
||||||
.value("SYNC_CLOCK", slsDetectorDefs::clockIndex::SYNC_CLOCK)
|
.value(" SYNC_CLOCK", slsDetectorDefs::clockIndex::SYNC_CLOCK)
|
||||||
.export_values();
|
.export_values();
|
||||||
|
|
||||||
py::enum_<slsDetectorDefs::readoutMode>(Defs, "readoutMode")
|
py::enum_<slsDetectorDefs::readoutMode>(Defs, "readoutMode")
|
||||||
.value("ANALOG_ONLY", slsDetectorDefs::readoutMode::ANALOG_ONLY)
|
.value("ANALOG_ONLY", slsDetectorDefs::readoutMode::ANALOG_ONLY)
|
||||||
.value("DIGITAL_ONLY", slsDetectorDefs::readoutMode::DIGITAL_ONLY)
|
.value(" DIGITAL_ONLY", slsDetectorDefs::readoutMode::DIGITAL_ONLY)
|
||||||
.value("ANALOG_AND_DIGITAL",
|
.value(" ANALOG_AND_DIGITAL",
|
||||||
slsDetectorDefs::readoutMode::ANALOG_AND_DIGITAL)
|
slsDetectorDefs::readoutMode::ANALOG_AND_DIGITAL)
|
||||||
.export_values();
|
.export_values();
|
||||||
|
|
||||||
py::enum_<slsDetectorDefs::speedLevel>(Defs, "speedLevel")
|
py::enum_<slsDetectorDefs::speedLevel>(Defs, "speedLevel")
|
||||||
.value("FULL_SPEED", slsDetectorDefs::speedLevel::FULL_SPEED)
|
.value("FULL_SPEED", slsDetectorDefs::speedLevel::FULL_SPEED)
|
||||||
.value("HALF_SPEED", slsDetectorDefs::speedLevel::HALF_SPEED)
|
.value(" HALF_SPEED", slsDetectorDefs::speedLevel::HALF_SPEED)
|
||||||
.value("QUARTER_SPEED", slsDetectorDefs::speedLevel::QUARTER_SPEED)
|
.value(" QUARTER_SPEED", slsDetectorDefs::speedLevel::QUARTER_SPEED)
|
||||||
.export_values();
|
.export_values();
|
||||||
|
|
||||||
py::enum_<slsDetectorDefs::portType>(Defs, "portType")
|
py::enum_<slsDetectorDefs::portType>(Defs, "portType")
|
||||||
@ -300,12 +279,13 @@ void init_enums(py::module &m) {
|
|||||||
.value("BURST_OFF", slsDetectorDefs::burstMode::BURST_OFF)
|
.value("BURST_OFF", slsDetectorDefs::burstMode::BURST_OFF)
|
||||||
.value("BURST_INTERNAL", slsDetectorDefs::burstMode::BURST_INTERNAL)
|
.value("BURST_INTERNAL", slsDetectorDefs::burstMode::BURST_INTERNAL)
|
||||||
.value("BURST_EXTERNAL", slsDetectorDefs::burstMode::BURST_EXTERNAL)
|
.value("BURST_EXTERNAL", slsDetectorDefs::burstMode::BURST_EXTERNAL)
|
||||||
|
.value("NUM_BURST_MODES", slsDetectorDefs::burstMode::NUM_BURST_MODES)
|
||||||
.export_values();
|
.export_values();
|
||||||
|
|
||||||
py::enum_<slsDetectorDefs::timingSourceType>(Defs, "timingSourceType")
|
py::enum_<slsDetectorDefs::timingSourceType>(Defs, "timingSourceType")
|
||||||
.value("TIMING_INTERNAL",
|
.value("TIMING_INTERNAL",
|
||||||
slsDetectorDefs::timingSourceType::TIMING_INTERNAL)
|
slsDetectorDefs::timingSourceType::TIMING_INTERNAL)
|
||||||
.value("TIMING_EXTERNAL",
|
.value(" TIMING_EXTERNAL",
|
||||||
slsDetectorDefs::timingSourceType::TIMING_EXTERNAL)
|
slsDetectorDefs::timingSourceType::TIMING_EXTERNAL)
|
||||||
.export_values();
|
.export_values();
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,28 @@ Testing functions from utils.py
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from sls_detector.utils import *
|
from slsdet.utils import *
|
||||||
|
import datetime as dt
|
||||||
|
|
||||||
|
def test_iterable():
|
||||||
|
assert is_iterable(5) == False
|
||||||
|
assert is_iterable('abc') == True
|
||||||
|
assert is_iterable([]) == True
|
||||||
|
assert is_iterable(5.9) == False
|
||||||
|
|
||||||
|
def test_reduce_time_to_single_value_from_list():
|
||||||
|
t = 3*[dt.timedelta(seconds = 1)]
|
||||||
|
assert reduce_time(t) == 1
|
||||||
|
|
||||||
|
def test_reduce_time_to_single_value_from_list_of_lists():
|
||||||
|
t = 3*[dt.timedelta(seconds = 3.3)]
|
||||||
|
tt = 5*t
|
||||||
|
assert reduce_time(tt) == 3.3
|
||||||
|
|
||||||
|
def test_reduce_time_when_sublist_is_different():
|
||||||
|
t = [dt.timedelta(seconds = 1), dt.timedelta(seconds = 2), dt.timedelta(seconds = 1)]
|
||||||
|
tt = [t for i in range(4)]
|
||||||
|
assert reduce_time(tt) == [1,2,1]
|
||||||
|
|
||||||
|
|
||||||
def test_convert_zero():
|
def test_convert_zero():
|
||||||
@ -60,3 +81,16 @@ def test_list_to_mask():
|
|||||||
assert(list_to_bitmask([1]) == 2)
|
assert(list_to_bitmask([1]) == 2)
|
||||||
assert(list_to_bitmask([3]) == 8)
|
assert(list_to_bitmask([3]) == 8)
|
||||||
assert(list_to_bitmask([1,1,1]) == 2)
|
assert(list_to_bitmask([1,1,1]) == 2)
|
||||||
|
|
||||||
|
|
||||||
|
def test_make_timedelta_from_double():
|
||||||
|
t = 1.7
|
||||||
|
r = make_timedelta(t)
|
||||||
|
assert t == r.total_seconds()
|
||||||
|
assert r == dt.timedelta(seconds=t)
|
||||||
|
|
||||||
|
def test_make_timedelta_from_timedelta():
|
||||||
|
t = dt.timedelta(minutes=1)
|
||||||
|
r = make_timedelta(t)
|
||||||
|
assert 60 == r.total_seconds()
|
||||||
|
assert r == dt.timedelta(minutes=1)
|
BIN
settingsdir/eiger/standard/4500eV/noise.sn000
Executable file
BIN
settingsdir/eiger/standard/4500eV/noise.sn000
Executable file
Binary file not shown.
@ -156,7 +156,7 @@ class moench04CtbZmq10GbData : public slsDetectorData<uint16_t> {
|
|||||||
if (dSamples>isample) {
|
if (dSamples>isample) {
|
||||||
ptr=data+32*(isample+1)+8*isample;
|
ptr=data+32*(isample+1)+8*isample;
|
||||||
sample=*((uint64_t*)ptr);
|
sample=*((uint64_t*)ptr);
|
||||||
cout << isc << " " << ibit[isc] << " " << isample << hex << sample << dec << endl;
|
// cout << isc << " " << ibit[isc] << " " << isample << hex << sample << dec << endl;
|
||||||
if (sample & (1<<ibit[isc]))
|
if (sample & (1<<ibit[isc]))
|
||||||
return 1;
|
return 1;
|
||||||
else
|
else
|
||||||
|
@ -120,7 +120,7 @@ class moench04CtbZmqData : public slsDetectorData<uint16_t> {
|
|||||||
if (dSamples>isample) {
|
if (dSamples>isample) {
|
||||||
ptr=data+aoff+8*isample;
|
ptr=data+aoff+8*isample;
|
||||||
sample=*((uint64_t*)ptr);
|
sample=*((uint64_t*)ptr);
|
||||||
cout << isc << " " << ibit[isc] << " " << isample << hex << sample << dec << endl;
|
// cout << isc << " " << ibit[isc] << " " << isample << hex << sample << dec << endl;
|
||||||
if (sample & (1<<ibit[isc]))
|
if (sample & (1<<ibit[isc]))
|
||||||
return 1;
|
return 1;
|
||||||
else
|
else
|
||||||
|
@ -5,12 +5,15 @@ LDFLAG= -L/usr/lib64/ -lpthread -lm -lstdc++ -lzmq -pthread -lrt -ltiff -O3
|
|||||||
|
|
||||||
#DESTDIR?=../bin
|
#DESTDIR?=../bin
|
||||||
|
|
||||||
all: moenchZmqProcess
|
all: moenchZmqProcess moenchZmq04Process
|
||||||
#moenchZmqProcessCtbGui
|
#moenchZmqProcessCtbGui
|
||||||
|
|
||||||
moenchZmqProcess: moenchZmqProcess.cpp clean
|
moenchZmqProcess: moenchZmqProcess.cpp clean
|
||||||
g++ -o moenchZmqProcess moenchZmqProcess.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DNEWZMQ -DINTERP
|
g++ -o moenchZmqProcess moenchZmqProcess.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DNEWZMQ -DINTERP
|
||||||
|
|
||||||
|
moenchZmq04Process: moenchZmqProcess.cpp clean
|
||||||
|
g++ -o moench04ZmqProcess moenchZmqProcess.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DNEWZMQ -DINTERP -DMOENCH04
|
||||||
|
|
||||||
#moenchZmqProcessCtbGui: moenchZmqProcess.cpp clean
|
#moenchZmqProcessCtbGui: moenchZmqProcess.cpp clean
|
||||||
# g++ -o moenchZmqProcessCtbGui moenchZmqProcess.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DNEWZMQ -DINTERP -DCTBGUI
|
# g++ -o moenchZmqProcessCtbGui moenchZmqProcess.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DNEWZMQ -DINTERP -DCTBGUI
|
||||||
|
|
||||||
|
@ -8,7 +8,13 @@
|
|||||||
#include "sls_detector_defs.h"
|
#include "sls_detector_defs.h"
|
||||||
#include "ZmqSocket.h"
|
#include "ZmqSocket.h"
|
||||||
#ifndef RECT
|
#ifndef RECT
|
||||||
|
#ifndef MOENCH04
|
||||||
#include "moench03T1ZmqDataNew.h"
|
#include "moench03T1ZmqDataNew.h"
|
||||||
|
#endif
|
||||||
|
#ifdef MOENCH04
|
||||||
|
#include "moench04CtbZmq10GbData.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef RECT
|
#ifdef RECT
|
||||||
#include "moench03T1ZmqDataNewRect.h"
|
#include "moench03T1ZmqDataNewRect.h"
|
||||||
@ -73,6 +79,10 @@ int main(int argc, char *argv[]) {
|
|||||||
char* socketip2 = 0;
|
char* socketip2 = 0;
|
||||||
uint32_t portnum2 = 0;
|
uint32_t portnum2 = 0;
|
||||||
|
|
||||||
|
zmqHeader zHeader, outHeader;
|
||||||
|
zHeader.jsonversion = SLS_DETECTOR_JSON_HEADER_VERSION;
|
||||||
|
outHeader.jsonversion = SLS_DETECTOR_JSON_HEADER_VERSION;
|
||||||
|
|
||||||
uint32_t nSigma=5;
|
uint32_t nSigma=5;
|
||||||
|
|
||||||
int ok;
|
int ok;
|
||||||
@ -124,7 +134,12 @@ int main(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//slsDetectorData *det=new moench03T1ZmqDataNew();
|
//slsDetectorData *det=new moench03T1ZmqDataNew();
|
||||||
|
#ifndef MOENCH04
|
||||||
moench03T1ZmqDataNew *det=new moench03T1ZmqDataNew();
|
moench03T1ZmqDataNew *det=new moench03T1ZmqDataNew();
|
||||||
|
#endif
|
||||||
|
#ifdef MOENCH04
|
||||||
|
moench04CtbZmq10GbData *det=new moench04CtbZmq10GbData();
|
||||||
|
#endif
|
||||||
cout << endl << " det" <<endl;
|
cout << endl << " det" <<endl;
|
||||||
int npx, npy;
|
int npx, npy;
|
||||||
det->getDetectorSize(npx, npy);
|
det->getDetectorSize(npx, npy);
|
||||||
@ -140,13 +155,15 @@ int main(int argc, char *argv[]) {
|
|||||||
char dummybuff[size];
|
char dummybuff[size];
|
||||||
|
|
||||||
|
|
||||||
int ncol_cm=CM_ROWS;
|
|
||||||
double xt_ghost=C_GHOST;
|
|
||||||
moench03CommonMode *cm=NULL;
|
moench03CommonMode *cm=NULL;
|
||||||
moench03GhostSummation *gs=NULL;
|
moench03GhostSummation *gs=NULL;
|
||||||
#ifdef CORR
|
#ifdef CORR
|
||||||
cm=new moench03CommonMode(ncol_cm);
|
|
||||||
gs=new moench03GhostSummation(det, xt_ghost);
|
//int ncol_cm=CM_ROWS;
|
||||||
|
//double xt_ghost=C_GHOST;
|
||||||
|
|
||||||
|
cm=new moench03CommonMode(CM_ROWS);
|
||||||
|
gs=new moench03GhostSummation(det, C_GHOST);
|
||||||
#endif
|
#endif
|
||||||
double *gainmap=NULL;
|
double *gainmap=NULL;
|
||||||
float *gm;
|
float *gm;
|
||||||
@ -308,9 +325,10 @@ int main(int argc, char *argv[]) {
|
|||||||
uint64_t bunchId = 0;
|
uint64_t bunchId = 0;
|
||||||
uint64_t timestamp = 0;
|
uint64_t timestamp = 0;
|
||||||
int16_t modId = 0;
|
int16_t modId = 0;
|
||||||
|
uint32_t expLength=0;
|
||||||
uint16_t xCoord = 0;
|
uint16_t xCoord = 0;
|
||||||
uint16_t yCoord = 0;
|
uint16_t yCoord = 0;
|
||||||
uint16_t zCoord = 0;
|
//uint16_t zCoord = 0;
|
||||||
uint32_t debug = 0;
|
uint32_t debug = 0;
|
||||||
//uint32_t dr = 16;
|
//uint32_t dr = 16;
|
||||||
//int16_t *dout;//=new int16_t [nnx*nny];
|
//int16_t *dout;//=new int16_t [nnx*nny];
|
||||||
@ -341,6 +359,7 @@ int main(int argc, char *argv[]) {
|
|||||||
filter->getImageSize(nnx, nny,nnsx, nnsy);
|
filter->getImageSize(nnx, nny,nnsx, nnsy);
|
||||||
|
|
||||||
|
|
||||||
|
std::map<std::string, std::string> addJsonHeader;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -350,16 +369,13 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
// cout << "+++++++++++++++++++++++++++++++LOOP" << endl;
|
// cout << "+++++++++++++++++++++++++++++++LOOP" << endl;
|
||||||
// get header, (if dummy, fail is on parse error or end of acquisition)
|
// get header, (if dummy, fail is on parse error or end of acquisition)
|
||||||
#ifndef NEWZMQ
|
|
||||||
if (!zmqsocket->ReceiveHeader(0, acqIndex, frameIndex, subframeIndex, filename, fileindex)){
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef NEWZMQ
|
|
||||||
rapidjson::Document doc;
|
|
||||||
if (!zmqsocket->ReceiveHeader(0, doc, SLS_DETECTOR_JSON_HEADER_VERSION)) {
|
// rapidjson::Document doc;
|
||||||
|
if (!zmqsocket->ReceiveHeader(0, zHeader, SLS_DETECTOR_JSON_HEADER_VERSION)) {
|
||||||
/* zmqsocket->CloseHeaderMessage();*/
|
/* zmqsocket->CloseHeaderMessage();*/
|
||||||
|
|
||||||
#endif
|
|
||||||
// if (!zmqsocket->ReceiveHeader(0, acqIndex, frameIndex, subframeIndex, filename, fileindex)) {
|
// if (!zmqsocket->ReceiveHeader(0, acqIndex, frameIndex, subframeIndex, filename, fileindex)) {
|
||||||
cprintf(RED, "Got Dummy\n");
|
cprintf(RED, "Got Dummy\n");
|
||||||
// t1=high_resolution_clock::now();
|
// t1=high_resolution_clock::now();
|
||||||
@ -378,7 +394,11 @@ int main(int argc, char *argv[]) {
|
|||||||
if (newFrame>0) {
|
if (newFrame>0) {
|
||||||
cprintf(RED,"DIDn't receive any data!\n");
|
cprintf(RED,"DIDn't receive any data!\n");
|
||||||
if (send) {
|
if (send) {
|
||||||
zmqsocket2->SendHeaderData(0, true, SLS_DETECTOR_JSON_HEADER_VERSION);
|
|
||||||
|
//zHeader.data = false;
|
||||||
|
outHeader.data=false;
|
||||||
|
// zmqsocket2->SendHeaderData(0, true, SLS_DETECTOR_JSON_HEADER_VERSION);
|
||||||
|
zmqsocket2->SendHeader(0,outHeader);
|
||||||
cprintf(RED, "Sent Dummy\n");
|
cprintf(RED, "Sent Dummy\n");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -510,14 +530,39 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
if(send_something) {
|
if(send_something) {
|
||||||
|
|
||||||
zmqsocket2->SendHeaderData (0, false,SLS_DETECTOR_JSON_HEADER_VERSION , dr, fileindex, 1,1,nnx,nny,nnx*nny*dr/8,acqIndex, frameIndex, fname,acqIndex,0 , packetNumber,bunchId, timestamp, modId,xCoord, yCoord, zCoord,debug, roundRNumber, detType, version, 0,0, 0,&additionalJsonHeader);
|
// zmqsocket2->SendHeaderData (0, false,SLS_DETECTOR_JSON_HEADER_VERSION , dr, fileindex, 1,1,nnx,nny,nnx*nny*dr/8,acqIndex, frameIndex, fname,acqIndex,0 , packetNumber,bunchId, timestamp, modId,xCoord, yCoord, zCoord,debug, roundRNumber, detType, version, 0,0, 0,&additionalJsonHeader);
|
||||||
|
|
||||||
|
outHeader.data=true;
|
||||||
|
outHeader.dynamicRange=dr;
|
||||||
|
outHeader.fileIndex=fileindex;
|
||||||
|
outHeader.ndetx=1;
|
||||||
|
outHeader.ndety=1;
|
||||||
|
outHeader.npixelsx=nnx;
|
||||||
|
outHeader.npixelsy=nny;
|
||||||
|
outHeader.imageSize=nnx*nny*dr/8;
|
||||||
|
outHeader.acqIndex=acqIndex;
|
||||||
|
outHeader.frameIndex=frameIndex;
|
||||||
|
outHeader.fname=fname;
|
||||||
|
outHeader.frameNumber=acqIndex;
|
||||||
|
outHeader.expLength=expLength;
|
||||||
|
outHeader.packetNumber=packetNumber;
|
||||||
|
outHeader.bunchId=bunchId;
|
||||||
|
outHeader.timestamp=timestamp;
|
||||||
|
outHeader.modId=modId;
|
||||||
|
outHeader.row=xCoord;
|
||||||
|
outHeader.column=yCoord;
|
||||||
|
outHeader.debug=debug;
|
||||||
|
outHeader.roundRNumber=roundRNumber;
|
||||||
|
outHeader.detType=detType;
|
||||||
|
outHeader.version=version;
|
||||||
|
|
||||||
|
zmqsocket2->SendHeader(0,outHeader);
|
||||||
zmqsocket2->SendData((char*)dout,nnx*nny*dr/8);
|
zmqsocket2->SendData((char*)dout,nnx*nny*dr/8);
|
||||||
cprintf(GREEN, "Sent Data\n");
|
cprintf(GREEN, "Sent Data\n");
|
||||||
}
|
}
|
||||||
|
outHeader.data=false;
|
||||||
zmqsocket2->SendHeaderData(0, true, SLS_DETECTOR_JSON_HEADER_VERSION);
|
zmqsocket2->SendHeader(0,outHeader);
|
||||||
|
// zmqsocket2->SendHeaderData(0, true, SLS_DETECTOR_JSON_HEADER_VERSION);
|
||||||
cprintf(RED, "Sent Dummy\n");
|
cprintf(RED, "Sent Dummy\n");
|
||||||
if (dout)
|
if (dout)
|
||||||
delete [] dout;
|
delete [] dout;
|
||||||
@ -544,33 +589,84 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef NEWZMQ
|
//#ifdef NEWZMQ
|
||||||
if (newFrame) {
|
if (newFrame) {
|
||||||
begin = std::chrono::steady_clock::now();
|
begin = std::chrono::steady_clock::now();
|
||||||
//time(&begin);
|
|
||||||
// t0 = high_resolution_clock::now();
|
|
||||||
//cout <<"new frame" << endl;
|
|
||||||
|
|
||||||
// acqIndex, frameIndex, subframeIndex, filename, fileindex
|
size = zHeader.imageSize;//doc["size"].GetUint();
|
||||||
size = doc["size"].GetUint();
|
|
||||||
// multisize = size;// * zmqsocket->size();
|
|
||||||
// dynamicRange = doc["bitmode"].GetUint();
|
|
||||||
// nPixelsX = doc["shape"][0].GetUint();
|
|
||||||
// nPixelsY = doc["shape"][1].GetUint();
|
|
||||||
filename = doc["fname"].GetString();
|
|
||||||
//acqIndex = doc["acqIndex"].GetUint64();
|
|
||||||
//frameIndex = doc["fIndex"].GetUint64();
|
|
||||||
fileindex = doc["fileIndex"].GetUint64();
|
|
||||||
//subFrameIndex = doc["expLength"].GetUint();
|
|
||||||
//packetNumber=doc["packetNumber"].GetUint();
|
|
||||||
//bunchId=doc["bunchId"].GetUint();
|
|
||||||
//timestamp=doc["timestamp"].GetUint();
|
|
||||||
//modId=doc["modId"].GetUint();
|
|
||||||
//debug=doc["debug"].GetUint();
|
|
||||||
//roundRNumber=doc["roundRNumber"].GetUint();
|
|
||||||
//detType=doc["detType"].GetUint();
|
|
||||||
//version=doc["version"].GetUint();
|
|
||||||
|
|
||||||
|
// dynamicRange = zheader.dynamicRange; //doc["bitmode"].GetUint();
|
||||||
|
// nPixelsX = zHeader.npixelsx; //doc["shape"][0].GetUint();
|
||||||
|
// nPixelsY = zHeader.npixelsy;// doc["shape"][1].GetUint();
|
||||||
|
filename = zHeader.fname;//doc["fname"].GetString();
|
||||||
|
acqIndex = zHeader.acqIndex; //doc["acqIndex"].GetUint64();
|
||||||
|
// frameIndex = zHeader.frameIndex;//doc["fIndex"].GetUint64();
|
||||||
|
fileindex = zHeader.fileIndex;//doc["fileIndex"].GetUint64();
|
||||||
|
expLength = zHeader.expLength;//doc["expLength"].GetUint();
|
||||||
|
packetNumber=zHeader.packetNumber;//doc["packetNumber"].GetUint();
|
||||||
|
bunchId=zHeader.bunchId;//doc["bunchId"].GetUint();
|
||||||
|
timestamp=zHeader.timestamp;//doc["timestamp"].GetUint();
|
||||||
|
modId=zHeader.modId;//doc["modId"].GetUint();
|
||||||
|
debug=zHeader.debug;//doc["debug"].GetUint();
|
||||||
|
// roundRNumber=r.roundRNumber;//doc["roundRNumber"].GetUint();
|
||||||
|
detType=zHeader.detType;//doc["detType"].GetUint();
|
||||||
|
version=zHeader.version;//doc["version"].GetUint();
|
||||||
|
/*document["bitmode"].GetUint(); zHeader.dynamicRange
|
||||||
|
|
||||||
|
document["fileIndex"].GetUint64(); zHeader.fileIndex
|
||||||
|
|
||||||
|
document["detshape"][0].GetUint();
|
||||||
|
zHeader.ndetx
|
||||||
|
|
||||||
|
document["detshape"][1].GetUint();
|
||||||
|
zHeader.ndety
|
||||||
|
|
||||||
|
document["shape"][0].GetUint();
|
||||||
|
zHeader.npixelsx
|
||||||
|
|
||||||
|
document["shape"][1].GetUint();
|
||||||
|
zHeader.npixelsy
|
||||||
|
|
||||||
|
document["size"].GetUint(); zHeader.imageSize
|
||||||
|
|
||||||
|
document["acqIndex"].GetUint64(); zHeader.acqIndex
|
||||||
|
|
||||||
|
document["frameIndex"].GetUint64(); zHeader.frameIndex
|
||||||
|
|
||||||
|
document["fname"].GetString(); zHeader.fname
|
||||||
|
|
||||||
|
document["frameNumber"].GetUint64(); zHeader.frameNumber
|
||||||
|
|
||||||
|
document["expLength"].GetUint(); zHeader.expLength
|
||||||
|
|
||||||
|
document["packetNumber"].GetUint(); zHeader.packetNumber
|
||||||
|
|
||||||
|
document["bunchId"].GetUint64(); zHeader.bunchId
|
||||||
|
|
||||||
|
document["timestamp"].GetUint64(); zHeader.timestamp
|
||||||
|
|
||||||
|
document["modId"].GetUint(); zHeader.modId
|
||||||
|
|
||||||
|
document["row"].GetUint(); zHeader.row
|
||||||
|
|
||||||
|
document["column"].GetUint(); zHeader.column
|
||||||
|
|
||||||
|
document["reserved"].GetUint(); zHeader.reserved
|
||||||
|
|
||||||
|
document["debug"].GetUint(); zHeader.debug
|
||||||
|
|
||||||
|
document["roundRNumber"].GetUint(); zHeader.roundRNumber
|
||||||
|
|
||||||
|
document["detType"].GetUint(); zHeader.detType
|
||||||
|
|
||||||
|
document["version"].GetUint(); zHeader.version
|
||||||
|
|
||||||
|
document["flippedDataX"].GetUint(); zHeader.flippedDataX
|
||||||
|
|
||||||
|
document["quad"].GetUint(); zHeader.quad
|
||||||
|
|
||||||
|
document["completeImage"].GetUint(); zHeader.completeImage
|
||||||
|
*/
|
||||||
//dataSize=size;
|
//dataSize=size;
|
||||||
|
|
||||||
//strcpy(fname,filename.c_str());
|
//strcpy(fname,filename.c_str());
|
||||||
@ -604,6 +700,8 @@ int main(int argc, char *argv[]) {
|
|||||||
// xCoord, yCoord,zCoord,
|
// xCoord, yCoord,zCoord,
|
||||||
// flippedDataX, packetNumber, bunchId, timestamp, modId, debug, roundRNumber, detType, version);
|
// flippedDataX, packetNumber, bunchId, timestamp, modId, debug, roundRNumber, detType, version);
|
||||||
|
|
||||||
|
addJsonHeader=zHeader.addJsonHeader;
|
||||||
|
|
||||||
/* Analog detector commands */
|
/* Analog detector commands */
|
||||||
//isPedestal=0;
|
//isPedestal=0;
|
||||||
//isFlat=0;
|
//isFlat=0;
|
||||||
@ -611,9 +709,10 @@ int main(int argc, char *argv[]) {
|
|||||||
fMode=eFrame;
|
fMode=eFrame;
|
||||||
frameMode_s="frame";
|
frameMode_s="frame";
|
||||||
cprintf(MAGENTA, "Frame mode: ");
|
cprintf(MAGENTA, "Frame mode: ");
|
||||||
if (doc.HasMember("frameMode")) {
|
// if (doc.HasMember("frameMode")) {
|
||||||
if (doc["frameMode"].IsString()) {
|
if (addJsonHeader.find("frameMode")!= addJsonHeader.end()) {
|
||||||
frameMode_s=doc["frameMode"].GetString();
|
// if (doc["frameMode"].IsString()) {
|
||||||
|
frameMode_s=addJsonHeader.at("frameMode");//doc["frameMode"].GetString();
|
||||||
if (frameMode_s == "pedestal"){
|
if (frameMode_s == "pedestal"){
|
||||||
fMode=ePedestal;
|
fMode=ePedestal;
|
||||||
//isPedestal=1;
|
//isPedestal=1;
|
||||||
@ -639,7 +738,7 @@ int main(int argc, char *argv[]) {
|
|||||||
cprintf(MAGENTA, "Resetting flatfield\n");
|
cprintf(MAGENTA, "Resetting flatfield\n");
|
||||||
fMode=eFlat;
|
fMode=eFlat;
|
||||||
}
|
}
|
||||||
#endif
|
//#endif
|
||||||
else {
|
else {
|
||||||
fMode=eFrame;
|
fMode=eFrame;
|
||||||
//isPedestal=0;
|
//isPedestal=0;
|
||||||
@ -647,19 +746,23 @@ int main(int argc, char *argv[]) {
|
|||||||
fMode=eFrame;
|
fMode=eFrame;
|
||||||
frameMode_s="frame";
|
frameMode_s="frame";
|
||||||
}
|
}
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
cprintf(MAGENTA, "%s\n" , frameMode_s.c_str());
|
cprintf(MAGENTA, "%s\n" , frameMode_s.c_str());
|
||||||
mt->setFrameMode(fMode);
|
mt->setFrameMode(fMode);
|
||||||
|
|
||||||
// threshold=0;
|
// threshold=0;
|
||||||
cprintf(MAGENTA, "Threshold: ");
|
cprintf(MAGENTA, "Threshold: ");
|
||||||
if (doc.HasMember("threshold")) {
|
if (addJsonHeader.find("threshold")!= addJsonHeader.end()) {
|
||||||
if (doc["threshold"].IsInt()) {
|
istringstream(addJsonHeader.at("threshold")) >>threshold;
|
||||||
threshold=doc["threshold"].GetInt();
|
// threshold=atoi(addJsonHeader.at("threshold").c_str());//doc["frameMode"].GetString();
|
||||||
|
}
|
||||||
|
//if (doc.HasMember("threshold")) {
|
||||||
|
//if (doc["threshold"].IsInt()) {
|
||||||
|
// threshold=doc["threshold"].GetInt();
|
||||||
mt->setThreshold(threshold);
|
mt->setThreshold(threshold);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
cprintf(MAGENTA, "%d\n", threshold);
|
cprintf(MAGENTA, "%d\n", threshold);
|
||||||
|
|
||||||
xmin=0;
|
xmin=0;
|
||||||
@ -667,40 +770,47 @@ int main(int argc, char *argv[]) {
|
|||||||
ymin=0;
|
ymin=0;
|
||||||
ymax=npy;
|
ymax=npy;
|
||||||
cprintf(MAGENTA, "ROI: ");
|
cprintf(MAGENTA, "ROI: ");
|
||||||
if (doc.HasMember("roi")) {
|
|
||||||
if (doc["roi"].IsArray()) {
|
|
||||||
if (doc["roi"].Size() > 0 )
|
|
||||||
if (doc["roi"][0].IsInt())
|
|
||||||
xmin=doc["roi"][0].GetInt();
|
|
||||||
|
|
||||||
if (doc["roi"].Size() > 1 )
|
if (addJsonHeader.find("roi")!= addJsonHeader.end()) {
|
||||||
if (doc["roi"][1].IsInt())
|
istringstream(addJsonHeader.at("roi")) >> xmin >> xmax >> ymin >> ymax ;
|
||||||
xmax=doc["roi"][1].GetInt();
|
// if (doc.HasMember("roi")) {
|
||||||
|
//if (doc["roi"].IsArray()) {
|
||||||
|
// if (doc["roi"].Size() > 0 )
|
||||||
|
// if (doc["roi"][0].IsInt())
|
||||||
|
// xmin=doc["roi"][0].GetInt();
|
||||||
|
|
||||||
if (doc["roi"].Size() > 2 )
|
// if (doc["roi"].Size() > 1 )
|
||||||
if (doc["roi"][2].IsInt())
|
// if (doc["roi"][1].IsInt())
|
||||||
ymin=doc["roi"][2].GetInt();
|
// xmax=doc["roi"][1].GetInt();
|
||||||
|
|
||||||
if (doc["roi"].Size() > 3 )
|
// if (doc["roi"].Size() > 2 )
|
||||||
if (doc["roi"][3].IsInt())
|
// if (doc["roi"][2].IsInt())
|
||||||
ymax=doc["roi"][3].GetInt();
|
// ymin=doc["roi"][2].GetInt();
|
||||||
}
|
|
||||||
|
// if (doc["roi"].Size() > 3 )
|
||||||
|
// if (doc["roi"][3].IsInt())
|
||||||
|
// ymax=doc["roi"][3].GetInt();
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
cprintf(MAGENTA, "%d %d %d %d\n", xmin, xmax, ymin, ymax);
|
cprintf(MAGENTA, "%d %d %d %d\n", xmin, xmax, ymin, ymax);
|
||||||
mt->setROI(xmin, xmax, ymin, ymax);
|
mt->setROI(xmin, xmax, ymin, ymax);
|
||||||
|
if (addJsonHeader.find("dynamicRange")!= addJsonHeader.end()) {
|
||||||
if (doc.HasMember("dynamicRange")) {
|
istringstream(addJsonHeader.at("dynamicRange")) >> dr ;
|
||||||
dr=doc["dynamicRange"].GetUint();
|
|
||||||
dr=32;
|
dr=32;
|
||||||
}
|
}
|
||||||
|
// if (doc.HasMember("dynamicRange")) {
|
||||||
|
// dr=doc["dynamicRange"].GetUint();
|
||||||
|
// dr=32;
|
||||||
|
// }
|
||||||
|
|
||||||
dMode=eAnalog;
|
dMode=eAnalog;
|
||||||
detectorMode_s="analog";
|
detectorMode_s="analog";
|
||||||
cprintf(MAGENTA, "Detector mode: ");
|
cprintf(MAGENTA, "Detector mode: ");
|
||||||
if (doc.HasMember("detectorMode")) {
|
if (addJsonHeader.find("detectorMode")!= addJsonHeader.end()) {;
|
||||||
if (doc["detectorMode"].IsString()) {
|
//if (doc.HasMember("detectorMode")) {
|
||||||
detectorMode_s=doc["detectorMode"].GetString();
|
//if (doc["detectorMode"].IsString()) {
|
||||||
|
detectorMode_s=addJsonHeader.at("detectorMode");//=doc["detectorMode"].GetString();
|
||||||
#ifdef INTERP
|
#ifdef INTERP
|
||||||
if (detectorMode_s == "interpolating"){
|
if (detectorMode_s == "interpolating"){
|
||||||
dMode=eInterpolating;
|
dMode=eInterpolating;
|
||||||
@ -718,7 +828,7 @@ int main(int argc, char *argv[]) {
|
|||||||
mt->setInterpolation(NULL);
|
mt->setInterpolation(NULL);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -767,19 +877,19 @@ int main(int argc, char *argv[]) {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
// threshold=0;
|
// threshold=0;
|
||||||
cprintf(MAGENTA, "Subframes: ");
|
// cprintf(MAGENTA, "Subframes: ");
|
||||||
subframes=0;
|
// subframes=0;
|
||||||
//isubframe=0;
|
// //isubframe=0;
|
||||||
insubframe=0;
|
// insubframe=0;
|
||||||
subnorm=1;
|
// subnorm=1;
|
||||||
f0=0;
|
// f0=0;
|
||||||
nnsubframe=0;
|
// nnsubframe=0;
|
||||||
if (doc.HasMember("subframes")) {
|
// if (doc.HasMember("subframes")) {
|
||||||
if (doc["subframes"].IsInt()) {
|
// if (doc["subframes"].IsInt()) {
|
||||||
subframes=doc["subframes"].GetInt();
|
// subframes=doc["subframes"].GetInt();
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
cprintf(MAGENTA, "%ld\n", subframes);
|
// cprintf(MAGENTA, "%ld\n", subframes);
|
||||||
|
|
||||||
|
|
||||||
newFrame=0;
|
newFrame=0;
|
||||||
@ -811,13 +921,13 @@ int main(int argc, char *argv[]) {
|
|||||||
// get data
|
// get data
|
||||||
// acqIndex = doc["acqIndex"].GetUint64();
|
// acqIndex = doc["acqIndex"].GetUint64();
|
||||||
|
|
||||||
frameIndex = doc["fIndex"].GetUint64();
|
frameIndex = zHeader.frameIndex;////doc["fIndex"].GetUint64();
|
||||||
|
|
||||||
// subFrameIndex = doc["expLength"].GetUint();
|
// subFrameIndex = doc["expLength"].GetUint();
|
||||||
|
|
||||||
// bunchId=doc["bunchId"].GetUint();
|
// bunchId=doc["bunchId"].GetUint();
|
||||||
// timestamp=doc["timestamp"].GetUint();
|
// timestamp=doc["timestamp"].GetUint();
|
||||||
packetNumber=doc["packetNumber"].GetUint();
|
packetNumber=zHeader.packetNumber; //doc["packetNumber"].GetUint();
|
||||||
// cout << acqIndex << " " << frameIndex << " " << subFrameIndex << " "<< bunchId << " " << timestamp << " " << packetNumber << endl;
|
// cout << acqIndex << " " << frameIndex << " " << subFrameIndex << " "<< bunchId << " " << timestamp << " " << packetNumber << endl;
|
||||||
//cprintf(GREEN, "frame\n");
|
//cprintf(GREEN, "frame\n");
|
||||||
if (packetNumber>=40) {
|
if (packetNumber>=40) {
|
||||||
@ -866,8 +976,9 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
zmqsocket2->SendHeaderData (0, false,SLS_DETECTOR_JSON_HEADER_VERSION , dr, fileindex, 1,1,nnx,nny,nnx*nny*dr/8,acqIndex, frameIndex, fname,acqIndex,0 , packetNumber,bunchId, timestamp, modId,xCoord, yCoord, zCoord,debug, roundRNumber, detType, version, 0,0, 0,&additionalJsonHeader);
|
// zmqsocket2->SendHeaderData (0, false,SLS_DETECTOR_JSON_HEADER_VERSION , dr, fileindex, 1,1,nnx,nny,nnx*nny*dr/8,acqIndex, frameIndex, fname,acqIndex,0 , packetNumber,bunchId, timestamp, modId,xCoord, yCoord, zCoord,debug, roundRNumber, detType, version, 0,0, 0,&additionalJsonHeader);
|
||||||
|
zHeader.data = true;
|
||||||
|
zmqsocket2->SendHeader(0,zHeader);
|
||||||
zmqsocket2->SendData((char*)dout,nnx*nny*dr/8);
|
zmqsocket2->SendData((char*)dout,nnx*nny*dr/8);
|
||||||
cprintf(GREEN, "Sent subdata\n");
|
cprintf(GREEN, "Sent subdata\n");
|
||||||
|
|
||||||
|
@ -320,7 +320,7 @@ public:
|
|||||||
// int nnx, nny, ns;
|
// int nnx, nny, ns;
|
||||||
int nn=dets[0]->getImageSize(nnx, nny,ns, nsy);
|
int nn=dets[0]->getImageSize(nnx, nny,ns, nsy);
|
||||||
if (image) {
|
if (image) {
|
||||||
delete image;
|
delete [] image;
|
||||||
image=NULL;
|
image=NULL;
|
||||||
}
|
}
|
||||||
image=new int[nn];
|
image=new int[nn];
|
||||||
|
@ -490,7 +490,7 @@ int *getClusters(char *data, int *ph=NULL) {
|
|||||||
// (clusters+nph)->ped=getPedestal(ix,iy,0);
|
// (clusters+nph)->ped=getPedestal(ix,iy,0);
|
||||||
for (ir=-(clusterSizeY/2); ir<(clusterSizeY/2)+1; ir++) {
|
for (ir=-(clusterSizeY/2); ir<(clusterSizeY/2)+1; ir++) {
|
||||||
for (ic=-(clusterSize/2); ic<(clusterSize/2)+1; ic++) {
|
for (ic=-(clusterSize/2); ic<(clusterSize/2)+1; ic++) {
|
||||||
if ((iy+ir)>=iy && (iy+ir)<ny && (ix+ic)>=ix && (ix+ic)<nx)
|
if ((iy+ir)>=0 && (iy+ir)<ny && (ix+ic)>=0 && (ix+ic)<nx)
|
||||||
(clusters+nph)->set_data(val[iy+ir][ix+ic],ic,ir);
|
(clusters+nph)->set_data(val[iy+ir][ix+ic],ic,ir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,16 +36,14 @@ class single_photon_hit {
|
|||||||
\param myFile file descriptor
|
\param myFile file descriptor
|
||||||
*/
|
*/
|
||||||
size_t write(FILE *myFile) {
|
size_t write(FILE *myFile) {
|
||||||
//fwrite((void*)this, 1, 3*sizeof(int)+4*sizeof(double)+sizeof(quad), myFile);
|
//fwrite((void*)this, 1, 3*sizeof(int)+4*sizeof(double)+sizeof(quad), myFile); // if (fwrite((void*)this, 1, sizeof(int)+2*sizeof(int16_t), myFile))
|
||||||
|
|
||||||
// if (fwrite((void*)this, 1, sizeof(int)+2*sizeof(int16_t), myFile))
|
|
||||||
#ifdef OLDFORMAT
|
#ifdef OLDFORMAT
|
||||||
if (fwrite((void*)&iframe, 1, sizeof(int), myFile)) {};
|
if (fwrite((void*)&iframe, 1, sizeof(int), myFile)) {};
|
||||||
#endif
|
#endif
|
||||||
#ifndef WRITE_QUAD
|
#ifndef WRITE_QUAD
|
||||||
//printf("no quad ");
|
//printf("no quad ");
|
||||||
//if (fwrite((void*)&x, 2, sizeof(int16_t), myFile))
|
if (fwrite((void*)&x, sizeof(int16_t), 2, myFile))
|
||||||
return fwrite((void*)&x, 1, dx*dy*sizeof(int)+2*sizeof(int16_t), myFile);
|
return fwrite((void*)data, sizeof(int), dx*dy, myFile);
|
||||||
#endif
|
#endif
|
||||||
#ifdef WRITE_QUAD
|
#ifdef WRITE_QUAD
|
||||||
// printf("quad ");
|
// printf("quad ");
|
||||||
@ -91,8 +89,8 @@ class single_photon_hit {
|
|||||||
default:
|
default:
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
if (fwrite((void*)&x, 2, sizeof(int16_t), myFile))
|
if (fwrite((void*)&x, sizeof(int16_t), 2, myFile))
|
||||||
return fwrite((void*)qq, 1, 4*sizeof(int), myFile);
|
return fwrite((void*)qq, sizeof(int), 4, myFile);
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
@ -109,14 +107,14 @@ class single_photon_hit {
|
|||||||
#endif
|
#endif
|
||||||
#ifndef WRITE_QUAD
|
#ifndef WRITE_QUAD
|
||||||
// printf( "no quad \n");
|
// printf( "no quad \n");
|
||||||
if (fread((void*)&x, 2, sizeof(int16_t), myFile))
|
if (fread((void*)&x, sizeof(int16_t),2, myFile))
|
||||||
return fread((void*)data, 1, dx*dy*sizeof(int), myFile);
|
return fread((void*)data, sizeof(int), dx*dy,myFile);
|
||||||
#endif
|
#endif
|
||||||
#ifdef WRITE_QUAD
|
#ifdef WRITE_QUAD
|
||||||
int qq[4];
|
int qq[4];
|
||||||
// printf( "quad \n");
|
printf( "quad \n");
|
||||||
if (fread((void*)&x, 2, sizeof(int16_t), myFile))
|
if (fread((void*)&x, sizeof(int16_t), 2, myFile))
|
||||||
if (fread((void*)qq, 1, 4*sizeof(int), myFile)) {
|
if (fread((void*)qq, sizeof(int), 4, myFile)) {
|
||||||
|
|
||||||
quad=TOP_RIGHT;
|
quad=TOP_RIGHT;
|
||||||
/* int mm=qq[0]; */
|
/* int mm=qq[0]; */
|
||||||
@ -216,7 +214,6 @@ class single_photon_hit {
|
|||||||
for (int iy=0; iy<dy; iy++) {
|
for (int iy=0; iy<dy; iy++) {
|
||||||
for (int ix=0; ix<dx; ix++) {
|
for (int ix=0; ix<dx; ix++) {
|
||||||
printf("%d \t",data[ix+iy*dx]);
|
printf("%d \t",data[ix+iy*dx]);
|
||||||
|
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
@ -88,6 +88,7 @@ target_include_directories(slsDetectorGui PUBLIC
|
|||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(slsDetectorGui PUBLIC
|
target_link_libraries(slsDetectorGui PUBLIC
|
||||||
|
slsProjectWarnings
|
||||||
slsDetectorShared
|
slsDetectorShared
|
||||||
${QT_QTCORE_LIBRARIES}
|
${QT_QTCORE_LIBRARIES}
|
||||||
${QT_QTGUI_LIBRARIES}
|
${QT_QTGUI_LIBRARIES}
|
||||||
|
@ -1066,239 +1066,6 @@
|
|||||||
<string>Acquisition</string>
|
<string>Acquisition</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QGridLayout" name="gridLayout_6">
|
<layout class="QGridLayout" name="gridLayout_6">
|
||||||
<item row="1" column="4">
|
|
||||||
<spacer name="horizontalSpacer_3">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Expanding</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="lblNumStoragecells">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string><html><head/><body><p>Number of additional storage cells. For Jungfrau only. </p><p>Default: 0. </p><p>Number of Images received: #frames * #triggers * (#storagecells+1) </p><p> #storagecells#</p><p><br/></p></body></html></string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Number of Storage cells:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<spacer name="horizontalSpacer_8">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Fixed</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>10</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="2">
|
|
||||||
<spacer name="verticalSpacer_2">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Expanding</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="2" colspan="2">
|
|
||||||
<widget class="QSpinBox" name="spinNumStoragecells">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>25</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string><html><head/><body><p>Number of additional storage cells. For Jungfrau only. </p><p>Default: 0. </p><p>Number of Images received: #frames * #triggers * (#storagecells+1) </p><p> #storagecells#</p><p><br/></p></body></html></string>
|
|
||||||
</property>
|
|
||||||
<property name="statusTip">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="whatsThis">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
<property name="keyboardTracking">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="suffix">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="minimum">
|
|
||||||
<number>-1</number>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>15</number>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="2">
|
|
||||||
<widget class="QDoubleSpinBox" name="spinSubExpTime">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>25</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string><nobr>
|
|
||||||
Exposure Time of a sub frame. Only for Eiger in 32 bit mode
|
|
||||||
</nobr><br><nobr>
|
|
||||||
#subexptime#
|
|
||||||
</nobr></string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
<property name="keyboardTracking">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="decimals">
|
|
||||||
<number>9</number>
|
|
||||||
</property>
|
|
||||||
<property name="minimum">
|
|
||||||
<double>-1.000000000000000</double>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<double>2000000000.000000000000000</double>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<double>1.000000000000000</double>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QLabel" name="lblSubDeadTime">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string><nobr>
|
|
||||||
Dead time between sub frames. Only for Eiger in 32 bit mode.
|
|
||||||
</nobr><br><nobr>
|
|
||||||
Default value is 0. A value less than the required minimum is ignored.
|
|
||||||
</nobr><br><nobr>
|
|
||||||
#subdeadtime#
|
|
||||||
</nobr></string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Sub Frame Dead Time:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="2">
|
|
||||||
<widget class="QDoubleSpinBox" name="spinSubDeadTime">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>25</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string><nobr>
|
|
||||||
Period between sub frames. Only for Eiger in 32 bit mode.
|
|
||||||
</nobr><br><nobr>
|
|
||||||
Default value is 0. A value less than the required minimum is ignored.
|
|
||||||
</nobr><br><nobr>
|
|
||||||
#subperiod#
|
|
||||||
</nobr></string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
<property name="keyboardTracking">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="decimals">
|
|
||||||
<number>9</number>
|
|
||||||
</property>
|
|
||||||
<property name="minimum">
|
|
||||||
<double>-1.000000000000000</double>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<double>2000000000.000000000000000</double>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<double>1.000000000000000</double>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="lblSubExpTime">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string><nobr>
|
|
||||||
Exposure Time of a sub frame. Only for Eiger in 32 bit mode
|
|
||||||
</nobr><br><nobr>
|
|
||||||
#subexptime#
|
|
||||||
</nobr></string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Sub Frame Exposure Time:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="3">
|
<item row="2" column="3">
|
||||||
<widget class="QComboBox" name="comboSubDeadTimeUnit">
|
<widget class="QComboBox" name="comboSubDeadTimeUnit">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
@ -1425,6 +1192,98 @@ Exposure Time of a sub frame. Only for Eiger in 32 bit mode
|
|||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="lblNumStoragecells">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>Number of additional storage cells. For Jungfrau only. </p><p>Default: 0. </p><p>Number of Images received: #frames * #triggers * (#storagecells+1) </p><p> #storagecells#</p><p><br/></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Number of Storage cells:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<spacer name="horizontalSpacer_8">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>10</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="2">
|
||||||
|
<widget class="QDoubleSpinBox" name="spinSubDeadTime">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><nobr>
|
||||||
|
Period between sub frames. Only for Eiger in 32 bit mode.
|
||||||
|
</nobr><br><nobr>
|
||||||
|
Default value is 0. A value less than the required minimum is ignored.
|
||||||
|
</nobr><br><nobr>
|
||||||
|
#subperiod#
|
||||||
|
</nobr></string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
<property name="keyboardTracking">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="decimals">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<double>-1.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<double>2000000000.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<double>1.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="lblSubExpTime">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><nobr>
|
||||||
|
Exposure Time of a sub frame. Only for Eiger in 32 bit mode
|
||||||
|
</nobr><br><nobr>
|
||||||
|
#subexptime#
|
||||||
|
</nobr></string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Sub Frame Exposure Time:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="3" column="0">
|
<item row="3" column="0">
|
||||||
<widget class="QLabel" name="lblDiscardBits">
|
<widget class="QLabel" name="lblDiscardBits">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
@ -1490,6 +1349,428 @@ Default value is 0. A value less than the required minimum is ignored.
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="1" column="4">
|
||||||
|
<spacer name="horizontalSpacer_3">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Expanding</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="8" column="2">
|
||||||
|
<spacer name="verticalSpacer_2">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Expanding</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="2" colspan="2">
|
||||||
|
<widget class="QSpinBox" name="spinNumStoragecells">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>Number of additional storage cells. For Jungfrau only. </p><p>Default: 0. </p><p>Number of Images received: #frames * #triggers * (#storagecells+1) </p><p> #storagecells#</p><p><br/></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="statusTip">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="whatsThis">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
<property name="keyboardTracking">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="suffix">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>-1</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>15</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="2">
|
||||||
|
<widget class="QDoubleSpinBox" name="spinSubExpTime">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><nobr>
|
||||||
|
Exposure Time of a sub frame. Only for Eiger in 32 bit mode
|
||||||
|
</nobr><br><nobr>
|
||||||
|
#subexptime#
|
||||||
|
</nobr></string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
<property name="keyboardTracking">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="decimals">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<double>-1.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<double>2000000000.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<double>1.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="lblSubDeadTime">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><nobr>
|
||||||
|
Dead time between sub frames. Only for Eiger in 32 bit mode.
|
||||||
|
</nobr><br><nobr>
|
||||||
|
Default value is 0. A value less than the required minimum is ignored.
|
||||||
|
</nobr><br><nobr>
|
||||||
|
#subdeadtime#
|
||||||
|
</nobr></string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Sub Frame Dead Time:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="3">
|
||||||
|
<widget class="QComboBox" name="comboExpTimeUnit">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>Exposure Time of a corresonding gate signal index. <br/>#exptime1# </p><p>#exptime2#</p><p>#exptime3# </p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="layoutDirection">
|
||||||
|
<enum>Qt::LeftToRight</enum>
|
||||||
|
</property>
|
||||||
|
<property name="currentIndex">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>hr</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>min</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>s</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>ms</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>us</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>ns</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="2">
|
||||||
|
<widget class="QDoubleSpinBox" name="spinExpTime">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>Exposure Time of a corresonding gate signal index. <br/>#exptime1# </p><p>#exptime2#</p><p>#exptime3# </p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
<property name="keyboardTracking">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="decimals">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<double>-1.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<double>2000000000.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<double>1.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="2">
|
||||||
|
<widget class="QSpinBox" name="spinGateIndex">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>Gate index. It will get exposure time and gate delay for corresponding gate signal.</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="statusTip">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="whatsThis">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
<property name="keyboardTracking">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="suffix">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="0">
|
||||||
|
<widget class="QLabel" name="lblGateDelay">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>Number of additional storage cells. For Jungfrau only. </p><p>Default: 0. </p><p>Number of Images received: #frames * #triggers * (#storagecells+1) </p><p> #storagecells#</p><p><br/></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Gate Delay:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="2">
|
||||||
|
<widget class="QDoubleSpinBox" name="spinGateDelay">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>Gate Delay of a corresonding gate signal index. <br/>#gatedelay1# </p><p>#gatedelay2#</p><p>#gatedelay3# </p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
<property name="keyboardTracking">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="decimals">
|
||||||
|
<number>9</number>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<double>-1.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<double>2000000000.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<double>1.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="3">
|
||||||
|
<widget class="QComboBox" name="comboGateDelayUnit">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>Gate Delay of a corresonding gate signal index. <br/>#gatedelay1# </p><p>#gatedelay2#</p><p>#gatedelay3# </p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="layoutDirection">
|
||||||
|
<enum>Qt::LeftToRight</enum>
|
||||||
|
</property>
|
||||||
|
<property name="currentIndex">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>hr</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>min</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>s</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>ms</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>us</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>ns</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="0">
|
||||||
|
<widget class="QLabel" name="lblExpTime">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>Number of additional storage cells. For Jungfrau only. </p><p>Default: 0. </p><p>Number of Images received: #frames * #triggers * (#storagecells+1) </p><p> #storagecells#</p><p><br/></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Expososure Time:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0">
|
||||||
|
<widget class="QLabel" name="lblGateIndex">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>Number of additional storage cells. For Jungfrau only. </p><p>Default: 0. </p><p>Number of Images received: #frames * #triggers * (#storagecells+1) </p><p> #storagecells#</p><p><br/></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Gate Index:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
|
@ -409,7 +409,7 @@
|
|||||||
<widget class="QFrame" name="frameTimeResolved">
|
<widget class="QFrame" name="frameTimeResolved">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>400</width>
|
<width>410</width>
|
||||||
<height>0</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
@ -432,6 +432,77 @@
|
|||||||
<property name="verticalSpacing">
|
<property name="verticalSpacing">
|
||||||
<number>4</number>
|
<number>4</number>
|
||||||
</property>
|
</property>
|
||||||
|
<item row="5" column="0">
|
||||||
|
<widget class="QStackedWidget" name="stackedLblTriggerBurst">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>171</width>
|
||||||
|
<height>32</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>171</width>
|
||||||
|
<height>32</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="currentIndex">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="pageLblTrigger">
|
||||||
|
<layout class="QGridLayout" name="gridLblTrigger">
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="lblNumTriggers">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>Number of Triggers to be expected.</p><p> #triggers#</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Number of Triggers:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="pageLblBurst">
|
||||||
|
<layout class="QGridLayout" name="gridLblBurst">
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="lblNumBursts">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>Number of Triggers to be expected.</p><p> #triggers#</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Number of Bursts:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="4" column="3">
|
<item row="4" column="3">
|
||||||
<widget class="QComboBox" name="comboPeriodUnit">
|
<widget class="QComboBox" name="comboPeriodUnit">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
@ -501,53 +572,6 @@ Frame period between exposures.
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="2" colspan="2">
|
|
||||||
<widget class="QSpinBox" name="spinNumSamples">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>25</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Number of Triggers to be expected.
|
|
||||||
#triggers#</string>
|
|
||||||
</property>
|
|
||||||
<property name="statusTip">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="whatsThis">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
<property name="keyboardTracking">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="suffix">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="minimum">
|
|
||||||
<number>-1</number>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>2000000000</number>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<number>1</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="2" colspan="2">
|
<item row="1" column="2" colspan="2">
|
||||||
<widget class="QSpinBox" name="spinNumMeasurements">
|
<widget class="QSpinBox" name="spinNumMeasurements">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@ -594,25 +618,17 @@ Frame period between exposures.
|
|||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="label_5">
|
<widget class="QLabel" name="label_5">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>175</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Number of Measurements:</string>
|
<string>Number of Measurements:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="0">
|
|
||||||
<widget class="QLabel" name="lblNumSamples">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Number of Triggers to be expected.
|
|
||||||
#triggers#</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Number of Samples:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="2" colspan="2">
|
<item row="0" column="2" colspan="2">
|
||||||
<widget class="QComboBox" name="comboTimingMode">
|
<widget class="QComboBox" name="comboTimingMode">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@ -651,6 +667,11 @@ Frame period between exposures.
|
|||||||
<string>Burst Trigger</string>
|
<string>Burst Trigger</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Trigger Gated</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="2">
|
<item row="3" column="2">
|
||||||
@ -910,77 +931,6 @@ Frame period between exposures.
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0">
|
|
||||||
<widget class="QStackedWidget" name="stackedLblTriggerBurst">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>171</width>
|
|
||||||
<height>32</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>171</width>
|
|
||||||
<height>32</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="currentIndex">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<widget class="QWidget" name="pageLblTrigger">
|
|
||||||
<layout class="QGridLayout" name="gridLblTrigger">
|
|
||||||
<property name="margin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="lblNumTriggers">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string><html><head/><body><p>Number of Triggers to be expected.</p><p> #triggers#</p></body></html></string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Number of Triggers:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="pageLblBurst">
|
|
||||||
<layout class="QGridLayout" name="gridLblBurst">
|
|
||||||
<property name="margin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="lblNumBursts">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string><html><head/><body><p>Number of Triggers to be expected.</p><p> #triggers#</p></body></html></string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Number of Bursts:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="5" column="2">
|
<item row="5" column="2">
|
||||||
<widget class="QStackedWidget" name="stackedSpinTriggerBurst">
|
<widget class="QStackedWidget" name="stackedSpinTriggerBurst">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@ -1481,6 +1431,214 @@ Frame period between exposures.
|
|||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="7" column="0">
|
||||||
|
<widget class="QStackedWidget" name="stackedLblSamplesGates">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>171</width>
|
||||||
|
<height>32</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>171</width>
|
||||||
|
<height>32</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="currentIndex">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="pageLblSamples">
|
||||||
|
<layout class="QGridLayout" name="gridLblTrigger_2">
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="lblNumSamples">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>Number of analog samples.</p><p>#asamples#</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Number of Samples:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="pageLblGates">
|
||||||
|
<layout class="QGridLayout" name="gridLblBurst_2">
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="lblNumGates">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>Number of external gates.</p><p>#gates#</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Number of Gates:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="7" column="2">
|
||||||
|
<widget class="QStackedWidget" name="stackedSpinSamplesGates">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>208</width>
|
||||||
|
<height>32</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>208</width>
|
||||||
|
<height>32</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="currentIndex">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="pageSpinSamples">
|
||||||
|
<layout class="QGridLayout" name="gridSpinTrigger_2">
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QSpinBox" name="spinNumSamples">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>Number of analog samples.</p><p>#asamples#</p><p><br/></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="statusTip">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="whatsThis">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
<property name="keyboardTracking">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="suffix">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>-1</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>2000000000</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="pageSpinGates">
|
||||||
|
<layout class="QGridLayout" name="gridSpinBurst_2">
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QSpinBox" name="spinNumGates">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>Number of external gates.</p><p>#gates#</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="statusTip">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="whatsThis">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
<property name="keyboardTracking">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="suffix">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>-1</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>2000000000</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -1513,7 +1671,6 @@ Frame period between exposures.
|
|||||||
<tabstop>comboExpUnit</tabstop>
|
<tabstop>comboExpUnit</tabstop>
|
||||||
<tabstop>spinPeriod</tabstop>
|
<tabstop>spinPeriod</tabstop>
|
||||||
<tabstop>comboPeriodUnit</tabstop>
|
<tabstop>comboPeriodUnit</tabstop>
|
||||||
<tabstop>spinNumSamples</tabstop>
|
|
||||||
</tabstops>
|
</tabstops>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../include/icons.qrc"/>
|
<include location="../include/icons.qrc"/>
|
||||||
|
@ -14,7 +14,8 @@ class qCloneWidget : public QMainWindow, private Ui::ClonePlotObject {
|
|||||||
qCloneWidget(QWidget *parent, SlsQt1DPlot *p1, SlsQt2DPlot *p2,
|
qCloneWidget(QWidget *parent, SlsQt1DPlot *p1, SlsQt2DPlot *p2,
|
||||||
SlsQt1DPlot *gp1, SlsQt2DPlot *gp, QString title,
|
SlsQt1DPlot *gp1, SlsQt2DPlot *gp, QString title,
|
||||||
QString filePath, QString fileName, int64_t aIndex,
|
QString filePath, QString fileName, int64_t aIndex,
|
||||||
bool displayStats, QString min, QString max, QString sum, bool completeImage);
|
bool displayStats, QString min, QString max, QString sum,
|
||||||
|
bool completeImage);
|
||||||
|
|
||||||
~qCloneWidget();
|
~qCloneWidget();
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "ui_form_dac.h"
|
|
||||||
#include "Detector.h"
|
#include "Detector.h"
|
||||||
#include "sls_detector_defs.h"
|
#include "sls_detector_defs.h"
|
||||||
|
#include "ui_form_dac.h"
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
class qDacWidget : public QWidget, private Ui::WidgetDacObject {
|
class qDacWidget : public QWidget, private Ui::WidgetDacObject {
|
||||||
|
@ -1,14 +1,15 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "logger.h"
|
||||||
#include "sls_detector_defs.h"
|
#include "sls_detector_defs.h"
|
||||||
|
|
||||||
#include <QAbstractButton>
|
#include <QAbstractButton>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
#include <cstdint>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
#include <cstdint>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
using std::chrono::duration;
|
using std::chrono::duration;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "ui_form_detectormain.h"
|
|
||||||
#include "qDefs.h"
|
|
||||||
#include "Detector.h"
|
#include "Detector.h"
|
||||||
|
#include "qDefs.h"
|
||||||
|
#include "ui_form_detectormain.h"
|
||||||
#include <QTabWidget>
|
#include <QTabWidget>
|
||||||
|
|
||||||
class qDrawPlot;
|
class qDrawPlot;
|
||||||
@ -29,7 +29,7 @@ class qDetectorMain : public QMainWindow, private Ui::DetectorMainObject {
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
qDetectorMain(int multiId, const std::string& fname, bool isDevel);
|
qDetectorMain(int multiId, const std::string &fname, bool isDevel);
|
||||||
~qDetectorMain();
|
~qDetectorMain();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
@ -51,9 +51,9 @@ class qDetectorMain : public QMainWindow, private Ui::DetectorMainObject {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void SetUpWidgetWindow();
|
void SetUpWidgetWindow();
|
||||||
void SetUpDetector(const std::string& config_file, int multiID);
|
void SetUpDetector(const std::string &config_file, int multiID);
|
||||||
void Initialization();
|
void Initialization();
|
||||||
void LoadConfigFile(const std::string& config_file);
|
void LoadConfigFile(const std::string &config_file);
|
||||||
|
|
||||||
/** enumeration of the tabs */
|
/** enumeration of the tabs */
|
||||||
enum {
|
enum {
|
||||||
@ -70,7 +70,7 @@ class qDetectorMain : public QMainWindow, private Ui::DetectorMainObject {
|
|||||||
slsDetectorDefs::detectorType detType;
|
slsDetectorDefs::detectorType detType;
|
||||||
std::unique_ptr<sls::Detector> det;
|
std::unique_ptr<sls::Detector> det;
|
||||||
qDrawPlot *plot;
|
qDrawPlot *plot;
|
||||||
MyTabWidget* tabs;
|
MyTabWidget *tabs;
|
||||||
std::unique_ptr<QScrollArea> scroll[NumberOfTabs];
|
std::unique_ptr<QScrollArea> scroll[NumberOfTabs];
|
||||||
qTabMeasurement *tabMeasurement;
|
qTabMeasurement *tabMeasurement;
|
||||||
qTabDataOutput *tabDataOutput;
|
qTabDataOutput *tabDataOutput;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "ui_form_plot.h"
|
|
||||||
#include "qDefs.h"
|
|
||||||
#include "Detector.h"
|
#include "Detector.h"
|
||||||
|
#include "qDefs.h"
|
||||||
|
#include "ui_form_plot.h"
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
|
||||||
class SlsQt1DPlot;
|
class SlsQt1DPlot;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "ui_form_tab_advanced.h"
|
|
||||||
#include "Detector.h"
|
#include "Detector.h"
|
||||||
|
#include "ui_form_tab_advanced.h"
|
||||||
|
|
||||||
class qDrawPlot;
|
class qDrawPlot;
|
||||||
|
|
||||||
@ -36,6 +36,9 @@ class qTabAdvanced : public QWidget, private Ui::TabAdvancedObject {
|
|||||||
void SetNumStoragecells(int value);
|
void SetNumStoragecells(int value);
|
||||||
void SetSubExposureTime();
|
void SetSubExposureTime();
|
||||||
void SetSubDeadTime();
|
void SetSubDeadTime();
|
||||||
|
void SetGateIndex(int value);
|
||||||
|
void SetExposureTime();
|
||||||
|
void SetGateDelay();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void SetupWidgetWindow();
|
void SetupWidgetWindow();
|
||||||
@ -59,6 +62,8 @@ class qTabAdvanced : public QWidget, private Ui::TabAdvancedObject {
|
|||||||
void GetNumStoragecells();
|
void GetNumStoragecells();
|
||||||
void GetSubExposureTime();
|
void GetSubExposureTime();
|
||||||
void GetSubDeadTime();
|
void GetSubDeadTime();
|
||||||
|
void GetExposureTime();
|
||||||
|
void GetGateDelay();
|
||||||
|
|
||||||
sls::Detector *det;
|
sls::Detector *det;
|
||||||
qDrawPlot *plot;
|
qDrawPlot *plot;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "ui_form_tab_dataoutput.h"
|
|
||||||
#include "Detector.h"
|
#include "Detector.h"
|
||||||
|
#include "ui_form_tab_dataoutput.h"
|
||||||
|
|
||||||
class qTabDataOutput : public QWidget, private Ui::TabDataOutputObject {
|
class qTabDataOutput : public QWidget, private Ui::TabDataOutputObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "ui_form_tab_debugging.h"
|
|
||||||
#include "Detector.h"
|
#include "Detector.h"
|
||||||
|
#include "ui_form_tab_debugging.h"
|
||||||
|
|
||||||
class QTreeWidget;
|
class QTreeWidget;
|
||||||
class QTreeWidgetItem;
|
class QTreeWidgetItem;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "ui_form_tab_developer.h"
|
|
||||||
#include "Detector.h"
|
#include "Detector.h"
|
||||||
#include "sls_detector_defs.h"
|
#include "sls_detector_defs.h"
|
||||||
|
#include "ui_form_tab_developer.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
class qDacWidget;
|
class qDacWidget;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "ui_form_tab_measurement.h"
|
|
||||||
#include "Detector.h"
|
#include "Detector.h"
|
||||||
|
#include "ui_form_tab_measurement.h"
|
||||||
|
|
||||||
class qDrawPlot;
|
class qDrawPlot;
|
||||||
class QStandardItemModel;
|
class QStandardItemModel;
|
||||||
@ -25,6 +25,7 @@ class qTabMeasurement : public QWidget, private Ui::TabMeasurementObject {
|
|||||||
void SetNumTriggers(int val);
|
void SetNumTriggers(int val);
|
||||||
void SetNumBursts(int val);
|
void SetNumBursts(int val);
|
||||||
void SetNumSamples(int val);
|
void SetNumSamples(int val);
|
||||||
|
void SetNumGates(int val);
|
||||||
void SetExposureTime();
|
void SetExposureTime();
|
||||||
void SetAcquisitionPeriod();
|
void SetAcquisitionPeriod();
|
||||||
void SetDelay();
|
void SetDelay();
|
||||||
@ -45,6 +46,7 @@ class qTabMeasurement : public QWidget, private Ui::TabMeasurementObject {
|
|||||||
* show bursts and burst period
|
* show bursts and burst period
|
||||||
*/
|
*/
|
||||||
void ShowTriggerDelay();
|
void ShowTriggerDelay();
|
||||||
|
void ShowGates();
|
||||||
void SetupTimingMode();
|
void SetupTimingMode();
|
||||||
void EnableWidgetsforTimingMode();
|
void EnableWidgetsforTimingMode();
|
||||||
|
|
||||||
@ -53,6 +55,7 @@ class qTabMeasurement : public QWidget, private Ui::TabMeasurementObject {
|
|||||||
void GetNumTriggers();
|
void GetNumTriggers();
|
||||||
void GetNumBursts();
|
void GetNumBursts();
|
||||||
void GetNumSamples();
|
void GetNumSamples();
|
||||||
|
void GetNumGates();
|
||||||
void GetExposureTime();
|
void GetExposureTime();
|
||||||
void GetAcquisitionPeriod();
|
void GetAcquisitionPeriod();
|
||||||
void CheckAcqPeriodGreaterThanExp();
|
void CheckAcqPeriodGreaterThanExp();
|
||||||
@ -76,7 +79,7 @@ class qTabMeasurement : public QWidget, private Ui::TabMeasurementObject {
|
|||||||
sls::Detector *det;
|
sls::Detector *det;
|
||||||
qDrawPlot *plot;
|
qDrawPlot *plot;
|
||||||
// enum for the timing mode
|
// enum for the timing mode
|
||||||
enum { AUTO, TRIGGER, GATED, BURST_TRIGGER, NUMTIMINGMODES };
|
enum { AUTO, TRIGGER, GATED, BURST_TRIGGER, TRIGGER_GATED, NUMTIMINGMODES };
|
||||||
QTimer *progressTimer;
|
QTimer *progressTimer;
|
||||||
// tool tip variables
|
// tool tip variables
|
||||||
QString acqPeriodTip;
|
QString acqPeriodTip;
|
||||||
@ -84,6 +87,7 @@ class qTabMeasurement : public QWidget, private Ui::TabMeasurementObject {
|
|||||||
QPalette red;
|
QPalette red;
|
||||||
bool delayImplemented;
|
bool delayImplemented;
|
||||||
bool sampleImplemented;
|
bool sampleImplemented;
|
||||||
|
bool gateImplemented;
|
||||||
bool startingFnumImplemented;
|
bool startingFnumImplemented;
|
||||||
bool isAcquisitionStopped{false};
|
bool isAcquisitionStopped{false};
|
||||||
int numMeasurements{1};
|
int numMeasurements{1};
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "ui_form_tab_plot.h"
|
|
||||||
#include "Detector.h"
|
#include "Detector.h"
|
||||||
|
#include "ui_form_tab_plot.h"
|
||||||
|
|
||||||
class qDrawPlot;
|
class qDrawPlot;
|
||||||
class QButtonGroup;
|
class QButtonGroup;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "ui_form_tab_settings.h"
|
|
||||||
#include "Detector.h"
|
#include "Detector.h"
|
||||||
|
#include "ui_form_tab_settings.h"
|
||||||
|
|
||||||
class qTabSettings : public QWidget, private Ui::TabSettingsObject {
|
class qTabSettings : public QWidget, private Ui::TabSettingsObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#ifndef SLSQT1DPLOT_H
|
#ifndef SLSQT1DPLOT_H
|
||||||
#define SLSQT1DPLOT_H
|
#define SLSQT1DPLOT_H
|
||||||
|
|
||||||
#include "ansi.h"
|
|
||||||
#include "SlsQt1DZoomer.h"
|
#include "SlsQt1DZoomer.h"
|
||||||
|
#include "ansi.h"
|
||||||
#include <qwt_plot.h>
|
#include <qwt_plot.h>
|
||||||
#include <qwt_plot_curve.h>
|
#include <qwt_plot_curve.h>
|
||||||
#include <qwt_plot_marker.h>
|
#include <qwt_plot_marker.h>
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#ifndef SLSQT2DZOOMER_H
|
#ifndef SLSQT2DZOOMER_H
|
||||||
#define SLSQT2DZOOMER_H
|
#define SLSQT2DZOOMER_H
|
||||||
#include "SlsQt2DHist.h"
|
#include "SlsQt2DHist.h"
|
||||||
|
#include <cstdio>
|
||||||
#include <qwt_plot_panner.h>
|
#include <qwt_plot_panner.h>
|
||||||
#include <qwt_plot_zoomer.h>
|
#include <qwt_plot_zoomer.h>
|
||||||
#include <cstdio>
|
|
||||||
|
|
||||||
class SlsQt2DZoomer : public QwtPlotZoomer {
|
class SlsQt2DZoomer : public QwtPlotZoomer {
|
||||||
private:
|
private:
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* TODO! short description */
|
/* TODO! short description */
|
||||||
#include "SlsQt1DPlot.h"
|
#include "SlsQt1DPlot.h"
|
||||||
#include <qwt_symbol.h>
|
#include <iostream>
|
||||||
#include <qwt_legend.h>
|
#include <qwt_legend.h>
|
||||||
#include <qwt_math.h>
|
#include <qwt_math.h>
|
||||||
#include <qwt_painter.h>
|
#include <qwt_painter.h>
|
||||||
@ -10,8 +10,8 @@
|
|||||||
#include <qwt_scale_draw.h>
|
#include <qwt_scale_draw.h>
|
||||||
#include <qwt_scale_engine.h>
|
#include <qwt_scale_engine.h>
|
||||||
#include <qwt_scale_widget.h>
|
#include <qwt_scale_widget.h>
|
||||||
|
#include <qwt_symbol.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#define QwtLog10ScaleEngine QwtLogScaleEngine // hmm
|
#define QwtLog10ScaleEngine QwtLogScaleEngine // hmm
|
||||||
|
|
||||||
@ -314,7 +314,8 @@ void SlsQtH1DList::Remove(SlsQtH1D *hist) {
|
|||||||
hl = hl->the_next;
|
hl = hl->the_next;
|
||||||
else { // match
|
else { // match
|
||||||
if (!hl->the_next)
|
if (!hl->the_next)
|
||||||
hl->the_hist = nullptr; // first the_hist is zero when there's no next
|
hl->the_hist =
|
||||||
|
nullptr; // first the_hist is zero when there's no next
|
||||||
else {
|
else {
|
||||||
SlsQtH1DList *t = hl->the_next;
|
SlsQtH1DList *t = hl->the_next;
|
||||||
hl->the_hist = t->the_hist;
|
hl->the_hist = t->the_hist;
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
/* TODO! short description */
|
/* TODO! short description */
|
||||||
#include "SlsQt1DZoomer.h"
|
#include "SlsQt1DZoomer.h"
|
||||||
#include "SlsQt1DPlot.h"
|
#include "SlsQt1DPlot.h"
|
||||||
|
#include <iostream>
|
||||||
#include <qwt_plot.h>
|
#include <qwt_plot.h>
|
||||||
#include <qwt_scale_div.h>
|
#include <qwt_scale_div.h>
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
void SlsQt1DZoomer::ResetZoomBase() {
|
void SlsQt1DZoomer::ResetZoomBase() {
|
||||||
SetZoomBase(x0, y0, x1 - x0,
|
SetZoomBase(x0, y0, x1 - x0,
|
||||||
|
@ -216,7 +216,7 @@ QwtLinearColorMap *SlsQt2DPlot::myColourMap(QVector<double> colourStops) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
QwtLinearColorMap *SlsQt2DPlot::myColourMap(int log) {
|
QwtLinearColorMap *SlsQt2DPlot::myColourMap(int log) {
|
||||||
QVector<double> cs{0.0, 0.34, 0.61 ,0.84, 1.0};
|
QVector<double> cs{0.0, 0.34, 0.61, 0.84, 1.0};
|
||||||
if (log) {
|
if (log) {
|
||||||
for (int i = 0; i < cs.size(); ++i)
|
for (int i = 0; i < cs.size(); ++i)
|
||||||
cs[i] = (pow(10, 2 * cs[i]) - 1) / 99.0;
|
cs[i] = (pow(10, 2 * cs[i]) - 1) / 99.0;
|
||||||
@ -224,7 +224,6 @@ QwtLinearColorMap *SlsQt2DPlot::myColourMap(int log) {
|
|||||||
return myColourMap(cs);
|
return myColourMap(cs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SlsQt2DPlot::Update() {
|
void SlsQt2DPlot::Update() {
|
||||||
if (isLog)
|
if (isLog)
|
||||||
hist->SetMinimumToFirstGreaterThanZero();
|
hist->SetMinimumToFirstGreaterThanZero();
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
#include "qDacWidget.h"
|
#include "qDacWidget.h"
|
||||||
#include "qDefs.h"
|
#include "qDefs.h"
|
||||||
|
|
||||||
|
|
||||||
qDacWidget::qDacWidget(QWidget *parent, sls::Detector *detector, bool d,
|
qDacWidget::qDacWidget(QWidget *parent, sls::Detector *detector, bool d,
|
||||||
std::string n, slsDetectorDefs::dacIndex i)
|
std::string n, slsDetectorDefs::dacIndex i)
|
||||||
: QWidget(parent), det(detector), isDac(d), index(i) {
|
: QWidget(parent), det(detector), isDac(d), index(i) {
|
||||||
@ -56,8 +55,8 @@ void qDacWidget::GetDac() {
|
|||||||
|
|
||||||
void qDacWidget::SetDac() {
|
void qDacWidget::SetDac() {
|
||||||
int val = (int)spinDac->value();
|
int val = (int)spinDac->value();
|
||||||
LOG(logINFO) << "Setting dac:" << lblDac->text().toAscii().data()
|
LOG(logINFO) << "Setting dac:" << lblDac->text().toAscii().data() << " : "
|
||||||
<< " : " << val;
|
<< val;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
det->setDAC(index, val, 0, {detectorIndex});
|
det->setDAC(index, val, 0, {detectorIndex});
|
||||||
|
@ -19,8 +19,8 @@
|
|||||||
#include <QScrollArea>
|
#include <QScrollArea>
|
||||||
#include <QSizePolicy>
|
#include <QSizePolicy>
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
|
#include <string>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
@ -57,8 +57,7 @@ int main(int argc, char **argv) {
|
|||||||
|
|
||||||
case 'f':
|
case 'f':
|
||||||
fname = optarg;
|
fname = optarg;
|
||||||
LOG(logDEBUG)
|
LOG(logDEBUG) << long_options[option_index].name << " " << optarg;
|
||||||
<< long_options[option_index].name << " " << optarg;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'd':
|
case 'd':
|
||||||
@ -93,7 +92,7 @@ int main(int argc, char **argv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
app.setStyle(new QPlastiqueStyle); //style is deleted by QApplication
|
app.setStyle(new QPlastiqueStyle); // style is deleted by QApplication
|
||||||
try {
|
try {
|
||||||
qDetectorMain det(multiId, fname, isDeveloper);
|
qDetectorMain det(multiId, fname, isDeveloper);
|
||||||
det.show();
|
det.show();
|
||||||
@ -105,18 +104,18 @@ int main(int argc, char **argv) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
qDetectorMain::qDetectorMain(int multiId, const std::string& fname, bool isDevel)
|
qDetectorMain::qDetectorMain(int multiId, const std::string &fname,
|
||||||
: QMainWindow(nullptr), detType(slsDetectorDefs::GENERIC), isDeveloper(isDevel),
|
bool isDevel)
|
||||||
heightPlotWindow(0), heightCentralWidget(0) {
|
: QMainWindow(nullptr), detType(slsDetectorDefs::GENERIC),
|
||||||
|
isDeveloper(isDevel), heightPlotWindow(0), heightCentralWidget(0) {
|
||||||
|
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
SetUpDetector(fname, multiId);
|
SetUpDetector(fname, multiId);
|
||||||
SetUpWidgetWindow();
|
SetUpWidgetWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
qDetectorMain::~qDetectorMain(){
|
qDetectorMain::~qDetectorMain() {
|
||||||
disconnect(tabs, SIGNAL(currentChanged(int)), this,
|
disconnect(tabs, SIGNAL(currentChanged(int)), this, SLOT(Refresh(int)));
|
||||||
SLOT(Refresh(int)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void qDetectorMain::SetUpWidgetWindow() {
|
void qDetectorMain::SetUpWidgetWindow() {
|
||||||
@ -132,8 +131,7 @@ void qDetectorMain::SetUpWidgetWindow() {
|
|||||||
layoutTabs->addWidget(tabs);
|
layoutTabs->addWidget(tabs);
|
||||||
|
|
||||||
// creating all the other tab widgets
|
// creating all the other tab widgets
|
||||||
tabMeasurement =
|
tabMeasurement = new qTabMeasurement(this, det.get(), plot);
|
||||||
new qTabMeasurement(this, det.get(), plot);
|
|
||||||
tabDataOutput = new qTabDataOutput(this, det.get());
|
tabDataOutput = new qTabDataOutput(this, det.get());
|
||||||
tabPlot = new qTabPlot(this, det.get(), plot);
|
tabPlot = new qTabPlot(this, det.get(), plot);
|
||||||
tabSettings = new qTabSettings(this, det.get());
|
tabSettings = new qTabSettings(this, det.get());
|
||||||
@ -206,7 +204,7 @@ void qDetectorMain::SetUpWidgetWindow() {
|
|||||||
Initialization();
|
Initialization();
|
||||||
}
|
}
|
||||||
|
|
||||||
void qDetectorMain::SetUpDetector(const std::string& config_file, int multiID) {
|
void qDetectorMain::SetUpDetector(const std::string &config_file, int multiID) {
|
||||||
|
|
||||||
// instantiate detector and set window title
|
// instantiate detector and set window title
|
||||||
det = sls::make_unique<sls::Detector>(multiID);
|
det = sls::make_unique<sls::Detector>(multiID);
|
||||||
@ -260,8 +258,8 @@ void qDetectorMain::Initialization() {
|
|||||||
// Measurement tab
|
// Measurement tab
|
||||||
connect(tabMeasurement, SIGNAL(EnableTabsSignal(bool)), this,
|
connect(tabMeasurement, SIGNAL(EnableTabsSignal(bool)), this,
|
||||||
SLOT(EnableTabs(bool)));
|
SLOT(EnableTabs(bool)));
|
||||||
connect(tabMeasurement, SIGNAL(FileNameChangedSignal(QString)),
|
connect(tabMeasurement, SIGNAL(FileNameChangedSignal(QString)), plot,
|
||||||
plot, SLOT(SetSaveFileName(QString)));
|
SLOT(SetSaveFileName(QString)));
|
||||||
// Plot tab
|
// Plot tab
|
||||||
connect(tabPlot, SIGNAL(DisableZoomSignal(bool)), this,
|
connect(tabPlot, SIGNAL(DisableZoomSignal(bool)), this,
|
||||||
SLOT(SetZoomToolTip(bool)));
|
SLOT(SetZoomToolTip(bool)));
|
||||||
@ -269,8 +267,7 @@ void qDetectorMain::Initialization() {
|
|||||||
// Plotting
|
// Plotting
|
||||||
connect(plot, SIGNAL(AcquireFinishedSignal()), tabMeasurement,
|
connect(plot, SIGNAL(AcquireFinishedSignal()), tabMeasurement,
|
||||||
SLOT(AcquireFinished()));
|
SLOT(AcquireFinished()));
|
||||||
connect(plot, SIGNAL(AbortSignal()), tabMeasurement,
|
connect(plot, SIGNAL(AbortSignal()), tabMeasurement, SLOT(AbortAcquire()));
|
||||||
SLOT(AbortAcquire()));
|
|
||||||
|
|
||||||
// menubar
|
// menubar
|
||||||
// Modes Menu
|
// Modes Menu
|
||||||
@ -284,7 +281,7 @@ void qDetectorMain::Initialization() {
|
|||||||
SLOT(ExecuteHelp(QAction *)));
|
SLOT(ExecuteHelp(QAction *)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void qDetectorMain::LoadConfigFile(const std::string& config_file) {
|
void qDetectorMain::LoadConfigFile(const std::string &config_file) {
|
||||||
|
|
||||||
LOG(logINFO) << "Loading config file at start up:" << config_file;
|
LOG(logINFO) << "Loading config file at start up:" << config_file;
|
||||||
|
|
||||||
@ -372,8 +369,7 @@ void qDetectorMain::ExecuteUtilities(QAction *action) {
|
|||||||
"The Configuration Parameters have been "
|
"The Configuration Parameters have been "
|
||||||
"configured successfully.",
|
"configured successfully.",
|
||||||
"qDetectorMain::ExecuteUtilities");
|
"qDetectorMain::ExecuteUtilities");
|
||||||
LOG(logINFO)
|
LOG(logINFO) << "Configuration Parameters loaded successfully";
|
||||||
<< "Configuration Parameters loaded successfully";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -277,8 +277,7 @@ void qDrawPlot::SetPlotTitlePrefix(QString title) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void qDrawPlot::SetXAxisTitle(QString title) {
|
void qDrawPlot::SetXAxisTitle(QString title) {
|
||||||
LOG(logINFO) << "Setting X Axis Title to "
|
LOG(logINFO) << "Setting X Axis Title to " << title.toAscii().constData();
|
||||||
<< title.toAscii().constData();
|
|
||||||
if (is1d) {
|
if (is1d) {
|
||||||
xTitle1d = title;
|
xTitle1d = title;
|
||||||
} else {
|
} else {
|
||||||
@ -287,8 +286,7 @@ void qDrawPlot::SetXAxisTitle(QString title) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void qDrawPlot::SetYAxisTitle(QString title) {
|
void qDrawPlot::SetYAxisTitle(QString title) {
|
||||||
LOG(logINFO) << "Setting Y Axis Title to "
|
LOG(logINFO) << "Setting Y Axis Title to " << title.toAscii().constData();
|
||||||
<< title.toAscii().constData();
|
|
||||||
if (is1d) {
|
if (is1d) {
|
||||||
yTitle1d = title;
|
yTitle1d = title;
|
||||||
} else {
|
} else {
|
||||||
@ -297,8 +295,7 @@ void qDrawPlot::SetYAxisTitle(QString title) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void qDrawPlot::SetZAxisTitle(QString title) {
|
void qDrawPlot::SetZAxisTitle(QString title) {
|
||||||
LOG(logINFO) << "Setting Z Axis Title to "
|
LOG(logINFO) << "Setting Z Axis Title to " << title.toAscii().constData();
|
||||||
<< title.toAscii().constData();
|
|
||||||
zTitle2d = title;
|
zTitle2d = title;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -309,8 +306,8 @@ void qDrawPlot::SetXYRangeChanged(bool disable, double *xy, bool *isXY) {
|
|||||||
std::copy(xy, xy + 4, xyRange);
|
std::copy(xy, xy + 4, xyRange);
|
||||||
std::copy(isXY, isXY + 4, isXYRange);
|
std::copy(isXY, isXY + 4, isXYRange);
|
||||||
|
|
||||||
LOG(logDEBUG) << "Setting Disable zoom to " << std::boolalpha
|
LOG(logDEBUG) << "Setting Disable zoom to " << std::boolalpha << disable
|
||||||
<< disable << std::noboolalpha;
|
<< std::noboolalpha;
|
||||||
disableZoom = disable;
|
disableZoom = disable;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -348,8 +345,8 @@ double qDrawPlot::GetYMaximum() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void qDrawPlot::SetDataCallBack(bool enable) {
|
void qDrawPlot::SetDataCallBack(bool enable) {
|
||||||
LOG(logINFO) << "Setting data call back to " << std::boolalpha
|
LOG(logINFO) << "Setting data call back to " << std::boolalpha << enable
|
||||||
<< enable << std::noboolalpha;
|
<< std::noboolalpha;
|
||||||
try {
|
try {
|
||||||
if (enable) {
|
if (enable) {
|
||||||
isPlot = true;
|
isPlot = true;
|
||||||
@ -360,7 +357,8 @@ void qDrawPlot::SetDataCallBack(bool enable) {
|
|||||||
det->registerDataCallback(nullptr, this);
|
det->registerDataCallback(nullptr, this);
|
||||||
det->setRxZmqDataStream(false);
|
det->setRxZmqDataStream(false);
|
||||||
}
|
}
|
||||||
} CATCH_DISPLAY("Could not get set rxr data streaming enable.",
|
}
|
||||||
|
CATCH_DISPLAY("Could not get set rxr data streaming enable.",
|
||||||
"qDrawPlot::SetDataCallBack")
|
"qDrawPlot::SetDataCallBack")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -570,8 +568,8 @@ void qDrawPlot::ClonePlot() {
|
|||||||
new qCloneWidget(this, cloneplot1D, cloneplot2D, clonegainplot1D,
|
new qCloneWidget(this, cloneplot1D, cloneplot2D, clonegainplot1D,
|
||||||
clonegainplot2D, boxPlot->title(), fileSavePath,
|
clonegainplot2D, boxPlot->title(), fileSavePath,
|
||||||
fileSaveName, currentAcqIndex, displayStatistics,
|
fileSaveName, currentAcqIndex, displayStatistics,
|
||||||
lblMinDisp->text(), lblMaxDisp->text(),
|
lblMinDisp->text(), lblMaxDisp->text(), lblSumDisp->text(),
|
||||||
lblSumDisp->text(), completeImage);
|
completeImage);
|
||||||
}
|
}
|
||||||
|
|
||||||
void qDrawPlot::SavePlot() {
|
void qDrawPlot::SavePlot() {
|
||||||
@ -673,8 +671,7 @@ void qDrawPlot::AcquireThread() {
|
|||||||
// exception in acquire will not call acquisition finished call back, so
|
// exception in acquire will not call acquisition finished call back, so
|
||||||
// handle it
|
// handle it
|
||||||
if (!mess.empty()) {
|
if (!mess.empty()) {
|
||||||
LOG(logERROR) << "Acquisition Finished with an exception: "
|
LOG(logERROR) << "Acquisition Finished with an exception: " << mess;
|
||||||
<< mess;
|
|
||||||
qDefs::ExceptionMessage("Acquire unsuccessful.", mess,
|
qDefs::ExceptionMessage("Acquire unsuccessful.", mess,
|
||||||
"qDrawPlot::AcquireFinished");
|
"qDrawPlot::AcquireFinished");
|
||||||
try {
|
try {
|
||||||
@ -739,8 +736,7 @@ void qDrawPlot::GetData(detectorData *data, uint64_t frameIndex,
|
|||||||
<< " \t nx: " << data->nx << std::endl
|
<< " \t nx: " << data->nx << std::endl
|
||||||
<< " \t ny: " << data->ny << std::endl
|
<< " \t ny: " << data->ny << std::endl
|
||||||
<< " \t data bytes: " << data->databytes << std::endl
|
<< " \t data bytes: " << data->databytes << std::endl
|
||||||
<< " \t dynamic range: " << data->dynamicRange
|
<< " \t dynamic range: " << data->dynamicRange << std::endl
|
||||||
<< std::endl
|
|
||||||
<< " \t file index: " << data->fileIndex << std::endl
|
<< " \t file index: " << data->fileIndex << std::endl
|
||||||
<< " \t complete image: " << data->completeImage << std::endl
|
<< " \t complete image: " << data->completeImage << std::endl
|
||||||
<< " ]";
|
<< " ]";
|
||||||
@ -748,8 +744,8 @@ void qDrawPlot::GetData(detectorData *data, uint64_t frameIndex,
|
|||||||
progress = (int)data->progressIndex;
|
progress = (int)data->progressIndex;
|
||||||
currentAcqIndex = data->fileIndex;
|
currentAcqIndex = data->fileIndex;
|
||||||
currentFrame = frameIndex;
|
currentFrame = frameIndex;
|
||||||
LOG(logDEBUG) << "[ Progress:" << progress
|
LOG(logDEBUG) << "[ Progress:" << progress << ", Frame:" << currentFrame
|
||||||
<< ", Frame:" << currentFrame << " ]";
|
<< " ]";
|
||||||
|
|
||||||
// 2d (only image, not gain data, not pedestalvals),
|
// 2d (only image, not gain data, not pedestalvals),
|
||||||
// check if npixelsX and npixelsY is the same (quad is different)
|
// check if npixelsX and npixelsY is the same (quad is different)
|
||||||
@ -757,8 +753,8 @@ void qDrawPlot::GetData(detectorData *data, uint64_t frameIndex,
|
|||||||
static_cast<int>(nPixelsY) != data->ny)) {
|
static_cast<int>(nPixelsY) != data->ny)) {
|
||||||
nPixelsX = data->nx;
|
nPixelsX = data->nx;
|
||||||
nPixelsY = data->ny;
|
nPixelsY = data->ny;
|
||||||
LOG(logINFO) << "Change in Detector Shape:\n\tnPixelsX:"
|
LOG(logINFO) << "Change in Detector Shape:\n\tnPixelsX:" << nPixelsX
|
||||||
<< nPixelsX << " nPixelsY:" << nPixelsY;
|
<< " nPixelsY:" << nPixelsY;
|
||||||
|
|
||||||
delete[] data2d;
|
delete[] data2d;
|
||||||
data2d = new double[nPixelsY * nPixelsX];
|
data2d = new double[nPixelsY * nPixelsX];
|
||||||
@ -815,8 +811,8 @@ void qDrawPlot::GetData(detectorData *data, uint64_t frameIndex,
|
|||||||
}
|
}
|
||||||
// calculate the pedestal value
|
// calculate the pedestal value
|
||||||
if (pedestalCount == NUM_PEDESTAL_FRAMES) {
|
if (pedestalCount == NUM_PEDESTAL_FRAMES) {
|
||||||
LOG(logINFO) << "Pedestal Calculated after "
|
LOG(logINFO) << "Pedestal Calculated after " << NUM_PEDESTAL_FRAMES
|
||||||
<< NUM_PEDESTAL_FRAMES << " frames";
|
<< " frames";
|
||||||
for (unsigned int px = 0; px < nPixels; ++px)
|
for (unsigned int px = 0; px < nPixels; ++px)
|
||||||
tempPedestalVals[px] =
|
tempPedestalVals[px] =
|
||||||
tempPedestalVals[px] / (double)NUM_PEDESTAL_FRAMES;
|
tempPedestalVals[px] / (double)NUM_PEDESTAL_FRAMES;
|
||||||
@ -1115,7 +1111,7 @@ void qDrawPlot::UpdatePlot() {
|
|||||||
// notify of incomplete images
|
// notify of incomplete images
|
||||||
lblCompleteImage->hide();
|
lblCompleteImage->hide();
|
||||||
lblInCompleteImage->hide();
|
lblInCompleteImage->hide();
|
||||||
if(completeImage) {
|
if (completeImage) {
|
||||||
lblCompleteImage->show();
|
lblCompleteImage->show();
|
||||||
} else {
|
} else {
|
||||||
lblInCompleteImage->show();
|
lblInCompleteImage->show();
|
||||||
|
@ -29,9 +29,21 @@ void qTabAdvanced::SetupWidgetWindow() {
|
|||||||
tab_roi->setEnabled(true);
|
tab_roi->setEnabled(true);
|
||||||
break;
|
break;
|
||||||
case slsDetectorDefs::MYTHEN3:
|
case slsDetectorDefs::MYTHEN3:
|
||||||
|
lblDiscardBits->setEnabled(true);
|
||||||
|
spinDiscardBits->setEnabled(true);
|
||||||
|
lblGateIndex->setEnabled(true);
|
||||||
|
spinGateIndex->setEnabled(true);
|
||||||
|
lblExpTime->setEnabled(true);
|
||||||
|
spinExpTime->setEnabled(true);
|
||||||
|
comboExpTimeUnit->setEnabled(true);
|
||||||
|
lblGateDelay->setEnabled(true);
|
||||||
|
spinGateDelay->setEnabled(true);
|
||||||
|
comboGateDelayUnit->setEnabled(true);
|
||||||
|
break;
|
||||||
case slsDetectorDefs::GOTTHARD2:
|
case slsDetectorDefs::GOTTHARD2:
|
||||||
lblDiscardBits->setEnabled(true);
|
lblDiscardBits->setEnabled(true);
|
||||||
spinDiscardBits->setEnabled(true);
|
spinDiscardBits->setEnabled(true);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -116,6 +128,28 @@ void qTabAdvanced::Initialization() {
|
|||||||
connect(spinDiscardBits, SIGNAL(valueChanged(int)), plot,
|
connect(spinDiscardBits, SIGNAL(valueChanged(int)), plot,
|
||||||
SLOT(SetNumDiscardBits(int)));
|
SLOT(SetNumDiscardBits(int)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// gate index
|
||||||
|
if (lblGateIndex->isEnabled()) {
|
||||||
|
connect(spinGateIndex, SIGNAL(valueChanged(int)), this,
|
||||||
|
SLOT(SetGateIndex(int)));
|
||||||
|
}
|
||||||
|
|
||||||
|
// exptime1, exptime2, exptme3
|
||||||
|
if (lblExpTime->isEnabled()) {
|
||||||
|
connect(spinExpTime, SIGNAL(valueChanged(double)), this,
|
||||||
|
SLOT(SetExposureTime()));
|
||||||
|
connect(comboExpTimeUnit, SIGNAL(currentIndexChanged(int)), this,
|
||||||
|
SLOT(SetExposureTime()));
|
||||||
|
}
|
||||||
|
|
||||||
|
// gatedelay1, gatedelay2, gatedelay3
|
||||||
|
if (lblGateDelay->isEnabled()) {
|
||||||
|
connect(spinGateDelay, SIGNAL(valueChanged(double)), this,
|
||||||
|
SLOT(SetGateDelay()));
|
||||||
|
connect(comboGateDelayUnit, SIGNAL(currentIndexChanged(int)), this,
|
||||||
|
SLOT(SetGateDelay()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void qTabAdvanced::PopulateDetectors() {
|
void qTabAdvanced::PopulateDetectors() {
|
||||||
@ -531,8 +565,7 @@ void qTabAdvanced::SetROI() {
|
|||||||
roi.xmax = spinXmax->value();
|
roi.xmax = spinXmax->value();
|
||||||
|
|
||||||
// set roi
|
// set roi
|
||||||
LOG(logINFO) << "Setting ROI: [" << roi.xmin << ", " << roi.xmax
|
LOG(logINFO) << "Setting ROI: [" << roi.xmin << ", " << roi.xmax << "]";
|
||||||
<< "]";
|
|
||||||
try {
|
try {
|
||||||
det->setROI(roi, {comboReadout->currentIndex()});
|
det->setROI(roi, {comboReadout->currentIndex()});
|
||||||
}
|
}
|
||||||
@ -586,8 +619,7 @@ void qTabAdvanced::GetNumStoragecells() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void qTabAdvanced::SetNumStoragecells(int value) {
|
void qTabAdvanced::SetNumStoragecells(int value) {
|
||||||
LOG(logINFO) << "Setting number of additional stoarge cells: "
|
LOG(logINFO) << "Setting number of additional stoarge cells: " << value;
|
||||||
<< value;
|
|
||||||
try {
|
try {
|
||||||
det->setNumberOfAdditionalStorageCells(value);
|
det->setNumberOfAdditionalStorageCells(value);
|
||||||
}
|
}
|
||||||
@ -621,8 +653,8 @@ void qTabAdvanced::SetSubExposureTime() {
|
|||||||
auto timeNS = qDefs::getNSTime(std::make_pair(
|
auto timeNS = qDefs::getNSTime(std::make_pair(
|
||||||
spinSubExpTime->value(),
|
spinSubExpTime->value(),
|
||||||
static_cast<qDefs::timeUnit>(comboSubExpTimeUnit->currentIndex())));
|
static_cast<qDefs::timeUnit>(comboSubExpTimeUnit->currentIndex())));
|
||||||
LOG(logINFO)
|
LOG(logINFO) << "Setting sub frame acquisition time to " << timeNS.count()
|
||||||
<< "Setting sub frame acquisition time to " << timeNS.count() << " ns"
|
<< " ns"
|
||||||
<< "/" << spinSubExpTime->value()
|
<< "/" << spinSubExpTime->value()
|
||||||
<< qDefs::getUnitString(
|
<< qDefs::getUnitString(
|
||||||
(qDefs::timeUnit)comboSubExpTimeUnit->currentIndex());
|
(qDefs::timeUnit)comboSubExpTimeUnit->currentIndex());
|
||||||
@ -661,8 +693,7 @@ void qTabAdvanced::SetSubDeadTime() {
|
|||||||
spinSubDeadTime->value(),
|
spinSubDeadTime->value(),
|
||||||
static_cast<qDefs::timeUnit>(comboSubDeadTimeUnit->currentIndex())));
|
static_cast<qDefs::timeUnit>(comboSubDeadTimeUnit->currentIndex())));
|
||||||
|
|
||||||
LOG(logINFO)
|
LOG(logINFO) << "Setting sub frame dead time to " << timeNS.count() << " ns"
|
||||||
<< "Setting sub frame dead time to " << timeNS.count() << " ns"
|
|
||||||
<< "/" << spinSubDeadTime->value()
|
<< "/" << spinSubDeadTime->value()
|
||||||
<< qDefs::getUnitString(
|
<< qDefs::getUnitString(
|
||||||
(qDefs::timeUnit)comboSubDeadTimeUnit->currentIndex());
|
(qDefs::timeUnit)comboSubDeadTimeUnit->currentIndex());
|
||||||
@ -674,6 +705,92 @@ void qTabAdvanced::SetSubDeadTime() {
|
|||||||
GetSubDeadTime();
|
GetSubDeadTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void qTabAdvanced::SetGateIndex(int value) {
|
||||||
|
LOG(logINFO) << "Getting exptime and gate delay for gate index: " << value;
|
||||||
|
GetExposureTime();
|
||||||
|
GetGateDelay();
|
||||||
|
}
|
||||||
|
|
||||||
|
void qTabAdvanced::GetExposureTime() {
|
||||||
|
int gateIndex = spinGateIndex->value();
|
||||||
|
LOG(logDEBUG) << "Getting exposure time" << gateIndex;
|
||||||
|
disconnect(spinExpTime, SIGNAL(valueChanged(double)), this,
|
||||||
|
SLOT(SetExposureTime()));
|
||||||
|
disconnect(comboExpTimeUnit, SIGNAL(currentIndexChanged(int)), this,
|
||||||
|
SLOT(SetExposureTime()));
|
||||||
|
try {
|
||||||
|
auto retval = det->getExptime(gateIndex).tsquash(
|
||||||
|
"Exptime is inconsistent for all detectors.");
|
||||||
|
auto time = qDefs::getUserFriendlyTime(retval);
|
||||||
|
spinExpTime->setValue(time.first);
|
||||||
|
comboExpTimeUnit->setCurrentIndex(static_cast<int>(time.second));
|
||||||
|
}
|
||||||
|
CATCH_DISPLAY("Could not get exposure time.",
|
||||||
|
"qTabSettings::GetExposureTime")
|
||||||
|
connect(spinExpTime, SIGNAL(valueChanged(double)), this,
|
||||||
|
SLOT(SetExposureTime()));
|
||||||
|
connect(comboExpTimeUnit, SIGNAL(currentIndexChanged(int)), this,
|
||||||
|
SLOT(SetExposureTime()));
|
||||||
|
}
|
||||||
|
|
||||||
|
void qTabAdvanced::SetExposureTime() {
|
||||||
|
int gateIndex = spinGateIndex->value();
|
||||||
|
auto timeNS = qDefs::getNSTime(std::make_pair(
|
||||||
|
spinExpTime->value(),
|
||||||
|
static_cast<qDefs::timeUnit>(comboExpTimeUnit->currentIndex())));
|
||||||
|
LOG(logINFO) << "Setting exptime" << gateIndex << " to " << timeNS.count()
|
||||||
|
<< " ns"
|
||||||
|
<< "/" << spinExpTime->value()
|
||||||
|
<< qDefs::getUnitString(
|
||||||
|
(qDefs::timeUnit)comboExpTimeUnit->currentIndex());
|
||||||
|
try {
|
||||||
|
det->setExptime(gateIndex, timeNS);
|
||||||
|
}
|
||||||
|
CATCH_DISPLAY("Could not set exposure time.",
|
||||||
|
"qTabAdvanced::SetExposureTime")
|
||||||
|
|
||||||
|
GetExposureTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
void qTabAdvanced::GetGateDelay() {
|
||||||
|
int gateIndex = spinGateIndex->value();
|
||||||
|
LOG(logDEBUG) << "Getting gate delay" << gateIndex;
|
||||||
|
disconnect(spinGateDelay, SIGNAL(valueChanged(double)), this,
|
||||||
|
SLOT(SetGateDelay()));
|
||||||
|
disconnect(comboGateDelayUnit, SIGNAL(currentIndexChanged(int)), this,
|
||||||
|
SLOT(SetGateDelay()));
|
||||||
|
try {
|
||||||
|
auto retval = det->getGateDelay(gateIndex).tsquash(
|
||||||
|
"GateDelay is inconsistent for all detectors.");
|
||||||
|
auto time = qDefs::getUserFriendlyTime(retval);
|
||||||
|
spinGateDelay->setValue(time.first);
|
||||||
|
comboGateDelayUnit->setCurrentIndex(static_cast<int>(time.second));
|
||||||
|
}
|
||||||
|
CATCH_DISPLAY("Could not get gate delay.", "qTabSettings::GetGateDelay")
|
||||||
|
connect(spinGateDelay, SIGNAL(valueChanged(double)), this,
|
||||||
|
SLOT(SetGateDelay()));
|
||||||
|
connect(comboGateDelayUnit, SIGNAL(currentIndexChanged(int)), this,
|
||||||
|
SLOT(SetGateDelay()));
|
||||||
|
}
|
||||||
|
|
||||||
|
void qTabAdvanced::SetGateDelay() {
|
||||||
|
int gateIndex = spinGateIndex->value();
|
||||||
|
auto timeNS = qDefs::getNSTime(std::make_pair(
|
||||||
|
spinGateDelay->value(),
|
||||||
|
static_cast<qDefs::timeUnit>(comboGateDelayUnit->currentIndex())));
|
||||||
|
LOG(logINFO) << "Setting gatedelay" << gateIndex << " to " << timeNS.count()
|
||||||
|
<< " ns"
|
||||||
|
<< "/" << spinGateDelay->value()
|
||||||
|
<< qDefs::getUnitString(
|
||||||
|
(qDefs::timeUnit)comboGateDelayUnit->currentIndex());
|
||||||
|
try {
|
||||||
|
det->setGateDelay(gateIndex, timeNS);
|
||||||
|
}
|
||||||
|
CATCH_DISPLAY("Could not set gate delay.", "qTabAdvanced::SetGateDelay")
|
||||||
|
|
||||||
|
GetGateDelay();
|
||||||
|
}
|
||||||
|
|
||||||
void qTabAdvanced::Refresh() {
|
void qTabAdvanced::Refresh() {
|
||||||
LOG(logDEBUG) << "**Updating Advanced Tab";
|
LOG(logDEBUG) << "**Updating Advanced Tab";
|
||||||
|
|
||||||
@ -701,5 +818,14 @@ void qTabAdvanced::Refresh() {
|
|||||||
GetSubDeadTime();
|
GetSubDeadTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// exptime1, exptime2, exptme3
|
||||||
|
if (lblExpTime->isEnabled()) {
|
||||||
|
GetExposureTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
// gatedelay1, gatedelay2, gatedelay3
|
||||||
|
if (lblGateDelay->isEnabled()) {
|
||||||
|
GetGateDelay();
|
||||||
|
}
|
||||||
LOG(logDEBUG) << "**Updated Advanced Tab";
|
LOG(logDEBUG) << "**Updated Advanced Tab";
|
||||||
}
|
}
|
||||||
|
@ -334,15 +334,13 @@ void qTabDataOutput::SetRateCorrection() {
|
|||||||
// custom dead time
|
// custom dead time
|
||||||
if (radioCustomDeadtime->isChecked()) {
|
if (radioCustomDeadtime->isChecked()) {
|
||||||
int64_t deadtime = spinCustomDeadTime->value();
|
int64_t deadtime = spinCustomDeadTime->value();
|
||||||
LOG(logINFO)
|
LOG(logINFO) << "Setting Rate Correction with custom dead time: "
|
||||||
<< "Setting Rate Correction with custom dead time: "
|
|
||||||
<< deadtime;
|
<< deadtime;
|
||||||
det->setRateCorrection(sls::ns(deadtime));
|
det->setRateCorrection(sls::ns(deadtime));
|
||||||
}
|
}
|
||||||
// default dead time
|
// default dead time
|
||||||
else {
|
else {
|
||||||
LOG(logINFO)
|
LOG(logINFO) << "Setting Rate Correction with default dead time";
|
||||||
<< "Setting Rate Correction with default dead time";
|
|
||||||
det->setDefaultRateCorrection();
|
det->setDefaultRateCorrection();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -398,8 +396,7 @@ void qTabDataOutput::SetFlags() {
|
|||||||
auto mode =
|
auto mode =
|
||||||
comboEigerParallelFlag->currentIndex() == PARALLEL ? true : false;
|
comboEigerParallelFlag->currentIndex() == PARALLEL ? true : false;
|
||||||
try {
|
try {
|
||||||
LOG(logINFO)
|
LOG(logINFO) << "Setting Readout Flags to "
|
||||||
<< "Setting Readout Flags to "
|
|
||||||
<< comboEigerParallelFlag->currentText().toAscii().data();
|
<< comboEigerParallelFlag->currentText().toAscii().data();
|
||||||
det->setParallelMode(mode);
|
det->setParallelMode(mode);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "qTabDebugging.h"
|
#include "qTabDebugging.h"
|
||||||
#include "qDefs.h"
|
|
||||||
#include "ToString.h"
|
#include "ToString.h"
|
||||||
|
#include "qDefs.h"
|
||||||
#include <QDesktopWidget>
|
#include <QDesktopWidget>
|
||||||
#include <QGridLayout>
|
#include <QGridLayout>
|
||||||
#include <QTreeWidget>
|
#include <QTreeWidget>
|
||||||
@ -105,8 +105,9 @@ void qTabDebugging::GetInfo() {
|
|||||||
treeDet->setHeaderLabel("Eiger Detector");
|
treeDet->setHeaderLabel("Eiger Detector");
|
||||||
// get num modules
|
// get num modules
|
||||||
for (int i = 0; i < comboDetector->count() / 2; ++i)
|
for (int i = 0; i < comboDetector->count() / 2; ++i)
|
||||||
items.append(new QTreeWidgetItem(
|
items.append(
|
||||||
(QTreeWidget *)nullptr, QStringList(QString("Module %1").arg(i))));
|
new QTreeWidgetItem((QTreeWidget *)nullptr,
|
||||||
|
QStringList(QString("Module %1").arg(i))));
|
||||||
treeDet->insertTopLevelItems(0, items);
|
treeDet->insertTopLevelItems(0, items);
|
||||||
// gets det names
|
// gets det names
|
||||||
for (int i = 0; i < comboDetector->count(); ++i) {
|
for (int i = 0; i < comboDetector->count(); ++i) {
|
||||||
|
@ -31,6 +31,7 @@ void qTabMeasurement::SetupWidgetWindow() {
|
|||||||
progressTimer = new QTimer(this);
|
progressTimer = new QTimer(this);
|
||||||
|
|
||||||
sampleImplemented = false;
|
sampleImplemented = false;
|
||||||
|
gateImplemented = false;
|
||||||
delayImplemented = true;
|
delayImplemented = true;
|
||||||
startingFnumImplemented = false;
|
startingFnumImplemented = false;
|
||||||
// by default, delay and starting fnum is disabled in form
|
// by default, delay and starting fnum is disabled in form
|
||||||
@ -41,6 +42,8 @@ void qTabMeasurement::SetupWidgetWindow() {
|
|||||||
// default is triggers and delay (not #bursts and burst period for gotthard2
|
// default is triggers and delay (not #bursts and burst period for gotthard2
|
||||||
// in auto mode)
|
// in auto mode)
|
||||||
ShowTriggerDelay();
|
ShowTriggerDelay();
|
||||||
|
// default is to show samples, mythen3, show gates
|
||||||
|
ShowGates();
|
||||||
|
|
||||||
// enabling according to det type
|
// enabling according to det type
|
||||||
switch (det->getDetectorType().squash()) {
|
switch (det->getDetectorType().squash()) {
|
||||||
@ -67,6 +70,9 @@ void qTabMeasurement::SetupWidgetWindow() {
|
|||||||
spinBurstPeriod->setEnabled(true);
|
spinBurstPeriod->setEnabled(true);
|
||||||
comboBurstPeriodUnit->setEnabled(true);
|
comboBurstPeriodUnit->setEnabled(true);
|
||||||
break;
|
break;
|
||||||
|
case slsDetectorDefs::MYTHEN3:
|
||||||
|
gateImplemented = true;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -97,6 +103,10 @@ void qTabMeasurement::Initialization() {
|
|||||||
connect(spinNumSamples, SIGNAL(valueChanged(int)), this,
|
connect(spinNumSamples, SIGNAL(valueChanged(int)), this,
|
||||||
SLOT(SetNumSamples(int)));
|
SLOT(SetNumSamples(int)));
|
||||||
}
|
}
|
||||||
|
if (gateImplemented) {
|
||||||
|
connect(spinNumGates, SIGNAL(valueChanged(int)), this,
|
||||||
|
SLOT(SetNumGates(int)));
|
||||||
|
}
|
||||||
connect(spinExpTime, SIGNAL(valueChanged(double)), this,
|
connect(spinExpTime, SIGNAL(valueChanged(double)), this,
|
||||||
SLOT(SetExposureTime()));
|
SLOT(SetExposureTime()));
|
||||||
connect(comboExpUnit, SIGNAL(currentIndexChanged(int)), this,
|
connect(comboExpUnit, SIGNAL(currentIndexChanged(int)), this,
|
||||||
@ -161,6 +171,16 @@ void qTabMeasurement::ShowTriggerDelay() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void qTabMeasurement::ShowGates() {
|
||||||
|
if (det->getDetectorType().squash() == slsDetectorDefs::MYTHEN3) {
|
||||||
|
stackedLblSamplesGates->setCurrentWidget(pageLblGates);
|
||||||
|
stackedSpinSamplesGates->setCurrentWidget(pageSpinGates);
|
||||||
|
} else {
|
||||||
|
stackedLblSamplesGates->setCurrentWidget(pageLblSamples);
|
||||||
|
stackedSpinSamplesGates->setCurrentWidget(pageSpinSamples);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void qTabMeasurement::SetupTimingMode() {
|
void qTabMeasurement::SetupTimingMode() {
|
||||||
QStandardItemModel *model =
|
QStandardItemModel *model =
|
||||||
qobject_cast<QStandardItemModel *>(comboTimingMode->model());
|
qobject_cast<QStandardItemModel *>(comboTimingMode->model());
|
||||||
@ -173,9 +193,20 @@ void qTabMeasurement::SetupTimingMode() {
|
|||||||
item[i] = model->itemFromIndex(index[i]);
|
item[i] = model->itemFromIndex(index[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (det->getDetectorType().squash() != slsDetectorDefs::EIGER) {
|
|
||||||
item[(int)GATED]->setEnabled(false);
|
item[(int)GATED]->setEnabled(false);
|
||||||
item[(int)BURST_TRIGGER]->setEnabled(false);
|
item[(int)BURST_TRIGGER]->setEnabled(false);
|
||||||
|
item[(int)TRIGGER_GATED]->setEnabled(false);
|
||||||
|
switch (det->getDetectorType().squash()) {
|
||||||
|
case slsDetectorDefs::EIGER:
|
||||||
|
item[(int)GATED]->setEnabled(true);
|
||||||
|
item[(int)BURST_TRIGGER]->setEnabled(true);
|
||||||
|
break;
|
||||||
|
case slsDetectorDefs::MYTHEN3:
|
||||||
|
item[(int)GATED]->setEnabled(true);
|
||||||
|
item[(int)TRIGGER_GATED]->setEnabled(true);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -197,6 +228,8 @@ void qTabMeasurement::EnableWidgetsforTimingMode() {
|
|||||||
lblDelay->setEnabled(false);
|
lblDelay->setEnabled(false);
|
||||||
spinDelay->setEnabled(false);
|
spinDelay->setEnabled(false);
|
||||||
comboDelayUnit->setEnabled(false);
|
comboDelayUnit->setEnabled(false);
|
||||||
|
lblNumGates->setEnabled(false);
|
||||||
|
spinNumGates->setEnabled(false);
|
||||||
|
|
||||||
switch (comboTimingMode->currentIndex()) {
|
switch (comboTimingMode->currentIndex()) {
|
||||||
case AUTO:
|
case AUTO:
|
||||||
@ -223,6 +256,7 @@ void qTabMeasurement::EnableWidgetsforTimingMode() {
|
|||||||
lblExpTime->setEnabled(true);
|
lblExpTime->setEnabled(true);
|
||||||
spinExpTime->setEnabled(true);
|
spinExpTime->setEnabled(true);
|
||||||
comboExpUnit->setEnabled(true);
|
comboExpUnit->setEnabled(true);
|
||||||
|
// not implemented in FW to have multiple frames for eiger
|
||||||
if (det->getDetectorType().squash() == slsDetectorDefs::EIGER) {
|
if (det->getDetectorType().squash() == slsDetectorDefs::EIGER) {
|
||||||
spinNumFrames->setValue(1);
|
spinNumFrames->setValue(1);
|
||||||
} else {
|
} else {
|
||||||
@ -241,8 +275,12 @@ void qTabMeasurement::EnableWidgetsforTimingMode() {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GATED:
|
case GATED:
|
||||||
// #frames
|
// #frames, #gates(mythen3)
|
||||||
spinNumTriggers->setValue(1);
|
spinNumTriggers->setValue(1);
|
||||||
|
if (det->getDetectorType().squash() == slsDetectorDefs::MYTHEN3) {
|
||||||
|
lblNumGates->setEnabled(true);
|
||||||
|
spinNumGates->setEnabled(true);
|
||||||
|
}
|
||||||
lblNumFrames->setEnabled(true);
|
lblNumFrames->setEnabled(true);
|
||||||
spinNumFrames->setEnabled(true);
|
spinNumFrames->setEnabled(true);
|
||||||
break;
|
break;
|
||||||
@ -258,6 +296,18 @@ void qTabMeasurement::EnableWidgetsforTimingMode() {
|
|||||||
spinPeriod->setEnabled(true);
|
spinPeriod->setEnabled(true);
|
||||||
comboPeriodUnit->setEnabled(true);
|
comboPeriodUnit->setEnabled(true);
|
||||||
break;
|
break;
|
||||||
|
case TRIGGER_GATED:
|
||||||
|
// #triggers, delay, #frames, #gates
|
||||||
|
lblNumTriggers->setEnabled(true);
|
||||||
|
spinNumTriggers->setEnabled(true);
|
||||||
|
lblDelay->setEnabled(true);
|
||||||
|
spinDelay->setEnabled(true);
|
||||||
|
comboDelayUnit->setEnabled(true);
|
||||||
|
lblNumFrames->setEnabled(true);
|
||||||
|
spinNumFrames->setEnabled(true);
|
||||||
|
lblNumGates->setEnabled(true);
|
||||||
|
spinNumGates->setEnabled(true);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -278,6 +328,7 @@ void qTabMeasurement::GetTimingMode() {
|
|||||||
case slsDetectorDefs::TRIGGER_EXPOSURE:
|
case slsDetectorDefs::TRIGGER_EXPOSURE:
|
||||||
case slsDetectorDefs::GATED:
|
case slsDetectorDefs::GATED:
|
||||||
case slsDetectorDefs::BURST_TRIGGER:
|
case slsDetectorDefs::BURST_TRIGGER:
|
||||||
|
case slsDetectorDefs::TRIGGER_GATED:
|
||||||
comboTimingMode->setCurrentIndex((int)retval);
|
comboTimingMode->setCurrentIndex((int)retval);
|
||||||
// update widget enable only if different
|
// update widget enable only if different
|
||||||
if (oldMode != comboTimingMode->currentIndex()) {
|
if (oldMode != comboTimingMode->currentIndex()) {
|
||||||
@ -411,6 +462,31 @@ void qTabMeasurement::SetNumSamples(int val) {
|
|||||||
&qTabMeasurement::GetNumSamples)
|
&qTabMeasurement::GetNumSamples)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void qTabMeasurement::GetNumGates() {
|
||||||
|
LOG(logDEBUG) << "Getting number of gates";
|
||||||
|
disconnect(spinNumGates, SIGNAL(valueChanged(int)), this,
|
||||||
|
SLOT(SetNumGates(int)));
|
||||||
|
try {
|
||||||
|
auto retval = det->getNumberOfGates().tsquash(
|
||||||
|
"Inconsistent number of gates for all detectors.");
|
||||||
|
spinNumGates->setValue(retval);
|
||||||
|
}
|
||||||
|
CATCH_DISPLAY("Could not get number of gates.",
|
||||||
|
"qTabMeasurement::GetNumGates")
|
||||||
|
connect(spinNumGates, SIGNAL(valueChanged(int)), this,
|
||||||
|
SLOT(SetNumGates(int)));
|
||||||
|
}
|
||||||
|
|
||||||
|
void qTabMeasurement::SetNumGates(int val) {
|
||||||
|
LOG(logINFO) << "Setting number of external gates to " << val;
|
||||||
|
try {
|
||||||
|
det->setNumberOfGates(val);
|
||||||
|
}
|
||||||
|
CATCH_HANDLE("Could not set number of gates.",
|
||||||
|
"qTabMeasurement::SetNumGates", this,
|
||||||
|
&qTabMeasurement::GetNumGates)
|
||||||
|
}
|
||||||
|
|
||||||
void qTabMeasurement::GetExposureTime() {
|
void qTabMeasurement::GetExposureTime() {
|
||||||
LOG(logDEBUG) << "Getting exposure time";
|
LOG(logDEBUG) << "Getting exposure time";
|
||||||
disconnect(spinExpTime, SIGNAL(valueChanged(double)), this,
|
disconnect(spinExpTime, SIGNAL(valueChanged(double)), this,
|
||||||
@ -419,13 +495,31 @@ void qTabMeasurement::GetExposureTime() {
|
|||||||
SLOT(SetExposureTime()));
|
SLOT(SetExposureTime()));
|
||||||
try {
|
try {
|
||||||
spinExpTime->setValue(-1);
|
spinExpTime->setValue(-1);
|
||||||
auto retval = det->getExptime().tsquash(
|
|
||||||
|
bool inconsistentGateValues = false;
|
||||||
|
std::chrono::nanoseconds retval;
|
||||||
|
if (det->getDetectorType().squash() == slsDetectorDefs::MYTHEN3) {
|
||||||
|
auto retvals = det->getExptimeForAllGates().tsquash(
|
||||||
"Inconsistent exposure time for all detectors.");
|
"Inconsistent exposure time for all detectors.");
|
||||||
|
// all gates have same value
|
||||||
|
if (retvals[0] == retvals[1] && retvals[1] == retvals[2]) {
|
||||||
|
retval = retvals[0];
|
||||||
|
} else {
|
||||||
|
// dont throw, just leave it as -1
|
||||||
|
inconsistentGateValues = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
retval = det->getExptime().tsquash(
|
||||||
|
"Inconsistent exposure time for all detectors.");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!inconsistentGateValues) {
|
||||||
auto time = qDefs::getUserFriendlyTime(retval);
|
auto time = qDefs::getUserFriendlyTime(retval);
|
||||||
spinExpTime->setValue(time.first);
|
spinExpTime->setValue(time.first);
|
||||||
comboExpUnit->setCurrentIndex(static_cast<int>(time.second));
|
comboExpUnit->setCurrentIndex(static_cast<int>(time.second));
|
||||||
CheckAcqPeriodGreaterThanExp();
|
CheckAcqPeriodGreaterThanExp();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
CATCH_DISPLAY("Could not get exposure time.",
|
CATCH_DISPLAY("Could not get exposure time.",
|
||||||
"qTabMeasurement::GetExposureTime")
|
"qTabMeasurement::GetExposureTime")
|
||||||
connect(spinExpTime, SIGNAL(valueChanged(double)), this,
|
connect(spinExpTime, SIGNAL(valueChanged(double)), this,
|
||||||
@ -771,8 +865,7 @@ void qTabMeasurement::AcquireFinished() {
|
|||||||
if (startingFnumImplemented) {
|
if (startingFnumImplemented) {
|
||||||
GetStartingFrameNumber();
|
GetStartingFrameNumber();
|
||||||
}
|
}
|
||||||
LOG(logDEBUG) << "Measurement " << currentMeasurement
|
LOG(logDEBUG) << "Measurement " << currentMeasurement << " finished";
|
||||||
<< " finished";
|
|
||||||
// next measurement if acq is not stopped
|
// next measurement if acq is not stopped
|
||||||
if (!isAcquisitionStopped &&
|
if (!isAcquisitionStopped &&
|
||||||
((currentMeasurement + 1) < numMeasurements)) {
|
((currentMeasurement + 1) < numMeasurements)) {
|
||||||
@ -801,8 +894,9 @@ void qTabMeasurement::Enable(bool enable) {
|
|||||||
frameNotTimeResolved->setEnabled(enable);
|
frameNotTimeResolved->setEnabled(enable);
|
||||||
|
|
||||||
// shortcut each time, else it doesnt work a second time
|
// shortcut each time, else it doesnt work a second time
|
||||||
btnStart->setShortcut(QApplication::translate(
|
btnStart->setShortcut(QApplication::translate("TabMeasurementObject",
|
||||||
"TabMeasurementObject", "Shift+Space", nullptr, QApplication::UnicodeUTF8));
|
"Shift+Space", nullptr,
|
||||||
|
QApplication::UnicodeUTF8));
|
||||||
}
|
}
|
||||||
|
|
||||||
void qTabMeasurement::Refresh() {
|
void qTabMeasurement::Refresh() {
|
||||||
@ -826,6 +920,9 @@ void qTabMeasurement::Refresh() {
|
|||||||
if (sampleImplemented) {
|
if (sampleImplemented) {
|
||||||
GetNumSamples();
|
GetNumSamples();
|
||||||
}
|
}
|
||||||
|
if (gateImplemented) {
|
||||||
|
GetNumGates();
|
||||||
|
}
|
||||||
GetFileWrite();
|
GetFileWrite();
|
||||||
GetFileName();
|
GetFileName();
|
||||||
GetRunIndex();
|
GetRunIndex();
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
#include <QStackedLayout>
|
#include <QStackedLayout>
|
||||||
#include <QStandardItemModel>
|
#include <QStandardItemModel>
|
||||||
|
|
||||||
|
|
||||||
QString qTabPlot::defaultPlotTitle("");
|
QString qTabPlot::defaultPlotTitle("");
|
||||||
QString qTabPlot::defaultHistXAxisTitle("Channel Number");
|
QString qTabPlot::defaultHistXAxisTitle("Channel Number");
|
||||||
QString qTabPlot::defaultHistYAxisTitle("Counts");
|
QString qTabPlot::defaultHistYAxisTitle("Counts");
|
||||||
@ -290,16 +289,14 @@ void qTabPlot::SetBinary() {
|
|||||||
bool binary1D = chkBinary->isChecked();
|
bool binary1D = chkBinary->isChecked();
|
||||||
bool binary2D = chkBinary_2->isChecked();
|
bool binary2D = chkBinary_2->isChecked();
|
||||||
if (is1d) {
|
if (is1d) {
|
||||||
LOG(logINFO) << "Binary Plot "
|
LOG(logINFO) << "Binary Plot " << (binary1D ? "enabled" : "disabled");
|
||||||
<< (binary1D ? "enabled" : "disabled");
|
|
||||||
lblFrom->setEnabled(binary1D);
|
lblFrom->setEnabled(binary1D);
|
||||||
lblTo->setEnabled(binary1D);
|
lblTo->setEnabled(binary1D);
|
||||||
spinFrom->setEnabled(binary1D);
|
spinFrom->setEnabled(binary1D);
|
||||||
spinTo->setEnabled(binary1D);
|
spinTo->setEnabled(binary1D);
|
||||||
plot->SetBinary(binary1D, spinFrom->value(), spinTo->value());
|
plot->SetBinary(binary1D, spinFrom->value(), spinTo->value());
|
||||||
} else {
|
} else {
|
||||||
LOG(logINFO) << "Binary Plot "
|
LOG(logINFO) << "Binary Plot " << (binary2D ? "enabled" : "disabled");
|
||||||
<< (binary2D ? "enabled" : "disabled");
|
|
||||||
lblFrom_2->setEnabled(binary2D);
|
lblFrom_2->setEnabled(binary2D);
|
||||||
lblTo_2->setEnabled(binary2D);
|
lblTo_2->setEnabled(binary2D);
|
||||||
spinFrom_2->setEnabled(binary2D);
|
spinFrom_2->setEnabled(binary2D);
|
||||||
@ -434,9 +431,9 @@ void qTabPlot::SetXYRange() {
|
|||||||
for (int i = 0; i < 4; ++i) {
|
for (int i = 0; i < 4; ++i) {
|
||||||
if (chkVal[i] && !dispVal[i].isEmpty()) {
|
if (chkVal[i] && !dispVal[i].isEmpty()) {
|
||||||
double val = dispVal[i].toDouble();
|
double val = dispVal[i].toDouble();
|
||||||
LOG(logDEBUG)
|
LOG(logDEBUG) << "Setting "
|
||||||
<< "Setting "
|
<< qDefs::getRangeAsString(
|
||||||
<< qDefs::getRangeAsString(static_cast<qDefs::range>(i))
|
static_cast<qDefs::range>(i))
|
||||||
<< " to " << val;
|
<< " to " << val;
|
||||||
xyRange[i] = val;
|
xyRange[i] = val;
|
||||||
isRange[i] = true;
|
isRange[i] = true;
|
||||||
@ -482,10 +479,10 @@ void qTabPlot::MaintainAspectRatio(int dimension) {
|
|||||||
ranges[qDefs::YMAX] = plot->GetYMaximum();
|
ranges[qDefs::YMAX] = plot->GetYMaximum();
|
||||||
double idealAspectratio = (ranges[qDefs::XMAX] - ranges[qDefs::XMIN]) /
|
double idealAspectratio = (ranges[qDefs::XMAX] - ranges[qDefs::XMIN]) /
|
||||||
(ranges[qDefs::YMAX] - ranges[qDefs::YMIN]);
|
(ranges[qDefs::YMAX] - ranges[qDefs::YMIN]);
|
||||||
LOG(logDEBUG) << "Ideal Aspect ratio: " << idealAspectratio
|
LOG(logDEBUG) << "Ideal Aspect ratio: " << idealAspectratio << " for x("
|
||||||
<< " for x(" << ranges[qDefs::XMIN] << " - "
|
<< ranges[qDefs::XMIN] << " - " << ranges[qDefs::XMAX]
|
||||||
<< ranges[qDefs::XMAX] << "), y(" << ranges[qDefs::YMIN]
|
<< "), y(" << ranges[qDefs::YMIN] << " - "
|
||||||
<< " - " << ranges[qDefs::YMAX] << ")";
|
<< ranges[qDefs::YMAX] << ")";
|
||||||
|
|
||||||
// calculate current aspect ratio
|
// calculate current aspect ratio
|
||||||
ranges[qDefs::XMIN] = dispXMin->text().toDouble();
|
ranges[qDefs::XMIN] = dispXMin->text().toDouble();
|
||||||
@ -494,10 +491,10 @@ void qTabPlot::MaintainAspectRatio(int dimension) {
|
|||||||
ranges[qDefs::YMAX] = dispYMax->text().toDouble();
|
ranges[qDefs::YMAX] = dispYMax->text().toDouble();
|
||||||
double currentAspectRatio = (ranges[qDefs::XMAX] - ranges[qDefs::XMIN]) /
|
double currentAspectRatio = (ranges[qDefs::XMAX] - ranges[qDefs::XMIN]) /
|
||||||
(ranges[qDefs::YMAX] - ranges[qDefs::YMIN]);
|
(ranges[qDefs::YMAX] - ranges[qDefs::YMIN]);
|
||||||
LOG(logDEBUG) << "Current Aspect ratio: " << currentAspectRatio
|
LOG(logDEBUG) << "Current Aspect ratio: " << currentAspectRatio << " for x("
|
||||||
<< " for x(" << ranges[qDefs::XMIN] << " - "
|
<< ranges[qDefs::XMIN] << " - " << ranges[qDefs::XMAX]
|
||||||
<< ranges[qDefs::XMAX] << "), y(" << ranges[qDefs::YMIN]
|
<< "), y(" << ranges[qDefs::YMIN] << " - "
|
||||||
<< " - " << ranges[qDefs::YMAX] << ")";
|
<< ranges[qDefs::YMAX] << ")";
|
||||||
|
|
||||||
if (currentAspectRatio != idealAspectratio) {
|
if (currentAspectRatio != idealAspectratio) {
|
||||||
// dimension: 1(x changed: y adjusted), 0(y changed: x adjusted),
|
// dimension: 1(x changed: y adjusted), 0(y changed: x adjusted),
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "qTabSettings.h"
|
#include "qTabSettings.h"
|
||||||
#include "qDefs.h"
|
|
||||||
#include "ToString.h"
|
#include "ToString.h"
|
||||||
|
#include "qDefs.h"
|
||||||
#include <QStandardItemModel>
|
#include <QStandardItemModel>
|
||||||
|
|
||||||
qTabSettings::qTabSettings(QWidget *parent, sls::Detector *detector)
|
qTabSettings::qTabSettings(QWidget *parent, sls::Detector *detector)
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
add_library(slsProjectCWarnings INTERFACE)
|
add_library(slsProjectCSettings INTERFACE)
|
||||||
target_compile_options(slsProjectCWarnings INTERFACE
|
target_compile_features(slsProjectCSettings INTERFACE c_std_99)
|
||||||
|
target_compile_options(slsProjectCSettings INTERFACE
|
||||||
-Wall
|
-Wall
|
||||||
-Wextra
|
-Wextra
|
||||||
-Wno-unused-parameter #Needs to be slowly mitigated
|
-Wno-unused-parameter #Needs to be slowly mitigated
|
||||||
@ -13,7 +14,7 @@ target_compile_options(slsProjectCWarnings INTERFACE
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Install fake the library
|
# Install fake the library
|
||||||
install(TARGETS slsProjectCWarnings
|
install(TARGETS slsProjectCSettings
|
||||||
EXPORT "${TARGETS_EXPORT_NAME}"
|
EXPORT "${TARGETS_EXPORT_NAME}"
|
||||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
|
@ -33,7 +33,7 @@ target_compile_definitions(ctbDetectorServer_virtual
|
|||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(ctbDetectorServer_virtual
|
target_link_libraries(ctbDetectorServer_virtual
|
||||||
PUBLIC pthread rt slsProjectCWarnings
|
PUBLIC pthread rt slsProjectCSettings
|
||||||
m
|
m
|
||||||
)
|
)
|
||||||
|
|
||||||
|
130
slsDetectorServers/ctbDetectorServer/RegisterDefs.h
Executable file → Normal file
130
slsDetectorServers/ctbDetectorServer/RegisterDefs.h
Executable file → Normal file
@ -10,7 +10,8 @@
|
|||||||
#define FPGA_VERSION_BRD_RVSN_MSK (0x00FFFFFF << FPGA_VERSION_BRD_RVSN_OFST)
|
#define FPGA_VERSION_BRD_RVSN_MSK (0x00FFFFFF << FPGA_VERSION_BRD_RVSN_OFST)
|
||||||
#define FPGA_VERSION_DTCTR_TYP_OFST (24)
|
#define FPGA_VERSION_DTCTR_TYP_OFST (24)
|
||||||
#define FPGA_VERSION_DTCTR_TYP_MSK (0x000000FF << FPGA_VERSION_DTCTR_TYP_OFST)
|
#define FPGA_VERSION_DTCTR_TYP_MSK (0x000000FF << FPGA_VERSION_DTCTR_TYP_OFST)
|
||||||
#define FPGA_VERSION_DTCTR_TYP_CTB_VAL ((0x4 << FPGA_VERSION_DTCTR_TYP_OFST) & FPGA_VERSION_DTCTR_TYP_MSK)
|
#define FPGA_VERSION_DTCTR_TYP_CTB_VAL \
|
||||||
|
((0x4 << FPGA_VERSION_DTCTR_TYP_OFST) & FPGA_VERSION_DTCTR_TYP_MSK)
|
||||||
|
|
||||||
/* Fix pattern RO register */
|
/* Fix pattern RO register */
|
||||||
#define FIX_PATT_REG (0x01 << MEM_MAP_SHIFT)
|
#define FIX_PATT_REG (0x01 << MEM_MAP_SHIFT)
|
||||||
@ -57,7 +58,8 @@
|
|||||||
#define STATUS_PLL_PHS_DN_OFST (23)
|
#define STATUS_PLL_PHS_DN_OFST (23)
|
||||||
#define STATUS_PLL_PHS_DN_MSK (0x00000001 << STATUS_PLL_PHS_DN_OFST)
|
#define STATUS_PLL_PHS_DN_MSK (0x00000001 << STATUS_PLL_PHS_DN_OFST)
|
||||||
#define STATUS_PT_CNTRL_STTS_OFF_OFST (24)
|
#define STATUS_PT_CNTRL_STTS_OFF_OFST (24)
|
||||||
#define STATUS_PT_CNTRL_STTS_OFF_MSK (0x000000FF << STATUS_PT_CNTRL_STTS_OFF_OFST)
|
#define STATUS_PT_CNTRL_STTS_OFF_MSK \
|
||||||
|
(0x000000FF << STATUS_PT_CNTRL_STTS_OFF_OFST)
|
||||||
#define STATUS_IDLE_MSK (0x677FF)
|
#define STATUS_IDLE_MSK (0x677FF)
|
||||||
|
|
||||||
/* Look at me RO register TODO */
|
/* Look at me RO register TODO */
|
||||||
@ -67,24 +69,30 @@
|
|||||||
#define SYSTEM_STATUS_REG (0x04 << MEM_MAP_SHIFT)
|
#define SYSTEM_STATUS_REG (0x04 << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
#define SYSTEM_STATUS_DDR3_CLBRTN_OK_OFST (0)
|
#define SYSTEM_STATUS_DDR3_CLBRTN_OK_OFST (0)
|
||||||
#define SYSTEM_STATUS_DDR3_CLBRTN_OK_MSK (0x00000001 << SYSTEM_STATUS_DDR3_CLBRTN_OK_OFST)
|
#define SYSTEM_STATUS_DDR3_CLBRTN_OK_MSK \
|
||||||
|
(0x00000001 << SYSTEM_STATUS_DDR3_CLBRTN_OK_OFST)
|
||||||
#define SYSTEM_STATUS_DDR3_CLBRTN_FL_OFST (1)
|
#define SYSTEM_STATUS_DDR3_CLBRTN_FL_OFST (1)
|
||||||
#define SYSTEM_STATUS_DDR3_CLBRTN_FL_MSK (0x00000001 << SYSTEM_STATUS_DDR3_CLBRTN_FL_OFST)
|
#define SYSTEM_STATUS_DDR3_CLBRTN_FL_MSK \
|
||||||
|
(0x00000001 << SYSTEM_STATUS_DDR3_CLBRTN_FL_OFST)
|
||||||
#define SYSTEM_STATUS_DDR3_INT_DN_OFST (2)
|
#define SYSTEM_STATUS_DDR3_INT_DN_OFST (2)
|
||||||
#define SYSTEM_STATUS_DDR3_INT_DN_MSK (0x00000001 << SYSTEM_STATUS_DDR3_INT_DN_OFST)
|
#define SYSTEM_STATUS_DDR3_INT_DN_MSK \
|
||||||
|
(0x00000001 << SYSTEM_STATUS_DDR3_INT_DN_OFST)
|
||||||
#define SYSTEM_STATUS_RCNFG_PLL_LCK_OFST (3)
|
#define SYSTEM_STATUS_RCNFG_PLL_LCK_OFST (3)
|
||||||
#define SYSTEM_STATUS_RCNFG_PLL_LCK_MSK (0x00000001 << SYSTEM_STATUS_RCNFG_PLL_LCK_OFST)
|
#define SYSTEM_STATUS_RCNFG_PLL_LCK_MSK \
|
||||||
|
(0x00000001 << SYSTEM_STATUS_RCNFG_PLL_LCK_OFST)
|
||||||
#define SYSTEM_STATUS_PLL_A_LCK_OFST (4)
|
#define SYSTEM_STATUS_PLL_A_LCK_OFST (4)
|
||||||
#define SYSTEM_STATUS_PLL_A_LCK_MSK (0x00000001 << SYSTEM_STATUS_PLL_A_LCK_OFST)
|
#define SYSTEM_STATUS_PLL_A_LCK_MSK (0x00000001 << SYSTEM_STATUS_PLL_A_LCK_OFST)
|
||||||
|
|
||||||
/* PLL Param (Reconfiguratble PLL Parameter) RO register TODO FIXME: Same as PLL_PARAM_REG 0x50 */
|
/* PLL Param (Reconfiguratble PLL Parameter) RO register TODO FIXME: Same as
|
||||||
|
* PLL_PARAM_REG 0x50 */
|
||||||
//#define PLL_PARAM_REG (0x05 << MEM_MAP_SHIFT)
|
//#define PLL_PARAM_REG (0x05 << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
/* FIFO Data RO register TODO */
|
/* FIFO Data RO register TODO */
|
||||||
#define FIFO_DATA_REG (0x06 << MEM_MAP_SHIFT)
|
#define FIFO_DATA_REG (0x06 << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
#define FIFO_DATA_HRDWR_SRL_NMBR_OFST (0)
|
#define FIFO_DATA_HRDWR_SRL_NMBR_OFST (0)
|
||||||
#define FIFO_DATA_HRDWR_SRL_NMBR_MSK (0x0000FFFF << FIFO_DATA_HRDWR_SRL_NMBR_OFST)
|
#define FIFO_DATA_HRDWR_SRL_NMBR_MSK \
|
||||||
|
(0x0000FFFF << FIFO_DATA_HRDWR_SRL_NMBR_OFST)
|
||||||
//#define FIFO_DATA_WRD_OFST (16)
|
//#define FIFO_DATA_WRD_OFST (16)
|
||||||
//#define FIFO_DATA_WRD_MSK (0x0000FFFF << FIFO_DATA_WRD_OFST)
|
//#define FIFO_DATA_WRD_MSK (0x0000FFFF << FIFO_DATA_WRD_OFST)
|
||||||
|
|
||||||
@ -114,7 +122,8 @@
|
|||||||
#define API_VERSION_DTCTR_TYP_OFST (24)
|
#define API_VERSION_DTCTR_TYP_OFST (24)
|
||||||
#define API_VERSION_DTCTR_TYP_MSK (0x000000FF << API_VERSION_DTCTR_TYP_OFST)
|
#define API_VERSION_DTCTR_TYP_MSK (0x000000FF << API_VERSION_DTCTR_TYP_OFST)
|
||||||
|
|
||||||
/* Time from Start 64 bit RO register. t = GCLK x 50 ns. Reset using CONTROL_CRST. TODO */
|
/* Time from Start 64 bit RO register. t = GCLK x 50 ns. Reset using
|
||||||
|
* CONTROL_CRST. TODO */
|
||||||
#define TIME_FROM_START_LSB_REG (0x10 << MEM_MAP_SHIFT)
|
#define TIME_FROM_START_LSB_REG (0x10 << MEM_MAP_SHIFT)
|
||||||
#define TIME_FROM_START_MSB_REG (0x11 << MEM_MAP_SHIFT)
|
#define TIME_FROM_START_MSB_REG (0x11 << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
@ -135,12 +144,16 @@
|
|||||||
#define PERIOD_LEFT_MSB_REG (0x19 << MEM_MAP_SHIFT)
|
#define PERIOD_LEFT_MSB_REG (0x19 << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
/* Exposure Time Left 64 bit RO register */
|
/* Exposure Time Left 64 bit RO register */
|
||||||
//#define EXPTIME_LEFT_LSB_REG (0x1A << MEM_MAP_SHIFT) // Not used in FW
|
//#define EXPTIME_LEFT_LSB_REG (0x1A << MEM_MAP_SHIFT) // Not
|
||||||
//#define EXPTIME_LEFT_MSB_REG (0x1B << MEM_MAP_SHIFT) // Not used in FW
|
// used in FW #define EXPTIME_LEFT_MSB_REG (0x1B <<
|
||||||
|
// MEM_MAP_SHIFT)
|
||||||
|
//// Not used in FW
|
||||||
|
|
||||||
/* Gates Left 64 bit RO register */
|
/* Gates Left 64 bit RO register */
|
||||||
//#define GATES_LEFT_LSB_REG (0x1C << MEM_MAP_SHIFT) // Not used in FW
|
//#define GATES_LEFT_LSB_REG (0x1C << MEM_MAP_SHIFT) // Not
|
||||||
//#define GATES_LEFT_MSB_REG (0x1D << MEM_MAP_SHIFT) // Not used in FW
|
// used in FW #define GATES_LEFT_MSB_REG (0x1D <<
|
||||||
|
// MEM_MAP_SHIFT)
|
||||||
|
//// Not used in FW
|
||||||
|
|
||||||
/* Data In 64 bit RO register TODO */
|
/* Data In 64 bit RO register TODO */
|
||||||
#define DATA_IN_LSB_REG (0x1E << MEM_MAP_SHIFT)
|
#define DATA_IN_LSB_REG (0x1E << MEM_MAP_SHIFT)
|
||||||
@ -151,14 +164,17 @@
|
|||||||
#define PATTERN_OUT_MSB_REG (0x21 << MEM_MAP_SHIFT)
|
#define PATTERN_OUT_MSB_REG (0x21 << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
/* Frames From Start 64 bit RO register TODO */
|
/* Frames From Start 64 bit RO register TODO */
|
||||||
//#define FRAMES_FROM_START_LSB_REG (0x22 << MEM_MAP_SHIFT) // Not used in FW
|
//#define FRAMES_FROM_START_LSB_REG (0x22 << MEM_MAP_SHIFT) // Not
|
||||||
//#define FRAMES_FROM_START_MSB_REG (0x23 << MEM_MAP_SHIFT) // Not used in FW
|
// used in FW #define FRAMES_FROM_START_MSB_REG (0x23 <<
|
||||||
|
// MEM_MAP_SHIFT)
|
||||||
|
//// Not used in FW
|
||||||
|
|
||||||
/* Frames From Start PG 64 bit RO register. Reset using CONTROL_CRST. TODO */
|
/* Frames From Start PG 64 bit RO register. Reset using CONTROL_CRST. TODO */
|
||||||
#define FRAMES_FROM_START_PG_LSB_REG (0x24 << MEM_MAP_SHIFT)
|
#define FRAMES_FROM_START_PG_LSB_REG (0x24 << MEM_MAP_SHIFT)
|
||||||
#define FRAMES_FROM_START_PG_MSB_REG (0x25 << MEM_MAP_SHIFT)
|
#define FRAMES_FROM_START_PG_MSB_REG (0x25 << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
/* Start Frame Time (Measurement Time) 64 bit register (timestamp at a frame start until reset) TODO */
|
/* Start Frame Time (Measurement Time) 64 bit register (timestamp at a frame
|
||||||
|
* start until reset) TODO */
|
||||||
#define START_FRAME_TIME_LSB_REG (0x26 << MEM_MAP_SHIFT)
|
#define START_FRAME_TIME_LSB_REG (0x26 << MEM_MAP_SHIFT)
|
||||||
#define START_FRAME_TIME_MSB_REG (0x27 << MEM_MAP_SHIFT)
|
#define START_FRAME_TIME_MSB_REG (0x27 << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
@ -177,9 +193,11 @@
|
|||||||
/* FIFO Digital In Status RO register */
|
/* FIFO Digital In Status RO register */
|
||||||
#define FIFO_DIN_STATUS_REG (0x3B << MEM_MAP_SHIFT)
|
#define FIFO_DIN_STATUS_REG (0x3B << MEM_MAP_SHIFT)
|
||||||
#define FIFO_DIN_STATUS_FIFO_FULL_OFST (30)
|
#define FIFO_DIN_STATUS_FIFO_FULL_OFST (30)
|
||||||
#define FIFO_DIN_STATUS_FIFO_FULL_MSK (0x00000001 << FIFO_DIN_STATUS_FIFO_FULL_OFST)
|
#define FIFO_DIN_STATUS_FIFO_FULL_MSK \
|
||||||
|
(0x00000001 << FIFO_DIN_STATUS_FIFO_FULL_OFST)
|
||||||
#define FIFO_DIN_STATUS_FIFO_EMPTY_OFST (31)
|
#define FIFO_DIN_STATUS_FIFO_EMPTY_OFST (31)
|
||||||
#define FIFO_DIN_STATUS_FIFO_EMPTY_MSK (0x00000001 << FIFO_DIN_STATUS_FIFO_EMPTY_OFST)
|
#define FIFO_DIN_STATUS_FIFO_EMPTY_MSK \
|
||||||
|
(0x00000001 << FIFO_DIN_STATUS_FIFO_EMPTY_OFST)
|
||||||
|
|
||||||
/* FIFO Digital In 64 bit RO register */
|
/* FIFO Digital In 64 bit RO register */
|
||||||
#define FIFO_DIN_LSB_REG (0x3C << MEM_MAP_SHIFT)
|
#define FIFO_DIN_LSB_REG (0x3C << MEM_MAP_SHIFT)
|
||||||
@ -243,9 +261,11 @@
|
|||||||
#define DUMMY_FIFO_CHNNL_SLCT_OFST (0)
|
#define DUMMY_FIFO_CHNNL_SLCT_OFST (0)
|
||||||
#define DUMMY_FIFO_CHNNL_SLCT_MSK (0x0000003F << DUMMY_FIFO_CHNNL_SLCT_OFST)
|
#define DUMMY_FIFO_CHNNL_SLCT_MSK (0x0000003F << DUMMY_FIFO_CHNNL_SLCT_OFST)
|
||||||
#define DUMMY_ANLG_FIFO_RD_STRBE_OFST (8)
|
#define DUMMY_ANLG_FIFO_RD_STRBE_OFST (8)
|
||||||
#define DUMMY_ANLG_FIFO_RD_STRBE_MSK (0x00000001 << DUMMY_ANLG_FIFO_RD_STRBE_OFST)
|
#define DUMMY_ANLG_FIFO_RD_STRBE_MSK \
|
||||||
|
(0x00000001 << DUMMY_ANLG_FIFO_RD_STRBE_OFST)
|
||||||
#define DUMMY_DGTL_FIFO_RD_STRBE_OFST (9)
|
#define DUMMY_DGTL_FIFO_RD_STRBE_OFST (9)
|
||||||
#define DUMMY_DGTL_FIFO_RD_STRBE_MSK (0x00000001 << DUMMY_DGTL_FIFO_RD_STRBE_OFST)
|
#define DUMMY_DGTL_FIFO_RD_STRBE_MSK \
|
||||||
|
(0x00000001 << DUMMY_DGTL_FIFO_RD_STRBE_OFST)
|
||||||
|
|
||||||
/* Receiver IP Address RW register */
|
/* Receiver IP Address RW register */
|
||||||
#define RX_IP_REG (0x45 << MEM_MAP_SHIFT)
|
#define RX_IP_REG (0x45 << MEM_MAP_SHIFT)
|
||||||
@ -313,21 +333,23 @@
|
|||||||
#define CONTROL_STP_ACQSTN_OFST (1)
|
#define CONTROL_STP_ACQSTN_OFST (1)
|
||||||
#define CONTROL_STP_ACQSTN_MSK (0x00000001 << CONTROL_STP_ACQSTN_OFST)
|
#define CONTROL_STP_ACQSTN_MSK (0x00000001 << CONTROL_STP_ACQSTN_OFST)
|
||||||
//#define CONTROL_STRT_FF_TST_OFST (2)
|
//#define CONTROL_STRT_FF_TST_OFST (2)
|
||||||
//#define CONTROL_STRT_FF_TST_MSK (0x00000001 << CONTROL_STRT_FF_TST_OFST)
|
//#define CONTROL_STRT_FF_TST_MSK (0x00000001 <<
|
||||||
//#define CONTROL_STP_FF_TST_OFST (3)
|
// CONTROL_STRT_FF_TST_OFST) #define CONTROL_STP_FF_TST_OFST (3)
|
||||||
//#define CONTROL_STP_FF_TST_MSK (0x00000001 << CONTROL_STP_FF_TST_OFST)
|
//#define CONTROL_STP_FF_TST_MSK (0x00000001 <<
|
||||||
//#define CONTROL_STRT_RDT_OFST (4)
|
// CONTROL_STP_FF_TST_OFST) #define CONTROL_STRT_RDT_OFST (4)
|
||||||
//#define CONTROL_STRT_RDT_MSK (0x00000001 << CONTROL_STRT_RDT_OFST)
|
//#define CONTROL_STRT_RDT_MSK (0x00000001 <<
|
||||||
//#define CONTROL_STP_RDT_OFST (5)
|
// CONTROL_STRT_RDT_OFST) #define CONTROL_STP_RDT_OFST (5)
|
||||||
//#define CONTROL_STP_RDT_MSK (0x00000001 << CONTROL_STP_RDT_OFST)
|
// #define CONTROL_STP_RDT_MSK (0x00000001 <<
|
||||||
|
// CONTROL_STP_RDT_OFST)
|
||||||
#define CONTROL_STRT_EXPSR_OFST (6)
|
#define CONTROL_STRT_EXPSR_OFST (6)
|
||||||
#define CONTROL_STRT_EXPSR_MSK (0x00000001 << CONTROL_STRT_EXPSR_OFST)
|
#define CONTROL_STRT_EXPSR_MSK (0x00000001 << CONTROL_STRT_EXPSR_OFST)
|
||||||
//#define CONTROL_STP_EXPSR_OFST (7)
|
//#define CONTROL_STP_EXPSR_OFST (7)
|
||||||
//#define CONTROL_STP_EXPSR_MSK (0x00000001 << CONTROL_STP_RDT_OFST)
|
//#define CONTROL_STP_EXPSR_MSK (0x00000001 <<
|
||||||
//#define CONTROL_STRT_TRN_OFST (8)
|
// CONTROL_STP_RDT_OFST) #define CONTROL_STRT_TRN_OFST (8) #define
|
||||||
//#define CONTROL_STRT_TRN_MSK (0x00000001 << CONTROL_STRT_RDT_OFST)
|
// CONTROL_STRT_TRN_MSK (0x00000001 << CONTROL_STRT_RDT_OFST)
|
||||||
//#define CONTROL_STP_TRN_OFST (9)
|
//#define CONTROL_STP_TRN_OFST (9)
|
||||||
//#define CONTROL_STP_TRN_MSK (0x00000001 << CONTROL_STP_RDT_OFST)
|
//#define CONTROL_STP_TRN_MSK (0x00000001 <<
|
||||||
|
// CONTROL_STP_RDT_OFST)
|
||||||
#define CONTROL_CRE_RST_OFST (10)
|
#define CONTROL_CRE_RST_OFST (10)
|
||||||
#define CONTROL_CRE_RST_MSK (0x00000001 << CONTROL_CRE_RST_OFST)
|
#define CONTROL_CRE_RST_MSK (0x00000001 << CONTROL_CRE_RST_OFST)
|
||||||
#define CONTROL_PRPHRL_RST_OFST (11) // Only GBE10?
|
#define CONTROL_PRPHRL_RST_OFST (11) // Only GBE10?
|
||||||
@ -335,7 +357,8 @@
|
|||||||
#define CONTROL_MMRY_RST_OFST (12)
|
#define CONTROL_MMRY_RST_OFST (12)
|
||||||
#define CONTROL_MMRY_RST_MSK (0x00000001 << CONTROL_MMRY_RST_OFST)
|
#define CONTROL_MMRY_RST_MSK (0x00000001 << CONTROL_MMRY_RST_OFST)
|
||||||
//#define CONTROL_PLL_RCNFG_WR_OFST (13)
|
//#define CONTROL_PLL_RCNFG_WR_OFST (13)
|
||||||
//#define CONTROL_PLL_RCNFG_WR_MSK (0x00000001 << CONTROL_PLL_RCNFG_WR_OFST)
|
//#define CONTROL_PLL_RCNFG_WR_MSK (0x00000001 <<
|
||||||
|
// CONTROL_PLL_RCNFG_WR_OFST)
|
||||||
#define CONTROL_SND_10GB_PCKT_OFST (14)
|
#define CONTROL_SND_10GB_PCKT_OFST (14)
|
||||||
#define CONTROL_SND_10GB_PCKT_MSK (0x00000001 << CONTROL_SND_10GB_PCKT_OFST)
|
#define CONTROL_SND_10GB_PCKT_MSK (0x00000001 << CONTROL_SND_10GB_PCKT_OFST)
|
||||||
#define CONTROL_CLR_ACQSTN_FIFO_OFST (15)
|
#define CONTROL_CLR_ACQSTN_FIFO_OFST (15)
|
||||||
@ -348,7 +371,8 @@
|
|||||||
#define PLL_CNTRL_REG (0x51 << MEM_MAP_SHIFT)
|
#define PLL_CNTRL_REG (0x51 << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
#define PLL_CNTRL_RCNFG_PRMTR_RST_OFST (0)
|
#define PLL_CNTRL_RCNFG_PRMTR_RST_OFST (0)
|
||||||
#define PLL_CNTRL_RCNFG_PRMTR_RST_MSK (0x00000001 << PLL_CNTRL_RCNFG_PRMTR_RST_OFST)
|
#define PLL_CNTRL_RCNFG_PRMTR_RST_MSK \
|
||||||
|
(0x00000001 << PLL_CNTRL_RCNFG_PRMTR_RST_OFST)
|
||||||
#define PLL_CNTRL_WR_PRMTR_OFST (2)
|
#define PLL_CNTRL_WR_PRMTR_OFST (2)
|
||||||
#define PLL_CNTRL_WR_PRMTR_MSK (0x00000001 << PLL_CNTRL_WR_PRMTR_OFST)
|
#define PLL_CNTRL_WR_PRMTR_MSK (0x00000001 << PLL_CNTRL_WR_PRMTR_OFST)
|
||||||
#define PLL_CNTRL_PLL_RST_OFST (3)
|
#define PLL_CNTRL_PLL_RST_OFST (3)
|
||||||
@ -378,7 +402,8 @@
|
|||||||
#define PATTERN_LOOP_0_ADDR_REG (0x54 << MEM_MAP_SHIFT)
|
#define PATTERN_LOOP_0_ADDR_REG (0x54 << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
#define PATTERN_LOOP_0_ADDR_STRT_OFST (0)
|
#define PATTERN_LOOP_0_ADDR_STRT_OFST (0)
|
||||||
#define PATTERN_LOOP_0_ADDR_STRT_MSK (0x00001FFF << PATTERN_LOOP_0_ADDR_STRT_OFST)
|
#define PATTERN_LOOP_0_ADDR_STRT_MSK \
|
||||||
|
(0x00001FFF << PATTERN_LOOP_0_ADDR_STRT_OFST)
|
||||||
#define PATTERN_LOOP_0_ADDR_STP_OFST (16)
|
#define PATTERN_LOOP_0_ADDR_STP_OFST (16)
|
||||||
#define PATTERN_LOOP_0_ADDR_STP_MSK (0x00001FFF << PATTERN_LOOP_0_ADDR_STP_OFST)
|
#define PATTERN_LOOP_0_ADDR_STP_MSK (0x00001FFF << PATTERN_LOOP_0_ADDR_STP_OFST)
|
||||||
|
|
||||||
@ -389,7 +414,8 @@
|
|||||||
#define PATTERN_LOOP_1_ADDR_REG (0x56 << MEM_MAP_SHIFT)
|
#define PATTERN_LOOP_1_ADDR_REG (0x56 << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
#define PATTERN_LOOP_1_ADDR_STRT_OFST (0)
|
#define PATTERN_LOOP_1_ADDR_STRT_OFST (0)
|
||||||
#define PATTERN_LOOP_1_ADDR_STRT_MSK (0x00001FFF << PATTERN_LOOP_1_ADDR_STRT_OFST)
|
#define PATTERN_LOOP_1_ADDR_STRT_MSK \
|
||||||
|
(0x00001FFF << PATTERN_LOOP_1_ADDR_STRT_OFST)
|
||||||
#define PATTERN_LOOP_1_ADDR_STP_OFST (16)
|
#define PATTERN_LOOP_1_ADDR_STP_OFST (16)
|
||||||
#define PATTERN_LOOP_1_ADDR_STP_MSK (0x00001FFF << PATTERN_LOOP_1_ADDR_STP_OFST)
|
#define PATTERN_LOOP_1_ADDR_STP_MSK (0x00001FFF << PATTERN_LOOP_1_ADDR_STP_OFST)
|
||||||
|
|
||||||
@ -400,7 +426,8 @@
|
|||||||
#define PATTERN_LOOP_2_ADDR_REG (0x58 << MEM_MAP_SHIFT)
|
#define PATTERN_LOOP_2_ADDR_REG (0x58 << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
#define PATTERN_LOOP_2_ADDR_STRT_OFST (0)
|
#define PATTERN_LOOP_2_ADDR_STRT_OFST (0)
|
||||||
#define PATTERN_LOOP_2_ADDR_STRT_MSK (0x00001FFF << PATTERN_LOOP_2_ADDR_STRT_OFST)
|
#define PATTERN_LOOP_2_ADDR_STRT_MSK \
|
||||||
|
(0x00001FFF << PATTERN_LOOP_2_ADDR_STRT_OFST)
|
||||||
#define PATTERN_LOOP_2_ADDR_STP_OFST (16)
|
#define PATTERN_LOOP_2_ADDR_STP_OFST (16)
|
||||||
#define PATTERN_LOOP_2_ADDR_STP_MSK (0x00001FFF << PATTERN_LOOP_2_ADDR_STP_OFST)
|
#define PATTERN_LOOP_2_ADDR_STP_MSK (0x00001FFF << PATTERN_LOOP_2_ADDR_STP_OFST)
|
||||||
|
|
||||||
@ -412,7 +439,7 @@
|
|||||||
|
|
||||||
#define PATTERN_WAIT_0_ADDR_OFST (0)
|
#define PATTERN_WAIT_0_ADDR_OFST (0)
|
||||||
#define PATTERN_WAIT_0_ADDR_MSK (0x00001FFF << PATTERN_WAIT_0_ADDR_OFST)
|
#define PATTERN_WAIT_0_ADDR_MSK (0x00001FFF << PATTERN_WAIT_0_ADDR_OFST)
|
||||||
//FIXME: is mask 3FF
|
// FIXME: is mask 3FF
|
||||||
|
|
||||||
/* Pattern Wait 1 RW regiser */
|
/* Pattern Wait 1 RW regiser */
|
||||||
#define PATTERN_WAIT_1_ADDR_REG (0x5B << MEM_MAP_SHIFT)
|
#define PATTERN_WAIT_1_ADDR_REG (0x5B << MEM_MAP_SHIFT)
|
||||||
@ -445,7 +472,6 @@
|
|||||||
/* Number of Words RW register TODO */
|
/* Number of Words RW register TODO */
|
||||||
#define NUMBER_OF_WORDS_REG (0x5F << MEM_MAP_SHIFT)
|
#define NUMBER_OF_WORDS_REG (0x5F << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
|
|
||||||
/* Delay 64 bit RW register. t = DLY x 50 ns. */
|
/* Delay 64 bit RW register. t = DLY x 50 ns. */
|
||||||
#define DELAY_LSB_REG (0x60 << MEM_MAP_SHIFT)
|
#define DELAY_LSB_REG (0x60 << MEM_MAP_SHIFT)
|
||||||
#define DELAY_MSB_REG (0x61 << MEM_MAP_SHIFT)
|
#define DELAY_MSB_REG (0x61 << MEM_MAP_SHIFT)
|
||||||
@ -463,12 +489,14 @@
|
|||||||
#define PERIOD_MSB_REG (0x67 << MEM_MAP_SHIFT)
|
#define PERIOD_MSB_REG (0x67 << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
/* Period 64 bit RW register */
|
/* Period 64 bit RW register */
|
||||||
//#define EXPTIME_LSB_REG (0x68 << MEM_MAP_SHIFT) // Not used in FW
|
//#define EXPTIME_LSB_REG (0x68 << MEM_MAP_SHIFT) //
|
||||||
//#define EXPTIME_MSB_REG (0x69 << MEM_MAP_SHIFT) // Not used in FW
|
// Not used in FW #define EXPTIME_MSB_REG (0x69 <<
|
||||||
|
// MEM_MAP_SHIFT) // Not used in FW
|
||||||
|
|
||||||
/* Gates 64 bit RW register */
|
/* Gates 64 bit RW register */
|
||||||
//#define GATES_LSB_REG (0x6A << MEM_MAP_SHIFT) // Not used in FW
|
//#define GATES_LSB_REG (0x6A << MEM_MAP_SHIFT) // Not used
|
||||||
//#define GATES_MSB_REG (0x6B << MEM_MAP_SHIFT) // Not used in FW
|
// in FW #define GATES_MSB_REG (0x6B << MEM_MAP_SHIFT) //
|
||||||
|
// Not used in FW
|
||||||
|
|
||||||
/* Pattern IO Control 64 bit RW regiser
|
/* Pattern IO Control 64 bit RW regiser
|
||||||
* Each bit configured as output(1)/ input(0) */
|
* Each bit configured as output(1)/ input(0) */
|
||||||
@ -505,7 +533,6 @@
|
|||||||
#define READOUT_10G_ENABLE_DGTL_OFST (8)
|
#define READOUT_10G_ENABLE_DGTL_OFST (8)
|
||||||
#define READOUT_10G_ENABLE_DGTL_MSK (0x00000001 << READOUT_10G_ENABLE_DGTL_OFST)
|
#define READOUT_10G_ENABLE_DGTL_MSK (0x00000001 << READOUT_10G_ENABLE_DGTL_OFST)
|
||||||
|
|
||||||
|
|
||||||
/* Digital Bit External Trigger RW register */
|
/* Digital Bit External Trigger RW register */
|
||||||
#define DBIT_EXT_TRG_REG (0x7B << MEM_MAP_SHIFT)
|
#define DBIT_EXT_TRG_REG (0x7B << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
@ -517,11 +544,15 @@
|
|||||||
/* Pin Delay 0 RW register */
|
/* Pin Delay 0 RW register */
|
||||||
#define OUTPUT_DELAY_0_REG (0x7C << MEM_MAP_SHIFT)
|
#define OUTPUT_DELAY_0_REG (0x7C << MEM_MAP_SHIFT)
|
||||||
#define OUTPUT_DELAY_0_OTPT_STTNG_STEPS (25)
|
#define OUTPUT_DELAY_0_OTPT_STTNG_STEPS (25)
|
||||||
#define OUTPUT_DELAY_0_OTPT_STTNG_OFST (0) //t = OTPT_STTNG * 25 ps, max for Cyclone V = 775 ps
|
#define OUTPUT_DELAY_0_OTPT_STTNG_OFST \
|
||||||
#define OUTPUT_DELAY_0_OTPT_STTNG_MSK (0x0000001F << OUTPUT_DELAY_0_OTPT_STTNG_OFST)
|
(0) // t = OTPT_STTNG * 25 ps, max for Cyclone V = 775 ps
|
||||||
// 1: load dynamic output settings, 0: trigger start of dynamic output delay configuration pn falling edge of ODT (output delay trigger) bit
|
#define OUTPUT_DELAY_0_OTPT_STTNG_MSK \
|
||||||
|
(0x0000001F << OUTPUT_DELAY_0_OTPT_STTNG_OFST)
|
||||||
|
// 1: load dynamic output settings, 0: trigger start of dynamic output delay
|
||||||
|
// configuration pn falling edge of ODT (output delay trigger) bit
|
||||||
#define OUTPUT_DELAY_0_OTPT_TRGGR_OFST (31)
|
#define OUTPUT_DELAY_0_OTPT_TRGGR_OFST (31)
|
||||||
#define OUTPUT_DELAY_0_OTPT_TRGGR_MSK (0x00000001 << OUTPUT_DELAY_0_OTPT_TRGGR_OFST)
|
#define OUTPUT_DELAY_0_OTPT_TRGGR_MSK \
|
||||||
|
(0x00000001 << OUTPUT_DELAY_0_OTPT_TRGGR_OFST)
|
||||||
#define OUTPUT_DELAY_0_OTPT_TRGGR_LD_VAL (1)
|
#define OUTPUT_DELAY_0_OTPT_TRGGR_LD_VAL (1)
|
||||||
#define OUTPUT_DELAY_0_OTPT_TRGGR_STRT_VAL (0)
|
#define OUTPUT_DELAY_0_OTPT_TRGGR_STRT_VAL (0)
|
||||||
|
|
||||||
@ -546,10 +577,7 @@
|
|||||||
#define I2C_SCL_LOW_COUNT_REG (0x108 << MEM_MAP_SHIFT)
|
#define I2C_SCL_LOW_COUNT_REG (0x108 << MEM_MAP_SHIFT)
|
||||||
#define I2C_SCL_HIGH_COUNT_REG (0x109 << MEM_MAP_SHIFT)
|
#define I2C_SCL_HIGH_COUNT_REG (0x109 << MEM_MAP_SHIFT)
|
||||||
#define I2C_SDA_HOLD_REG (0x10A << MEM_MAP_SHIFT)
|
#define I2C_SDA_HOLD_REG (0x10A << MEM_MAP_SHIFT)
|
||||||
//fixme: upto 0x10f
|
// fixme: upto 0x10f
|
||||||
|
|
||||||
/* Round Robin */
|
/* Round Robin */
|
||||||
#define RXR_ENDPOINT_START_REG (0x1000 << MEM_MAP_SHIFT)
|
#define RXR_ENDPOINT_START_REG (0x1000 << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Binary file not shown.
854
slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c
Executable file → Normal file
854
slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
74
slsDetectorServers/ctbDetectorServer/slsDetectorServer_defs.h
Executable file → Normal file
74
slsDetectorServers/ctbDetectorServer/slsDetectorServer_defs.h
Executable file → Normal file
@ -1,7 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "sls_detector_defs.h"
|
|
||||||
#include "RegisterDefs.h"
|
#include "RegisterDefs.h"
|
||||||
|
#include "sls_detector_defs.h"
|
||||||
|
|
||||||
#define MIN_REQRD_VRSN_T_RD_API 0x181130
|
#define MIN_REQRD_VRSN_T_RD_API 0x181130
|
||||||
#define REQRD_FRMWR_VRSN 0x191127
|
#define REQRD_FRMWR_VRSN 0x191127
|
||||||
@ -15,13 +14,13 @@ typedef struct udp_header_struct {
|
|||||||
uint16_t udp_destmac_lsb;
|
uint16_t udp_destmac_lsb;
|
||||||
uint32_t udp_srcmac_lsb;
|
uint32_t udp_srcmac_lsb;
|
||||||
uint8_t ip_tos;
|
uint8_t ip_tos;
|
||||||
uint8_t ip_ihl: 4, ip_ver: 4;
|
uint8_t ip_ihl : 4, ip_ver : 4;
|
||||||
uint16_t udp_ethertype;
|
uint16_t udp_ethertype;
|
||||||
uint16_t ip_identification;
|
uint16_t ip_identification;
|
||||||
uint16_t ip_totallength;
|
uint16_t ip_totallength;
|
||||||
uint8_t ip_protocol;
|
uint8_t ip_protocol;
|
||||||
uint8_t ip_ttl;
|
uint8_t ip_ttl;
|
||||||
uint16_t ip_fragmentoffset: 13, ip_flags: 3;
|
uint16_t ip_fragmentoffset : 13, ip_flags : 3;
|
||||||
uint16_t ip_srcip_msb;
|
uint16_t ip_srcip_msb;
|
||||||
uint16_t ip_checksum;
|
uint16_t ip_checksum;
|
||||||
uint16_t ip_destip_msb;
|
uint16_t ip_destip_msb;
|
||||||
@ -36,11 +35,54 @@ typedef struct udp_header_struct {
|
|||||||
#define UDP_IP_HEADER_LENGTH_BYTES (28)
|
#define UDP_IP_HEADER_LENGTH_BYTES (28)
|
||||||
|
|
||||||
/* Enums */
|
/* Enums */
|
||||||
enum ADCINDEX {V_PWR_IO, V_PWR_A, V_PWR_B, V_PWR_C, V_PWR_D, I_PWR_IO, I_PWR_A, I_PWR_B, I_PWR_C, I_PWR_D, S_ADC0, S_ADC1, S_ADC2, S_ADC3, S_ADC4, S_ADC5, S_ADC6, S_ADC7, S_TMP};
|
enum ADCINDEX {
|
||||||
enum DACINDEX {D0, D1, D2, D3, D4, D5, D6, D7, D8, D9,
|
V_PWR_IO,
|
||||||
D10, D11, D12, D13, D14, D15, D16, D17,
|
V_PWR_A,
|
||||||
D_PWR_D, D_PWR_CHIP, D_PWR_C, D_PWR_B, D_PWR_A, D_PWR_IO};
|
V_PWR_B,
|
||||||
enum CLKINDEX {RUN_CLK, ADC_CLK, SYNC_CLK, DBIT_CLK, NUM_CLOCKS};
|
V_PWR_C,
|
||||||
|
V_PWR_D,
|
||||||
|
I_PWR_IO,
|
||||||
|
I_PWR_A,
|
||||||
|
I_PWR_B,
|
||||||
|
I_PWR_C,
|
||||||
|
I_PWR_D,
|
||||||
|
S_ADC0,
|
||||||
|
S_ADC1,
|
||||||
|
S_ADC2,
|
||||||
|
S_ADC3,
|
||||||
|
S_ADC4,
|
||||||
|
S_ADC5,
|
||||||
|
S_ADC6,
|
||||||
|
S_ADC7,
|
||||||
|
S_TMP
|
||||||
|
};
|
||||||
|
enum DACINDEX {
|
||||||
|
D0,
|
||||||
|
D1,
|
||||||
|
D2,
|
||||||
|
D3,
|
||||||
|
D4,
|
||||||
|
D5,
|
||||||
|
D6,
|
||||||
|
D7,
|
||||||
|
D8,
|
||||||
|
D9,
|
||||||
|
D10,
|
||||||
|
D11,
|
||||||
|
D12,
|
||||||
|
D13,
|
||||||
|
D14,
|
||||||
|
D15,
|
||||||
|
D16,
|
||||||
|
D17,
|
||||||
|
D_PWR_D,
|
||||||
|
D_PWR_CHIP,
|
||||||
|
D_PWR_C,
|
||||||
|
D_PWR_B,
|
||||||
|
D_PWR_A,
|
||||||
|
D_PWR_IO
|
||||||
|
};
|
||||||
|
enum CLKINDEX { RUN_CLK, ADC_CLK, SYNC_CLK, DBIT_CLK, NUM_CLOCKS };
|
||||||
#define CLK_NAMES "run", "adc", "sync", "dbit"
|
#define CLK_NAMES "run", "adc", "sync", "dbit"
|
||||||
|
|
||||||
/* Hardware Definitions */
|
/* Hardware Definitions */
|
||||||
@ -67,7 +109,7 @@ enum CLKINDEX {RUN_CLK, ADC_CLK, SYNC_CLK, DBIT_CLK, NUM_CLOCKS};
|
|||||||
#define DEFAULT_NUM_FRAMES (1)
|
#define DEFAULT_NUM_FRAMES (1)
|
||||||
#define DEFAULT_EXPTIME (0)
|
#define DEFAULT_EXPTIME (0)
|
||||||
#define DEFAULT_NUM_CYCLES (1)
|
#define DEFAULT_NUM_CYCLES (1)
|
||||||
#define DEFAULT_PERIOD (1 * 1000 * 1000) //ns
|
#define DEFAULT_PERIOD (1 * 1000 * 1000) // ns
|
||||||
#define DEFAULT_DELAY (0)
|
#define DEFAULT_DELAY (0)
|
||||||
#define DEFAULT_HIGH_VOLTAGE (0)
|
#define DEFAULT_HIGH_VOLTAGE (0)
|
||||||
#define DEFAULT_VLIMIT (-100)
|
#define DEFAULT_VLIMIT (-100)
|
||||||
@ -85,16 +127,21 @@ enum CLKINDEX {RUN_CLK, ADC_CLK, SYNC_CLK, DBIT_CLK, NUM_CLOCKS};
|
|||||||
#define VCHIP_MIN_MV (1673)
|
#define VCHIP_MIN_MV (1673)
|
||||||
#define VCHIP_MAX_MV (2668) // min dac val
|
#define VCHIP_MAX_MV (2668) // min dac val
|
||||||
#define POWER_RGLTR_MIN (636)
|
#define POWER_RGLTR_MIN (636)
|
||||||
#define POWER_RGLTR_MAX (2638) // min dac val (not vchip-max) because of dac conversions
|
#define POWER_RGLTR_MAX \
|
||||||
|
(2638) // min dac val (not vchip-max) because of dac conversions
|
||||||
#define VCHIP_POWER_INCRMNT (200)
|
#define VCHIP_POWER_INCRMNT (200)
|
||||||
#define VIO_MIN_MV (1200) // for fpga to function
|
#define VIO_MIN_MV (1200) // for fpga to function
|
||||||
|
|
||||||
/* Defines in the Firmware */
|
/* Defines in the Firmware */
|
||||||
#define MAX_PATTERN_LENGTH (0x2000)
|
#define MAX_PATTERN_LENGTH (0x2000)
|
||||||
#define DIGITAL_IO_DELAY_MAXIMUM_PS ((OUTPUT_DELAY_0_OTPT_STTNG_MSK >> OUTPUT_DELAY_0_OTPT_STTNG_OFST) * OUTPUT_DELAY_0_OTPT_STTNG_STEPS)
|
#define DIGITAL_IO_DELAY_MAXIMUM_PS \
|
||||||
|
((OUTPUT_DELAY_0_OTPT_STTNG_MSK >> OUTPUT_DELAY_0_OTPT_STTNG_OFST) * \
|
||||||
|
OUTPUT_DELAY_0_OTPT_STTNG_STEPS)
|
||||||
#define MAX_PHASE_SHIFTS_STEPS (8)
|
#define MAX_PHASE_SHIFTS_STEPS (8)
|
||||||
|
|
||||||
#define WAIT_TME_US_FR_ACQDONE_REG (100) // wait time in us after acquisition done to ensure there is no data in fifo
|
#define WAIT_TME_US_FR_ACQDONE_REG \
|
||||||
|
(100) // wait time in us after acquisition done to ensure there is no data
|
||||||
|
// in fifo
|
||||||
#define WAIT_TIME_US_PLL (10 * 1000)
|
#define WAIT_TIME_US_PLL (10 * 1000)
|
||||||
#define WAIT_TIME_US_STP_ACQ (100)
|
#define WAIT_TIME_US_STP_ACQ (100)
|
||||||
#define WAIT_TIME_CONFIGURE_MAC (2 * 1000 * 1000)
|
#define WAIT_TIME_CONFIGURE_MAC (2 * 1000 * 1000)
|
||||||
@ -109,4 +156,3 @@ enum CLKINDEX {RUN_CLK, ADC_CLK, SYNC_CLK, DBIT_CLK, NUM_CLOCKS};
|
|||||||
|
|
||||||
#define MAXIMUM_ADC_CLK (65)
|
#define MAXIMUM_ADC_CLK (65)
|
||||||
#define PLL_VCO_FREQ_MHZ (800)
|
#define PLL_VCO_FREQ_MHZ (800)
|
||||||
|
|
||||||
|
135
slsDetectorServers/eigerDetectorServer/9mhvserial_bf.c
Executable file → Normal file
135
slsDetectorServers/eigerDetectorServer/9mhvserial_bf.c
Executable file → Normal file
@ -1,14 +1,14 @@
|
|||||||
#include "ansi.h"
|
#include "ansi.h"
|
||||||
|
|
||||||
#include <termios.h> /* POSIX terminal control definitions */
|
#include <errno.h>
|
||||||
|
#include <fcntl.h> // File control definitions
|
||||||
|
#include <linux/i2c-dev.h> // I2C_SLAVE, __u8 reg
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h> // atoi
|
#include <stdlib.h> // atoi
|
||||||
#include <fcntl.h> // File control definitions
|
|
||||||
#include <sys/ioctl.h> // ioctl
|
|
||||||
#include <unistd.h> // read, close
|
|
||||||
#include <string.h> // memset
|
#include <string.h> // memset
|
||||||
#include <linux/i2c-dev.h> // I2C_SLAVE, __u8 reg
|
#include <sys/ioctl.h> // ioctl
|
||||||
#include <errno.h>
|
#include <termios.h> /* POSIX terminal control definitions */
|
||||||
|
#include <unistd.h> // read, close
|
||||||
|
|
||||||
#define PORTNAME "/dev/ttyBF1"
|
#define PORTNAME "/dev/ttyBF1"
|
||||||
#define GOODBYE 200
|
#define GOODBYE 200
|
||||||
@ -18,43 +18,41 @@
|
|||||||
//#define I2C_DEVICE_ADDRESS 0x48
|
//#define I2C_DEVICE_ADDRESS 0x48
|
||||||
#define I2C_REGISTER_ADDRESS 0x40
|
#define I2C_REGISTER_ADDRESS 0x40
|
||||||
|
|
||||||
|
int i2c_open(const char *file, unsigned int addr) {
|
||||||
|
|
||||||
|
// device file
|
||||||
int i2c_open(const char* file,unsigned int addr){
|
int fd = open(file, O_RDWR);
|
||||||
|
|
||||||
//device file
|
|
||||||
int fd = open( file, O_RDWR );
|
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
LOG(logERROR, ("Warning: Unable to open file %s\n",file));
|
LOG(logERROR, ("Warning: Unable to open file %s\n", file));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//device address
|
// device address
|
||||||
if( ioctl( fd, I2C_SLAVE, addr&0x7F ) < 0 ) {
|
if (ioctl(fd, I2C_SLAVE, addr & 0x7F) < 0) {
|
||||||
LOG(logERROR, ("Warning: Unable to set slave address:0x%x \n",addr));
|
LOG(logERROR, ("Warning: Unable to set slave address:0x%x \n", addr));
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int i2c_read() {
|
||||||
int i2c_read(){
|
|
||||||
|
|
||||||
int fd = i2c_open(I2C_DEVICE_FILE, I2C_DEVICE_ADDRESS);
|
int fd = i2c_open(I2C_DEVICE_FILE, I2C_DEVICE_ADDRESS);
|
||||||
__u8 reg = I2C_REGISTER_ADDRESS & 0xff;
|
__u8 reg = I2C_REGISTER_ADDRESS & 0xff;
|
||||||
|
|
||||||
unsigned char buf = reg;
|
unsigned char buf = reg;
|
||||||
if (write(fd, &buf, 1)!= 1){
|
if (write(fd, &buf, 1) != 1) {
|
||||||
LOG(logERROR, ("Warning: Unable to write read request to register %d\n", reg));
|
LOG(logERROR,
|
||||||
|
("Warning: Unable to write read request to register %d\n", reg));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
//read and update value (but old value read out)
|
// read and update value (but old value read out)
|
||||||
if(read(fd, &buf, 1) != 1){
|
if (read(fd, &buf, 1) != 1) {
|
||||||
LOG(logERROR, ("Warning: Unable to read register %d\n", reg));
|
LOG(logERROR, ("Warning: Unable to read register %d\n", reg));
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
//read again to read the updated value
|
// read again to read the updated value
|
||||||
if(read(fd, &buf, 1) != 1){
|
if (read(fd, &buf, 1) != 1) {
|
||||||
LOG(logERROR, ("Warning: Unable to read register %d\n", reg));
|
LOG(logERROR, ("Warning: Unable to read register %d\n", reg));
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
@ -62,13 +60,12 @@ int i2c_read(){
|
|||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int i2c_write(unsigned int value) {
|
||||||
int i2c_write(unsigned int value){
|
|
||||||
|
|
||||||
__u8 val = value & 0xff;
|
__u8 val = value & 0xff;
|
||||||
|
|
||||||
int fd = i2c_open(I2C_DEVICE_FILE, I2C_DEVICE_ADDRESS);
|
int fd = i2c_open(I2C_DEVICE_FILE, I2C_DEVICE_ADDRESS);
|
||||||
if(fd < 0)
|
if (fd < 0)
|
||||||
return fd;
|
return fd;
|
||||||
|
|
||||||
__u8 reg = I2C_REGISTER_ADDRESS & 0xff;
|
__u8 reg = I2C_REGISTER_ADDRESS & 0xff;
|
||||||
@ -76,7 +73,8 @@ int i2c_write(unsigned int value){
|
|||||||
buf[0] = reg;
|
buf[0] = reg;
|
||||||
buf[1] = val;
|
buf[1] = val;
|
||||||
if (write(fd, buf, 2) != 2) {
|
if (write(fd, buf, 2) != 2) {
|
||||||
LOG(logERROR, ("Warning: Unable to write %d to register %d\n",val, reg));
|
LOG(logERROR,
|
||||||
|
("Warning: Unable to write %d to register %d\n", val, reg));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,22 +82,18 @@ int i2c_write(unsigned int value){
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int main(int argc, char *argv[]) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char* argv[]) {
|
|
||||||
|
|
||||||
int fd = open(PORTNAME, O_RDWR | O_NOCTTY | O_SYNC);
|
int fd = open(PORTNAME, O_RDWR | O_NOCTTY | O_SYNC);
|
||||||
if(fd < 0){
|
if (fd < 0) {
|
||||||
LOG(logERROR, ("Warning: Unable to open port %s\n", PORTNAME));
|
LOG(logERROR, ("Warning: Unable to open port %s\n", PORTNAME));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
LOG(logINFO, ("opened port at %s\n",PORTNAME));
|
LOG(logINFO, ("opened port at %s\n", PORTNAME));
|
||||||
|
|
||||||
struct termios serial_conf;
|
struct termios serial_conf;
|
||||||
// reset structure
|
// reset structure
|
||||||
memset(&serial_conf,0,sizeof(serial_conf));
|
memset(&serial_conf, 0, sizeof(serial_conf));
|
||||||
// control options
|
// control options
|
||||||
serial_conf.c_cflag = B2400 | CS8 | CREAD | CLOCAL;
|
serial_conf.c_cflag = B2400 | CS8 | CREAD | CLOCAL;
|
||||||
// input options
|
// input options
|
||||||
@ -109,37 +103,37 @@ int main(int argc, char* argv[]) {
|
|||||||
// line options
|
// line options
|
||||||
serial_conf.c_lflag = ICANON;
|
serial_conf.c_lflag = ICANON;
|
||||||
// flush input
|
// flush input
|
||||||
if(tcflush(fd, TCIOFLUSH) < 0){
|
if (tcflush(fd, TCIOFLUSH) < 0) {
|
||||||
LOG(logERROR, ("Warning: error form tcflush %d\n", errno));
|
LOG(logERROR, ("Warning: error form tcflush %d\n", errno));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
// set new options for the port, TCSANOW:changes occur immediately without waiting for data to complete
|
// set new options for the port, TCSANOW:changes occur immediately without
|
||||||
if(tcsetattr(fd, TCSANOW, &serial_conf) < 0){
|
// waiting for data to complete
|
||||||
|
if (tcsetattr(fd, TCSANOW, &serial_conf) < 0) {
|
||||||
LOG(logERROR, ("Warning: error form tcsetattr %d\n", errno));
|
LOG(logERROR, ("Warning: error form tcsetattr %d\n", errno));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(tcsetattr(fd, TCSAFLUSH, &serial_conf) < 0){
|
if (tcsetattr(fd, TCSAFLUSH, &serial_conf) < 0) {
|
||||||
LOG(logERROR, ("Warning: error form tcsetattr %d\n", errno));
|
LOG(logERROR, ("Warning: error form tcsetattr %d\n", errno));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
int n = 0;
|
int n = 0;
|
||||||
int ival= 0;
|
int ival = 0;
|
||||||
char buffer[BUFFERSIZE];
|
char buffer[BUFFERSIZE];
|
||||||
memset(buffer,0,BUFFERSIZE);
|
memset(buffer, 0, BUFFERSIZE);
|
||||||
buffer[BUFFERSIZE-1] = '\n';
|
buffer[BUFFERSIZE - 1] = '\n';
|
||||||
LOG(logINFO, ("Ready...\n"));
|
LOG(logINFO, ("Ready...\n"));
|
||||||
|
|
||||||
|
while (ret != GOODBYE) {
|
||||||
while(ret != GOODBYE){
|
memset(buffer, 0, BUFFERSIZE);
|
||||||
memset(buffer,0,BUFFERSIZE);
|
n = read(fd, buffer, BUFFERSIZE);
|
||||||
n = read(fd,buffer,BUFFERSIZE);
|
|
||||||
LOG(logDEBUG1, ("Received %d Bytes\n", n));
|
LOG(logDEBUG1, ("Received %d Bytes\n", n));
|
||||||
LOG(logINFO, ("Got message: '%s'\n",buffer));
|
LOG(logINFO, ("Got message: '%s'\n", buffer));
|
||||||
|
|
||||||
switch(buffer[0]){
|
switch (buffer[0]) {
|
||||||
case '\0':
|
case '\0':
|
||||||
LOG(logINFO, ("Got Start (Detector restart)\n"));
|
LOG(logINFO, ("Got Start (Detector restart)\n"));
|
||||||
break;
|
break;
|
||||||
@ -147,43 +141,44 @@ int main(int argc, char* argv[]) {
|
|||||||
LOG(logINFO, ("Got Start \n"));
|
LOG(logINFO, ("Got Start \n"));
|
||||||
break;
|
break;
|
||||||
case 'p':
|
case 'p':
|
||||||
if (!sscanf(&buffer[1],"%d",&ival)){
|
if (!sscanf(&buffer[1], "%d", &ival)) {
|
||||||
LOG(logERROR, ("Warning: cannot scan voltage value\n"));
|
LOG(logERROR, ("Warning: cannot scan voltage value\n"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// ok/ fail
|
// ok/ fail
|
||||||
memset(buffer,0,BUFFERSIZE);
|
memset(buffer, 0, BUFFERSIZE);
|
||||||
buffer[BUFFERSIZE-1] = '\n';
|
buffer[BUFFERSIZE - 1] = '\n';
|
||||||
if(i2c_write(ival)<0)
|
if (i2c_write(ival) < 0)
|
||||||
strcpy(buffer,"fail ");
|
strcpy(buffer, "fail ");
|
||||||
else
|
else
|
||||||
strcpy(buffer,"success ");
|
strcpy(buffer, "success ");
|
||||||
LOG(logINFO, ("Sending: '%s'\n",buffer));
|
LOG(logINFO, ("Sending: '%s'\n", buffer));
|
||||||
n = write(fd, buffer, BUFFERSIZE);
|
n = write(fd, buffer, BUFFERSIZE);
|
||||||
LOG(logDEBUG1, ("Sent %d Bytes\n", n));
|
LOG(logDEBUG1, ("Sent %d Bytes\n", n));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'g':
|
case 'g':
|
||||||
ival = i2c_read();
|
ival = i2c_read();
|
||||||
//ok/ fail
|
// ok/ fail
|
||||||
memset(buffer,0,BUFFERSIZE);
|
memset(buffer, 0, BUFFERSIZE);
|
||||||
buffer[BUFFERSIZE-1] = '\n';
|
buffer[BUFFERSIZE - 1] = '\n';
|
||||||
if(ival < 0)
|
if (ival < 0)
|
||||||
strcpy(buffer,"fail ");
|
strcpy(buffer, "fail ");
|
||||||
else
|
else
|
||||||
strcpy(buffer,"success ");
|
strcpy(buffer, "success ");
|
||||||
n = write(fd, buffer, BUFFERSIZE);
|
n = write(fd, buffer, BUFFERSIZE);
|
||||||
LOG(logINFO, ("Sending: '%s'\n",buffer));
|
LOG(logINFO, ("Sending: '%s'\n", buffer));
|
||||||
LOG(logDEBUG1, ("Sent %d Bytes\n", n));
|
LOG(logDEBUG1, ("Sent %d Bytes\n", n));
|
||||||
//value
|
// value
|
||||||
memset(buffer,0,BUFFERSIZE);
|
memset(buffer, 0, BUFFERSIZE);
|
||||||
buffer[BUFFERSIZE-1] = '\n';
|
buffer[BUFFERSIZE - 1] = '\n';
|
||||||
if(ival >= 0){
|
if (ival >= 0) {
|
||||||
LOG(logINFO, ("Sending: '%d'\n",ival));
|
LOG(logINFO, ("Sending: '%d'\n", ival));
|
||||||
sprintf(buffer,"%d ",ival);
|
sprintf(buffer, "%d ", ival);
|
||||||
n = write(fd, buffer, BUFFERSIZE);
|
n = write(fd, buffer, BUFFERSIZE);
|
||||||
LOG(logINFO, ("Sent %d Bytes\n", n));
|
LOG(logINFO, ("Sent %d Bytes\n", n));
|
||||||
}else LOG(logERROR, ("%s\n",buffer));
|
} else
|
||||||
|
LOG(logERROR, ("%s\n", buffer));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'e':
|
case 'e':
|
||||||
@ -191,7 +186,7 @@ int main(int argc, char* argv[]) {
|
|||||||
ret = GOODBYE;
|
ret = GOODBYE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LOG(logERROR, ("Unknown Command. buffer:'%s'\n",buffer));
|
LOG(logERROR, ("Unknown Command. buffer:'%s'\n", buffer));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
1329
slsDetectorServers/eigerDetectorServer/Beb.c
Executable file → Normal file
1329
slsDetectorServers/eigerDetectorServer/Beb.c
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
98
slsDetectorServers/eigerDetectorServer/Beb.h
Executable file → Normal file
98
slsDetectorServers/eigerDetectorServer/Beb.h
Executable file → Normal file
@ -1,11 +1,10 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
|
||||||
#include "LocalLinkInterface.h"
|
#include "LocalLinkInterface.h"
|
||||||
#include "slsDetectorServer_defs.h"
|
#include "slsDetectorServer_defs.h"
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
struct BebInfo {
|
||||||
struct BebInfo{
|
|
||||||
unsigned int beb_number;
|
unsigned int beb_number;
|
||||||
unsigned int serial_address;
|
unsigned int serial_address;
|
||||||
char src_mac_1GbE[50];
|
char src_mac_1GbE[50];
|
||||||
@ -16,30 +15,32 @@ struct BebInfo{
|
|||||||
unsigned int src_port_10GbE;
|
unsigned int src_port_10GbE;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void BebInfo_BebInfo(struct BebInfo *bebInfo, unsigned int beb_num);
|
||||||
void BebInfo_BebInfo(struct BebInfo* bebInfo, unsigned int beb_num);
|
void BebInfo_BebDstInfo(struct BebInfo *bebInfo, unsigned int beb_num);
|
||||||
void BebInfo_BebDstInfo(struct BebInfo* bebInfo, unsigned int beb_num);
|
int BebInfo_SetSerialAddress(struct BebInfo *bebInfo, unsigned int add);
|
||||||
int BebInfo_SetSerialAddress(struct BebInfo* bebInfo, unsigned int add);
|
int BebInfo_SetHeaderInfo(
|
||||||
int BebInfo_SetHeaderInfo(struct BebInfo* bebInfo, int ten_gig, char* src_mac, char* src_ip, unsigned int src_port);//src_port fixed 42000+beb_number or 52000 + beb_number);
|
struct BebInfo *bebInfo, int ten_gig, char *src_mac, char *src_ip,
|
||||||
unsigned int BebInfo_GetBebNumber(struct BebInfo* bebInfo);
|
unsigned int
|
||||||
unsigned int BebInfo_GetSerialAddress(struct BebInfo* bebInfo);
|
src_port); // src_port fixed 42000+beb_number or 52000 + beb_number);
|
||||||
char* BebInfo_GetSrcMAC(struct BebInfo* bebInfo, int ten_gig);
|
unsigned int BebInfo_GetBebNumber(struct BebInfo *bebInfo);
|
||||||
char* BebInfo_GetSrcIP(struct BebInfo* bebInfo, int ten_gig);
|
unsigned int BebInfo_GetSerialAddress(struct BebInfo *bebInfo);
|
||||||
unsigned int BebInfo_GetSrcPort(struct BebInfo* bebInfo, int ten_gig);
|
char *BebInfo_GetSrcMAC(struct BebInfo *bebInfo, int ten_gig);
|
||||||
void BebInfo_Print(struct BebInfo* bebInfo);
|
char *BebInfo_GetSrcIP(struct BebInfo *bebInfo, int ten_gig);
|
||||||
|
unsigned int BebInfo_GetSrcPort(struct BebInfo *bebInfo, int ten_gig);
|
||||||
|
void BebInfo_Print(struct BebInfo *bebInfo);
|
||||||
void Beb_ClearBebInfos();
|
void Beb_ClearBebInfos();
|
||||||
int Beb_InitBebInfos();
|
int Beb_InitBebInfos();
|
||||||
int Beb_CheckSourceStuffBebInfo();
|
int Beb_CheckSourceStuffBebInfo();
|
||||||
unsigned int Beb_GetBebInfoIndex(unsigned int beb_numb);
|
unsigned int Beb_GetBebInfoIndex(unsigned int beb_numb);
|
||||||
|
|
||||||
|
void Beb_GetModuleConfiguration(int *master, int *top, int *normal);
|
||||||
|
int Beb_IsTransmitting(int *retval, int tengiga, int waitForDelay);
|
||||||
|
|
||||||
void Beb_GetModuleConfiguration(int* master, int* top, int* normal);
|
void Beb_SetTopVariable(int val);
|
||||||
int Beb_IsTransmitting(int* retval, int tengiga, int waitForDelay);
|
int Beb_SetTop(enum TOPINDEX ind);
|
||||||
|
int Beb_SetMaster(enum MASTERINDEX ind);
|
||||||
int Beb_SetMasterViaSoftware();
|
int Beb_SetActivate(int enable);
|
||||||
int Beb_SetSlaveViaSoftware();
|
int Beb_GetActivate(int *retval);
|
||||||
int Beb_Activate(int enable);
|
|
||||||
int Beb_GetActivate();
|
|
||||||
int Beb_Set32bitOverflow(int val);
|
int Beb_Set32bitOverflow(int val);
|
||||||
|
|
||||||
int Beb_GetTenGigaFlowControl();
|
int Beb_GetTenGigaFlowControl();
|
||||||
@ -51,32 +52,47 @@ int Beb_SetTransmissionDelayLeft(int value);
|
|||||||
int Beb_GetTransmissionDelayRight();
|
int Beb_GetTransmissionDelayRight();
|
||||||
int Beb_SetTransmissionDelayRight(int value);
|
int Beb_SetTransmissionDelayRight(int value);
|
||||||
|
|
||||||
int Beb_ResetToHardwareSettings();
|
|
||||||
u_int32_t Beb_GetFirmwareRevision();
|
u_int32_t Beb_GetFirmwareRevision();
|
||||||
u_int32_t Beb_GetFirmwareSoftwareAPIVersion();
|
u_int32_t Beb_GetFirmwareSoftwareAPIVersion();
|
||||||
void Beb_ResetFrameNumber();
|
void Beb_ResetFrameNumber();
|
||||||
int Beb_WriteTo(unsigned int index);
|
int Beb_WriteTo(unsigned int index);
|
||||||
int Beb_SetMAC(char* mac, uint8_t* dst_ptr);
|
int Beb_SetMAC(char *mac, uint8_t *dst_ptr);
|
||||||
int Beb_SetIP(char* ip, uint8_t* dst_ptr);
|
int Beb_SetIP(char *ip, uint8_t *dst_ptr);
|
||||||
int Beb_SetPortNumber(unsigned int port_number, uint8_t* dst_ptr);
|
int Beb_SetPortNumber(unsigned int port_number, uint8_t *dst_ptr);
|
||||||
void Beb_AdjustIPChecksum(struct udp_header_type *ip);
|
void Beb_AdjustIPChecksum(struct udp_header_type *ip);
|
||||||
|
|
||||||
int Beb_SetHeaderData(unsigned int beb_number, int ten_gig, char* dst_mac, char* dst_ip, unsigned int dst_port);
|
int Beb_SetHeaderData(unsigned int beb_number, int ten_gig, char *dst_mac,
|
||||||
int Beb_SetHeaderData1(char* src_mac, char* src_ip, unsigned int src_port, char* dst_mac, char* dst_ip, unsigned int dst_port);
|
char *dst_ip, unsigned int dst_port);
|
||||||
|
int Beb_SetHeaderData1(char *src_mac, char *src_ip, unsigned int src_port,
|
||||||
|
char *dst_mac, char *dst_ip, unsigned int dst_port);
|
||||||
|
|
||||||
void Beb_SwapDataFun(int little_endian, unsigned int n, unsigned int *d);
|
void Beb_SwapDataFun(int little_endian, unsigned int n, unsigned int *d);
|
||||||
int Beb_SetByteOrder();
|
int Beb_SetByteOrder();
|
||||||
void Beb_Beb();
|
void Beb_Beb();
|
||||||
int Beb_SetBebSrcHeaderInfos(unsigned int beb_number, int ten_gig, char* src_mac, char* src_ip, unsigned int src_port);
|
int Beb_SetBebSrcHeaderInfos(unsigned int beb_number, int ten_gig,
|
||||||
int Beb_SetUpUDPHeader(unsigned int beb_number, int ten_gig, unsigned int header_number, char* dst_mac, char* dst_ip, unsigned int dst_port);
|
char *src_mac, char *src_ip,
|
||||||
|
unsigned int src_port);
|
||||||
|
int Beb_SetUpUDPHeader(unsigned int beb_number, int ten_gig,
|
||||||
|
unsigned int header_number, char *dst_mac, char *dst_ip,
|
||||||
|
unsigned int dst_port);
|
||||||
|
|
||||||
/*int Beb_SendMultiReadRequest(unsigned int beb_number, unsigned int left_right, int ten_gig, unsigned int dst_number, unsigned int npackets, unsigned int packet_size, int stop_read_when_fifo_empty=1);*/
|
/*int Beb_SendMultiReadRequest(unsigned int beb_number, unsigned int
|
||||||
int Beb_SendMultiReadRequest(unsigned int beb_number, unsigned int left_right, int ten_gig, unsigned int dst_number, unsigned int npackets, unsigned int packet_size, int stop_read_when_fifo_empty);
|
* left_right, int ten_gig, unsigned int dst_number, unsigned int npackets,
|
||||||
|
* unsigned int packet_size, int stop_read_when_fifo_empty=1);*/
|
||||||
|
int Beb_SendMultiReadRequest(unsigned int beb_number, unsigned int left_right,
|
||||||
|
int ten_gig, unsigned int dst_number,
|
||||||
|
unsigned int npackets, unsigned int packet_size,
|
||||||
|
int stop_read_when_fifo_empty);
|
||||||
|
|
||||||
int Beb_StopAcquisition();
|
int Beb_StopAcquisition();
|
||||||
int Beb_SetUpTransferParameters(short the_bit_mode);
|
int Beb_SetUpTransferParameters(short the_bit_mode);
|
||||||
/*int Beb_RequestNImages(unsigned int beb_number, unsigned int left_right, int ten_gig, unsigned int dst_number, unsigned int nimages, int test_just_send_out_packets_no_wait=0); //all images go to the same destination!*/
|
/*int Beb_RequestNImages(unsigned int beb_number, unsigned int left_right, int
|
||||||
int Beb_RequestNImages(unsigned int beb_number, int ten_gig, unsigned int dst_number, unsigned int nimages, int test_just_send_out_packets_no_wait);
|
* ten_gig, unsigned int dst_number, unsigned int nimages, int
|
||||||
|
* test_just_send_out_packets_no_wait=0); //all images go to the same
|
||||||
|
* destination!*/
|
||||||
|
int Beb_RequestNImages(unsigned int beb_number, int ten_gig,
|
||||||
|
unsigned int dst_number, unsigned int nimages,
|
||||||
|
int test_just_send_out_packets_no_wait);
|
||||||
|
|
||||||
int Beb_Test(unsigned int beb_number);
|
int Beb_Test(unsigned int beb_number);
|
||||||
|
|
||||||
@ -85,17 +101,15 @@ int Beb_GetBebFPGATemp();
|
|||||||
void Beb_SetDetectorNumber(uint32_t detid);
|
void Beb_SetDetectorNumber(uint32_t detid);
|
||||||
int Beb_SetQuad(int value);
|
int Beb_SetQuad(int value);
|
||||||
int Beb_GetQuad();
|
int Beb_GetQuad();
|
||||||
int* Beb_GetDetectorPosition();
|
int *Beb_GetDetectorPosition();
|
||||||
int Beb_SetDetectorPosition(int pos[]);
|
int Beb_SetDetectorPosition(int pos[]);
|
||||||
int Beb_SetStartingFrameNumber(uint64_t value);
|
int Beb_SetStartingFrameNumber(uint64_t value);
|
||||||
int Beb_GetStartingFrameNumber(uint64_t* retval, int tengigaEnable);
|
int Beb_GetStartingFrameNumber(uint64_t *retval, int tengigaEnable);
|
||||||
|
|
||||||
void Beb_SetReadNLines(int value);
|
void Beb_SetReadNLines(int value);
|
||||||
|
|
||||||
uint16_t Beb_swap_uint16( uint16_t val);
|
uint16_t Beb_swap_uint16(uint16_t val);
|
||||||
int Beb_open(u_int32_t** csp0base, u_int32_t offset);
|
int Beb_open(u_int32_t **csp0base, u_int32_t offset);
|
||||||
u_int32_t Beb_Read32 (u_int32_t* baseaddr, u_int32_t offset);
|
u_int32_t Beb_Read32(u_int32_t *baseaddr, u_int32_t offset);
|
||||||
u_int32_t Beb_Write32 (u_int32_t* baseaddr, u_int32_t offset, u_int32_t data);
|
u_int32_t Beb_Write32(u_int32_t *baseaddr, u_int32_t offset, u_int32_t data);
|
||||||
void Beb_close(int fd,u_int32_t* csp0base);
|
void Beb_close(int fd, u_int32_t *csp0base);
|
||||||
|
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ target_compile_definitions(eigerDetectorServerMaster_virtual
|
|||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(eigerDetectorServerMaster_virtual
|
target_link_libraries(eigerDetectorServerMaster_virtual
|
||||||
PUBLIC pthread rt slsProjectCWarnings
|
PUBLIC pthread rt slsProjectCSettings
|
||||||
)
|
)
|
||||||
|
|
||||||
set_target_properties(eigerDetectorServerMaster_virtual PROPERTIES
|
set_target_properties(eigerDetectorServerMaster_virtual PROPERTIES
|
||||||
|
2113
slsDetectorServers/eigerDetectorServer/FebControl.c
Executable file → Normal file
2113
slsDetectorServers/eigerDetectorServer/FebControl.c
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
139
slsDetectorServers/eigerDetectorServer/FebControl.h
Executable file → Normal file
139
slsDetectorServers/eigerDetectorServer/FebControl.h
Executable file → Normal file
@ -1,9 +1,9 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "FebInterface.h"
|
#include "FebInterface.h"
|
||||||
|
#include "slsDetectorServer_defs.h"
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
|
||||||
|
struct Module {
|
||||||
struct Module{
|
|
||||||
unsigned int module_number;
|
unsigned int module_number;
|
||||||
int top_address_valid;
|
int top_address_valid;
|
||||||
unsigned int top_left_address;
|
unsigned int top_left_address;
|
||||||
@ -12,39 +12,42 @@ struct Module{
|
|||||||
unsigned int bottom_left_address;
|
unsigned int bottom_left_address;
|
||||||
unsigned int bottom_right_address;
|
unsigned int bottom_right_address;
|
||||||
|
|
||||||
unsigned int idelay_top[4]; //ll,lr,rl,ll
|
unsigned int idelay_top[4]; // ll,lr,rl,ll
|
||||||
unsigned int idelay_bottom[4]; //ll,lr,rl,ll
|
unsigned int idelay_bottom[4]; // ll,lr,rl,ll
|
||||||
float high_voltage;
|
float high_voltage;
|
||||||
int* top_dac;
|
int *top_dac;
|
||||||
int* bottom_dac;
|
int *bottom_dac;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void Module_Module(struct Module *mod, unsigned int number,
|
||||||
|
unsigned int address_top);
|
||||||
|
void Module_ModuleBottom(struct Module *mod, unsigned int number,
|
||||||
|
unsigned int address_bottom);
|
||||||
|
void Module_Module1(struct Module *mod, unsigned int number,
|
||||||
|
unsigned int address_top, unsigned int address_bottom);
|
||||||
|
unsigned int Module_GetModuleNumber(struct Module *mod);
|
||||||
|
int Module_TopAddressIsValid(struct Module *mod);
|
||||||
|
unsigned int Module_GetTopBaseAddress(struct Module *mod);
|
||||||
|
unsigned int Module_GetTopLeftAddress(struct Module *mod);
|
||||||
|
unsigned int Module_GetTopRightAddress(struct Module *mod);
|
||||||
|
unsigned int Module_GetBottomBaseAddress(struct Module *mod);
|
||||||
|
int Module_BottomAddressIsValid(struct Module *mod);
|
||||||
|
unsigned int Module_GetBottomLeftAddress(struct Module *mod);
|
||||||
|
unsigned int Module_GetBottomRightAddress(struct Module *mod);
|
||||||
|
unsigned int Module_SetTopIDelay(struct Module *mod, unsigned int chip,
|
||||||
|
unsigned int value);
|
||||||
|
unsigned int Module_GetTopIDelay(struct Module *mod, unsigned int chip);
|
||||||
|
unsigned int Module_SetBottomIDelay(struct Module *mod, unsigned int chip,
|
||||||
|
unsigned int value);
|
||||||
|
unsigned int Module_GetBottomIDelay(struct Module *mod, unsigned int chip);
|
||||||
|
|
||||||
void Module_Module(struct Module* mod,unsigned int number, unsigned int address_top);
|
float Module_SetHighVoltage(struct Module *mod, float value);
|
||||||
void Module_ModuleBottom(struct Module* mod,unsigned int number, unsigned int address_bottom);
|
float Module_GetHighVoltage(struct Module *mod);
|
||||||
void Module_Module1(struct Module* mod,unsigned int number, unsigned int address_top, unsigned int address_bottom);
|
|
||||||
unsigned int Module_GetModuleNumber(struct Module* mod);
|
|
||||||
int Module_TopAddressIsValid(struct Module* mod);
|
|
||||||
unsigned int Module_GetTopBaseAddress(struct Module* mod);
|
|
||||||
unsigned int Module_GetTopLeftAddress(struct Module* mod) ;
|
|
||||||
unsigned int Module_GetTopRightAddress(struct Module* mod);
|
|
||||||
unsigned int Module_GetBottomBaseAddress(struct Module* mod);
|
|
||||||
int Module_BottomAddressIsValid(struct Module* mod);
|
|
||||||
unsigned int Module_GetBottomLeftAddress(struct Module* mod);
|
|
||||||
unsigned int Module_GetBottomRightAddress(struct Module* mod);
|
|
||||||
unsigned int Module_SetTopIDelay(struct Module* mod,unsigned int chip,unsigned int value);
|
|
||||||
unsigned int Module_GetTopIDelay(struct Module* mod,unsigned int chip) ;
|
|
||||||
unsigned int Module_SetBottomIDelay(struct Module* mod,unsigned int chip,unsigned int value);
|
|
||||||
unsigned int Module_GetBottomIDelay(struct Module* mod,unsigned int chip);
|
|
||||||
|
|
||||||
float Module_SetHighVoltage(struct Module* mod,float value);
|
|
||||||
float Module_GetHighVoltage(struct Module* mod);
|
|
||||||
|
|
||||||
int Module_SetTopDACValue(struct Module* mod,unsigned int i, int value);
|
|
||||||
int Module_GetTopDACValue(struct Module* mod,unsigned int i);
|
|
||||||
int Module_SetBottomDACValue(struct Module* mod,unsigned int i, int value);
|
|
||||||
int Module_GetBottomDACValue(struct Module* mod,unsigned int i);
|
|
||||||
|
|
||||||
|
int Module_SetTopDACValue(struct Module *mod, unsigned int i, int value);
|
||||||
|
int Module_GetTopDACValue(struct Module *mod, unsigned int i);
|
||||||
|
int Module_SetBottomDACValue(struct Module *mod, unsigned int i, int value);
|
||||||
|
int Module_GetBottomDACValue(struct Module *mod, unsigned int i);
|
||||||
|
|
||||||
void Feb_Control_activate(int activate);
|
void Feb_Control_activate(int activate);
|
||||||
|
|
||||||
@ -52,22 +55,30 @@ int Feb_Control_IsBottomModule();
|
|||||||
int Feb_Control_GetModuleNumber();
|
int Feb_Control_GetModuleNumber();
|
||||||
|
|
||||||
void Feb_Control_PrintModuleList();
|
void Feb_Control_PrintModuleList();
|
||||||
int Feb_Control_GetModuleIndex(unsigned int module_number, unsigned int* module_index);
|
int Feb_Control_GetModuleIndex(unsigned int module_number,
|
||||||
int Feb_Control_CheckModuleAddresses(struct Module* m);
|
unsigned int *module_index);
|
||||||
|
int Feb_Control_CheckModuleAddresses(struct Module *m);
|
||||||
int Feb_Control_AddModule(unsigned int module_number, unsigned int top_address);
|
int Feb_Control_AddModule(unsigned int module_number, unsigned int top_address);
|
||||||
int Feb_Control_AddModule1(unsigned int module_number, int top_enable, unsigned int top_address, unsigned int bottom_address, int half_module);
|
int Feb_Control_AddModule1(unsigned int module_number, int top_enable,
|
||||||
int Feb_Control_GetDACNumber(char* s, unsigned int* n);
|
unsigned int top_address,
|
||||||
int Feb_Control_SendDACValue(unsigned int dst_num, unsigned int ch, unsigned int* value);
|
unsigned int bottom_address, int half_module);
|
||||||
int Feb_Control_VoltageToDAC(float value, unsigned int* digital, unsigned int nsteps, float vmin, float vmax);
|
int Feb_Control_GetDACNumber(char *s, unsigned int *n);
|
||||||
float Feb_Control_DACToVoltage(unsigned int digital,unsigned int nsteps,float vmin,float vmax);
|
int Feb_Control_SendDACValue(unsigned int dst_num, unsigned int ch,
|
||||||
int Feb_Control_SendIDelays(unsigned int dst_num, int chip_lr, unsigned int channels, unsigned int ndelay_units);
|
unsigned int *value);
|
||||||
|
int Feb_Control_VoltageToDAC(float value, unsigned int *digital,
|
||||||
|
unsigned int nsteps, float vmin, float vmax);
|
||||||
|
float Feb_Control_DACToVoltage(unsigned int digital, unsigned int nsteps,
|
||||||
|
float vmin, float vmax);
|
||||||
|
int Feb_Control_SendIDelays(unsigned int dst_num, int chip_lr,
|
||||||
|
unsigned int channels, unsigned int ndelay_units);
|
||||||
int Feb_Control_SetStaticBits();
|
int Feb_Control_SetStaticBits();
|
||||||
int Feb_Control_SetStaticBits1(unsigned int the_static_bits);
|
int Feb_Control_SetStaticBits1(unsigned int the_static_bits);
|
||||||
int Feb_Control_SendBitModeToBebServer();
|
int Feb_Control_SendBitModeToBebServer();
|
||||||
unsigned int Feb_Control_ConvertTimeToRegister(float time_in_sec);
|
unsigned int Feb_Control_ConvertTimeToRegister(float time_in_sec);
|
||||||
unsigned int Feb_Control_AddressToAll();
|
unsigned int Feb_Control_AddressToAll();
|
||||||
int Feb_Control_SetCommandRegister(unsigned int cmd);
|
int Feb_Control_SetCommandRegister(unsigned int cmd);
|
||||||
int Feb_Control_GetDAQStatusRegister(unsigned int dst_address, unsigned int* ret_status);
|
int Feb_Control_GetDAQStatusRegister(unsigned int dst_address,
|
||||||
|
unsigned int *ret_status);
|
||||||
int Feb_Control_StartDAQOnlyNWaitForFinish(int sleep_time_us);
|
int Feb_Control_StartDAQOnlyNWaitForFinish(int sleep_time_us);
|
||||||
int Feb_Control_ResetChipCompletely();
|
int Feb_Control_ResetChipCompletely();
|
||||||
int Feb_Control_ResetChipPartially();
|
int Feb_Control_ResetChipPartially();
|
||||||
@ -80,22 +91,25 @@ unsigned int Feb_Control_GetNModules();
|
|||||||
unsigned int Feb_Control_GetNHalfModules();
|
unsigned int Feb_Control_GetNHalfModules();
|
||||||
|
|
||||||
int Feb_Control_SetHighVoltage(int value);
|
int Feb_Control_SetHighVoltage(int value);
|
||||||
int Feb_Control_GetHighVoltage(int* value);
|
int Feb_Control_GetHighVoltage(int *value);
|
||||||
|
|
||||||
int Feb_Control_SendHighVoltage(int dacvalue);
|
int Feb_Control_SendHighVoltage(int dacvalue);
|
||||||
int Feb_Control_ReceiveHighVoltage(unsigned int* value);
|
int Feb_Control_ReceiveHighVoltage(unsigned int *value);
|
||||||
|
|
||||||
int Feb_Control_SetIDelays(unsigned int module_num, unsigned int ndelay_units);
|
int Feb_Control_SetIDelays(unsigned int module_num, unsigned int ndelay_units);
|
||||||
int Feb_Control_SetIDelays1(unsigned int module_num, unsigned int chip_pos, unsigned int ndelay_units);
|
int Feb_Control_SetIDelays1(unsigned int module_num, unsigned int chip_pos,
|
||||||
|
unsigned int ndelay_units);
|
||||||
|
|
||||||
int Feb_Control_DecodeDACString(char* dac_str, unsigned int* module_index, int* top, int* bottom, unsigned int* dac_ch);
|
int Feb_Control_DecodeDACString(char *dac_str, unsigned int *module_index,
|
||||||
int Feb_Control_SetDAC(char* s, int value, int is_a_voltage_mv);
|
int *top, int *bottom, unsigned int *dac_ch);
|
||||||
int Feb_Control_GetDAC(char* s, int* ret_value, int voltage_mv);
|
int Feb_Control_SetDAC(char *s, int value, int is_a_voltage_mv);
|
||||||
int Feb_Control_GetDACName(unsigned int dac_num,char* s);
|
int Feb_Control_GetDAC(char *s, int *ret_value, int voltage_mv);
|
||||||
|
int Feb_Control_GetDACName(unsigned int dac_num, char *s);
|
||||||
|
|
||||||
int Feb_Control_SetTrimbits(unsigned int module_num, unsigned int* trimbits);
|
int Feb_Control_SetTrimbits(unsigned int module_num, unsigned int *trimbits,
|
||||||
unsigned int* Feb_Control_GetTrimbits();
|
int top);
|
||||||
int Feb_Control_SaveAllTrimbitsTo(int value);
|
unsigned int *Feb_Control_GetTrimbits();
|
||||||
|
int Feb_Control_SaveAllTrimbitsTo(int value, int top);
|
||||||
int Feb_Control_Reset();
|
int Feb_Control_Reset();
|
||||||
int Feb_Control_PrepareForAcquisition();
|
int Feb_Control_PrepareForAcquisition();
|
||||||
|
|
||||||
@ -111,7 +125,8 @@ unsigned int Feb_Control_GetNExposures();
|
|||||||
int Feb_Control_SetExposureTime(double the_exposure_time_in_sec);
|
int Feb_Control_SetExposureTime(double the_exposure_time_in_sec);
|
||||||
double Feb_Control_GetExposureTime();
|
double Feb_Control_GetExposureTime();
|
||||||
int64_t Feb_Control_GetExposureTime_in_nsec();
|
int64_t Feb_Control_GetExposureTime_in_nsec();
|
||||||
int Feb_Control_SetSubFrameExposureTime(int64_t the_subframe_exposure_time_in_10nsec);
|
int Feb_Control_SetSubFrameExposureTime(
|
||||||
|
int64_t the_subframe_exposure_time_in_10nsec);
|
||||||
int64_t Feb_Control_GetSubFrameExposureTime();
|
int64_t Feb_Control_GetSubFrameExposureTime();
|
||||||
int Feb_Control_SetSubFramePeriod(int64_t the_subframe_period_in_10nsec);
|
int Feb_Control_SetSubFramePeriod(int64_t the_subframe_period_in_10nsec);
|
||||||
int64_t Feb_Control_GetSubFramePeriod();
|
int64_t Feb_Control_GetSubFramePeriod();
|
||||||
@ -119,17 +134,24 @@ int Feb_Control_SetExposurePeriod(double the_exposure_period_in_sec);
|
|||||||
double Feb_Control_GetExposurePeriod();
|
double Feb_Control_GetExposurePeriod();
|
||||||
int Feb_Control_SetDynamicRange(unsigned int four_eight_sixteen_or_thirtytwo);
|
int Feb_Control_SetDynamicRange(unsigned int four_eight_sixteen_or_thirtytwo);
|
||||||
unsigned int Feb_Control_GetDynamicRange();
|
unsigned int Feb_Control_GetDynamicRange();
|
||||||
int Feb_Control_SetReadoutSpeed(unsigned int readout_speed); //0 was default, 0->full,1->half,2->quarter or 3->super_slow
|
int Feb_Control_SetReadoutSpeed(
|
||||||
int Feb_Control_SetReadoutMode(unsigned int readout_mode); ///0 was default,0->parallel,1->non-parallel,2-> safe_mode
|
unsigned int readout_speed); // 0 was default, 0->full,1->half,2->quarter or
|
||||||
int Feb_Control_SetTriggerMode(unsigned int trigger_mode, int polarity);//0 and 1 was default,
|
// 3->super_slow
|
||||||
int Feb_Control_SetExternalEnableMode(int use_external_enable, int polarity);//0 and 1 was default,
|
int Feb_Control_SetReadoutMode(
|
||||||
|
unsigned int readout_mode); /// 0 was
|
||||||
|
/// default,0->parallel,1->non-parallel,2->
|
||||||
|
/// safe_mode
|
||||||
|
int Feb_Control_SetTriggerMode(unsigned int trigger_mode,
|
||||||
|
int polarity); // 0 and 1 was default,
|
||||||
|
int Feb_Control_SetExternalEnableMode(int use_external_enable,
|
||||||
|
int polarity); // 0 and 1 was default,
|
||||||
|
|
||||||
int Feb_Control_SetInTestModeVariable(int on);
|
int Feb_Control_SetInTestModeVariable(int on);
|
||||||
int Feb_Control_GetTestModeVariable();
|
int Feb_Control_GetTestModeVariable();
|
||||||
|
|
||||||
void Feb_Control_Set_Counter_Bit(int value);
|
void Feb_Control_Set_Counter_Bit(int value);
|
||||||
int Feb_Control_Get_Counter_Bit();
|
int Feb_Control_Get_Counter_Bit();
|
||||||
int Feb_Control_Pulse_Pixel(int npulses,int x, int y);
|
int Feb_Control_Pulse_Pixel(int npulses, int x, int y);
|
||||||
int Feb_Control_PulsePixelNMove(int npulses, int inc_x_pos, int inc_y_pos);
|
int Feb_Control_PulsePixelNMove(int npulses, int inc_x_pos, int inc_y_pos);
|
||||||
int Feb_Control_Shift32InSerialIn(unsigned int value_to_shift_in);
|
int Feb_Control_Shift32InSerialIn(unsigned int value_to_shift_in);
|
||||||
int Feb_Control_SendTokenIn();
|
int Feb_Control_SendTokenIn();
|
||||||
@ -153,10 +175,13 @@ int64_t Feb_Control_GetSubMeasuredPeriod();
|
|||||||
int Feb_Control_SoftwareTrigger();
|
int Feb_Control_SoftwareTrigger();
|
||||||
int Feb_Control_SetInterruptSubframe(int val);
|
int Feb_Control_SetInterruptSubframe(int val);
|
||||||
int Feb_Control_GetInterruptSubframe();
|
int Feb_Control_GetInterruptSubframe();
|
||||||
|
|
||||||
|
int Feb_Control_SetTop(enum TOPINDEX ind, int left, int right);
|
||||||
|
void Feb_Control_SetMasterVariable(int val);
|
||||||
|
int Feb_Control_SetMaster(enum MASTERINDEX ind);
|
||||||
int Feb_Control_SetQuad(int val);
|
int Feb_Control_SetQuad(int val);
|
||||||
int Feb_Control_SetReadNLines(int value);
|
int Feb_Control_SetReadNLines(int value);
|
||||||
int Feb_Control_GetReadNLines();
|
int Feb_Control_GetReadNLines();
|
||||||
|
|
||||||
int Feb_Control_WriteRegister(uint32_t offset, uint32_t data);
|
int Feb_Control_WriteRegister(uint32_t offset, uint32_t data);
|
||||||
int Feb_Control_ReadRegister(uint32_t offset, uint32_t* retval);
|
int Feb_Control_ReadRegister(uint32_t offset, uint32_t *retval);
|
||||||
|
|
||||||
|
207
slsDetectorServers/eigerDetectorServer/FebInterface.c
Executable file → Normal file
207
slsDetectorServers/eigerDetectorServer/FebInterface.c
Executable file → Normal file
@ -1,27 +1,24 @@
|
|||||||
#include "FebInterface.h"
|
#include "FebInterface.h"
|
||||||
#include "LocalLinkInterface.h"
|
#include "LocalLinkInterface.h"
|
||||||
#include "xparameters.h"
|
|
||||||
#include "clogger.h"
|
#include "clogger.h"
|
||||||
|
#include "xparameters.h"
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
struct LocalLinkInterface ll_local, *ll;
|
||||||
|
|
||||||
struct LocalLinkInterface ll_local,* ll;
|
|
||||||
|
|
||||||
unsigned int Feb_Interface_nfebs;
|
unsigned int Feb_Interface_nfebs;
|
||||||
unsigned int* Feb_Interface_feb_numb;
|
unsigned int *Feb_Interface_feb_numb;
|
||||||
|
|
||||||
int Feb_Interface_send_ndata;
|
int Feb_Interface_send_ndata;
|
||||||
unsigned int Feb_Interface_send_buffer_size;
|
unsigned int Feb_Interface_send_buffer_size;
|
||||||
unsigned int* Feb_Interface_send_data_raw;
|
unsigned int *Feb_Interface_send_data_raw;
|
||||||
unsigned int* Feb_Interface_send_data;
|
unsigned int *Feb_Interface_send_data;
|
||||||
|
|
||||||
int Feb_Interface_recv_ndata;
|
int Feb_Interface_recv_ndata;
|
||||||
unsigned int Feb_Interface_recv_buffer_size;
|
unsigned int Feb_Interface_recv_buffer_size;
|
||||||
unsigned int* Feb_Interface_recv_data_raw;
|
unsigned int *Feb_Interface_recv_data_raw;
|
||||||
unsigned int* Feb_Interface_recv_data;
|
unsigned int *Feb_Interface_recv_data;
|
||||||
|
|
||||||
|
|
||||||
void Feb_Interface_FebInterface() {
|
void Feb_Interface_FebInterface() {
|
||||||
ll = &ll_local;
|
ll = &ll_local;
|
||||||
@ -30,166 +27,210 @@ void Feb_Interface_FebInterface() {
|
|||||||
|
|
||||||
Feb_Interface_send_ndata = 0;
|
Feb_Interface_send_ndata = 0;
|
||||||
Feb_Interface_send_buffer_size = 1026;
|
Feb_Interface_send_buffer_size = 1026;
|
||||||
Feb_Interface_send_data_raw = malloc((Feb_Interface_send_buffer_size+1) * sizeof(unsigned int));
|
Feb_Interface_send_data_raw =
|
||||||
|
malloc((Feb_Interface_send_buffer_size + 1) * sizeof(unsigned int));
|
||||||
Feb_Interface_send_data = &Feb_Interface_send_data_raw[1];
|
Feb_Interface_send_data = &Feb_Interface_send_data_raw[1];
|
||||||
|
|
||||||
Feb_Interface_recv_ndata = 0;
|
Feb_Interface_recv_ndata = 0;
|
||||||
Feb_Interface_recv_buffer_size = 1026;
|
Feb_Interface_recv_buffer_size = 1026;
|
||||||
Feb_Interface_recv_data_raw = malloc((Feb_Interface_recv_buffer_size+1) * sizeof(unsigned int));
|
Feb_Interface_recv_data_raw =
|
||||||
|
malloc((Feb_Interface_recv_buffer_size + 1) * sizeof(unsigned int));
|
||||||
Feb_Interface_recv_data = &Feb_Interface_recv_data_raw[1];
|
Feb_Interface_recv_data = &Feb_Interface_recv_data_raw[1];
|
||||||
|
|
||||||
Local_LocalLinkInterface1(ll,XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_RIGHT_BASEADDR);
|
Local_LocalLinkInterface1(
|
||||||
|
ll, XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_RIGHT_BASEADDR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Feb_Interface_SendCompleteList(unsigned int n, unsigned int *list) {
|
||||||
|
|
||||||
void Feb_Interface_SendCompleteList(unsigned int n,unsigned int* list) {
|
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
if (Feb_Interface_feb_numb) free(Feb_Interface_feb_numb);
|
if (Feb_Interface_feb_numb)
|
||||||
|
free(Feb_Interface_feb_numb);
|
||||||
Feb_Interface_nfebs = n;
|
Feb_Interface_nfebs = n;
|
||||||
Feb_Interface_feb_numb = malloc(n * sizeof(unsigned int));
|
Feb_Interface_feb_numb = malloc(n * sizeof(unsigned int));
|
||||||
for(i=0;i<n;i++) Feb_Interface_feb_numb[i] = list[i];
|
for (i = 0; i < n; i++)
|
||||||
|
Feb_Interface_feb_numb[i] = list[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
int Feb_Interface_WriteTo(unsigned int ch) {
|
int Feb_Interface_WriteTo(unsigned int ch) {
|
||||||
if (ch>0xfff) return 0;
|
if (ch > 0xfff)
|
||||||
|
return 0;
|
||||||
|
|
||||||
LOG(logDEBUG1, ("FIW ch %d\n", ch));
|
LOG(logDEBUG1, ("FIW ch %d\n", ch));
|
||||||
|
|
||||||
Feb_Interface_send_data_raw[0] = 0x8fff0000;
|
Feb_Interface_send_data_raw[0] = 0x8fff0000;
|
||||||
if (Local_Write(ll,4,Feb_Interface_send_data_raw)!=4) return 0;
|
if (Local_Write(ll, 4, Feb_Interface_send_data_raw) != 4)
|
||||||
|
return 0;
|
||||||
|
|
||||||
Feb_Interface_send_data_raw[0] = 0x90000000 | (ch<<16);
|
Feb_Interface_send_data_raw[0] = 0x90000000 | (ch << 16);
|
||||||
if (Local_Write(ll,4,Feb_Interface_send_data_raw)!=4) return 0;
|
if (Local_Write(ll, 4, Feb_Interface_send_data_raw) != 4)
|
||||||
|
return 0;
|
||||||
|
|
||||||
Feb_Interface_send_data_raw[0] = 0xc0000000;
|
Feb_Interface_send_data_raw[0] = 0xc0000000;
|
||||||
return ((Feb_Interface_send_ndata+1)*4==Local_Write(ll,(Feb_Interface_send_ndata+1)*4,Feb_Interface_send_data_raw));
|
return ((Feb_Interface_send_ndata + 1) * 4 ==
|
||||||
|
Local_Write(ll, (Feb_Interface_send_ndata + 1) * 4,
|
||||||
|
Feb_Interface_send_data_raw));
|
||||||
}
|
}
|
||||||
|
|
||||||
int Feb_Interface_ReadFrom(unsigned int ch, unsigned int ntrys) {
|
int Feb_Interface_ReadFrom(unsigned int ch, unsigned int ntrys) {
|
||||||
unsigned int t;
|
unsigned int t;
|
||||||
if (ch>=0xfff) return 0;
|
if (ch >= 0xfff)
|
||||||
|
return 0;
|
||||||
|
|
||||||
Feb_Interface_recv_data_raw[0] = 0xa0000000 | (ch<<16);
|
Feb_Interface_recv_data_raw[0] = 0xa0000000 | (ch << 16);
|
||||||
Local_Write(ll,4,Feb_Interface_recv_data_raw);
|
Local_Write(ll, 4, Feb_Interface_recv_data_raw);
|
||||||
usleep(20);
|
usleep(20);
|
||||||
|
|
||||||
Feb_Interface_recv_ndata=-1;
|
Feb_Interface_recv_ndata = -1;
|
||||||
for(t=0;t<ntrys;t++) {
|
for (t = 0; t < ntrys; t++) {
|
||||||
if ((Feb_Interface_recv_ndata=Local_Read(ll,Feb_Interface_recv_buffer_size*4,Feb_Interface_recv_data_raw)/4)>0) {
|
if ((Feb_Interface_recv_ndata =
|
||||||
|
Local_Read(ll, Feb_Interface_recv_buffer_size * 4,
|
||||||
|
Feb_Interface_recv_data_raw) /
|
||||||
|
4) > 0) {
|
||||||
Feb_Interface_recv_ndata--;
|
Feb_Interface_recv_ndata--;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
usleep(1000);
|
usleep(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (Feb_Interface_recv_ndata>=0);
|
return (Feb_Interface_recv_ndata >= 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int Feb_Interface_SetByteOrder() {
|
int Feb_Interface_SetByteOrder() {
|
||||||
Feb_Interface_send_data_raw[0] = 0x8fff0000;
|
Feb_Interface_send_data_raw[0] = 0x8fff0000;
|
||||||
if (Local_Write(ll,4,Feb_Interface_send_data_raw)!=4) return 0;
|
if (Local_Write(ll, 4, Feb_Interface_send_data_raw) != 4)
|
||||||
|
return 0;
|
||||||
Feb_Interface_send_ndata = 2;
|
Feb_Interface_send_ndata = 2;
|
||||||
Feb_Interface_send_data[0] = 0;
|
Feb_Interface_send_data[0] = 0;
|
||||||
Feb_Interface_send_data[1] = 0;
|
Feb_Interface_send_data[1] = 0;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
unsigned int dst = 0xff;
|
unsigned int dst = 0xff;
|
||||||
for(i=0;i<Feb_Interface_nfebs;i++) dst = (dst | Feb_Interface_feb_numb[i]);
|
for (i = 0; i < Feb_Interface_nfebs; i++)
|
||||||
|
dst = (dst | Feb_Interface_feb_numb[i]);
|
||||||
int passed = Feb_Interface_WriteTo(dst);
|
int passed = Feb_Interface_WriteTo(dst);
|
||||||
|
|
||||||
return passed;
|
return passed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Feb_Interface_ReadRegister(unsigned int sub_num, unsigned int reg_num,
|
||||||
int Feb_Interface_ReadRegister(unsigned int sub_num, unsigned int reg_num,unsigned int* value_read) {
|
unsigned int *value_read) {
|
||||||
return Feb_Interface_ReadRegisters(sub_num,1,®_num,value_read);
|
return Feb_Interface_ReadRegisters(sub_num, 1, ®_num, value_read);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Feb_Interface_ReadRegisters(unsigned int sub_num, unsigned int nreads,
|
||||||
int Feb_Interface_ReadRegisters(unsigned int sub_num, unsigned int nreads, unsigned int* reg_nums,unsigned int* values_read) {
|
unsigned int *reg_nums,
|
||||||
//here cout<<"Reading Register ...."<<endl;
|
unsigned int *values_read) {
|
||||||
|
// here cout<<"Reading Register ...."<<endl;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
nreads &= 0x3ff;
|
nreads &= 0x3ff;
|
||||||
if (!nreads||nreads>Feb_Interface_send_buffer_size-2) return 0;
|
if (!nreads || nreads > Feb_Interface_send_buffer_size - 2)
|
||||||
|
return 0;
|
||||||
|
|
||||||
Feb_Interface_send_ndata = nreads+2;
|
Feb_Interface_send_ndata = nreads + 2;
|
||||||
Feb_Interface_send_data[0] = 0x20000000 | nreads << 14;
|
Feb_Interface_send_data[0] = 0x20000000 | nreads << 14;
|
||||||
|
|
||||||
for(i=0;i<nreads;i++) Feb_Interface_send_data[i+1]=reg_nums[i];
|
for (i = 0; i < nreads; i++)
|
||||||
Feb_Interface_send_data[nreads+1] = 0;
|
Feb_Interface_send_data[i + 1] = reg_nums[i];
|
||||||
|
Feb_Interface_send_data[nreads + 1] = 0;
|
||||||
|
|
||||||
if (!Feb_Interface_WriteTo(sub_num)||!Feb_Interface_ReadFrom(sub_num,20)||Feb_Interface_recv_ndata!=(int)(nreads+2)) return 0;
|
if (!Feb_Interface_WriteTo(sub_num) ||
|
||||||
|
!Feb_Interface_ReadFrom(sub_num, 20) ||
|
||||||
|
Feb_Interface_recv_ndata != (int)(nreads + 2))
|
||||||
|
return 0;
|
||||||
|
|
||||||
for(i=0;i<nreads;i++) values_read[i] = Feb_Interface_recv_data[i+1];
|
for (i = 0; i < nreads; i++)
|
||||||
|
values_read[i] = Feb_Interface_recv_data[i + 1];
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Feb_Interface_WriteRegister(unsigned int sub_num, unsigned int reg_num,unsigned int value, int wait_on, unsigned int wait_on_address) {
|
int Feb_Interface_WriteRegister(unsigned int sub_num, unsigned int reg_num,
|
||||||
return Feb_Interface_WriteRegisters(sub_num,1,®_num,&value,&wait_on,&wait_on_address);
|
unsigned int value, int wait_on,
|
||||||
|
unsigned int wait_on_address) {
|
||||||
|
return Feb_Interface_WriteRegisters(sub_num, 1, ®_num, &value, &wait_on,
|
||||||
|
&wait_on_address);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Feb_Interface_WriteRegisters(unsigned int sub_num, unsigned int nwrites, unsigned int* reg_nums, unsigned int* values, int* wait_ons, unsigned int* wait_on_addresses) {
|
int Feb_Interface_WriteRegisters(unsigned int sub_num, unsigned int nwrites,
|
||||||
|
unsigned int *reg_nums, unsigned int *values,
|
||||||
|
int *wait_ons,
|
||||||
|
unsigned int *wait_on_addresses) {
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
nwrites &= 0x3ff; //10 bits
|
nwrites &= 0x3ff; // 10 bits
|
||||||
if (!nwrites||2*nwrites>Feb_Interface_send_buffer_size-2) return 0;
|
if (!nwrites || 2 * nwrites > Feb_Interface_send_buffer_size - 2)
|
||||||
|
return 0;
|
||||||
|
|
||||||
//cout<<"Write register : "<<this<<" "<<s_num<<" "<<nwrites<<" "<<reg_nums<<" "<<values<<" "<<wait_ons<<" "<<wait_on_addresses<<endl;
|
// cout<<"Write register : "<<this<<" "<<s_num<<" "<<nwrites<<"
|
||||||
Feb_Interface_send_ndata = 2*nwrites+2;
|
// "<<reg_nums<<" "<<values<<" "<<wait_ons<<" "<<wait_on_addresses<<endl;
|
||||||
|
Feb_Interface_send_ndata = 2 * nwrites + 2;
|
||||||
Feb_Interface_send_data[0] = 0x80000000 | nwrites << 14;
|
Feb_Interface_send_data[0] = 0x80000000 | nwrites << 14;
|
||||||
Feb_Interface_send_data[2*nwrites+1] = 0;
|
Feb_Interface_send_data[2 * nwrites + 1] = 0;
|
||||||
|
|
||||||
for(i=0;i<nwrites;i++) Feb_Interface_send_data[2*i+1] = 0x3fff®_nums[i];
|
for (i = 0; i < nwrites; i++)
|
||||||
for(i=0;i<nwrites;i++) Feb_Interface_send_data[2*i+2] = values[i];
|
Feb_Interface_send_data[2 * i + 1] = 0x3fff & reg_nums[i];
|
||||||
|
for (i = 0; i < nwrites; i++)
|
||||||
|
Feb_Interface_send_data[2 * i + 2] = values[i];
|
||||||
// wait on busy data(28), address of busy flag data(27 downto 14)
|
// wait on busy data(28), address of busy flag data(27 downto 14)
|
||||||
if (wait_ons&&wait_on_addresses) for(i=0;i<nwrites;i++) Feb_Interface_send_data[2*i+1] |= (wait_ons[i]<<28 | (0x3fff&wait_on_addresses[i])<<14);
|
if (wait_ons && wait_on_addresses)
|
||||||
|
for (i = 0; i < nwrites; i++)
|
||||||
|
Feb_Interface_send_data[2 * i + 1] |=
|
||||||
|
(wait_ons[i] << 28 | (0x3fff & wait_on_addresses[i]) << 14);
|
||||||
|
|
||||||
if (!Feb_Interface_WriteTo(sub_num)) return 0;
|
if (!Feb_Interface_WriteTo(sub_num))
|
||||||
|
return 0;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Feb_Interface_WriteMemoryInLoops(unsigned int sub_num, unsigned int mem_num, unsigned int start_address, unsigned int nwrites, unsigned int *values) {
|
int Feb_Interface_WriteMemoryInLoops(unsigned int sub_num, unsigned int mem_num,
|
||||||
|
unsigned int start_address,
|
||||||
|
unsigned int nwrites,
|
||||||
|
unsigned int *values) {
|
||||||
unsigned int max_single_packet_size = 352;
|
unsigned int max_single_packet_size = 352;
|
||||||
int passed=1;
|
int passed = 1;
|
||||||
unsigned int n_to_send = max_single_packet_size;
|
unsigned int n_to_send = max_single_packet_size;
|
||||||
unsigned int ndata_sent = 0;
|
unsigned int ndata_sent = 0;
|
||||||
unsigned int ndata_countdown = nwrites;
|
unsigned int ndata_countdown = nwrites;
|
||||||
while(ndata_countdown>0) {
|
while (ndata_countdown > 0) {
|
||||||
n_to_send = ndata_countdown<max_single_packet_size ? ndata_countdown:max_single_packet_size;
|
n_to_send = ndata_countdown < max_single_packet_size
|
||||||
if (!Feb_Interface_WriteMemory(sub_num,mem_num,start_address,n_to_send,&(values[ndata_sent]))) {passed=0; break;}
|
? ndata_countdown
|
||||||
ndata_countdown-=n_to_send;
|
: max_single_packet_size;
|
||||||
ndata_sent +=n_to_send;
|
if (!Feb_Interface_WriteMemory(sub_num, mem_num, start_address,
|
||||||
start_address +=n_to_send;
|
n_to_send, &(values[ndata_sent]))) {
|
||||||
usleep(500);//500 works
|
passed = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
ndata_countdown -= n_to_send;
|
||||||
|
ndata_sent += n_to_send;
|
||||||
|
start_address += n_to_send;
|
||||||
|
usleep(500); // 500 works
|
||||||
}
|
}
|
||||||
return passed;
|
return passed;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Feb_Interface_WriteMemory(unsigned int sub_num, unsigned int mem_num, unsigned int start_address, unsigned int nwrites, unsigned int *values) {
|
int Feb_Interface_WriteMemory(unsigned int sub_num, unsigned int mem_num,
|
||||||
|
unsigned int start_address, unsigned int nwrites,
|
||||||
|
unsigned int *values) {
|
||||||
// -1 means write to all
|
// -1 means write to all
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
mem_num &= 0x3f;
|
mem_num &= 0x3f;
|
||||||
start_address &= 0x3fff;
|
start_address &= 0x3fff;
|
||||||
nwrites &= 0x3ff;
|
nwrites &= 0x3ff;
|
||||||
if (!nwrites||nwrites>Feb_Interface_send_buffer_size-2) {
|
if (!nwrites || nwrites > Feb_Interface_send_buffer_size - 2) {
|
||||||
LOG(logERROR, ("invalid nwrites:%d\n",nwrites));
|
LOG(logERROR, ("invalid nwrites:%d\n", nwrites));
|
||||||
return 0;
|
return 0;
|
||||||
}//*d-1026
|
} //*d-1026
|
||||||
|
|
||||||
Feb_Interface_send_ndata = nwrites+2;//*d-1026
|
Feb_Interface_send_ndata = nwrites + 2; //*d-1026
|
||||||
Feb_Interface_send_data[0] = 0xc0000000 | mem_num << 24 | nwrites << 14 | start_address; //cmd -> write to memory, nwrites, mem number, start address
|
Feb_Interface_send_data[0] =
|
||||||
Feb_Interface_send_data[nwrites+1] = 0;
|
0xc0000000 | mem_num << 24 | nwrites << 14 |
|
||||||
for(i=0;i<nwrites;i++) Feb_Interface_send_data[i+1] = values[i];
|
start_address; // cmd -> write to memory, nwrites, mem number, start
|
||||||
|
// address
|
||||||
|
Feb_Interface_send_data[nwrites + 1] = 0;
|
||||||
|
for (i = 0; i < nwrites; i++)
|
||||||
|
Feb_Interface_send_data[i + 1] = values[i];
|
||||||
|
|
||||||
|
if (!Feb_Interface_WriteTo(sub_num))
|
||||||
if (!Feb_Interface_WriteTo(sub_num)) return 0;
|
return 0;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
28
slsDetectorServers/eigerDetectorServer/FebInterface.h
Executable file → Normal file
28
slsDetectorServers/eigerDetectorServer/FebInterface.h
Executable file → Normal file
@ -3,12 +3,24 @@
|
|||||||
int Feb_Interface_WriteTo(unsigned int ch);
|
int Feb_Interface_WriteTo(unsigned int ch);
|
||||||
int Feb_Interface_ReadFrom(unsigned int ch, unsigned int ntrys);
|
int Feb_Interface_ReadFrom(unsigned int ch, unsigned int ntrys);
|
||||||
void Feb_Interface_FebInterface();
|
void Feb_Interface_FebInterface();
|
||||||
void Feb_Interface_SendCompleteList(unsigned int n,unsigned int* list);
|
void Feb_Interface_SendCompleteList(unsigned int n, unsigned int *list);
|
||||||
int Feb_Interface_SetByteOrder();
|
int Feb_Interface_SetByteOrder();
|
||||||
int Feb_Interface_ReadRegister(unsigned int sub_num, unsigned int reg_num,unsigned int* value_read);
|
int Feb_Interface_ReadRegister(unsigned int sub_num, unsigned int reg_num,
|
||||||
int Feb_Interface_ReadRegisters(unsigned int sub_num, unsigned int nreads, unsigned int* reg_nums,unsigned int* values_read);
|
unsigned int *value_read);
|
||||||
int Feb_Interface_WriteRegister(unsigned int sub_num, unsigned int reg_num,unsigned int value, int wait_on, unsigned int wait_on_address);
|
int Feb_Interface_ReadRegisters(unsigned int sub_num, unsigned int nreads,
|
||||||
int Feb_Interface_WriteRegisters(unsigned int sub_num, unsigned int nwrites, unsigned int* reg_nums, unsigned int* values, int* wait_ons, unsigned int* wait_on_addresses);
|
unsigned int *reg_nums,
|
||||||
int Feb_Interface_WriteMemoryInLoops(unsigned int sub_num, unsigned int mem_num, unsigned int start_address, unsigned int nwrites, unsigned int *values);
|
unsigned int *values_read);
|
||||||
int Feb_Interface_WriteMemory(unsigned int sub_num, unsigned int mem_num, unsigned int start_address, unsigned int nwrites, unsigned int *values);
|
int Feb_Interface_WriteRegister(unsigned int sub_num, unsigned int reg_num,
|
||||||
|
unsigned int value, int wait_on,
|
||||||
|
unsigned int wait_on_address);
|
||||||
|
int Feb_Interface_WriteRegisters(unsigned int sub_num, unsigned int nwrites,
|
||||||
|
unsigned int *reg_nums, unsigned int *values,
|
||||||
|
int *wait_ons,
|
||||||
|
unsigned int *wait_on_addresses);
|
||||||
|
int Feb_Interface_WriteMemoryInLoops(unsigned int sub_num, unsigned int mem_num,
|
||||||
|
unsigned int start_address,
|
||||||
|
unsigned int nwrites,
|
||||||
|
unsigned int *values);
|
||||||
|
int Feb_Interface_WriteMemory(unsigned int sub_num, unsigned int mem_num,
|
||||||
|
unsigned int start_address, unsigned int nwrites,
|
||||||
|
unsigned int *values);
|
||||||
|
152
slsDetectorServers/eigerDetectorServer/FebRegisterDefs.h
Executable file → Normal file
152
slsDetectorServers/eigerDetectorServer/FebRegisterDefs.h
Executable file → Normal file
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
//daq register definitions
|
// daq register definitions
|
||||||
#define DAQ_REG_CTRL 1
|
#define DAQ_REG_CTRL 1
|
||||||
#define DAQ_REG_CHIP_CMDS 2
|
#define DAQ_REG_CHIP_CMDS 2
|
||||||
#define DAQ_REG_STATIC_BITS 3
|
#define DAQ_REG_STATIC_BITS 3
|
||||||
@ -12,32 +12,35 @@
|
|||||||
#define DAQ_REG_EXPOSURE_TIMER 4 // == (31 downto 3) * 10^(2 downto 0)
|
#define DAQ_REG_EXPOSURE_TIMER 4 // == (31 downto 3) * 10^(2 downto 0)
|
||||||
#define DAQ_REG_EXPOSURE_REPEAT_TIMER 5 // == (31 downto 3) * 10^(2 downto 0)
|
#define DAQ_REG_EXPOSURE_REPEAT_TIMER 5 // == (31 downto 3) * 10^(2 downto 0)
|
||||||
#define DAQ_REG_SUBFRAME_EXPOSURES 6
|
#define DAQ_REG_SUBFRAME_EXPOSURES 6
|
||||||
#define DAQ_REG_SUBFRAME_PERIOD 7 //also pg and fifo status register
|
#define DAQ_REG_SUBFRAME_PERIOD 7 // also pg and fifo status register
|
||||||
#define DAQ_REG_PARTIAL_READOUT 8
|
#define DAQ_REG_PARTIAL_READOUT 8
|
||||||
|
|
||||||
#define DAQ_REG_HRDWRE 12
|
#define DAQ_REG_HRDWRE 12
|
||||||
|
// clang-format off
|
||||||
#define DAQ_REG_HRDWRE_OW_OFST (0)
|
#define DAQ_REG_HRDWRE_OW_TOP_OFST (0)
|
||||||
#define DAQ_REG_HRDWRE_OW_MSK (0x00000001 << DAQ_REG_HRDWRE_OW_OFST)
|
#define DAQ_REG_HRDWRE_OW_TOP_MSK (0x00000001 << DAQ_REG_HRDWRE_OW_TOP_OFST)
|
||||||
#define DAQ_REG_HRDWRE_TOP_OFST (1)
|
#define DAQ_REG_HRDWRE_TOP_OFST (1)
|
||||||
#define DAQ_REG_HRDWRE_TOP_MSK (0x00000001 << DAQ_REG_HRDWRE_TOP_OFST)
|
#define DAQ_REG_HRDWRE_TOP_MSK (0x00000001 << DAQ_REG_HRDWRE_TOP_OFST)
|
||||||
#define DAQ_REG_HRDWRE_INTRRPT_SF_OFST (2)
|
#define DAQ_REG_HRDWRE_INTRRPT_SF_OFST (2)
|
||||||
#define DAQ_REG_HRDWRE_INTRRPT_SF_MSK (0x00000001 << DAQ_REG_HRDWRE_INTRRPT_SF_OFST)
|
#define DAQ_REG_HRDWRE_INTRRPT_SF_MSK (0x00000001 << DAQ_REG_HRDWRE_INTRRPT_SF_OFST)
|
||||||
|
#define DAQ_REG_HRDWRE_OW_MASTER_OFST (3)
|
||||||
|
#define DAQ_REG_HRDWRE_OW_MASTER_MSK (0x00000001 << DAQ_REG_HRDWRE_OW_MASTER_OFST)
|
||||||
|
#define DAQ_REG_HRDWRE_MASTER_OFST (4)
|
||||||
|
#define DAQ_REG_HRDWRE_MASTER_MSK (0x00000001 << DAQ_REG_HRDWRE_MASTER_OFST)
|
||||||
|
|
||||||
#define DAQ_REG_RO_OFFSET 20
|
#define DAQ_REG_RO_OFFSET 20
|
||||||
#define DAQ_REG_STATUS (DAQ_REG_RO_OFFSET + 0) //also pg and fifo status register
|
#define DAQ_REG_STATUS (DAQ_REG_RO_OFFSET + 0) // also pg and fifo status register
|
||||||
#define FEB_REG_STATUS (DAQ_REG_RO_OFFSET + 3)
|
#define FEB_REG_STATUS (DAQ_REG_RO_OFFSET + 3)
|
||||||
#define MEAS_SUBPERIOD_REG (DAQ_REG_RO_OFFSET + 4)
|
#define MEAS_SUBPERIOD_REG (DAQ_REG_RO_OFFSET + 4)
|
||||||
#define MEAS_PERIOD_REG (DAQ_REG_RO_OFFSET + 5)
|
#define MEAS_PERIOD_REG (DAQ_REG_RO_OFFSET + 5)
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
|
|
||||||
#define DAQ_CTRL_RESET 0x80000000
|
#define DAQ_CTRL_RESET 0x80000000
|
||||||
#define DAQ_CTRL_START 0x40000000
|
#define DAQ_CTRL_START 0x40000000
|
||||||
#define ACQ_CTRL_START 0x50000000 //this is 0x10000000 (acq) | 0x40000000 (daq)
|
#define ACQ_CTRL_START 0x50000000 // this is 0x10000000 (acq) | 0x40000000 (daq)
|
||||||
#define DAQ_CTRL_STOP 0x00000000
|
#define DAQ_CTRL_STOP 0x00000000
|
||||||
|
|
||||||
//direct chip commands to the DAQ_REG_CHIP_CMDS register
|
// direct chip commands to the DAQ_REG_CHIP_CMDS register
|
||||||
#define DAQ_SET_STATIC_BIT 0x00000001
|
#define DAQ_SET_STATIC_BIT 0x00000001
|
||||||
#define DAQ_RESET_COMPLETELY 0x0000000E
|
#define DAQ_RESET_COMPLETELY 0x0000000E
|
||||||
#define DAQ_RESET_PERIPHERY 0x00000002
|
#define DAQ_RESET_PERIPHERY 0x00000002
|
||||||
@ -52,9 +55,11 @@
|
|||||||
#define DAQ_SERIALIN_SHIFT_IN_32 0x00000100
|
#define DAQ_SERIALIN_SHIFT_IN_32 0x00000100
|
||||||
#define DAQ_LOAD_16ROWS_OF_TRIMBITS 0x00000200
|
#define DAQ_LOAD_16ROWS_OF_TRIMBITS 0x00000200
|
||||||
|
|
||||||
#define DAQ_IGNORE_INITIAL_CRAP 0x00000400 //crap before readout
|
// crap before readout
|
||||||
|
#define DAQ_IGNORE_INITIAL_CRAP 0x00000400
|
||||||
#define DAQ_READOUT_NROWS 0x00000800
|
#define DAQ_READOUT_NROWS 0x00000800
|
||||||
#define DAQ_CLKOUT_LAST_4_BITS_AND_RETURN_TO_START 0x00001000 //last 4 bit of data in the last frame
|
// last 4 bit of data in the last frame
|
||||||
|
#define DAQ_CLKOUT_LAST_4_BITS_AND_RETURN_TO_START 0x00001000
|
||||||
|
|
||||||
#define DAQ_RELEASE_IMAGE_STORE_AFTER_READOUT 0x00002000
|
#define DAQ_RELEASE_IMAGE_STORE_AFTER_READOUT 0x00002000
|
||||||
#define DAQ_RESET_PIXEL_COUNTERS_AFTER_READOUT 0x00004000
|
#define DAQ_RESET_PIXEL_COUNTERS_AFTER_READOUT 0x00004000
|
||||||
@ -63,80 +68,104 @@
|
|||||||
#define DAQ_CLK_MAIN_CLK_TO_SELECT_NEXT_PIXEL 0x00010000
|
#define DAQ_CLK_MAIN_CLK_TO_SELECT_NEXT_PIXEL 0x00010000
|
||||||
#define DAQ_SEND_N_TEST_PULSES 0x00020000
|
#define DAQ_SEND_N_TEST_PULSES 0x00020000
|
||||||
|
|
||||||
#define DAQ_CHIP_CONTROLLER_HALF_SPEED 0x00040000 //everything at 100 MHz (50MHz ddr readout)
|
// everything at 100 MHz (50MHz ddr readout)
|
||||||
#define DAQ_CHIP_CONTROLLER_QUARTER_SPEED 0x00080000 //everything at 50 MHz (25MHz ddr readout)
|
#define DAQ_CHIP_CONTROLLER_HALF_SPEED 0x00040000
|
||||||
#define DAQ_CHIP_CONTROLLER_SUPER_SLOW_SPEED 0x000c0000 //everything at ~200 kHz (200 kHz MHz ddr readout)
|
// everything at 50 MHz (25MHz ddr readout)
|
||||||
|
#define DAQ_CHIP_CONTROLLER_QUARTER_SPEED 0x00080000
|
||||||
|
// everything at ~200 kHz (200 kHz MHz ddr readout)
|
||||||
|
#define DAQ_CHIP_CONTROLLER_SUPER_SLOW_SPEED 0x000c0000
|
||||||
|
|
||||||
//#define DAQ_FIFO_ENABLE 0x00100000 commented out as it is not used anywhere
|
//#define DAQ_FIFO_ENABLE 0x00100000 commented out as it
|
||||||
|
// is not used anywhere
|
||||||
#define DAQ_REG_CHIP_CMDS_INT_TRIGGER 0x00100000
|
#define DAQ_REG_CHIP_CMDS_INT_TRIGGER 0x00100000
|
||||||
|
|
||||||
//direct chip commands to the DAQ_REG_CHIP_CMDS register
|
// direct chip commands to the DAQ_REG_CHIP_CMDS register
|
||||||
#define DAQ_NEXPOSURERS_SAFEST_MODE_ROW_CLK_BEFORE_MODE 0x00200000 //row clk is before main clk readout sequence
|
// row clk is before main clk readout sequence
|
||||||
#define DAQ_NEXPOSURERS_NORMAL_NONPARALLEL_MODE 0x00400000 //expose ->readout ->expose -> ..., with store is always closed
|
#define DAQ_NEXPOSURERS_SAFEST_MODE_ROW_CLK_BEFORE_MODE 0x00200000
|
||||||
#define DAQ_NEXPOSURERS_PARALLEL_MODE 0x00600000 //parallel acquire/read mode
|
// expose ->readout ->expose -> ..., with store is always closed
|
||||||
|
#define DAQ_NEXPOSURERS_NORMAL_NONPARALLEL_MODE 0x00400000
|
||||||
|
// parallel acquire/read mode
|
||||||
|
#define DAQ_NEXPOSURERS_PARALLEL_MODE 0x00600000
|
||||||
|
|
||||||
//DAQ_NEXPOSURERS_READOUT_COMPLETE_IMAGES is old now hard-wired in the firmware that every image comes with a header
|
// DAQ_NEXPOSURERS_READOUT_COMPLETE_IMAGES is old now hard-wired in the firmware
|
||||||
//#define DAQ_NEXPOSURERS_READOUT_COMPLETE_IMAGES 0x00800000 //DAQ_IGNORE_INITIAL_CRAP and DAQ_CLKOUT_LAST_4_BITS_AND_RETURN_TO_START
|
// that every image comes with a header #define
|
||||||
|
// DAQ_NEXPOSURERS_READOUT_COMPLETE_IMAGES 0x00800000
|
||||||
|
////DAQ_IGNORE_INITIAL_CRAP and DAQ_CLKOUT_LAST_4_BITS_AND_RETURN_TO_START
|
||||||
|
|
||||||
#define DAQ_NEXPOSURERS_EXTERNAL_ENABLING 0x01000000
|
#define DAQ_NEXPOSURERS_EXTERNAL_ENABLING 0x01000000
|
||||||
#define DAQ_NEXPOSURERS_EXTERNAL_ENABLING_POLARITY 0x02000000
|
#define DAQ_NEXPOSURERS_EXTERNAL_ENABLING_POLARITY 0x02000000
|
||||||
#define DAQ_NEXPOSURERS_EXTERNAL_TRIGGER_POLARITY 0x04000000
|
#define DAQ_NEXPOSURERS_EXTERNAL_TRIGGER_POLARITY 0x04000000
|
||||||
|
|
||||||
#define DAQ_NEXPOSURERS_INTERNAL_ACQUISITION 0x00000000 //internally controlled
|
// internally controlled
|
||||||
#define DAQ_NEXPOSURERS_EXTERNAL_ACQUISITION_START 0x08000000 //external acquisition start
|
#define DAQ_NEXPOSURERS_INTERNAL_ACQUISITION 0x00000000
|
||||||
#define DAQ_NEXPOSURERS_EXTERNAL_IMAGE_START 0x10000000 //external image start
|
// external acquisition start
|
||||||
#define DAQ_NEXPOSURERS_EXTERNAL_IMAGE_START_AND_STOP 0x18000000 //externally controlly, external image start and stop
|
#define DAQ_NEXPOSURERS_EXTERNAL_ACQUISITION_START 0x08000000
|
||||||
|
// external image start
|
||||||
|
#define DAQ_NEXPOSURERS_EXTERNAL_IMAGE_START 0x10000000
|
||||||
|
// externally controlly, external image start and stop
|
||||||
|
#define DAQ_NEXPOSURERS_EXTERNAL_IMAGE_START_AND_STOP 0x18000000
|
||||||
|
|
||||||
#define DAQ_NEXPOSURERS_ACTIVATE_AUTO_SUBIMAGING 0x20000000
|
#define DAQ_NEXPOSURERS_ACTIVATE_AUTO_SUBIMAGING 0x20000000
|
||||||
#define DAQ_NEXPOSURERS_ACTIVATE_RATE_CORRECTION 0x40000000
|
#define DAQ_NEXPOSURERS_ACTIVATE_RATE_CORRECTION 0x40000000
|
||||||
|
|
||||||
//#define DAQ_MASTER_HALF_MODULE 0x80000000 currently not used
|
//#define DAQ_MASTER_HALF_MODULE 0x80000000 currently not
|
||||||
|
// used
|
||||||
|
|
||||||
|
// chips static bits
|
||||||
//chips static bits
|
|
||||||
#define DAQ_STATIC_BIT_PROGRAM 0x00000001
|
#define DAQ_STATIC_BIT_PROGRAM 0x00000001
|
||||||
#define DAQ_STATIC_BIT_M4 0x00000002 //these are the status bits, not bit mode
|
// these are the status bits, not bit mode
|
||||||
#define DAQ_STATIC_BIT_M8 0x00000004 //these are the status bits, not bit mode
|
#define DAQ_STATIC_BIT_M4 0x00000002
|
||||||
#define DAQ_STATIC_BIT_M12 0x00000000 //these are the status bits, not bit mode, ie. "00" is 12 bit mode
|
#define DAQ_STATIC_BIT_M8 0x00000004
|
||||||
|
// these are the status bits, not bit mode, ie. "00" is 12 bit mode
|
||||||
|
#define DAQ_STATIC_BIT_M12 0x00000000
|
||||||
|
|
||||||
#define DAQ_STATIC_BIT_CHIP_TEST 0x00000008
|
#define DAQ_STATIC_BIT_CHIP_TEST 0x00000008
|
||||||
#define DAQ_STATIC_BIT_ROTEST 0x00000010
|
#define DAQ_STATIC_BIT_ROTEST 0x00000010
|
||||||
#define DAQ_CS_BAR_LEFT 0x00000020
|
#define DAQ_CS_BAR_LEFT 0x00000020
|
||||||
#define DAQ_CS_BAR_RIGHT 0x00000040
|
#define DAQ_CS_BAR_RIGHT 0x00000040
|
||||||
|
|
||||||
|
// status flags
|
||||||
//status flags
|
|
||||||
#define DAQ_STATUS_DAQ_RUNNING 0x01
|
#define DAQ_STATUS_DAQ_RUNNING 0x01
|
||||||
#define DAQ_DATA_COLLISION_ERROR 0x02
|
#define DAQ_DATA_COLLISION_ERROR 0x02
|
||||||
|
|
||||||
|
|
||||||
#define DAQ_STATUS_CURRENT_M4 0x04
|
#define DAQ_STATUS_CURRENT_M4 0x04
|
||||||
#define DAQ_STATUS_CURRENT_M8 0x08
|
#define DAQ_STATUS_CURRENT_M8 0x08
|
||||||
#define DAQ_STATUS_CURRENT_M12 0x00 //in 12 bit mode both are cleared
|
#define DAQ_STATUS_CURRENT_M12 0x00 // in 12 bit mode both are cleared
|
||||||
#define DAQ_STATUS_CURRENT_TESTMODE 0x10
|
#define DAQ_STATUS_CURRENT_TESTMODE 0x10
|
||||||
#define DAQ_STATUS_TOKEN_OUT 0x20
|
#define DAQ_STATUS_TOKEN_OUT 0x20
|
||||||
#define DAQ_STATUS_SERIAL_OUT 0x40
|
#define DAQ_STATUS_SERIAL_OUT 0x40
|
||||||
#define DAQ_STATUS_PIXELS_ARE_ENABLED 0x80
|
#define DAQ_STATUS_PIXELS_ARE_ENABLED 0x80
|
||||||
#define DAQ_STATUS_DAQ_RUN_TOGGLE 0x200
|
#define DAQ_STATUS_DAQ_RUN_TOGGLE 0x200
|
||||||
|
|
||||||
//data delay registers
|
// data delay registers
|
||||||
#define CHIP_DATA_OUT_DELAY_REG_CTRL 1
|
#define CHIP_DATA_OUT_DELAY_REG_CTRL 1
|
||||||
#define CHIP_DATA_OUT_DELAY_REG2 2
|
#define CHIP_DATA_OUT_DELAY_REG2 2
|
||||||
#define CHIP_DATA_OUT_DELAY_REG3 3
|
#define CHIP_DATA_OUT_DELAY_REG3 3
|
||||||
#define CHIP_DATA_OUT_DELAY_REG4 4
|
#define CHIP_DATA_OUT_DELAY_REG4 4
|
||||||
#define CHIP_DATA_OUT_DELAY_SET 0x20000000
|
#define CHIP_DATA_OUT_DELAY_SET 0x20000000
|
||||||
|
|
||||||
//module configuration
|
/** BEB Registers */
|
||||||
#define TOP_BIT_MASK 0x00f
|
|
||||||
#define MASTER_BIT_MASK 0x200
|
|
||||||
#define NORMAL_MODULE_BIT_MASK 0x400
|
|
||||||
|
|
||||||
// Master Slave Top Bottom Definition
|
// module configuration - XPAR_PLB_GPIO_SYS_BASEADDR
|
||||||
#define MODULE_CONFIGURATION_MASK 0x84
|
#define BEB_CONFIG_WR_OFST (0x160) // 0x20 * 11 (P11)
|
||||||
//Software Configuration
|
#define BEB_CONFIG_MASTER_OFST (0)
|
||||||
#define MASTERCONFIG_OFFSET 0x160 //0x20 * 11 (P11)
|
#define BEB_CONFIG_MASTER_MSK (0x00000001 << BEB_CONFIG_MASTER_OFST)
|
||||||
#define MASTER_BIT 0x1
|
#define BEB_CONFIG_OW_MASTER_OFST (1)
|
||||||
#define OVERWRITE_HARDWARE_BIT 0x2
|
#define BEB_CONFIG_OW_MASTER_MSK (0x00000001 << BEB_CONFIG_OW_MASTER_OFST)
|
||||||
#define DEACTIVATE_BIT 0x4
|
#define BEB_CONFIG_ACTIVATE_OFST (2)
|
||||||
|
#define BEB_CONFIG_ACTIVATE_MSK (0x00000001 << BEB_CONFIG_ACTIVATE_OFST)
|
||||||
|
#define BEB_CONFIG_TOP_OFST (3)
|
||||||
|
#define BEB_CONFIG_TOP_MSK (0x00000001 << BEB_CONFIG_TOP_OFST)
|
||||||
|
#define BEB_CONFIG_OW_TOP_OFST (4)
|
||||||
|
#define BEB_CONFIG_OW_TOP_MSK (0x00000001 << BEB_CONFIG_OW_TOP_OFST)
|
||||||
|
|
||||||
|
#define BEB_CONFIG_RD_OFST (0x84)
|
||||||
|
#define BEB_CONFIG_TOP_RD_OFST (0)
|
||||||
|
#define BEB_CONFIG_TOP_RD_MSK (0x00000001 << BEB_CONFIG_TOP_RD_OFST)
|
||||||
|
#define BEB_CONFIG_MASTER_RD_OFST (9)
|
||||||
|
#define BEB_CONFIG_MASTER_RD_MSK (0x00000001 << BEB_CONFIG_MASTER_RD_OFST)
|
||||||
|
#define BEB_CONFIG_NORMAL_RD_OFST (10)
|
||||||
|
#define BEB_CONFIG_NORMAL_RD_MSK (0x00000001 << BEB_CONFIG_NORMAL_RD_OFST)
|
||||||
|
|
||||||
#define FPGA_TEMP_OFFSET 0x200
|
#define FPGA_TEMP_OFFSET 0x200
|
||||||
|
|
||||||
@ -146,11 +175,12 @@
|
|||||||
#define FLOW_REG_OFFSET 0x140
|
#define FLOW_REG_OFFSET 0x140
|
||||||
|
|
||||||
#define FLOW_REG_TXM_FLOW_CNTRL_10G_OFST (0)
|
#define FLOW_REG_TXM_FLOW_CNTRL_10G_OFST (0)
|
||||||
#define FLOW_REG_TXM_FLOW_CNTRL_10G_MSK (0x1 << FLOW_REG_TXM_FLOW_CNTRL_10G_OFST)
|
#define FLOW_REG_TXM_FLOW_CNTRL_10G_MSK \
|
||||||
|
(0x1 << FLOW_REG_TXM_FLOW_CNTRL_10G_OFST)
|
||||||
#define FLOW_REG_OVERFLOW_32_BIT_OFST (2)
|
#define FLOW_REG_OVERFLOW_32_BIT_OFST (2)
|
||||||
#define FLOW_REG_OVERFLOW_32_BIT_MSK (0x1 << FLOW_REG_OVERFLOW_32_BIT_OFST)
|
#define FLOW_REG_OVERFLOW_32_BIT_MSK (0x1 << FLOW_REG_OVERFLOW_32_BIT_OFST)
|
||||||
|
|
||||||
//command memory
|
// command memory
|
||||||
#define LEFT_OFFSET 0x0
|
#define LEFT_OFFSET 0x0
|
||||||
#define RIGHT_OFFSET 0x100
|
#define RIGHT_OFFSET 0x100
|
||||||
|
|
||||||
@ -164,13 +194,13 @@
|
|||||||
#define TWO_REQUESTS_OFFSET 0x1c
|
#define TWO_REQUESTS_OFFSET 0x1c
|
||||||
#define TWO_REQUESTS_BIT 0x80000000
|
#define TWO_REQUESTS_BIT 0x80000000
|
||||||
|
|
||||||
//version
|
// version
|
||||||
#define FIRMWARE_VERSION_OFFSET 0x4
|
#define FIRMWARE_VERSION_OFFSET 0x4
|
||||||
#define FIRMWARESOFTWARE_API_OFFSET 0x0
|
#define FIRMWARESOFTWARE_API_OFFSET 0x0
|
||||||
|
|
||||||
#define FRAME_NUM_RESET_OFFSET 0xA0
|
#define FRAME_NUM_RESET_OFFSET 0xA0
|
||||||
|
|
||||||
//1g counters
|
// 1g counters
|
||||||
#define ONE_GIGA_LEFT_INDEX_LSB_COUNTER 0x04
|
#define ONE_GIGA_LEFT_INDEX_LSB_COUNTER 0x04
|
||||||
#define ONE_GIGA_LEFT_INDEX_MSB_COUNTER 0x24
|
#define ONE_GIGA_LEFT_INDEX_MSB_COUNTER 0x24
|
||||||
|
|
||||||
@ -183,7 +213,7 @@
|
|||||||
#define ONE_GIGA_RIGHT_TXN_DELAY_COUNTER 0x144
|
#define ONE_GIGA_RIGHT_TXN_DELAY_COUNTER 0x144
|
||||||
#define ONE_GIGA_RIGHT_FRAME_DELAY_COUNTER 0x164
|
#define ONE_GIGA_RIGHT_FRAME_DELAY_COUNTER 0x164
|
||||||
|
|
||||||
//10g counters
|
// 10g counters
|
||||||
#define TEN_GIGA_LEFT_INDEX_LSB_COUNTER 0x84
|
#define TEN_GIGA_LEFT_INDEX_LSB_COUNTER 0x84
|
||||||
#define TEN_GIGA_LEFT_INDEX_MSB_COUNTER 0xa4
|
#define TEN_GIGA_LEFT_INDEX_MSB_COUNTER 0xa4
|
||||||
|
|
||||||
@ -210,19 +240,3 @@
|
|||||||
#define UDP_HEADER_Z_MSK (0xFFFF << UDP_HEADER_Z_OFST)
|
#define UDP_HEADER_Z_MSK (0xFFFF << UDP_HEADER_Z_OFST)
|
||||||
#define UDP_HEADER_Y_OFST (16)
|
#define UDP_HEADER_Y_OFST (16)
|
||||||
#define UDP_HEADER_Y_MSK (0xFFFF << UDP_HEADER_Y_OFST)
|
#define UDP_HEADER_Y_MSK (0xFFFF << UDP_HEADER_Y_OFST)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
36
slsDetectorServers/eigerDetectorServer/HardwareIO.c
Executable file → Normal file
36
slsDetectorServers/eigerDetectorServer/HardwareIO.c
Executable file → Normal file
@ -1,76 +1,64 @@
|
|||||||
#include "HardwareIO.h"
|
#include "HardwareIO.h"
|
||||||
|
|
||||||
xfs_u8 HWIO_xfs_in8(xfs_u32 InAddress)
|
xfs_u8 HWIO_xfs_in8(xfs_u32 InAddress) {
|
||||||
{
|
|
||||||
/* read the contents of the I/O location and then synchronize the I/O
|
/* read the contents of the I/O location and then synchronize the I/O
|
||||||
* such that the I/O operation completes before proceeding on
|
* such that the I/O operation completes before proceeding on
|
||||||
*/
|
*/
|
||||||
|
|
||||||
xfs_u8 IoContents;
|
xfs_u8 IoContents;
|
||||||
__asm__ volatile ("eieio; lbz %0,0(%1)":"=r" (IoContents):"b"
|
__asm__ volatile("eieio; lbz %0,0(%1)" : "=r"(IoContents) : "b"(InAddress));
|
||||||
(InAddress));
|
|
||||||
return IoContents;
|
return IoContents;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
xfs_u16 HWIO_xfs_in16(xfs_u32 InAddress)
|
xfs_u16 HWIO_xfs_in16(xfs_u32 InAddress) {
|
||||||
{
|
|
||||||
/* read the contents of the I/O location and then synchronize the I/O
|
/* read the contents of the I/O location and then synchronize the I/O
|
||||||
* such that the I/O operation completes before proceeding on
|
* such that the I/O operation completes before proceeding on
|
||||||
*/
|
*/
|
||||||
|
|
||||||
xfs_u16 IoContents;
|
xfs_u16 IoContents;
|
||||||
__asm__ volatile ("eieio; lhz %0,0(%1)":"=r" (IoContents):"b"
|
__asm__ volatile("eieio; lhz %0,0(%1)" : "=r"(IoContents) : "b"(InAddress));
|
||||||
(InAddress));
|
|
||||||
return IoContents;
|
return IoContents;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
xfs_u32 HWIO_xfs_in32(xfs_u32 InAddress)
|
xfs_u32 HWIO_xfs_in32(xfs_u32 InAddress) {
|
||||||
{
|
|
||||||
/* read the contents of the I/O location and then synchronize the I/O
|
/* read the contents of the I/O location and then synchronize the I/O
|
||||||
* such that the I/O operation completes before proceeding on
|
* such that the I/O operation completes before proceeding on
|
||||||
*/
|
*/
|
||||||
|
|
||||||
xfs_u32 IoContents;
|
xfs_u32 IoContents;
|
||||||
__asm__ volatile ("eieio; lwz %0,0(%1)":"=r" (IoContents):"b"
|
__asm__ volatile("eieio; lwz %0,0(%1)" : "=r"(IoContents) : "b"(InAddress));
|
||||||
(InAddress));
|
|
||||||
return IoContents;
|
return IoContents;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void HWIO_xfs_out8(xfs_u32 OutAddress, xfs_u8 Value)
|
void HWIO_xfs_out8(xfs_u32 OutAddress, xfs_u8 Value) {
|
||||||
{
|
|
||||||
/* write the contents of the I/O location and then synchronize the I/O
|
/* write the contents of the I/O location and then synchronize the I/O
|
||||||
* such that the I/O operation completes before proceeding on
|
* such that the I/O operation completes before proceeding on
|
||||||
*/
|
*/
|
||||||
|
|
||||||
__asm__ volatile ("stb %0,0(%1); eieio"::"r" (Value), "b"(OutAddress));
|
__asm__ volatile("stb %0,0(%1); eieio" ::"r"(Value), "b"(OutAddress));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void HWIO_xfs_out16(xfs_u32 OutAddress, xfs_u16 Value)
|
void HWIO_xfs_out16(xfs_u32 OutAddress, xfs_u16 Value) {
|
||||||
{
|
|
||||||
/* write the contents of the I/O location and then synchronize the I/O
|
/* write the contents of the I/O location and then synchronize the I/O
|
||||||
* such that the I/O operation completes before proceeding on
|
* such that the I/O operation completes before proceeding on
|
||||||
*/
|
*/
|
||||||
|
|
||||||
__asm__ volatile ("sth %0,0(%1); eieio"::"r" (Value), "b"(OutAddress));
|
__asm__ volatile("sth %0,0(%1); eieio" ::"r"(Value), "b"(OutAddress));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void HWIO_xfs_out32(xfs_u32 OutAddress, xfs_u32 Value)
|
void HWIO_xfs_out32(xfs_u32 OutAddress, xfs_u32 Value) {
|
||||||
{
|
|
||||||
/* write the contents of the I/O location and then synchronize the I/O
|
/* write the contents of the I/O location and then synchronize the I/O
|
||||||
* such that the I/O operation completes before proceeding on
|
* such that the I/O operation completes before proceeding on
|
||||||
*/
|
*/
|
||||||
|
|
||||||
__asm__ volatile ("stw %0,0(%1); eieio"::"r" (Value), "b"(OutAddress));
|
__asm__ volatile("stw %0,0(%1); eieio" ::"r"(Value), "b"(OutAddress));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
17
slsDetectorServers/eigerDetectorServer/HardwareIO.h
Executable file → Normal file
17
slsDetectorServers/eigerDetectorServer/HardwareIO.h
Executable file → Normal file
@ -1,16 +1,13 @@
|
|||||||
|
|
||||||
//Class initially from Gerd and was called mmap_test.c
|
// Class initially from Gerd and was called mmap_test.c
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "xfs_types.h"
|
#include "xfs_types.h"
|
||||||
|
|
||||||
|
xfs_u8 HWIO_xfs_in8(xfs_u32 InAddress);
|
||||||
|
xfs_u16 HWIO_xfs_in16(xfs_u32 InAddress);
|
||||||
|
xfs_u32 HWIO_xfs_in32(xfs_u32 InAddress);
|
||||||
|
|
||||||
|
void HWIO_xfs_out8(xfs_u32 OutAddress, xfs_u8 Value);
|
||||||
xfs_u8 HWIO_xfs_in8(xfs_u32 InAddress);
|
void HWIO_xfs_out16(xfs_u32 OutAddress, xfs_u16 Value);
|
||||||
xfs_u16 HWIO_xfs_in16(xfs_u32 InAddress);
|
void HWIO_xfs_out32(xfs_u32 OutAddress, xfs_u32 Value);
|
||||||
xfs_u32 HWIO_xfs_in32(xfs_u32 InAddress);
|
|
||||||
|
|
||||||
void HWIO_xfs_out8(xfs_u32 OutAddress, xfs_u8 Value);
|
|
||||||
void HWIO_xfs_out16(xfs_u32 OutAddress, xfs_u16 Value);
|
|
||||||
void HWIO_xfs_out32(xfs_u32 OutAddress, xfs_u32 Value);
|
|
||||||
|
|
||||||
|
9
slsDetectorServers/eigerDetectorServer/HardwareMMappingDefs.h
Executable file → Normal file
9
slsDetectorServers/eigerDetectorServer/HardwareMMappingDefs.h
Executable file → Normal file
@ -1,11 +1,10 @@
|
|||||||
|
|
||||||
|
|
||||||
//from Gerd and was called mmap_test.h
|
// from Gerd and was called mmap_test.h
|
||||||
|
|
||||||
#ifndef __PLB_LL_FIFO_H__
|
#ifndef __PLB_LL_FIFO_H__
|
||||||
#define __PLB_LL_FIFO_H__
|
#define __PLB_LL_FIFO_H__
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
/* definitions */
|
/* definitions */
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
@ -20,7 +19,6 @@
|
|||||||
#define PLB_LL_FIFO_CTRL_LL_SOF 0x10000000
|
#define PLB_LL_FIFO_CTRL_LL_SOF 0x10000000
|
||||||
#define PLB_LL_FIFO_CTRL_LL_MASK 0xF0000000
|
#define PLB_LL_FIFO_CTRL_LL_MASK 0xF0000000
|
||||||
|
|
||||||
|
|
||||||
#define PLB_LL_FIFO_CTRL_TX_RESET 0x08000000
|
#define PLB_LL_FIFO_CTRL_TX_RESET 0x08000000
|
||||||
#define PLB_LL_FIFO_CTRL_RX_RESET 0x04000000
|
#define PLB_LL_FIFO_CTRL_RX_RESET 0x04000000
|
||||||
|
|
||||||
@ -38,10 +36,8 @@
|
|||||||
// reset Rx and Tx Fifo and set User Reset
|
// reset Rx and Tx Fifo and set User Reset
|
||||||
#define PLB_LL_FIFO_CTRL_RESET_FIFO 0x0C400000
|
#define PLB_LL_FIFO_CTRL_RESET_FIFO 0x0C400000
|
||||||
|
|
||||||
|
|
||||||
#define PLB_LL_FIFO_CTRL_CONFIG_VECTOR 0x000FFFFF
|
#define PLB_LL_FIFO_CTRL_CONFIG_VECTOR 0x000FFFFF
|
||||||
|
|
||||||
|
|
||||||
#define PLB_LL_FIFO_STATUS_LL_REM_SHIFT 30
|
#define PLB_LL_FIFO_STATUS_LL_REM_SHIFT 30
|
||||||
#define PLB_LL_FIFO_STATUS_LL_REM 0xC0000000
|
#define PLB_LL_FIFO_STATUS_LL_REM 0xC0000000
|
||||||
#define PLB_LL_FIFO_STATUS_LL_EOF 0x20000000
|
#define PLB_LL_FIFO_STATUS_LL_EOF 0x20000000
|
||||||
@ -56,7 +52,4 @@
|
|||||||
|
|
||||||
#define PLB_LL_FIFO_ALMOST_FULL_THRESHOLD_WORDS 100
|
#define PLB_LL_FIFO_ALMOST_FULL_THRESHOLD_WORDS 100
|
||||||
|
|
||||||
|
|
||||||
#endif // __PLB_LL_FIFO_H__
|
#endif // __PLB_LL_FIFO_H__
|
||||||
|
|
||||||
|
|
||||||
|
198
slsDetectorServers/eigerDetectorServer/LocalLinkInterface.c
Executable file → Normal file
198
slsDetectorServers/eigerDetectorServer/LocalLinkInterface.c
Executable file → Normal file
@ -2,82 +2,85 @@
|
|||||||
#include "HardwareMMappingDefs.h"
|
#include "HardwareMMappingDefs.h"
|
||||||
#include "clogger.h"
|
#include "clogger.h"
|
||||||
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <sys/mman.h>
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <sys/mman.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
void Local_LocalLinkInterface1(struct LocalLinkInterface *ll,
|
||||||
void Local_LocalLinkInterface1(struct LocalLinkInterface* ll,unsigned int ll_fifo_badr) {
|
unsigned int ll_fifo_badr) {
|
||||||
LOG(logDEBUG1, ("Initialize PLB LL FIFOs\n"));
|
LOG(logDEBUG1, ("Initialize PLB LL FIFOs\n"));
|
||||||
ll->ll_fifo_base=0;
|
ll->ll_fifo_base = 0;
|
||||||
ll->ll_fifo_ctrl_reg=0;
|
ll->ll_fifo_ctrl_reg = 0;
|
||||||
if (Local_Init(ll,ll_fifo_badr)) {
|
if (Local_Init(ll, ll_fifo_badr)) {
|
||||||
Local_Reset(ll);
|
Local_Reset(ll);
|
||||||
LOG(logDEBUG1, ("\tFIFO Status : 0x%08x\n\n\n", Local_StatusVector(ll)));
|
LOG(logDEBUG1,
|
||||||
} else LOG(logERROR, ("\tCould not map LocalLink : 0x%08x\n\n\n", ll_fifo_badr));
|
("\tFIFO Status : 0x%08x\n\n\n", Local_StatusVector(ll)));
|
||||||
|
} else
|
||||||
|
LOG(logERROR,
|
||||||
|
("\tCould not map LocalLink : 0x%08x\n\n\n", ll_fifo_badr));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Local_LocalLinkInterface(struct LocalLinkInterface *ll) {
|
||||||
void Local_LocalLinkInterface(struct LocalLinkInterface* ll) {
|
|
||||||
LOG(logDEBUG1, ("Initializing new memory\n"));
|
LOG(logDEBUG1, ("Initializing new memory\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Local_Init(struct LocalLinkInterface *ll, unsigned int ll_fifo_badr) {
|
||||||
|
|
||||||
int Local_Init(struct LocalLinkInterface* ll,unsigned int ll_fifo_badr) {
|
|
||||||
int fd;
|
int fd;
|
||||||
void *plb_ll_fifo_ptr;
|
void *plb_ll_fifo_ptr;
|
||||||
|
|
||||||
if ((fd=open("/dev/mem", O_RDWR)) < 0) {
|
if ((fd = open("/dev/mem", O_RDWR)) < 0) {
|
||||||
fprintf(stderr, "Could not open /dev/mem\n");
|
fprintf(stderr, "Could not open /dev/mem\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
plb_ll_fifo_ptr = mmap(0, getpagesize(), PROT_READ | PROT_WRITE, MAP_FILE | MAP_SHARED, fd, ll_fifo_badr);
|
plb_ll_fifo_ptr = mmap(0, getpagesize(), PROT_READ | PROT_WRITE,
|
||||||
|
MAP_FILE | MAP_SHARED, fd, ll_fifo_badr);
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
||||||
if (plb_ll_fifo_ptr == MAP_FAILED) {
|
if (plb_ll_fifo_ptr == MAP_FAILED) {
|
||||||
perror ("mmap");
|
perror("mmap");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ll->ll_fifo_base = (xfs_u32) plb_ll_fifo_ptr;
|
ll->ll_fifo_base = (xfs_u32)plb_ll_fifo_ptr;
|
||||||
ll->ll_fifo_ctrl_reg = 0;
|
ll->ll_fifo_ctrl_reg = 0;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Local_Reset(struct LocalLinkInterface *ll) {
|
||||||
|
return Local_Reset1(ll, PLB_LL_FIFO_CTRL_RESET_STD);
|
||||||
int Local_Reset(struct LocalLinkInterface* ll) {
|
|
||||||
return Local_Reset1(ll,PLB_LL_FIFO_CTRL_RESET_STD);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int Local_Reset1(struct LocalLinkInterface* ll,unsigned int rst_mask) {
|
int Local_Reset1(struct LocalLinkInterface *ll, unsigned int rst_mask) {
|
||||||
ll->ll_fifo_ctrl_reg |= rst_mask;
|
ll->ll_fifo_ctrl_reg |= rst_mask;
|
||||||
LOG(logDEBUG1, ("\tCTRL Register bits: 0x%08x\n",ll->ll_fifo_ctrl_reg));
|
LOG(logDEBUG1, ("\tCTRL Register bits: 0x%08x\n", ll->ll_fifo_ctrl_reg));
|
||||||
|
|
||||||
HWIO_xfs_out32(ll->ll_fifo_base+4*PLB_LL_FIFO_REG_CTRL,ll->ll_fifo_ctrl_reg);
|
HWIO_xfs_out32(ll->ll_fifo_base + 4 * PLB_LL_FIFO_REG_CTRL,
|
||||||
HWIO_xfs_out32(ll->ll_fifo_base+4*PLB_LL_FIFO_REG_CTRL,ll->ll_fifo_ctrl_reg);
|
ll->ll_fifo_ctrl_reg);
|
||||||
HWIO_xfs_out32(ll->ll_fifo_base+4*PLB_LL_FIFO_REG_CTRL,ll->ll_fifo_ctrl_reg);
|
HWIO_xfs_out32(ll->ll_fifo_base + 4 * PLB_LL_FIFO_REG_CTRL,
|
||||||
HWIO_xfs_out32(ll->ll_fifo_base+4*PLB_LL_FIFO_REG_CTRL,ll->ll_fifo_ctrl_reg);
|
ll->ll_fifo_ctrl_reg);
|
||||||
|
HWIO_xfs_out32(ll->ll_fifo_base + 4 * PLB_LL_FIFO_REG_CTRL,
|
||||||
|
ll->ll_fifo_ctrl_reg);
|
||||||
|
HWIO_xfs_out32(ll->ll_fifo_base + 4 * PLB_LL_FIFO_REG_CTRL,
|
||||||
|
ll->ll_fifo_ctrl_reg);
|
||||||
|
|
||||||
ll->ll_fifo_ctrl_reg &= (~rst_mask);
|
ll->ll_fifo_ctrl_reg &= (~rst_mask);
|
||||||
|
|
||||||
HWIO_xfs_out32(ll->ll_fifo_base+4*PLB_LL_FIFO_REG_CTRL,ll->ll_fifo_ctrl_reg);
|
HWIO_xfs_out32(ll->ll_fifo_base + 4 * PLB_LL_FIFO_REG_CTRL,
|
||||||
|
ll->ll_fifo_ctrl_reg);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned int Local_StatusVector(struct LocalLinkInterface *ll) {
|
||||||
|
return HWIO_xfs_in32(ll->ll_fifo_base + 4 * PLB_LL_FIFO_REG_STATUS);
|
||||||
unsigned int Local_StatusVector(struct LocalLinkInterface* ll) {
|
|
||||||
return HWIO_xfs_in32(ll->ll_fifo_base+4*PLB_LL_FIFO_REG_STATUS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int Local_Write(struct LocalLinkInterface* ll,unsigned int buffer_len, void *buffer) {
|
int Local_Write(struct LocalLinkInterface *ll, unsigned int buffer_len,
|
||||||
|
void *buffer) {
|
||||||
// note: buffer must be word (4 byte) aligned
|
// note: buffer must be word (4 byte) aligned
|
||||||
// frame_len in byte
|
// frame_len in byte
|
||||||
int vacancy=0;
|
int vacancy = 0;
|
||||||
int i;
|
int i;
|
||||||
int words_send = 0;
|
int words_send = 0;
|
||||||
int last_word;
|
int last_word;
|
||||||
@ -85,48 +88,55 @@ int Local_Write(struct LocalLinkInterface* ll,unsigned int buffer_len, void *buf
|
|||||||
unsigned int fifo_ctrl;
|
unsigned int fifo_ctrl;
|
||||||
xfs_u32 status;
|
xfs_u32 status;
|
||||||
|
|
||||||
if (buffer_len < 1) return -1;
|
if (buffer_len < 1)
|
||||||
|
return -1;
|
||||||
|
|
||||||
last_word = (buffer_len-1)/4;
|
last_word = (buffer_len - 1) / 4;
|
||||||
word_ptr = (unsigned int *)buffer;
|
word_ptr = (unsigned int *)buffer;
|
||||||
|
|
||||||
LOG(logDEBUG1, ("LL Write - Len: %2d - If: %X - Data: ",buffer_len, ll->ll_fifo_base));
|
LOG(logDEBUG1, ("LL Write - Len: %2d - If: %X - Data: ", buffer_len,
|
||||||
for (i=0; i < buffer_len/4; i++)
|
ll->ll_fifo_base));
|
||||||
LOG(logDEBUG1, ("%.8X ",*(((unsigned *) buffer)+i)));
|
for (i = 0; i < buffer_len / 4; i++)
|
||||||
|
LOG(logDEBUG1, ("%.8X ", *(((unsigned *)buffer) + i)));
|
||||||
|
|
||||||
while (words_send <= last_word)
|
while (words_send <= last_word) {
|
||||||
|
while (!vacancy) // wait for Fifo to be empty again
|
||||||
{
|
{
|
||||||
while (!vacancy)//wait for Fifo to be empty again
|
status =
|
||||||
{
|
HWIO_xfs_in32(ll->ll_fifo_base + 4 * PLB_LL_FIFO_REG_STATUS);
|
||||||
status = HWIO_xfs_in32(ll->ll_fifo_base+4*PLB_LL_FIFO_REG_STATUS);
|
if ((status & PLB_LL_FIFO_STATUS_ALMOSTFULL) == 0)
|
||||||
if ((status & PLB_LL_FIFO_STATUS_ALMOSTFULL) == 0) vacancy = 1;
|
vacancy = 1;
|
||||||
if (vacancy == 0) {
|
if (vacancy == 0) {
|
||||||
LOG(logERROR, ("Fifo full!\n"));
|
LOG(logERROR, ("Fifo full!\n"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Just to know: #define PLB_LL_FIFO_ALMOST_FULL_THRESHOLD_WORDS 100
|
// Just to know: #define PLB_LL_FIFO_ALMOST_FULL_THRESHOLD_WORDS 100
|
||||||
for (i=0; ((i<PLB_LL_FIFO_ALMOST_FULL_THRESHOLD_WORDS) && (words_send <= last_word)); i++)
|
for (i = 0; ((i < PLB_LL_FIFO_ALMOST_FULL_THRESHOLD_WORDS) &&
|
||||||
{
|
(words_send <= last_word));
|
||||||
|
i++) {
|
||||||
fifo_ctrl = 0;
|
fifo_ctrl = 0;
|
||||||
if (words_send == 0)
|
if (words_send == 0) {
|
||||||
{
|
fifo_ctrl =
|
||||||
fifo_ctrl = PLB_LL_FIFO_CTRL_LL_SOF;//announce the start of file
|
PLB_LL_FIFO_CTRL_LL_SOF; // announce the start of file
|
||||||
}
|
}
|
||||||
|
|
||||||
if (words_send == last_word)
|
if (words_send == last_word) {
|
||||||
{
|
fifo_ctrl |=
|
||||||
fifo_ctrl |= (PLB_LL_FIFO_CTRL_LL_EOF | (( (buffer_len-1)<<PLB_LL_FIFO_CTRL_LL_REM_SHIFT) & PLB_LL_FIFO_CTRL_LL_REM) );
|
(PLB_LL_FIFO_CTRL_LL_EOF |
|
||||||
|
(((buffer_len - 1) << PLB_LL_FIFO_CTRL_LL_REM_SHIFT) &
|
||||||
|
PLB_LL_FIFO_CTRL_LL_REM));
|
||||||
}
|
}
|
||||||
Local_ctrl_reg_write_mask(ll,PLB_LL_FIFO_CTRL_LL_MASK,fifo_ctrl);
|
Local_ctrl_reg_write_mask(ll, PLB_LL_FIFO_CTRL_LL_MASK, fifo_ctrl);
|
||||||
HWIO_xfs_out32(ll->ll_fifo_base+4*PLB_LL_FIFO_REG_FIFO,word_ptr[words_send++]);
|
HWIO_xfs_out32(ll->ll_fifo_base + 4 * PLB_LL_FIFO_REG_FIFO,
|
||||||
|
word_ptr[words_send++]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return buffer_len;
|
return buffer_len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Local_Read(struct LocalLinkInterface *ll, unsigned int buffer_len,
|
||||||
int Local_Read(struct LocalLinkInterface* ll,unsigned int buffer_len, void *buffer) {
|
void *buffer) {
|
||||||
static unsigned int buffer_ptr = 0;
|
static unsigned int buffer_ptr = 0;
|
||||||
// note: buffer must be word (4 byte) aligned
|
// note: buffer must be word (4 byte) aligned
|
||||||
// frame_len in byte
|
// frame_len in byte
|
||||||
@ -136,19 +146,15 @@ int Local_Read(struct LocalLinkInterface* ll,unsigned int buffer_len, void *buff
|
|||||||
volatile unsigned int fifo_val;
|
volatile unsigned int fifo_val;
|
||||||
int sof = 0;
|
int sof = 0;
|
||||||
|
|
||||||
LOG(logDEBUG1, ("LL Read - If: %X - Data: ",ll->ll_fifo_base));
|
LOG(logDEBUG1, ("LL Read - If: %X - Data: ", ll->ll_fifo_base));
|
||||||
|
|
||||||
word_ptr = (unsigned int *)buffer;
|
word_ptr = (unsigned int *)buffer;
|
||||||
do
|
do {
|
||||||
{
|
status = HWIO_xfs_in32(ll->ll_fifo_base + 4 * PLB_LL_FIFO_REG_STATUS);
|
||||||
status = HWIO_xfs_in32(ll->ll_fifo_base+4*PLB_LL_FIFO_REG_STATUS);
|
|
||||||
|
|
||||||
if (!(status & PLB_LL_FIFO_STATUS_EMPTY))
|
if (!(status & PLB_LL_FIFO_STATUS_EMPTY)) {
|
||||||
{
|
if (status & PLB_LL_FIFO_STATUS_LL_SOF) {
|
||||||
if (status & PLB_LL_FIFO_STATUS_LL_SOF)
|
if (buffer_ptr) {
|
||||||
{
|
|
||||||
if (buffer_ptr)
|
|
||||||
{
|
|
||||||
buffer_ptr = 0;
|
buffer_ptr = 0;
|
||||||
return -1; // buffer overflow
|
return -1; // buffer overflow
|
||||||
}
|
}
|
||||||
@ -156,65 +162,61 @@ int Local_Read(struct LocalLinkInterface* ll,unsigned int buffer_len, void *buff
|
|||||||
sof = 1;
|
sof = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
fifo_val = HWIO_xfs_in32(ll->ll_fifo_base+4*PLB_LL_FIFO_REG_FIFO); //read from fifo
|
fifo_val = HWIO_xfs_in32(
|
||||||
|
ll->ll_fifo_base + 4 * PLB_LL_FIFO_REG_FIFO); // read from fifo
|
||||||
|
|
||||||
if ((buffer_ptr > 0) || sof)
|
if ((buffer_ptr > 0) || sof) {
|
||||||
{
|
if ((buffer_len >> 2) > buffer_ptr) {
|
||||||
if ( (buffer_len >> 2) > buffer_ptr)
|
|
||||||
{
|
|
||||||
LOG(logDEBUG1, ("%.8X ", fifo_val));
|
LOG(logDEBUG1, ("%.8X ", fifo_val));
|
||||||
word_ptr[buffer_ptr++] = fifo_val; //write to buffer
|
word_ptr[buffer_ptr++] = fifo_val; // write to buffer
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
buffer_ptr = 0;
|
buffer_ptr = 0;
|
||||||
return -2; // buffer overflow
|
return -2; // buffer overflow
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status & PLB_LL_FIFO_STATUS_LL_EOF)
|
if (status & PLB_LL_FIFO_STATUS_LL_EOF) {
|
||||||
{
|
len = (buffer_ptr << 2) - 3 +
|
||||||
len = (buffer_ptr << 2) -3 + ( (status & PLB_LL_FIFO_STATUS_LL_REM)>>PLB_LL_FIFO_STATUS_LL_REM_SHIFT );
|
((status & PLB_LL_FIFO_STATUS_LL_REM) >>
|
||||||
LOG(logDEBUG1, ("Len: %d\n",len));
|
PLB_LL_FIFO_STATUS_LL_REM_SHIFT);
|
||||||
|
LOG(logDEBUG1, ("Len: %d\n", len));
|
||||||
buffer_ptr = 0;
|
buffer_ptr = 0;
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} while (!(status & PLB_LL_FIFO_STATUS_EMPTY));
|
||||||
while(!(status & PLB_LL_FIFO_STATUS_EMPTY));
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Local_ctrl_reg_write_mask(struct LocalLinkInterface* ll,unsigned int mask, unsigned int val) {
|
int Local_ctrl_reg_write_mask(struct LocalLinkInterface *ll, unsigned int mask,
|
||||||
|
unsigned int val) {
|
||||||
ll->ll_fifo_ctrl_reg &= (~mask);
|
ll->ll_fifo_ctrl_reg &= (~mask);
|
||||||
ll->ll_fifo_ctrl_reg |= ( mask & val);
|
ll->ll_fifo_ctrl_reg |= (mask & val);
|
||||||
HWIO_xfs_out32(ll->ll_fifo_base+4*PLB_LL_FIFO_REG_CTRL,ll->ll_fifo_ctrl_reg);
|
HWIO_xfs_out32(ll->ll_fifo_base + 4 * PLB_LL_FIFO_REG_CTRL,
|
||||||
|
ll->ll_fifo_ctrl_reg);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Local_Test(struct LocalLinkInterface *ll, unsigned int buffer_len,
|
||||||
int Local_Test(struct LocalLinkInterface* ll,unsigned int buffer_len, void *buffer) {
|
void *buffer) {
|
||||||
|
|
||||||
int len;
|
int len;
|
||||||
unsigned int rec_buff_len = 4096;
|
unsigned int rec_buff_len = 4096;
|
||||||
unsigned int rec_buffer[4097];
|
unsigned int rec_buffer[4097];
|
||||||
|
|
||||||
|
Local_Write(ll, buffer_len, buffer);
|
||||||
Local_Write(ll,buffer_len,buffer);
|
|
||||||
usleep(10000);
|
usleep(10000);
|
||||||
|
|
||||||
do{
|
do {
|
||||||
len = Local_Read(ll,rec_buff_len,rec_buffer);
|
len = Local_Read(ll, rec_buff_len, rec_buffer);
|
||||||
LOG(logDEBUG1, ("receive length: %i\n",len));
|
LOG(logDEBUG1, ("receive length: %i\n", len));
|
||||||
|
|
||||||
if (len > 0) {
|
if (len > 0) {
|
||||||
rec_buffer[len]=0;
|
rec_buffer[len] = 0;
|
||||||
LOG(logINFO, ("%s\n", (char*) rec_buffer));
|
LOG(logINFO, ("%s\n", (char *)rec_buffer));
|
||||||
}
|
}
|
||||||
} while(len > 0);
|
} while (len > 0);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
29
slsDetectorServers/eigerDetectorServer/LocalLinkInterface.h
Executable file → Normal file
29
slsDetectorServers/eigerDetectorServer/LocalLinkInterface.h
Executable file → Normal file
@ -2,20 +2,23 @@
|
|||||||
|
|
||||||
#include "HardwareIO.h"
|
#include "HardwareIO.h"
|
||||||
|
|
||||||
|
struct LocalLinkInterface {
|
||||||
struct LocalLinkInterface{
|
|
||||||
xfs_u32 ll_fifo_base;
|
xfs_u32 ll_fifo_base;
|
||||||
unsigned int ll_fifo_ctrl_reg;
|
unsigned int ll_fifo_ctrl_reg;
|
||||||
};
|
};
|
||||||
|
|
||||||
int Local_Init(struct LocalLinkInterface* ll,unsigned int ll_fifo_badr);
|
int Local_Init(struct LocalLinkInterface *ll, unsigned int ll_fifo_badr);
|
||||||
int Local_Reset1(struct LocalLinkInterface* ll,unsigned int rst_mask);
|
int Local_Reset1(struct LocalLinkInterface *ll, unsigned int rst_mask);
|
||||||
int Local_ctrl_reg_write_mask(struct LocalLinkInterface* ll,unsigned int mask, unsigned int val);
|
int Local_ctrl_reg_write_mask(struct LocalLinkInterface *ll, unsigned int mask,
|
||||||
void Local_LocalLinkInterface1(struct LocalLinkInterface* ll,unsigned int ll_fifo_badr);
|
unsigned int val);
|
||||||
unsigned int Local_StatusVector(struct LocalLinkInterface* ll);
|
void Local_LocalLinkInterface1(struct LocalLinkInterface *ll,
|
||||||
int Local_Reset(struct LocalLinkInterface* ll);
|
unsigned int ll_fifo_badr);
|
||||||
int Local_Write(struct LocalLinkInterface* ll,unsigned int buffer_len, void *buffer);
|
unsigned int Local_StatusVector(struct LocalLinkInterface *ll);
|
||||||
int Local_Read(struct LocalLinkInterface* ll,unsigned int buffer_len, void *buffer);
|
int Local_Reset(struct LocalLinkInterface *ll);
|
||||||
int Local_Test(struct LocalLinkInterface* ll,unsigned int buffer_len, void *buffer);
|
int Local_Write(struct LocalLinkInterface *ll, unsigned int buffer_len,
|
||||||
void Local_LocalLinkInterface(struct LocalLinkInterface* ll);
|
void *buffer);
|
||||||
|
int Local_Read(struct LocalLinkInterface *ll, unsigned int buffer_len,
|
||||||
|
void *buffer);
|
||||||
|
int Local_Test(struct LocalLinkInterface *ll, unsigned int buffer_len,
|
||||||
|
void *buffer);
|
||||||
|
void Local_LocalLinkInterface(struct LocalLinkInterface *ll);
|
||||||
|
Binary file not shown.
2
slsDetectorServers/eigerDetectorServer/config.txt
Normal file
2
slsDetectorServers/eigerDetectorServer/config.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
top 1
|
||||||
|
master 1
|
1307
slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c
Executable file → Normal file
1307
slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
68
slsDetectorServers/eigerDetectorServer/slsDetectorServer_defs.h
Executable file → Normal file
68
slsDetectorServers/eigerDetectorServer/slsDetectorServer_defs.h
Executable file → Normal file
@ -1,17 +1,37 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "sls_detector_defs.h"
|
#include "sls_detector_defs.h"
|
||||||
|
|
||||||
#define REQUIRED_FIRMWARE_VERSION (24)
|
#define REQUIRED_FIRMWARE_VERSION (26)
|
||||||
#define IDFILECOMMAND "more /home/root/executables/detid.txt"
|
#define IDFILECOMMAND "more /home/root/executables/detid.txt"
|
||||||
#define FIRMWARE_VERSION_SAME_TOP_BOT_ADDR (26)
|
#define CONFIG_FILE ("config.txt")
|
||||||
|
#define WAIT_STOP_SERVER_START (1 * 1000 * 1000)
|
||||||
|
|
||||||
#define STATUS_IDLE 0
|
#define STATUS_IDLE 0
|
||||||
#define STATUS_RUNNING 1
|
#define STATUS_RUNNING 1
|
||||||
#define STATUS_ERROR 2
|
#define STATUS_ERROR 2
|
||||||
|
|
||||||
/* Enums */
|
/* Enums */
|
||||||
enum DACINDEX {E_SVP,E_VTR,E_VRF,E_VRS,E_SVN,E_VTGSTV,E_VCMP_LL,E_VCMP_LR,E_CAL,E_VCMP_RL,E_RXB_RB,E_RXB_LB,E_VCMP_RR,E_VCP,E_VCN,E_VIS,E_VTHRESHOLD};
|
enum DACINDEX {
|
||||||
#define DEFAULT_DAC_VALS { \
|
E_SVP,
|
||||||
|
E_VTR,
|
||||||
|
E_VRF,
|
||||||
|
E_VRS,
|
||||||
|
E_SVN,
|
||||||
|
E_VTGSTV,
|
||||||
|
E_VCMP_LL,
|
||||||
|
E_VCMP_LR,
|
||||||
|
E_CAL,
|
||||||
|
E_VCMP_RL,
|
||||||
|
E_RXB_RB,
|
||||||
|
E_RXB_LB,
|
||||||
|
E_VCMP_RR,
|
||||||
|
E_VCP,
|
||||||
|
E_VCN,
|
||||||
|
E_VIS,
|
||||||
|
E_VTHRESHOLD
|
||||||
|
};
|
||||||
|
#define DEFAULT_DAC_VALS \
|
||||||
|
{ \
|
||||||
0, /* SvP */ \
|
0, /* SvP */ \
|
||||||
2480, /* Vtr */ \
|
2480, /* Vtr */ \
|
||||||
3300, /* Vrf */ \
|
3300, /* Vrf */ \
|
||||||
@ -29,10 +49,24 @@ enum DACINDEX {E_SVP,E_VTR,E_VRF,E_VRS,E_SVN,E_VTGSTV,E_VCMP_LL,E_VCMP_L
|
|||||||
2000, /* Vcn */ \
|
2000, /* Vcn */ \
|
||||||
1550 /* Vis */ \
|
1550 /* Vis */ \
|
||||||
};
|
};
|
||||||
enum ADCINDEX {TEMP_FPGAEXT, TEMP_10GE, TEMP_DCDC, TEMP_SODL, TEMP_SODR, TEMP_FPGA, TEMP_FPGAFEBL, TEMP_FPGAFEBR};
|
enum ADCINDEX {
|
||||||
enum NETWORKINDEX {TXN_LEFT, TXN_RIGHT, TXN_FRAME,FLOWCTRL_10G};
|
TEMP_FPGAEXT,
|
||||||
enum ROINDEX {E_PARALLEL, E_NON_PARALLEL};
|
TEMP_10GE,
|
||||||
enum CLKINDEX {RUN_CLK, NUM_CLOCKS};
|
TEMP_DCDC,
|
||||||
|
TEMP_SODL,
|
||||||
|
TEMP_SODR,
|
||||||
|
TEMP_FPGA,
|
||||||
|
TEMP_FPGAFEBL,
|
||||||
|
TEMP_FPGAFEBR
|
||||||
|
};
|
||||||
|
enum NETWORKINDEX { TXN_LEFT, TXN_RIGHT, TXN_FRAME, FLOWCTRL_10G };
|
||||||
|
enum ROINDEX { E_PARALLEL, E_NON_PARALLEL };
|
||||||
|
enum CLKINDEX { RUN_CLK, NUM_CLOCKS };
|
||||||
|
enum TOPINDEX { TOP_HARDWARE, OW_TOP, OW_BOTTOM };
|
||||||
|
#define TOP_NAMES "hardware", "top", "bottom"
|
||||||
|
enum MASTERINDEX { MASTER_HARDWARE, OW_MASTER, OW_SLAVE };
|
||||||
|
#define MASTER_NAMES "hardware", "master", "slave"
|
||||||
|
|
||||||
#define CLK_NAMES "run"
|
#define CLK_NAMES "run"
|
||||||
|
|
||||||
/* Hardware Definitions */
|
/* Hardware Definitions */
|
||||||
@ -40,13 +74,13 @@ enum CLKINDEX {RUN_CLK, NUM_CLOCKS};
|
|||||||
#define NCHIP (4)
|
#define NCHIP (4)
|
||||||
#define NDAC (16)
|
#define NDAC (16)
|
||||||
|
|
||||||
|
|
||||||
#define TEN_GIGA_BUFFER_SIZE (4112)
|
#define TEN_GIGA_BUFFER_SIZE (4112)
|
||||||
#define ONE_GIGA_BUFFER_SIZE (1040)
|
#define ONE_GIGA_BUFFER_SIZE (1040)
|
||||||
#define TEN_GIGA_CONSTANT (4)
|
#define TEN_GIGA_CONSTANT (4)
|
||||||
#define ONE_GIGA_CONSTANT (16)
|
#define ONE_GIGA_CONSTANT (16)
|
||||||
#define NORMAL_HIGHVOLTAGE_INPUTPORT "/sys/class/hwmon/hwmon5/device/in0_input"
|
#define NORMAL_HIGHVOLTAGE_INPUTPORT "/sys/class/hwmon/hwmon5/device/in0_input"
|
||||||
#define NORMAL_HIGHVOLTAGE_OUTPUTPORT "/sys/class/hwmon/hwmon5/device/out0_output"
|
#define NORMAL_HIGHVOLTAGE_OUTPUTPORT \
|
||||||
|
"/sys/class/hwmon/hwmon5/device/out0_output"
|
||||||
#define SPECIAL9M_HIGHVOLTAGE_PORT "/dev/ttyS1"
|
#define SPECIAL9M_HIGHVOLTAGE_PORT "/dev/ttyS1"
|
||||||
#define SPECIAL9M_HIGHVOLTAGE_BUFFERSIZE (16)
|
#define SPECIAL9M_HIGHVOLTAGE_BUFFERSIZE (16)
|
||||||
#define DEFAULT_UDP_SOURCE_PORT (0xE185)
|
#define DEFAULT_UDP_SOURCE_PORT (0xE185)
|
||||||
@ -55,8 +89,8 @@ enum CLKINDEX {RUN_CLK, NUM_CLOCKS};
|
|||||||
#define DEFAULT_NUM_FRAMES (1)
|
#define DEFAULT_NUM_FRAMES (1)
|
||||||
#define DEFAULT_STARTING_FRAME_NUMBER (1)
|
#define DEFAULT_STARTING_FRAME_NUMBER (1)
|
||||||
#define DEFAULT_NUM_CYCLES (1)
|
#define DEFAULT_NUM_CYCLES (1)
|
||||||
#define DEFAULT_EXPTIME (1E9) //ns
|
#define DEFAULT_EXPTIME (1E9) // ns
|
||||||
#define DEFAULT_PERIOD (1E9) //ns
|
#define DEFAULT_PERIOD (1E9) // ns
|
||||||
#define DEFAULT_DELAY (0)
|
#define DEFAULT_DELAY (0)
|
||||||
#define DEFAULT_HIGH_VOLTAGE (0)
|
#define DEFAULT_HIGH_VOLTAGE (0)
|
||||||
#define DEFAULT_SETTINGS (DYNAMICGAIN)
|
#define DEFAULT_SETTINGS (DYNAMICGAIN)
|
||||||
@ -73,7 +107,7 @@ enum CLKINDEX {RUN_CLK, NUM_CLOCKS};
|
|||||||
#define DEFAULT_PHOTON_ENERGY (-1)
|
#define DEFAULT_PHOTON_ENERGY (-1)
|
||||||
#define DEFAULT_RATE_CORRECTION (0)
|
#define DEFAULT_RATE_CORRECTION (0)
|
||||||
#define DEFAULT_EXT_GATING_ENABLE (0)
|
#define DEFAULT_EXT_GATING_ENABLE (0)
|
||||||
#define DEFAULT_EXT_GATING_POLARITY (1) //positive
|
#define DEFAULT_EXT_GATING_POLARITY (1) // positive
|
||||||
#define DEFAULT_TEST_MODE (0)
|
#define DEFAULT_TEST_MODE (0)
|
||||||
#define DEFAULT_HIGH_VOLTAGE (0)
|
#define DEFAULT_HIGH_VOLTAGE (0)
|
||||||
|
|
||||||
@ -86,12 +120,14 @@ enum CLKINDEX {RUN_CLK, NUM_CLOCKS};
|
|||||||
|
|
||||||
#define DAC_MIN_MV (0)
|
#define DAC_MIN_MV (0)
|
||||||
#define DAC_MAX_MV (2048)
|
#define DAC_MAX_MV (2048)
|
||||||
#define LTC2620_MIN_VAL (0) // including LTC defines instead of LTC262.h (includes bit banging and blackfin read and write)
|
#define LTC2620_MIN_VAL \
|
||||||
|
(0) // including LTC defines instead of LTC262.h (includes bit banging and
|
||||||
|
// blackfin read and write)
|
||||||
#define LTC2620_MAX_VAL (4095) // 12 bits
|
#define LTC2620_MAX_VAL (4095) // 12 bits
|
||||||
#define DAC_MAX_STEPS (4096)
|
#define DAC_MAX_STEPS (4096)
|
||||||
|
|
||||||
#define MAX_SUBFRAME_EXPOSURE_VAL_IN_10NS (0x1FFFFFFF) /** 29 bit register for max subframe exposure value */
|
#define MAX_SUBFRAME_EXPOSURE_VAL_IN_10NS \
|
||||||
|
(0x1FFFFFFF) /** 29 bit register for max subframe exposure value */
|
||||||
|
|
||||||
#define SLAVE_HIGH_VOLTAGE_READ_VAL (-999)
|
#define SLAVE_HIGH_VOLTAGE_READ_VAL (-999)
|
||||||
#define HIGH_VOLTAGE_TOLERANCE (5)
|
#define HIGH_VOLTAGE_TOLERANCE (5)
|
||||||
|
|
||||||
|
8
slsDetectorServers/eigerDetectorServer/xfs_types.h
Executable file → Normal file
8
slsDetectorServers/eigerDetectorServer/xfs_types.h
Executable file → Normal file
@ -14,10 +14,8 @@ typedef signed int xfs_i32;
|
|||||||
typedef signed short xfs_i16;
|
typedef signed short xfs_i16;
|
||||||
typedef signed char xfs_i8;
|
typedef signed char xfs_i8;
|
||||||
|
|
||||||
|
|
||||||
// UDP Header
|
// UDP Header
|
||||||
struct udp_header_type
|
struct udp_header_type {
|
||||||
{
|
|
||||||
// ethternet frame (14 byte)
|
// ethternet frame (14 byte)
|
||||||
uint8_t dst_mac[6];
|
uint8_t dst_mac[6];
|
||||||
uint8_t src_mac[6];
|
uint8_t src_mac[6];
|
||||||
@ -41,8 +39,4 @@ struct udp_header_type
|
|||||||
uint8_t dst_port[2];
|
uint8_t dst_port[2];
|
||||||
uint8_t udp_message_len[2];
|
uint8_t udp_message_len[2];
|
||||||
uint8_t udp_checksum[2];
|
uint8_t udp_checksum[2];
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
62
slsDetectorServers/eigerDetectorServer/xparameters.h
Executable file → Normal file
62
slsDetectorServers/eigerDetectorServer/xparameters.h
Executable file → Normal file
@ -1,4 +1,5 @@
|
|||||||
/* ONLY THOSE ARE USED IN THIS SOFTWARE. If one of those is modified in xilinx compilation, this file should be replaced with updated values
|
/* ONLY THOSE ARE USED IN THIS SOFTWARE. If one of those is modified in xilinx
|
||||||
|
compilation, this file should be replaced with updated values
|
||||||
XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_RIGHT_BASEADDR
|
XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_RIGHT_BASEADDR
|
||||||
XPAR_PLB_LL_FIFO_AURORA_RX4_TX1_RIGHT_BASEADDR
|
XPAR_PLB_LL_FIFO_AURORA_RX4_TX1_RIGHT_BASEADDR
|
||||||
XPAR_PLB_LL_FIFO_AURORA_RX4_TX1_LEFT_BASEADDR
|
XPAR_PLB_LL_FIFO_AURORA_RX4_TX1_LEFT_BASEADDR
|
||||||
@ -24,27 +25,22 @@ XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_BASEADDR
|
|||||||
|
|
||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
|
|
||||||
|
|
||||||
/* Definitions for peripheral BB_IO_SHIFT_REG_PPC440 */
|
/* Definitions for peripheral BB_IO_SHIFT_REG_PPC440 */
|
||||||
#define XPAR_BB_IO_SHIFT_REG_PPC440_BASEADDR 0xD3000000
|
#define XPAR_BB_IO_SHIFT_REG_PPC440_BASEADDR 0xD3000000
|
||||||
#define XPAR_BB_IO_SHIFT_REG_PPC440_HIGHADDR 0xD300FFFF
|
#define XPAR_BB_IO_SHIFT_REG_PPC440_HIGHADDR 0xD300FFFF
|
||||||
|
|
||||||
|
|
||||||
/* Definitions for peripheral EIGER_BEB_SYNCH_IO_PPC440 */
|
/* Definitions for peripheral EIGER_BEB_SYNCH_IO_PPC440 */
|
||||||
#define XPAR_EIGER_BEB_SYNCH_IO_PPC440_BASEADDR 0xD3100000
|
#define XPAR_EIGER_BEB_SYNCH_IO_PPC440_BASEADDR 0xD3100000
|
||||||
#define XPAR_EIGER_BEB_SYNCH_IO_PPC440_HIGHADDR 0xD310FFFF
|
#define XPAR_EIGER_BEB_SYNCH_IO_PPC440_HIGHADDR 0xD310FFFF
|
||||||
|
|
||||||
|
|
||||||
/* Definitions for peripheral PLB_BRAM_10G */
|
/* Definitions for peripheral PLB_BRAM_10G */
|
||||||
#define XPAR_PLB_BRAM_10G_MEM0_BASEADDR 0xD4100000
|
#define XPAR_PLB_BRAM_10G_MEM0_BASEADDR 0xD4100000
|
||||||
#define XPAR_PLB_BRAM_10G_MEM0_HIGHADDR 0xD410FFFF
|
#define XPAR_PLB_BRAM_10G_MEM0_HIGHADDR 0xD410FFFF
|
||||||
|
|
||||||
|
|
||||||
/* Definitions for peripheral PLB_BRAM_TEMAC */
|
/* Definitions for peripheral PLB_BRAM_TEMAC */
|
||||||
#define XPAR_PLB_BRAM_TEMAC_MEM0_BASEADDR 0xD4000000
|
#define XPAR_PLB_BRAM_TEMAC_MEM0_BASEADDR 0xD4000000
|
||||||
#define XPAR_PLB_BRAM_TEMAC_MEM0_HIGHADDR 0xD400FFFF
|
#define XPAR_PLB_BRAM_TEMAC_MEM0_HIGHADDR 0xD400FFFF
|
||||||
|
|
||||||
|
|
||||||
/* Definitions for peripheral PLB_GPIO_SYS */
|
/* Definitions for peripheral PLB_GPIO_SYS */
|
||||||
#define XPAR_PLB_GPIO_SYS_BASEADDR 0xD1000000
|
#define XPAR_PLB_GPIO_SYS_BASEADDR 0xD1000000
|
||||||
#define XPAR_PLB_GPIO_SYS_HIGHADDR 0xD100FFFF
|
#define XPAR_PLB_GPIO_SYS_HIGHADDR 0xD100FFFF
|
||||||
@ -52,12 +48,9 @@ XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_BASEADDR
|
|||||||
/** Command Generator */
|
/** Command Generator */
|
||||||
#define XPAR_CMD_GENERATOR 0xC5000000
|
#define XPAR_CMD_GENERATOR 0xC5000000
|
||||||
|
|
||||||
|
|
||||||
/** Version Numbers */
|
/** Version Numbers */
|
||||||
#define XPAR_VERSION 0xc6000000
|
#define XPAR_VERSION 0xc6000000
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Definitions for peripheral PLB_GPIO_TEST */
|
/* Definitions for peripheral PLB_GPIO_TEST */
|
||||||
#define XPAR_PLB_GPIO_TEST_BASEADDR 0xD1010000
|
#define XPAR_PLB_GPIO_TEST_BASEADDR 0xD1010000
|
||||||
#define XPAR_PLB_GPIO_TEST_HIGHADDR 0xD101FFFF
|
#define XPAR_PLB_GPIO_TEST_HIGHADDR 0xD101FFFF
|
||||||
@ -66,9 +59,6 @@ XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_BASEADDR
|
|||||||
#define UDP_HEADER_FRAME_NUMBER_LSB_OFST (0x0140)
|
#define UDP_HEADER_FRAME_NUMBER_LSB_OFST (0x0140)
|
||||||
#define UDP_HEADER_FRAME_NUMBER_MSB_OFST (0x0160)
|
#define UDP_HEADER_FRAME_NUMBER_MSB_OFST (0x0160)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Definitions for packet, frame and delay down counters */
|
/* Definitions for packet, frame and delay down counters */
|
||||||
#define XPAR_COUNTER_BASEADDR 0xD1020000
|
#define XPAR_COUNTER_BASEADDR 0xD1020000
|
||||||
#define XPAR_COUNTER_HIGHADDR 0xD102FFFF
|
#define XPAR_COUNTER_HIGHADDR 0xD102FFFF
|
||||||
@ -83,8 +73,6 @@ XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_BASEADDR
|
|||||||
#define UDP_HEADER_GET_FNUM_10G_RIGHT_LSB_OFST (0x00C4)
|
#define UDP_HEADER_GET_FNUM_10G_RIGHT_LSB_OFST (0x00C4)
|
||||||
#define UDP_HEADER_GET_FNUM_10G_RIGHT_MSB_OFST (0x00E4)
|
#define UDP_HEADER_GET_FNUM_10G_RIGHT_MSB_OFST (0x00E4)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Definitions for peripheral PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT */
|
/* Definitions for peripheral PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT */
|
||||||
#define XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_BASEADDR 0xC4100000
|
#define XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_BASEADDR 0xC4100000
|
||||||
#define XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_HIGHADDR 0xC410FFFF
|
#define XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_HIGHADDR 0xC410FFFF
|
||||||
@ -92,46 +80,37 @@ XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_BASEADDR
|
|||||||
/* Definitions for a new memory */
|
/* Definitions for a new memory */
|
||||||
//#define XPAR_PLB_LL_NEW_MEMORY 0xD1000000//0xD1000084//0xC4200000
|
//#define XPAR_PLB_LL_NEW_MEMORY 0xD1000000//0xD1000084//0xC4200000
|
||||||
|
|
||||||
|
|
||||||
/* Definitions for peripheral PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_RIGHT */
|
/* Definitions for peripheral PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_RIGHT */
|
||||||
#define XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_RIGHT_BASEADDR 0xC4110000
|
#define XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_RIGHT_BASEADDR 0xC4110000
|
||||||
#define XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_RIGHT_HIGHADDR 0xC411FFFF
|
#define XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_RIGHT_HIGHADDR 0xC411FFFF
|
||||||
|
|
||||||
|
|
||||||
/* Definitions for peripheral PLB_LL_FIFO_AURORA_RX4_TX1_LEFT */
|
/* Definitions for peripheral PLB_LL_FIFO_AURORA_RX4_TX1_LEFT */
|
||||||
#define XPAR_PLB_LL_FIFO_AURORA_RX4_TX1_LEFT_BASEADDR 0xC4120000
|
#define XPAR_PLB_LL_FIFO_AURORA_RX4_TX1_LEFT_BASEADDR 0xC4120000
|
||||||
#define XPAR_PLB_LL_FIFO_AURORA_RX4_TX1_LEFT_HIGHADDR 0xC412FFFF
|
#define XPAR_PLB_LL_FIFO_AURORA_RX4_TX1_LEFT_HIGHADDR 0xC412FFFF
|
||||||
|
|
||||||
|
|
||||||
/* Definitions for peripheral PLB_LL_FIFO_AURORA_RX4_TX1_RIGHT */
|
/* Definitions for peripheral PLB_LL_FIFO_AURORA_RX4_TX1_RIGHT */
|
||||||
#define XPAR_PLB_LL_FIFO_AURORA_RX4_TX1_RIGHT_BASEADDR 0xC4130000
|
#define XPAR_PLB_LL_FIFO_AURORA_RX4_TX1_RIGHT_BASEADDR 0xC4130000
|
||||||
#define XPAR_PLB_LL_FIFO_AURORA_RX4_TX1_RIGHT_HIGHADDR 0xC413FFFF
|
#define XPAR_PLB_LL_FIFO_AURORA_RX4_TX1_RIGHT_HIGHADDR 0xC413FFFF
|
||||||
|
|
||||||
|
|
||||||
/* Definitions for peripheral PLB_LL_FIFO_XAUI_10G */
|
/* Definitions for peripheral PLB_LL_FIFO_XAUI_10G */
|
||||||
#define XPAR_PLB_LL_FIFO_XAUI_10G_BASEADDR 0xC4140000
|
#define XPAR_PLB_LL_FIFO_XAUI_10G_BASEADDR 0xC4140000
|
||||||
#define XPAR_PLB_LL_FIFO_XAUI_10G_HIGHADDR 0xC414FFFF
|
#define XPAR_PLB_LL_FIFO_XAUI_10G_HIGHADDR 0xC414FFFF
|
||||||
|
|
||||||
|
|
||||||
/* Definitions for peripheral PLB_V46_CPU_TO_PLB_V46_BRIDGED */
|
/* Definitions for peripheral PLB_V46_CPU_TO_PLB_V46_BRIDGED */
|
||||||
#define XPAR_PLB_V46_CPU_TO_PLB_V46_BRIDGED_BRIDGE_BASEADDR 0xCFFF0000
|
#define XPAR_PLB_V46_CPU_TO_PLB_V46_BRIDGED_BRIDGE_BASEADDR 0xCFFF0000
|
||||||
#define XPAR_PLB_V46_CPU_TO_PLB_V46_BRIDGED_BRIDGE_HIGHADDR 0xCFFFFFFF
|
#define XPAR_PLB_V46_CPU_TO_PLB_V46_BRIDGED_BRIDGE_HIGHADDR 0xCFFFFFFF
|
||||||
#define XPAR_PLB_V46_CPU_TO_PLB_V46_BRIDGED_RNG0_BASEADDR 0xD0000000
|
#define XPAR_PLB_V46_CPU_TO_PLB_V46_BRIDGED_RNG0_BASEADDR 0xD0000000
|
||||||
#define XPAR_PLB_V46_CPU_TO_PLB_V46_BRIDGED_RNG0_HIGHADDR 0xDFFFFFFF
|
#define XPAR_PLB_V46_CPU_TO_PLB_V46_BRIDGED_RNG0_HIGHADDR 0xDFFFFFFF
|
||||||
|
|
||||||
|
|
||||||
/* Definitions for peripheral PPC_SRAM */
|
/* Definitions for peripheral PPC_SRAM */
|
||||||
#define XPAR_PPC_SRAM_BASEADDR 0x00000000
|
#define XPAR_PPC_SRAM_BASEADDR 0x00000000
|
||||||
#define XPAR_PPC_SRAM_HIGHADDR 0x01FFFFFF
|
#define XPAR_PPC_SRAM_HIGHADDR 0x01FFFFFF
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
|
|
||||||
|
|
||||||
/* Definitions for peripheral PFLASH */
|
/* Definitions for peripheral PFLASH */
|
||||||
#define XPAR_PFLASH_NUM_BANKS_MEM 1
|
#define XPAR_PFLASH_NUM_BANKS_MEM 1
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
|
|
||||||
/* Definitions for peripheral PFLASH */
|
/* Definitions for peripheral PFLASH */
|
||||||
@ -155,13 +134,11 @@ XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_BASEADDR
|
|||||||
#define XPAR_PLB_SHT1X_IF_CH1_BASEADDR 0xD2200000
|
#define XPAR_PLB_SHT1X_IF_CH1_BASEADDR 0xD2200000
|
||||||
#define XPAR_PLB_SHT1X_IF_CH1_HIGHADDR 0xD220FFFF
|
#define XPAR_PLB_SHT1X_IF_CH1_HIGHADDR 0xD220FFFF
|
||||||
|
|
||||||
|
|
||||||
/* Definitions for peripheral PLB_SHT1X_IF_CH2 */
|
/* Definitions for peripheral PLB_SHT1X_IF_CH2 */
|
||||||
#define XPAR_PLB_SHT1X_IF_CH2_DEVICE_ID 1
|
#define XPAR_PLB_SHT1X_IF_CH2_DEVICE_ID 1
|
||||||
#define XPAR_PLB_SHT1X_IF_CH2_BASEADDR 0xD2210000
|
#define XPAR_PLB_SHT1X_IF_CH2_BASEADDR 0xD2210000
|
||||||
#define XPAR_PLB_SHT1X_IF_CH2_HIGHADDR 0xD221FFFF
|
#define XPAR_PLB_SHT1X_IF_CH2_HIGHADDR 0xD221FFFF
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
|
|
||||||
/* Definitions for driver UARTLITE */
|
/* Definitions for driver UARTLITE */
|
||||||
@ -176,10 +153,8 @@ XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_BASEADDR
|
|||||||
#define XPAR_RS232_ODD_PARITY 0
|
#define XPAR_RS232_ODD_PARITY 0
|
||||||
#define XPAR_RS232_DATA_BITS 8
|
#define XPAR_RS232_DATA_BITS 8
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
|
|
||||||
|
|
||||||
/* Canonical definitions for peripheral RS232 */
|
/* Canonical definitions for peripheral RS232 */
|
||||||
#define XPAR_UARTLITE_0_DEVICE_ID XPAR_RS232_DEVICE_ID
|
#define XPAR_UARTLITE_0_DEVICE_ID XPAR_RS232_DEVICE_ID
|
||||||
#define XPAR_UARTLITE_0_BASEADDR 0xC0000000
|
#define XPAR_UARTLITE_0_BASEADDR 0xC0000000
|
||||||
@ -190,7 +165,6 @@ XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_BASEADDR
|
|||||||
#define XPAR_UARTLITE_0_DATA_BITS 8
|
#define XPAR_UARTLITE_0_DATA_BITS 8
|
||||||
#define XPAR_UARTLITE_0_SIO_CHAN 1
|
#define XPAR_UARTLITE_0_SIO_CHAN 1
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
|
|
||||||
/* Definitions for driver SPI */
|
/* Definitions for driver SPI */
|
||||||
@ -205,7 +179,6 @@ XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_BASEADDR
|
|||||||
#define XPAR_SPI_FLASH_NUM_SS_BITS 1
|
#define XPAR_SPI_FLASH_NUM_SS_BITS 1
|
||||||
#define XPAR_SPI_FLASH_NUM_TRANSFER_BITS 8
|
#define XPAR_SPI_FLASH_NUM_TRANSFER_BITS 8
|
||||||
|
|
||||||
|
|
||||||
/* Definitions for peripheral XPS_SPI_FEB_CFG */
|
/* Definitions for peripheral XPS_SPI_FEB_CFG */
|
||||||
#define XPAR_XPS_SPI_FEB_CFG_DEVICE_ID 1
|
#define XPAR_XPS_SPI_FEB_CFG_DEVICE_ID 1
|
||||||
#define XPAR_XPS_SPI_FEB_CFG_BASEADDR 0xD2010000
|
#define XPAR_XPS_SPI_FEB_CFG_BASEADDR 0xD2010000
|
||||||
@ -215,10 +188,8 @@ XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_BASEADDR
|
|||||||
#define XPAR_XPS_SPI_FEB_CFG_NUM_SS_BITS 2
|
#define XPAR_XPS_SPI_FEB_CFG_NUM_SS_BITS 2
|
||||||
#define XPAR_XPS_SPI_FEB_CFG_NUM_TRANSFER_BITS 8
|
#define XPAR_XPS_SPI_FEB_CFG_NUM_TRANSFER_BITS 8
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
|
|
||||||
|
|
||||||
/* Canonical definitions for peripheral SPI_FLASH */
|
/* Canonical definitions for peripheral SPI_FLASH */
|
||||||
#define XPAR_SPI_0_DEVICE_ID XPAR_SPI_FLASH_DEVICE_ID
|
#define XPAR_SPI_0_DEVICE_ID XPAR_SPI_FLASH_DEVICE_ID
|
||||||
#define XPAR_SPI_0_BASEADDR 0xD2000000
|
#define XPAR_SPI_0_BASEADDR 0xD2000000
|
||||||
@ -228,7 +199,6 @@ XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_BASEADDR
|
|||||||
#define XPAR_SPI_0_NUM_SS_BITS 1
|
#define XPAR_SPI_0_NUM_SS_BITS 1
|
||||||
#define XPAR_SPI_0_NUM_TRANSFER_BITS 8
|
#define XPAR_SPI_0_NUM_TRANSFER_BITS 8
|
||||||
|
|
||||||
|
|
||||||
/* Canonical definitions for peripheral XPS_SPI_FEB_CFG */
|
/* Canonical definitions for peripheral XPS_SPI_FEB_CFG */
|
||||||
#define XPAR_SPI_1_DEVICE_ID XPAR_XPS_SPI_FEB_CFG_DEVICE_ID
|
#define XPAR_SPI_1_DEVICE_ID XPAR_XPS_SPI_FEB_CFG_DEVICE_ID
|
||||||
#define XPAR_SPI_1_BASEADDR 0xD2010000
|
#define XPAR_SPI_1_BASEADDR 0xD2010000
|
||||||
@ -238,7 +208,6 @@ XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_BASEADDR
|
|||||||
#define XPAR_SPI_1_NUM_SS_BITS 2
|
#define XPAR_SPI_1_NUM_SS_BITS 2
|
||||||
#define XPAR_SPI_1_NUM_TRANSFER_BITS 8
|
#define XPAR_SPI_1_NUM_TRANSFER_BITS 8
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
|
|
||||||
/* Definitions for driver LLTEMAC */
|
/* Definitions for driver LLTEMAC */
|
||||||
@ -275,23 +244,18 @@ XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_BASEADDR
|
|||||||
#define XPAR_LLTEMAC_0_MCAST_EXTEND 0
|
#define XPAR_LLTEMAC_0_MCAST_EXTEND 0
|
||||||
#define XPAR_LLTEMAC_0_INTR 1
|
#define XPAR_LLTEMAC_0_INTR 1
|
||||||
|
|
||||||
|
|
||||||
/* LocalLink TYPE Enumerations */
|
/* LocalLink TYPE Enumerations */
|
||||||
#define XPAR_LL_FIFO 1
|
#define XPAR_LL_FIFO 1
|
||||||
#define XPAR_LL_DMA 2
|
#define XPAR_LL_DMA 2
|
||||||
|
|
||||||
|
|
||||||
/* Canonical LocalLink parameters for TEMAC_INST */
|
/* Canonical LocalLink parameters for TEMAC_INST */
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
|
|
||||||
|
|
||||||
/* Definitions for peripheral XPS_BRAM_IF_CNTLR_PPC440 */
|
/* Definitions for peripheral XPS_BRAM_IF_CNTLR_PPC440 */
|
||||||
#define XPAR_XPS_BRAM_IF_CNTLR_PPC440_BASEADDR 0xFFFC0000
|
#define XPAR_XPS_BRAM_IF_CNTLR_PPC440_BASEADDR 0xFFFC0000
|
||||||
#define XPAR_XPS_BRAM_IF_CNTLR_PPC440_HIGHADDR 0xFFFFFFFF
|
#define XPAR_XPS_BRAM_IF_CNTLR_PPC440_HIGHADDR 0xFFFFFFFF
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
|
|
||||||
#define XPAR_INTC_MAX_NUM_INTR_INPUTS 5
|
#define XPAR_INTC_MAX_NUM_INTR_INPUTS 5
|
||||||
@ -306,7 +270,6 @@ XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_BASEADDR
|
|||||||
#define XPAR_XPS_INTC_PPC440_HIGHADDR 0xC100FFFF
|
#define XPAR_XPS_INTC_PPC440_HIGHADDR 0xC100FFFF
|
||||||
#define XPAR_XPS_INTC_PPC440_KIND_OF_INTR 0xFFFFFFF4
|
#define XPAR_XPS_INTC_PPC440_KIND_OF_INTR 0xFFFFFFF4
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
|
|
||||||
#define XPAR_INTC_SINGLE_BASEADDR 0xC1000000
|
#define XPAR_INTC_SINGLE_BASEADDR 0xC1000000
|
||||||
@ -331,10 +294,14 @@ XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_BASEADDR
|
|||||||
#define XPAR_INTC_0_HIGHADDR 0xC100FFFF
|
#define XPAR_INTC_0_HIGHADDR 0xC100FFFF
|
||||||
#define XPAR_INTC_0_KIND_OF_INTR 0xFFFFFFF4
|
#define XPAR_INTC_0_KIND_OF_INTR 0xFFFFFFF4
|
||||||
|
|
||||||
#define XPAR_INTC_0_LLFIFO_0_VEC_ID XPAR_XPS_INTC_PPC440_XPS_LL_FIFO_TEMAC_IP2INTC_IRPT_INTR
|
#define XPAR_INTC_0_LLFIFO_0_VEC_ID \
|
||||||
#define XPAR_INTC_0_LLTEMAC_0_VEC_ID XPAR_XPS_INTC_PPC440_TEMAC_INST_TEMACINTC0_IRPT_INTR
|
XPAR_XPS_INTC_PPC440_XPS_LL_FIFO_TEMAC_IP2INTC_IRPT_INTR
|
||||||
#define XPAR_INTC_0_TMRCTR_0_VEC_ID XPAR_XPS_INTC_PPC440_XPS_TIMER_PPC440_INTERRUPT_INTR
|
#define XPAR_INTC_0_LLTEMAC_0_VEC_ID \
|
||||||
#define XPAR_INTC_0_SPI_0_VEC_ID XPAR_XPS_INTC_PPC440_SPI_FLASH_IP2INTC_IRPT_INTR
|
XPAR_XPS_INTC_PPC440_TEMAC_INST_TEMACINTC0_IRPT_INTR
|
||||||
|
#define XPAR_INTC_0_TMRCTR_0_VEC_ID \
|
||||||
|
XPAR_XPS_INTC_PPC440_XPS_TIMER_PPC440_INTERRUPT_INTR
|
||||||
|
#define XPAR_INTC_0_SPI_0_VEC_ID \
|
||||||
|
XPAR_XPS_INTC_PPC440_SPI_FLASH_IP2INTC_IRPT_INTR
|
||||||
#define XPAR_INTC_0_UARTLITE_0_VEC_ID XPAR_XPS_INTC_PPC440_RS232_INTERRUPT_INTR
|
#define XPAR_INTC_0_UARTLITE_0_VEC_ID XPAR_XPS_INTC_PPC440_RS232_INTERRUPT_INTR
|
||||||
|
|
||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
@ -347,7 +314,6 @@ XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_BASEADDR
|
|||||||
#define XPAR_XPS_LL_FIFO_TEMAC_BASEADDR 0xC4000000
|
#define XPAR_XPS_LL_FIFO_TEMAC_BASEADDR 0xC4000000
|
||||||
#define XPAR_XPS_LL_FIFO_TEMAC_HIGHADDR 0xC400FFFF
|
#define XPAR_XPS_LL_FIFO_TEMAC_HIGHADDR 0xC400FFFF
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
|
|
||||||
/* Canonical definitions for peripheral XPS_LL_FIFO_TEMAC */
|
/* Canonical definitions for peripheral XPS_LL_FIFO_TEMAC */
|
||||||
@ -355,7 +321,6 @@ XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_BASEADDR
|
|||||||
#define XPAR_LLFIFO_0_BASEADDR 0xC4000000
|
#define XPAR_LLFIFO_0_BASEADDR 0xC4000000
|
||||||
#define XPAR_LLFIFO_0_HIGHADDR 0xC400FFFF
|
#define XPAR_LLFIFO_0_HIGHADDR 0xC400FFFF
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
|
|
||||||
/* Definitions for driver SYSMON */
|
/* Definitions for driver SYSMON */
|
||||||
@ -367,17 +332,14 @@ XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_BASEADDR
|
|||||||
#define XPAR_XPS_SYSMON_ADC_PPC440_HIGHADDR 0xD001FFFF
|
#define XPAR_XPS_SYSMON_ADC_PPC440_HIGHADDR 0xD001FFFF
|
||||||
#define XPAR_XPS_SYSMON_ADC_PPC440_INCLUDE_INTR 1
|
#define XPAR_XPS_SYSMON_ADC_PPC440_INCLUDE_INTR 1
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
|
|
||||||
|
|
||||||
/* Canonical definitions for peripheral XPS_SYSMON_ADC_PPC440 */
|
/* Canonical definitions for peripheral XPS_SYSMON_ADC_PPC440 */
|
||||||
#define XPAR_SYSMON_0_DEVICE_ID XPAR_XPS_SYSMON_ADC_PPC440_DEVICE_ID
|
#define XPAR_SYSMON_0_DEVICE_ID XPAR_XPS_SYSMON_ADC_PPC440_DEVICE_ID
|
||||||
#define XPAR_SYSMON_0_BASEADDR 0xD0010000
|
#define XPAR_SYSMON_0_BASEADDR 0xD0010000
|
||||||
#define XPAR_SYSMON_0_HIGHADDR 0xD001FFFF
|
#define XPAR_SYSMON_0_HIGHADDR 0xD001FFFF
|
||||||
#define XPAR_SYSMON_0_INCLUDE_INTR 1
|
#define XPAR_SYSMON_0_INCLUDE_INTR 1
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
|
|
||||||
/* Definitions for driver TMRCTR */
|
/* Definitions for driver TMRCTR */
|
||||||
@ -388,16 +350,13 @@ XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_BASEADDR
|
|||||||
#define XPAR_XPS_TIMER_PPC440_BASEADDR 0xC2000000
|
#define XPAR_XPS_TIMER_PPC440_BASEADDR 0xC2000000
|
||||||
#define XPAR_XPS_TIMER_PPC440_HIGHADDR 0xC200FFFF
|
#define XPAR_XPS_TIMER_PPC440_HIGHADDR 0xC200FFFF
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
|
|
||||||
|
|
||||||
/* Canonical definitions for peripheral XPS_TIMER_PPC440 */
|
/* Canonical definitions for peripheral XPS_TIMER_PPC440 */
|
||||||
#define XPAR_TMRCTR_0_DEVICE_ID XPAR_XPS_TIMER_PPC440_DEVICE_ID
|
#define XPAR_TMRCTR_0_DEVICE_ID XPAR_XPS_TIMER_PPC440_DEVICE_ID
|
||||||
#define XPAR_TMRCTR_0_BASEADDR 0xC2000000
|
#define XPAR_TMRCTR_0_BASEADDR 0xC2000000
|
||||||
#define XPAR_TMRCTR_0_HIGHADDR 0xC200FFFF
|
#define XPAR_TMRCTR_0_HIGHADDR 0xC200FFFF
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
|
|
||||||
/* Definitions for bus frequencies */
|
/* Definitions for bus frequencies */
|
||||||
@ -553,4 +512,3 @@ XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_BASEADDR
|
|||||||
#define XPAR_PPC440_VIRTEX5_HW_VER "1.01.a"
|
#define XPAR_PPC440_VIRTEX5_HW_VER "1.01.a"
|
||||||
|
|
||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ target_compile_definitions(gotthard2DetectorServer_virtual
|
|||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(gotthard2DetectorServer_virtual
|
target_link_libraries(gotthard2DetectorServer_virtual
|
||||||
PUBLIC pthread rt slsProjectCWarnings
|
PUBLIC pthread rt slsProjectCSettings
|
||||||
)
|
)
|
||||||
|
|
||||||
set_target_properties(gotthard2DetectorServer_virtual PROPERTIES
|
set_target_properties(gotthard2DetectorServer_virtual PROPERTIES
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
// clang-format off
|
||||||
|
|
||||||
#define REG_OFFSET (4)
|
#define REG_OFFSET (4)
|
||||||
|
|
||||||
|
|
||||||
/* Base addresses 0x1804 0000 ---------------------------------------------*/
|
/* Base addresses 0x1804 0000 ---------------------------------------------*/
|
||||||
/* Reconfiguration core for readout pll */
|
/* Reconfiguration core for readout pll */
|
||||||
#define BASE_READOUT_PLL (0x0000) // 0x1804_0000 - 0x1804_07FF
|
#define BASE_READOUT_PLL (0x0000) // 0x1804_0000 - 0x1804_07FF
|
||||||
@ -40,8 +38,8 @@
|
|||||||
#define BASE_UDP_RAM (0x01000) // 0x1806_1000 - 0x1806_1FFF
|
#define BASE_UDP_RAM (0x01000) // 0x1806_1000 - 0x1806_1FFF
|
||||||
|
|
||||||
|
|
||||||
|
/* Clock Generation registers
|
||||||
/* Clock Generation registers ------------------------------------------------------*/
|
* ------------------------------------------------------*/
|
||||||
#define PLL_RESET_REG (0x00 * REG_OFFSET + BASE_CLK_GENERATION)
|
#define PLL_RESET_REG (0x00 * REG_OFFSET + BASE_CLK_GENERATION)
|
||||||
|
|
||||||
#define PLL_RESET_READOUT_OFST (0)
|
#define PLL_RESET_READOUT_OFST (0)
|
||||||
@ -49,8 +47,6 @@
|
|||||||
#define PLL_RESET_SYSTEM_OFST (1)
|
#define PLL_RESET_SYSTEM_OFST (1)
|
||||||
#define PLL_RESET_SYSTEM_MSK (0x00000001 << PLL_RESET_SYSTEM_OFST)
|
#define PLL_RESET_SYSTEM_MSK (0x00000001 << PLL_RESET_SYSTEM_OFST)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Control registers --------------------------------------------------*/
|
/* Control registers --------------------------------------------------*/
|
||||||
|
|
||||||
/* Module Control Board Serial Number register */
|
/* Module Control Board Serial Number register */
|
||||||
@ -72,8 +68,8 @@
|
|||||||
|
|
||||||
#define API_VERSION_OFST (0)
|
#define API_VERSION_OFST (0)
|
||||||
#define API_VERSION_MSK (0x00FFFFFF << API_VERSION_OFST)
|
#define API_VERSION_MSK (0x00FFFFFF << API_VERSION_OFST)
|
||||||
#define API_VERSION_DETECTOR_TYPE_OFST (24) //Not used in software
|
#define API_VERSION_DETECTOR_TYPE_OFST (24) // Not used in software
|
||||||
#define API_VERSION_DETECTOR_TYPE_MSK (0x000000FF << API_VERSION_DETECTOR_TYPE_OFST) //Not used in software
|
#define API_VERSION_DETECTOR_TYPE_MSK (0x000000FF << API_VERSION_DETECTOR_TYPE_OFST) // Not used in software
|
||||||
|
|
||||||
/* Fix pattern register */
|
/* Fix pattern register */
|
||||||
#define FIX_PATT_REG (0x03 * REG_OFFSET + BASE_CONTROL)
|
#define FIX_PATT_REG (0x03 * REG_OFFSET + BASE_CONTROL)
|
||||||
@ -91,6 +87,11 @@
|
|||||||
/* Config RW regiseter */
|
/* Config RW regiseter */
|
||||||
#define CONFIG_REG (0x20 * REG_OFFSET + BASE_CONTROL)
|
#define CONFIG_REG (0x20 * REG_OFFSET + BASE_CONTROL)
|
||||||
|
|
||||||
|
#define CONFIG_VETO_ENBL_OFST (0)
|
||||||
|
#define CONFIG_VETO_ENBL_MSK (0x00000001 << CONFIG_VETO_ENBL_OFST)
|
||||||
|
#define CONFIG_VETO_CH_10GB_ENBL_OFST (1)
|
||||||
|
#define CONFIG_VETO_CH_10GB_ENBL_MSK (0x00000001 << CONFIG_VETO_CH_10GB_ENBL_OFST)
|
||||||
|
|
||||||
/* Control RW register */
|
/* Control RW register */
|
||||||
#define CONTROL_REG (0x21 * REG_OFFSET + BASE_CONTROL)
|
#define CONTROL_REG (0x21 * REG_OFFSET + BASE_CONTROL)
|
||||||
|
|
||||||
@ -112,8 +113,6 @@
|
|||||||
/** DTA Offset Register */
|
/** DTA Offset Register */
|
||||||
#define DTA_OFFSET_REG (0x24 * REG_OFFSET + BASE_CONTROL)
|
#define DTA_OFFSET_REG (0x24 * REG_OFFSET + BASE_CONTROL)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* ASIC registers --------------------------------------------------*/
|
/* ASIC registers --------------------------------------------------*/
|
||||||
|
|
||||||
/* ASIC Config register */
|
/* ASIC Config register */
|
||||||
@ -151,8 +150,6 @@
|
|||||||
#define ASIC_INT_EXPTIME_LSB_REG (0x04 * REG_OFFSET + BASE_ASIC)
|
#define ASIC_INT_EXPTIME_LSB_REG (0x04 * REG_OFFSET + BASE_ASIC)
|
||||||
#define ASIC_INT_EXPTIME_MSB_REG (0x05 * REG_OFFSET + BASE_ASIC)
|
#define ASIC_INT_EXPTIME_MSB_REG (0x05 * REG_OFFSET + BASE_ASIC)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Packetizer -------------------------------------------------------------*/
|
/* Packetizer -------------------------------------------------------------*/
|
||||||
|
|
||||||
/* Packetizer Config Register */
|
/* Packetizer Config Register */
|
||||||
@ -177,7 +174,6 @@
|
|||||||
#define COORD_ID_OFST (16) // Not connected in firmware TODO
|
#define COORD_ID_OFST (16) // Not connected in firmware TODO
|
||||||
#define COORD_ID_MSK (0x0000FFFF << COORD_ID_OFST) // Not connected in firmware TODO
|
#define COORD_ID_MSK (0x0000FFFF << COORD_ID_OFST) // Not connected in firmware TODO
|
||||||
|
|
||||||
|
|
||||||
/* Flow control registers --------------------------------------------------*/
|
/* Flow control registers --------------------------------------------------*/
|
||||||
|
|
||||||
/* Flow status Register*/
|
/* Flow status Register*/
|
||||||
@ -216,7 +212,8 @@
|
|||||||
#define TIME_FROM_START_LSB_REG (0x0A * REG_OFFSET + BASE_FLOW_CONTROL)
|
#define TIME_FROM_START_LSB_REG (0x0A * REG_OFFSET + BASE_FLOW_CONTROL)
|
||||||
#define TIME_FROM_START_MSB_REG (0x0B * REG_OFFSET + BASE_FLOW_CONTROL)
|
#define TIME_FROM_START_MSB_REG (0x0B * REG_OFFSET + BASE_FLOW_CONTROL)
|
||||||
|
|
||||||
/* Get Frames from Start 64 bit register (frames from last reset using CONTROL_CRST) */
|
/* Get Frames from Start 64 bit register (frames from last reset using
|
||||||
|
* CONTROL_CRST) */
|
||||||
#define FRAMES_FROM_START_LSB_REG (0x0C * REG_OFFSET + BASE_FLOW_CONTROL)
|
#define FRAMES_FROM_START_LSB_REG (0x0C * REG_OFFSET + BASE_FLOW_CONTROL)
|
||||||
#define FRAMES_FROM_START_MSB_REG (0x0D * REG_OFFSET + BASE_FLOW_CONTROL)
|
#define FRAMES_FROM_START_MSB_REG (0x0D * REG_OFFSET + BASE_FLOW_CONTROL)
|
||||||
|
|
||||||
@ -249,3 +246,10 @@
|
|||||||
/* Trigger Delay 64 bit register */
|
/* Trigger Delay 64 bit register */
|
||||||
#define SET_TRIGGER_DELAY_LSB_REG (0x32 * REG_OFFSET + BASE_FLOW_CONTROL)
|
#define SET_TRIGGER_DELAY_LSB_REG (0x32 * REG_OFFSET + BASE_FLOW_CONTROL)
|
||||||
#define SET_TRIGGER_DELAY_MSB_REG (0x33 * REG_OFFSET + BASE_FLOW_CONTROL)
|
#define SET_TRIGGER_DELAY_MSB_REG (0x33 * REG_OFFSET + BASE_FLOW_CONTROL)
|
||||||
|
|
||||||
|
|
||||||
|
/* UDP datagram registers --------------------------------------------------*/
|
||||||
|
#define RXR_ENDPOINTS_MAX (32)
|
||||||
|
#define RXR_ENDPOINT_OFST (16 * REG_OFFSET)
|
||||||
|
|
||||||
|
// clang-format on
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -12,7 +12,7 @@
|
|||||||
#define NADC (32)
|
#define NADC (32)
|
||||||
#define ONCHIP_NDAC (7)
|
#define ONCHIP_NDAC (7)
|
||||||
#define DYNAMIC_RANGE (16)
|
#define DYNAMIC_RANGE (16)
|
||||||
#define HV_SOFT_MAX_VOLTAGE (200)
|
#define HV_SOFT_MAX_VOLTAGE (500)
|
||||||
#define HV_HARD_MAX_VOLTAGE (530)
|
#define HV_HARD_MAX_VOLTAGE (530)
|
||||||
#define HV_DRIVER_FILE_NAME ("/etc/devlinks/hvdac")
|
#define HV_DRIVER_FILE_NAME ("/etc/devlinks/hvdac")
|
||||||
#define DAC_DRIVER_FILE_NAME ("/etc/devlinks/dac")
|
#define DAC_DRIVER_FILE_NAME ("/etc/devlinks/dac")
|
||||||
@ -44,59 +44,79 @@
|
|||||||
#define DEFAULT_CURRENT_SOURCE (0)
|
#define DEFAULT_CURRENT_SOURCE (0)
|
||||||
#define DEFAULT_TIMING_SOURCE (TIMING_INTERNAL)
|
#define DEFAULT_TIMING_SOURCE (TIMING_INTERNAL)
|
||||||
|
|
||||||
#define DEFAULT_READOUT_C0 (144444448) // rdo_clk, 144 MHz
|
#define DEFAULT_READOUT_C0 (8) //(108333336) // rdo_clk, 108 MHz
|
||||||
#define DEFAULT_READOUT_C1 (144444448) // rdo_x2_clk, 144 MHz
|
#define DEFAULT_READOUT_C1 (8) //(108333336) // rdo_x2_clk, 108 MHz
|
||||||
#define DEFAULT_SYSTEM_C0 (144444448) // run_clk, 144 MHz
|
#define DEFAULT_SYSTEM_C0 (5) //(144444448) // run_clk, 144 MHz
|
||||||
#define DEFAULT_SYSTEM_C1 (72222224) // chip_clk, 72 MHz
|
#define DEFAULT_SYSTEM_C1 (10) //(72222224) // chip_clk, 72 MHz
|
||||||
#define DEFAULT_SYSTEM_C2 (18055556) // sync_clk, 18 MHz
|
#define DEFAULT_SYSTEM_C2 (5) //(144444448) // sync_clk, 144 MHz
|
||||||
#define DEFAULT_SYSTEM_C3 (144444448) // str_clk, 144 MHz
|
#define DEFAULT_SYSTEM_C3 (5) //(144444448) // str_clk, 144 MHz
|
||||||
|
|
||||||
/* Firmware Definitions */
|
/* Firmware Definitions */
|
||||||
#define IP_HEADER_SIZE (20)
|
|
||||||
#define FIXED_PLL_FREQUENCY (20000000) // 20MHz
|
#define FIXED_PLL_FREQUENCY (20000000) // 20MHz
|
||||||
#define INT_SYSTEM_C0_FREQUENCY (144000000) //144 MHz
|
#define INT_SYSTEM_C0_FREQUENCY (144000000) // 144 MHz
|
||||||
#define READOUT_PLL_VCO_FREQ_HZ (866666688) // 866 MHz
|
#define READOUT_PLL_VCO_FREQ_HZ (866666688) // 866 MHz
|
||||||
#define SYSTEM_PLL_VCO_FREQ_HZ (722222224) // 722 MHz
|
#define SYSTEM_PLL_VCO_FREQ_HZ (722222224) // 722 MHz
|
||||||
|
#define VETO_DATA_SIZE (160)
|
||||||
|
typedef struct {
|
||||||
|
uint64_t frameNumber;
|
||||||
|
uint64_t bunchId;
|
||||||
|
} veto_header;
|
||||||
|
|
||||||
/** Other Definitions */
|
/** Other Definitions */
|
||||||
#define BIT16_MASK (0xFFFF)
|
#define BIT16_MASK (0xFFFF)
|
||||||
|
|
||||||
/* Enums */
|
/* Enums */
|
||||||
enum DACINDEX {G2_VREF_H_ADC, /* 0 */ \
|
enum DACINDEX {
|
||||||
G2_DAC_UNUSED, /* 1 */ \
|
G2_VREF_H_ADC, /* 0 */
|
||||||
G2_VB_COMP_FE, /* 2 */ \
|
G2_DAC_UNUSED, /* 1 */
|
||||||
G2_VB_COMP_ADC, /* 3 */ \
|
G2_VB_COMP_FE, /* 2 */
|
||||||
G2_VCOM_CDS, /* 4 */ \
|
G2_VB_COMP_ADC, /* 3 */
|
||||||
G2_VREF_RSTORE,/* 5 */ \
|
G2_VCOM_CDS, /* 4 */
|
||||||
G2_VB_OPA_1ST, /* 6 */ \
|
G2_VREF_RSTORE, /* 5 */
|
||||||
G2_VREF_COMP_FE,/* 7 */ \
|
G2_VB_OPA_1ST, /* 6 */
|
||||||
G2_VCOM_ADC1, /* 8 */ \
|
G2_VREF_COMP_FE, /* 7 */
|
||||||
G2_VREF_PRECH, /* 9 */ \
|
G2_VCOM_ADC1, /* 8 */
|
||||||
G2_VREF_L_ADC, /* 10 */ \
|
G2_VREF_PRECH, /* 9 */
|
||||||
G2_VREF_CDS, /* 11 */ \
|
G2_VREF_L_ADC, /* 10 */
|
||||||
G2_VB_CS, /* 12 */ \
|
G2_VREF_CDS, /* 11 */
|
||||||
G2_VB_OPA_FD, /* 13 */ \
|
G2_VB_CS, /* 12 */
|
||||||
G2_DAC_UNUSED2, /* 14 */ \
|
G2_VB_OPA_FD, /* 13 */
|
||||||
G2_VCOM_ADC2 /* 15*/ \
|
G2_DAC_UNUSED2, /* 14 */
|
||||||
};
|
G2_VCOM_ADC2 /* 15*/
|
||||||
#define DAC_NAMES "vref_h_adc", "dac_unused", "vb_comp_fe", "vb_comp_adc", "vcom_cds", "vref_rstore", "vb_opa_1st", "vref_comp_fe", "vcom_adc1", "vref_prech", "vref_l_adc", "vref_cds", "vb_cs", "vb_opa_fd", "dac_unused2", "vcom_adc2"
|
};
|
||||||
|
#define DAC_NAMES \
|
||||||
|
"vref_h_adc", "dac_unused", "vb_comp_fe", "vb_comp_adc", "vcom_cds", \
|
||||||
|
"vref_rstore", "vb_opa_1st", "vref_comp_fe", "vcom_adc1", \
|
||||||
|
"vref_prech", "vref_l_adc", "vref_cds", "vb_cs", "vb_opa_fd", \
|
||||||
|
"dac_unused2", "vcom_adc2"
|
||||||
|
|
||||||
enum ONCHIP_DACINDEX {G2_VCHIP_COMP_FE, /* 0 */ \
|
enum ONCHIP_DACINDEX {
|
||||||
G2_VCHIP_OPA_1ST, /* 1 */ \
|
G2_VCHIP_COMP_FE, /* 0 */
|
||||||
G2_VCHIP_OPA_FD, /* 2 */ \
|
G2_VCHIP_OPA_1ST, /* 1 */
|
||||||
G2_VCHIP_COMP_ADC, /* 3 */ \
|
G2_VCHIP_OPA_FD, /* 2 */
|
||||||
G2_VCHIP_UNUSED, /* 4 */ \
|
G2_VCHIP_COMP_ADC, /* 3 */
|
||||||
G2_VCHIP_REF_COMP_FE, /* 5 */ \
|
G2_VCHIP_UNUSED, /* 4 */
|
||||||
G2_VCHIP_CS /* 6 */ \
|
G2_VCHIP_REF_COMP_FE, /* 5 */
|
||||||
};
|
G2_VCHIP_CS /* 6 */
|
||||||
#define ONCHIP_DAC_NAMES "vchip_comp_fe", "vchip_opa_1st", "vchip_opa_fd", "vchip_comp_adc", "vchip_unused", "vchip_ref_comp_fe", "vchip_cs"
|
};
|
||||||
|
#define ONCHIP_DAC_NAMES \
|
||||||
|
"vchip_comp_fe", "vchip_opa_1st", "vchip_opa_fd", "vchip_comp_adc", \
|
||||||
|
"vchip_unused", "vchip_ref_comp_fe", "vchip_cs"
|
||||||
|
|
||||||
|
enum CLKINDEX {
|
||||||
|
READOUT_C0,
|
||||||
|
READOUT_C1,
|
||||||
|
SYSTEM_C0,
|
||||||
|
SYSTEM_C1,
|
||||||
|
SYSTEM_C2,
|
||||||
|
SYSTEM_C3,
|
||||||
|
NUM_CLOCKS
|
||||||
|
};
|
||||||
|
#define CLK_NAMES \
|
||||||
|
"READOUT_C0", "READOUT_C1", "SYSTEM_C0", "SYSTEM_C1", "SYSTEM_C2", \
|
||||||
|
"SYSTEM_C3"
|
||||||
|
|
||||||
enum CLKINDEX {READOUT_C0, READOUT_C1, SYSTEM_C0, SYSTEM_C1, SYSTEM_C2, SYSTEM_C3, NUM_CLOCKS};
|
enum PLLINDEX { READOUT_PLL, SYSTEM_PLL };
|
||||||
#define CLK_NAMES "READOUT_C0", "READOUT_C1", "SYSTEM_C0", "SYSTEM_C1", "SYSTEM_C2", "SYSTEM_C3"
|
|
||||||
|
|
||||||
enum PLLINDEX {READOUT_PLL, SYSTEM_PLL};
|
|
||||||
|
|
||||||
|
|
||||||
/** Chip Definitions */
|
/** Chip Definitions */
|
||||||
#define ASIC_ADDR_MAX_BITS (4)
|
#define ASIC_ADDR_MAX_BITS (4)
|
||||||
@ -124,13 +144,13 @@ typedef struct udp_header_struct {
|
|||||||
uint16_t udp_destmac_lsb;
|
uint16_t udp_destmac_lsb;
|
||||||
uint32_t udp_srcmac_lsb;
|
uint32_t udp_srcmac_lsb;
|
||||||
uint8_t ip_tos;
|
uint8_t ip_tos;
|
||||||
uint8_t ip_ihl: 4, ip_ver: 4;
|
uint8_t ip_ihl : 4, ip_ver : 4;
|
||||||
uint16_t udp_ethertype;
|
uint16_t udp_ethertype;
|
||||||
uint16_t ip_identification;
|
uint16_t ip_identification;
|
||||||
uint16_t ip_totallength;
|
uint16_t ip_totallength;
|
||||||
uint8_t ip_protocol;
|
uint8_t ip_protocol;
|
||||||
uint8_t ip_ttl;
|
uint8_t ip_ttl;
|
||||||
uint16_t ip_fragmentoffset: 13, ip_flags: 3;
|
uint16_t ip_fragmentoffset : 13, ip_flags : 3;
|
||||||
uint16_t ip_srcip_msb;
|
uint16_t ip_srcip_msb;
|
||||||
uint16_t ip_checksum;
|
uint16_t ip_checksum;
|
||||||
uint16_t ip_destip_msb;
|
uint16_t ip_destip_msb;
|
||||||
@ -140,4 +160,5 @@ typedef struct udp_header_struct {
|
|||||||
uint16_t udp_checksum;
|
uint16_t udp_checksum;
|
||||||
uint16_t udp_destport;
|
uint16_t udp_destport;
|
||||||
} udp_header;
|
} udp_header;
|
||||||
|
#define IP_HEADER_SIZE (20)
|
||||||
#define UDP_IP_HEADER_LENGTH_BYTES (28)
|
#define UDP_IP_HEADER_LENGTH_BYTES (28)
|
@ -27,7 +27,7 @@ target_compile_definitions(gotthardDetectorServer_virtual
|
|||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(gotthardDetectorServer_virtual
|
target_link_libraries(gotthardDetectorServer_virtual
|
||||||
PUBLIC pthread rt slsProjectCWarnings
|
PUBLIC pthread rt slsProjectCSettings
|
||||||
)
|
)
|
||||||
|
|
||||||
set_target_properties(gotthardDetectorServer_virtual PROPERTIES
|
set_target_properties(gotthardDetectorServer_virtual PROPERTIES
|
||||||
|
69
slsDetectorServers/gotthardDetectorServer/RegisterDefs.h
Executable file → Normal file
69
slsDetectorServers/gotthardDetectorServer/RegisterDefs.h
Executable file → Normal file
@ -8,11 +8,16 @@
|
|||||||
|
|
||||||
#define GAIN_CONFGAIN_OFST (0)
|
#define GAIN_CONFGAIN_OFST (0)
|
||||||
#define GAIN_CONFGAIN_MSK (0x000000FF << GAIN_CONFGAIN_OFST)
|
#define GAIN_CONFGAIN_MSK (0x000000FF << GAIN_CONFGAIN_OFST)
|
||||||
#define GAIN_CONFGAIN_HGH_GAIN_VAL ((0x0 << GAIN_CONFGAIN_OFST) & GAIN_CONFGAIN_MSK)
|
#define GAIN_CONFGAIN_HGH_GAIN_VAL \
|
||||||
#define GAIN_CONFGAIN_DYNMC_GAIN_VAL ((0x8 << GAIN_CONFGAIN_OFST) & GAIN_CONFGAIN_MSK)
|
((0x0 << GAIN_CONFGAIN_OFST) & GAIN_CONFGAIN_MSK)
|
||||||
#define GAIN_CONFGAIN_LW_GAIN_VAL ((0x6 << GAIN_CONFGAIN_OFST) & GAIN_CONFGAIN_MSK)
|
#define GAIN_CONFGAIN_DYNMC_GAIN_VAL \
|
||||||
#define GAIN_CONFGAIN_MDM_GAIN_VAL ((0x2 << GAIN_CONFGAIN_OFST) & GAIN_CONFGAIN_MSK)
|
((0x8 << GAIN_CONFGAIN_OFST) & GAIN_CONFGAIN_MSK)
|
||||||
#define GAIN_CONFGAIN_VRY_HGH_GAIN_VAL ((0x1 << GAIN_CONFGAIN_OFST) & GAIN_CONFGAIN_MSK)
|
#define GAIN_CONFGAIN_LW_GAIN_VAL \
|
||||||
|
((0x6 << GAIN_CONFGAIN_OFST) & GAIN_CONFGAIN_MSK)
|
||||||
|
#define GAIN_CONFGAIN_MDM_GAIN_VAL \
|
||||||
|
((0x2 << GAIN_CONFGAIN_OFST) & GAIN_CONFGAIN_MSK)
|
||||||
|
#define GAIN_CONFGAIN_VRY_HGH_GAIN_VAL \
|
||||||
|
((0x1 << GAIN_CONFGAIN_OFST) & GAIN_CONFGAIN_MSK)
|
||||||
|
|
||||||
/** Flow Control register */
|
/** Flow Control register */
|
||||||
//#define FLOW_CONTROL_REG (0x11 << MEM_MAP_SHIFT)
|
//#define FLOW_CONTROL_REG (0x11 << MEM_MAP_SHIFT)
|
||||||
@ -60,12 +65,16 @@
|
|||||||
|
|
||||||
#define DAQ_TKN_TMNG_OFST (0)
|
#define DAQ_TKN_TMNG_OFST (0)
|
||||||
#define DAQ_TKN_TMNG_MSK (0x0000FFFF << DAQ_TKN_TMNG_OFST)
|
#define DAQ_TKN_TMNG_MSK (0x0000FFFF << DAQ_TKN_TMNG_OFST)
|
||||||
#define DAQ_TKN_TMNG_BRD_RVSN_1_VAL ((0x1f16 << DAQ_TKN_TMNG_OFST) & DAQ_TKN_TMNG_MSK)
|
#define DAQ_TKN_TMNG_BRD_RVSN_1_VAL \
|
||||||
#define DAQ_TKN_TMNG_BRD_RVSN_2_VAL ((0x1f10 << DAQ_TKN_TMNG_OFST) & DAQ_TKN_TMNG_MSK)
|
((0x1f16 << DAQ_TKN_TMNG_OFST) & DAQ_TKN_TMNG_MSK)
|
||||||
|
#define DAQ_TKN_TMNG_BRD_RVSN_2_VAL \
|
||||||
|
((0x1f10 << DAQ_TKN_TMNG_OFST) & DAQ_TKN_TMNG_MSK)
|
||||||
#define DAQ_PCKT_LNGTH_OFST (16)
|
#define DAQ_PCKT_LNGTH_OFST (16)
|
||||||
#define DAQ_PCKT_LNGTH_MSK (0x0000FFFF << DAQ_PCKT_LNGTH_OFST)
|
#define DAQ_PCKT_LNGTH_MSK (0x0000FFFF << DAQ_PCKT_LNGTH_OFST)
|
||||||
#define DAQ_PCKT_LNGTH_NO_ROI_VAL ((0x0013f << DAQ_PCKT_LNGTH_OFST) & DAQ_PCKT_LNGTH_MSK)
|
#define DAQ_PCKT_LNGTH_NO_ROI_VAL \
|
||||||
#define DAQ_PCKT_LNGTH_ROI_VAL ((0x0007f << DAQ_PCKT_LNGTH_OFST) & DAQ_PCKT_LNGTH_MSK)
|
((0x0013f << DAQ_PCKT_LNGTH_OFST) & DAQ_PCKT_LNGTH_MSK)
|
||||||
|
#define DAQ_PCKT_LNGTH_ROI_VAL \
|
||||||
|
((0x0007f << DAQ_PCKT_LNGTH_OFST) & DAQ_PCKT_LNGTH_MSK)
|
||||||
|
|
||||||
/** Time From Start register */
|
/** Time From Start register */
|
||||||
//#define TIME_FROM_START_REG (0x16 << MEM_MAP_SHIFT)
|
//#define TIME_FROM_START_REG (0x16 << MEM_MAP_SHIFT)
|
||||||
@ -95,27 +104,37 @@
|
|||||||
|
|
||||||
#define ADC_SYNC_ENET_STRT_DLY_OFST (0)
|
#define ADC_SYNC_ENET_STRT_DLY_OFST (0)
|
||||||
#define ADC_SYNC_ENET_STRT_DLY_MSK (0x0000000F << ADC_SYNC_ENET_STRT_DLY_OFST)
|
#define ADC_SYNC_ENET_STRT_DLY_MSK (0x0000000F << ADC_SYNC_ENET_STRT_DLY_OFST)
|
||||||
#define ADC_SYNC_ENET_STRT_DLY_VAL ((0x4 << ADC_SYNC_ENET_STRT_DLY_OFST) & ADC_SYNC_ENET_STRT_DLY_MSK)
|
#define ADC_SYNC_ENET_STRT_DLY_VAL \
|
||||||
|
((0x4 << ADC_SYNC_ENET_STRT_DLY_OFST) & ADC_SYNC_ENET_STRT_DLY_MSK)
|
||||||
#define ADC_SYNC_TKN1_HGH_DLY_OFST (4)
|
#define ADC_SYNC_TKN1_HGH_DLY_OFST (4)
|
||||||
#define ADC_SYNC_TKN1_HGH_DLY_MSK (0x0000000F << ADC_SYNC_TKN1_HGH_DLY_OFST)
|
#define ADC_SYNC_TKN1_HGH_DLY_MSK (0x0000000F << ADC_SYNC_TKN1_HGH_DLY_OFST)
|
||||||
#define ADC_SYNC_TKN1_HGH_DLY_VAL ((0x1 << ADC_SYNC_TKN1_HGH_DLY_OFST) & ADC_SYNC_TKN1_HGH_DLY_MSK)
|
#define ADC_SYNC_TKN1_HGH_DLY_VAL \
|
||||||
|
((0x1 << ADC_SYNC_TKN1_HGH_DLY_OFST) & ADC_SYNC_TKN1_HGH_DLY_MSK)
|
||||||
#define ADC_SYNC_TKN2_HGH_DLY_OFST (8)
|
#define ADC_SYNC_TKN2_HGH_DLY_OFST (8)
|
||||||
#define ADC_SYNC_TKN2_HGH_DLY_MSK (0x0000000F << ADC_SYNC_TKN2_HGH_DLY_OFST)
|
#define ADC_SYNC_TKN2_HGH_DLY_MSK (0x0000000F << ADC_SYNC_TKN2_HGH_DLY_OFST)
|
||||||
#define ADC_SYNC_TKN2_HGH_DLY_VAL ((0x2 << ADC_SYNC_TKN2_HGH_DLY_OFST) & ADC_SYNC_TKN2_HGH_DLY_MSK)
|
#define ADC_SYNC_TKN2_HGH_DLY_VAL \
|
||||||
|
((0x2 << ADC_SYNC_TKN2_HGH_DLY_OFST) & ADC_SYNC_TKN2_HGH_DLY_MSK)
|
||||||
#define ADC_SYNC_TKN1_LOW_DLY_OFST (12)
|
#define ADC_SYNC_TKN1_LOW_DLY_OFST (12)
|
||||||
#define ADC_SYNC_TKN1_LOW_DLY_MSK (0x0000000F << ADC_SYNC_TKN1_LOW_DLY_OFST)
|
#define ADC_SYNC_TKN1_LOW_DLY_MSK (0x0000000F << ADC_SYNC_TKN1_LOW_DLY_OFST)
|
||||||
#define ADC_SYNC_TKN1_LOW_DLY_VAL ((0x2 << ADC_SYNC_TKN1_LOW_DLY_OFST) & ADC_SYNC_TKN1_LOW_DLY_MSK)
|
#define ADC_SYNC_TKN1_LOW_DLY_VAL \
|
||||||
|
((0x2 << ADC_SYNC_TKN1_LOW_DLY_OFST) & ADC_SYNC_TKN1_LOW_DLY_MSK)
|
||||||
#define ADC_SYNC_TKN2_LOW_DLY_OFST (16)
|
#define ADC_SYNC_TKN2_LOW_DLY_OFST (16)
|
||||||
#define ADC_SYNC_TKN2_LOW_DLY_MSK (0x0000000F << ADC_SYNC_TKN2_LOW_DLY_OFST)
|
#define ADC_SYNC_TKN2_LOW_DLY_MSK (0x0000000F << ADC_SYNC_TKN2_LOW_DLY_OFST)
|
||||||
#define ADC_SYNC_TKN2_LOW_DLY_VAL ((0x3 << ADC_SYNC_TKN2_LOW_DLY_OFST) & ADC_SYNC_TKN2_LOW_DLY_MSK)
|
#define ADC_SYNC_TKN2_LOW_DLY_VAL \
|
||||||
//0x32214
|
((0x3 << ADC_SYNC_TKN2_LOW_DLY_OFST) & ADC_SYNC_TKN2_LOW_DLY_MSK)
|
||||||
#define ADC_SYNC_TKN_VAL (ADC_SYNC_ENET_STRT_DLY_VAL | ADC_SYNC_TKN1_HGH_DLY_VAL | ADC_SYNC_TKN2_HGH_DLY_VAL | ADC_SYNC_TKN1_LOW_DLY_VAL | ADC_SYNC_TKN2_LOW_DLY_VAL)
|
// 0x32214
|
||||||
|
#define ADC_SYNC_TKN_VAL \
|
||||||
|
(ADC_SYNC_ENET_STRT_DLY_VAL | ADC_SYNC_TKN1_HGH_DLY_VAL | \
|
||||||
|
ADC_SYNC_TKN2_HGH_DLY_VAL | ADC_SYNC_TKN1_LOW_DLY_VAL | \
|
||||||
|
ADC_SYNC_TKN2_LOW_DLY_VAL)
|
||||||
#define ADC_SYNC_CLEAN_FIFOS_OFST (20)
|
#define ADC_SYNC_CLEAN_FIFOS_OFST (20)
|
||||||
#define ADC_SYNC_CLEAN_FIFOS_MSK (0x00000001 << ADC_SYNC_CLEAN_FIFOS_OFST)
|
#define ADC_SYNC_CLEAN_FIFOS_MSK (0x00000001 << ADC_SYNC_CLEAN_FIFOS_OFST)
|
||||||
#define ADC_SYNC_ENET_DELAY_OFST (24)
|
#define ADC_SYNC_ENET_DELAY_OFST (24)
|
||||||
#define ADC_SYNC_ENET_DELAY_MSK (0x000000FF << ADC_SYNC_ENET_DELAY_OFST)
|
#define ADC_SYNC_ENET_DELAY_MSK (0x000000FF << ADC_SYNC_ENET_DELAY_OFST)
|
||||||
#define ADC_SYNC_ENET_DELAY_NO_ROI_VAL ((0x88 << ADC_SYNC_ENET_DELAY_OFST) & ADC_SYNC_ENET_DELAY_MSK)
|
#define ADC_SYNC_ENET_DELAY_NO_ROI_VAL \
|
||||||
#define ADC_SYNC_ENET_DELAY_ROI_VAL ((0x1b << ADC_SYNC_ENET_DELAY_OFST) & ADC_SYNC_ENET_DELAY_MSK)
|
((0x88 << ADC_SYNC_ENET_DELAY_OFST) & ADC_SYNC_ENET_DELAY_MSK)
|
||||||
|
#define ADC_SYNC_ENET_DELAY_ROI_VAL \
|
||||||
|
((0x1b << ADC_SYNC_ENET_DELAY_OFST) & ADC_SYNC_ENET_DELAY_MSK)
|
||||||
|
|
||||||
/** Time From Start register */
|
/** Time From Start register */
|
||||||
//#define MU_TIME_REG (0x1a << MEM_MAP_SHIFT)
|
//#define MU_TIME_REG (0x1a << MEM_MAP_SHIFT)
|
||||||
@ -131,7 +150,9 @@
|
|||||||
#define TEMP_SPI_IN_T2_CLK_MSK (0x00000001 << TEMP_SPI_IN_T2_CLK_OFST)
|
#define TEMP_SPI_IN_T2_CLK_MSK (0x00000001 << TEMP_SPI_IN_T2_CLK_OFST)
|
||||||
#define TEMP_SPI_IN_T2_CS_OFST (3)
|
#define TEMP_SPI_IN_T2_CS_OFST (3)
|
||||||
#define TEMP_SPI_IN_T2_CS_MSK (0x00000001 << TEMP_SPI_IN_T2_CS_OFST)
|
#define TEMP_SPI_IN_T2_CS_MSK (0x00000001 << TEMP_SPI_IN_T2_CS_OFST)
|
||||||
#define TEMP_SPI_IN_IDLE_MSK (TEMP_SPI_IN_T1_CS_MSK | TEMP_SPI_IN_T2_CS_MSK | TEMP_SPI_IN_T1_CLK_MSK | TEMP_SPI_IN_T2_CLK_MSK)
|
#define TEMP_SPI_IN_IDLE_MSK \
|
||||||
|
(TEMP_SPI_IN_T1_CS_MSK | TEMP_SPI_IN_T2_CS_MSK | TEMP_SPI_IN_T1_CLK_MSK | \
|
||||||
|
TEMP_SPI_IN_T2_CLK_MSK)
|
||||||
|
|
||||||
/** Temperatre SPI Out register */
|
/** Temperatre SPI Out register */
|
||||||
#define TEMP_SPI_OUT_REG (0x1c << MEM_MAP_SHIFT)
|
#define TEMP_SPI_OUT_REG (0x1c << MEM_MAP_SHIFT)
|
||||||
@ -171,7 +192,8 @@
|
|||||||
#define FPGA_VERSION_REG (0x22 << MEM_MAP_SHIFT)
|
#define FPGA_VERSION_REG (0x22 << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
#define FPGA_VERSION_OFST (0)
|
#define FPGA_VERSION_OFST (0)
|
||||||
#define FPGA_VERSION_MSK (0x00FFFFFF << FPGA_VERSION_OFST) // to get in format yymmdd
|
#define FPGA_VERSION_MSK \
|
||||||
|
(0x00FFFFFF << FPGA_VERSION_OFST) // to get in format yymmdd
|
||||||
|
|
||||||
/* Fix Pattern register */
|
/* Fix Pattern register */
|
||||||
#define FIX_PATT_REG (0x23 << MEM_MAP_SHIFT)
|
#define FIX_PATT_REG (0x23 << MEM_MAP_SHIFT)
|
||||||
@ -260,7 +282,8 @@
|
|||||||
#define EXT_SIGNAL_MSK (0x00000007 << EXT_SIGNAL_OFST)
|
#define EXT_SIGNAL_MSK (0x00000007 << EXT_SIGNAL_OFST)
|
||||||
#define EXT_SIGNAL_OFF_VAL ((0x0 << EXT_SIGNAL_OFST) & EXT_SIGNAL_MSK)
|
#define EXT_SIGNAL_OFF_VAL ((0x0 << EXT_SIGNAL_OFST) & EXT_SIGNAL_MSK)
|
||||||
#define EXT_SIGNAL_TRGGR_IN_RSNG_VAL ((0x3 << EXT_SIGNAL_OFST) & EXT_SIGNAL_MSK)
|
#define EXT_SIGNAL_TRGGR_IN_RSNG_VAL ((0x3 << EXT_SIGNAL_OFST) & EXT_SIGNAL_MSK)
|
||||||
#define EXT_SIGNAL_TRGGR_IN_FLLNG_VAL ((0x4 << EXT_SIGNAL_OFST) & EXT_SIGNAL_MSK)
|
#define EXT_SIGNAL_TRGGR_IN_FLLNG_VAL \
|
||||||
|
((0x4 << EXT_SIGNAL_OFST) & EXT_SIGNAL_MSK)
|
||||||
|
|
||||||
/** Look at me register */
|
/** Look at me register */
|
||||||
//#define LOOK_AT_ME_REG (0x28 << MEM_MAP_SHIFT)
|
//#define LOOK_AT_ME_REG (0x28 << MEM_MAP_SHIFT)
|
||||||
@ -274,7 +297,8 @@
|
|||||||
#define CHIP_OF_INTRST_ADC_SEL_OFST (0)
|
#define CHIP_OF_INTRST_ADC_SEL_OFST (0)
|
||||||
#define CHIP_OF_INTRST_ADC_SEL_MSK (0x0000001F << CHIP_OF_INTRST_ADC_SEL_OFST)
|
#define CHIP_OF_INTRST_ADC_SEL_MSK (0x0000001F << CHIP_OF_INTRST_ADC_SEL_OFST)
|
||||||
#define CHIP_OF_INTRST_NUM_CHNNLS_OFST (16)
|
#define CHIP_OF_INTRST_NUM_CHNNLS_OFST (16)
|
||||||
#define CHIP_OF_INTRST_NUM_CHNNLS_MSK (0x0000FFFF << CHIP_OF_INTRST_NUM_CHNNLS_OFST)
|
#define CHIP_OF_INTRST_NUM_CHNNLS_MSK \
|
||||||
|
(0x0000FFFF << CHIP_OF_INTRST_NUM_CHNNLS_OFST)
|
||||||
|
|
||||||
/** Out MUX register */
|
/** Out MUX register */
|
||||||
//#define OUT_MUX_REG (0x2b << MEM_MAP_SHIFT)
|
//#define OUT_MUX_REG (0x2b << MEM_MAP_SHIFT)
|
||||||
@ -366,4 +390,3 @@
|
|||||||
|
|
||||||
/* Counter Block Memory starting address */
|
/* Counter Block Memory starting address */
|
||||||
#define COUNTER_MEMORY_REG (0x85 << MEM_MAP_SHIFT)
|
#define COUNTER_MEMORY_REG (0x85 << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
|
Binary file not shown.
596
slsDetectorServers/gotthardDetectorServer/slsDetectorFunctionList.c
Executable file → Normal file
596
slsDetectorServers/gotthardDetectorServer/slsDetectorFunctionList.c
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
50
slsDetectorServers/gotthardDetectorServer/slsDetectorServer_defs.h
Executable file → Normal file
50
slsDetectorServers/gotthardDetectorServer/slsDetectorServer_defs.h
Executable file → Normal file
@ -3,12 +3,22 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
/* Enums */
|
/* Enums */
|
||||||
enum ADCINDEX {TEMP_FPGA, TEMP_ADC};
|
enum ADCINDEX { TEMP_FPGA, TEMP_ADC };
|
||||||
enum DACINDEX {G_VREF_DS, G_VCASCN_PB, G_VCASCP_PB, G_VOUT_CM, G_VCASC_OUT, G_VIN_CM, G_VREF_COMP, G_IB_TESTC};
|
enum DACINDEX {
|
||||||
enum CLKINDEX {ADC_CLK, NUM_CLOCKS};
|
G_VREF_DS,
|
||||||
|
G_VCASCN_PB,
|
||||||
|
G_VCASCP_PB,
|
||||||
|
G_VOUT_CM,
|
||||||
|
G_VCASC_OUT,
|
||||||
|
G_VIN_CM,
|
||||||
|
G_VREF_COMP,
|
||||||
|
G_IB_TESTC
|
||||||
|
};
|
||||||
|
enum CLKINDEX { ADC_CLK, NUM_CLOCKS };
|
||||||
#define CLK_NAMES "adc"
|
#define CLK_NAMES "adc"
|
||||||
|
|
||||||
#define DEFAULT_DAC_VALS { \
|
#define DEFAULT_DAC_VALS \
|
||||||
|
{ \
|
||||||
660, /* G_VREF_DS */ \
|
660, /* G_VREF_DS */ \
|
||||||
650, /* G_VCASCN_PB */ \
|
650, /* G_VCASCN_PB */ \
|
||||||
1480, /* G_VCASCP_PB */ \
|
1480, /* G_VCASCP_PB */ \
|
||||||
@ -32,12 +42,15 @@ enum CLKINDEX {ADC_CLK, NUM_CLOCKS};
|
|||||||
#define NUM_BITS_PER_PIXEL (DYNAMIC_RANGE / 8)
|
#define NUM_BITS_PER_PIXEL (DYNAMIC_RANGE / 8)
|
||||||
#define DATA_BYTES (NCHIP * NCHAN * NUM_BITS_PER_PIXEL)
|
#define DATA_BYTES (NCHIP * NCHAN * NUM_BITS_PER_PIXEL)
|
||||||
#define CLK_FREQ (32007729) /* Hz */
|
#define CLK_FREQ (32007729) /* Hz */
|
||||||
|
#define MAX_EXT_SIGNALS (1)
|
||||||
|
|
||||||
/** Firmware Definitions */
|
/** Firmware Definitions */
|
||||||
#define IP_PACKET_SIZE_NO_ROI (NCHIP * (NCHAN / 2) * 2 + 14 + 20) // 2 packets, so divide by 2
|
#define IP_PACKET_SIZE_NO_ROI \
|
||||||
|
(NCHIP * (NCHAN / 2) * 2 + 14 + 20) // 2 packets, so divide by 2
|
||||||
#define IP_PACKET_SIZE_ROI (NCHIPS_PER_ADC * NCHAN * 2 + 14 + 20)
|
#define IP_PACKET_SIZE_ROI (NCHIPS_PER_ADC * NCHAN * 2 + 14 + 20)
|
||||||
|
|
||||||
#define UDP_PACKETSIZE_NO_ROI (NCHIP * (NCHAN / 2) * 2 + 4 + 8 + 2) // 2 packets, so divide by 2
|
#define UDP_PACKETSIZE_NO_ROI \
|
||||||
|
(NCHIP * (NCHAN / 2) * 2 + 4 + 8 + 2) // 2 packets, so divide by 2
|
||||||
#define UDP_PACKETSIZE_ROI (NCHIPS_PER_ADC * NCHAN * 2 + 4 + 8 + 2)
|
#define UDP_PACKETSIZE_ROI (NCHIPS_PER_ADC * NCHAN * 2 + 4 + 8 + 2)
|
||||||
|
|
||||||
/** Default Parameters */
|
/** Default Parameters */
|
||||||
@ -57,7 +70,7 @@ enum CLKINDEX {ADC_CLK, NUM_CLOCKS};
|
|||||||
#define DAC_MAX_MV (2500)
|
#define DAC_MAX_MV (2500)
|
||||||
|
|
||||||
/** ENEt conf structs */
|
/** ENEt conf structs */
|
||||||
typedef struct mac_header_struct{
|
typedef struct mac_header_struct {
|
||||||
u_int8_t mac_dest_mac2;
|
u_int8_t mac_dest_mac2;
|
||||||
u_int8_t mac_dest_mac1;
|
u_int8_t mac_dest_mac1;
|
||||||
u_int8_t mac_dummy1;
|
u_int8_t mac_dummy1;
|
||||||
@ -78,8 +91,8 @@ typedef struct mac_header_struct{
|
|||||||
typedef struct ip_header_struct {
|
typedef struct ip_header_struct {
|
||||||
u_int16_t ip_len;
|
u_int16_t ip_len;
|
||||||
u_int8_t ip_tos;
|
u_int8_t ip_tos;
|
||||||
u_int8_t ip_ihl:4 ,ip_ver:4;
|
u_int8_t ip_ihl : 4, ip_ver : 4;
|
||||||
u_int16_t ip_offset:13,ip_flag:3;
|
u_int16_t ip_offset : 13, ip_flag : 3;
|
||||||
u_int16_t ip_ident;
|
u_int16_t ip_ident;
|
||||||
u_int16_t ip_chksum;
|
u_int16_t ip_chksum;
|
||||||
u_int8_t ip_protocol;
|
u_int8_t ip_protocol;
|
||||||
@ -88,14 +101,14 @@ typedef struct ip_header_struct {
|
|||||||
u_int32_t ip_destip;
|
u_int32_t ip_destip;
|
||||||
} ip_header;
|
} ip_header;
|
||||||
|
|
||||||
typedef struct udp_header_struct{
|
typedef struct udp_header_struct {
|
||||||
u_int16_t udp_destport;
|
u_int16_t udp_destport;
|
||||||
u_int16_t udp_srcport;
|
u_int16_t udp_srcport;
|
||||||
u_int16_t udp_chksum;
|
u_int16_t udp_chksum;
|
||||||
u_int16_t udp_len;
|
u_int16_t udp_len;
|
||||||
} udp_header;
|
} udp_header;
|
||||||
|
|
||||||
typedef struct mac_conf_struct{
|
typedef struct mac_conf_struct {
|
||||||
mac_header mac;
|
mac_header mac;
|
||||||
ip_header ip;
|
ip_header ip;
|
||||||
udp_header udp;
|
udp_header udp;
|
||||||
@ -105,23 +118,22 @@ typedef struct mac_conf_struct{
|
|||||||
u_int32_t cdone;
|
u_int32_t cdone;
|
||||||
} mac_conf;
|
} mac_conf;
|
||||||
|
|
||||||
typedef struct tse_conf_struct{
|
typedef struct tse_conf_struct {
|
||||||
u_int32_t rev; //0x0
|
u_int32_t rev; // 0x0
|
||||||
u_int32_t scratch;
|
u_int32_t scratch;
|
||||||
u_int32_t command_config;
|
u_int32_t command_config;
|
||||||
u_int32_t mac_0; //0x3
|
u_int32_t mac_0; // 0x3
|
||||||
u_int32_t mac_1;
|
u_int32_t mac_1;
|
||||||
u_int32_t frm_length;
|
u_int32_t frm_length;
|
||||||
u_int32_t pause_quant;
|
u_int32_t pause_quant;
|
||||||
u_int32_t rx_section_empty; //0x7
|
u_int32_t rx_section_empty; // 0x7
|
||||||
u_int32_t rx_section_full;
|
u_int32_t rx_section_full;
|
||||||
u_int32_t tx_section_empty;
|
u_int32_t tx_section_empty;
|
||||||
u_int32_t tx_section_full;
|
u_int32_t tx_section_full;
|
||||||
u_int32_t rx_almost_empty; //0xB
|
u_int32_t rx_almost_empty; // 0xB
|
||||||
u_int32_t rx_almost_full;
|
u_int32_t rx_almost_full;
|
||||||
u_int32_t tx_almost_empty;
|
u_int32_t tx_almost_empty;
|
||||||
u_int32_t tx_almost_full;
|
u_int32_t tx_almost_full;
|
||||||
u_int32_t mdio_addr0; //0xF
|
u_int32_t mdio_addr0; // 0xF
|
||||||
u_int32_t mdio_addr1;
|
u_int32_t mdio_addr1;
|
||||||
}tse_conf;
|
} tse_conf;
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ target_compile_definitions(jungfrauDetectorServer_virtual
|
|||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(jungfrauDetectorServer_virtual
|
target_link_libraries(jungfrauDetectorServer_virtual
|
||||||
PUBLIC pthread rt slsProjectCWarnings
|
PUBLIC pthread rt slsProjectCSettings
|
||||||
)
|
)
|
||||||
|
|
||||||
set_target_properties(jungfrauDetectorServer_virtual PROPERTIES
|
set_target_properties(jungfrauDetectorServer_virtual PROPERTIES
|
||||||
|
270
slsDetectorServers/jungfrauDetectorServer/RegisterDefs.h
Executable file → Normal file
270
slsDetectorServers/jungfrauDetectorServer/RegisterDefs.h
Executable file → Normal file
@ -11,8 +11,6 @@
|
|||||||
#define DETECTOR_TYPE_OFST (24)
|
#define DETECTOR_TYPE_OFST (24)
|
||||||
#define DETECTOR_TYPE_MSK (0x000000FF << DETECTOR_TYPE_OFST)
|
#define DETECTOR_TYPE_MSK (0x000000FF << DETECTOR_TYPE_OFST)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Fix pattern register */
|
/* Fix pattern register */
|
||||||
#define FIX_PATT_REG (0x01 << MEM_MAP_SHIFT)
|
#define FIX_PATT_REG (0x01 << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
@ -25,35 +23,38 @@
|
|||||||
#define RUN_BUSY_MSK (0x00000001 << RUN_BUSY_OFST)
|
#define RUN_BUSY_MSK (0x00000001 << RUN_BUSY_OFST)
|
||||||
#define WAITING_FOR_TRIGGER_OFST (3)
|
#define WAITING_FOR_TRIGGER_OFST (3)
|
||||||
#define WAITING_FOR_TRIGGER_MSK (0x00000001 << WAITING_FOR_TRIGGER_OFST)
|
#define WAITING_FOR_TRIGGER_MSK (0x00000001 << WAITING_FOR_TRIGGER_OFST)
|
||||||
#define DELAYBEFORE_OFST (4) //Not used in software
|
#define DELAYBEFORE_OFST (4) // Not used in software
|
||||||
#define DELAYBEFORE_MSK (0x00000001 << DELAYBEFORE_OFST) //Not used in software
|
#define DELAYBEFORE_MSK (0x00000001 << DELAYBEFORE_OFST) // Not used in software
|
||||||
#define DELAYAFTER_OFST (5) //Not used in software
|
#define DELAYAFTER_OFST (5) // Not used in software
|
||||||
#define DELAYAFTER_MSK (0x00000001 << DELAYAFTER_OFST) //Not used in software
|
#define DELAYAFTER_MSK (0x00000001 << DELAYAFTER_OFST) // Not used in software
|
||||||
#define STOPPED_OFST (15)
|
#define STOPPED_OFST (15)
|
||||||
#define STOPPED_MSK (0x00000001 << STOPPED_OFST)
|
#define STOPPED_MSK (0x00000001 << STOPPED_OFST)
|
||||||
#define RUNMACHINE_BUSY_OFST (17)
|
#define RUNMACHINE_BUSY_OFST (17)
|
||||||
#define RUNMACHINE_BUSY_MSK (0x00000001 << RUNMACHINE_BUSY_OFST)
|
#define RUNMACHINE_BUSY_MSK (0x00000001 << RUNMACHINE_BUSY_OFST)
|
||||||
|
|
||||||
|
|
||||||
/* Look at me register */
|
/* Look at me register */
|
||||||
#define LOOK_AT_ME_REG (0x03 << MEM_MAP_SHIFT) //Not used in firmware or software
|
#define LOOK_AT_ME_REG \
|
||||||
|
(0x03 << MEM_MAP_SHIFT) // Not used in firmware or software
|
||||||
|
|
||||||
/* System Status register */
|
/* System Status register */
|
||||||
#define SYSTEM_STATUS_REG (0x04 << MEM_MAP_SHIFT) //Not used in software
|
#define SYSTEM_STATUS_REG (0x04 << MEM_MAP_SHIFT) // Not used in software
|
||||||
|
|
||||||
#define DDR3_CAL_DONE_OFST (0) //Not used in software
|
|
||||||
#define DDR3_CAL_DONE_MSK (0x00000001 << DDR3_CAL_DONE_OFST) //Not used in software
|
|
||||||
#define DDR3_CAL_FAIL_OFST (1) //Not used in software
|
|
||||||
#define DDR3_CAL_FAIL_MSK (0x00000001 << DDR3_CAL_FAIL_OFST) //Not used in software
|
|
||||||
#define DDR3_INIT_DONE_OFST (2) //Not used in software
|
|
||||||
#define DDR3_INIT_DONE_MSK (0x00000001 << DDR3_INIT_DONE_OFST) //Not used in software
|
|
||||||
#define RECONFIG_PLL_LCK_OFST (3) //Not used in software
|
|
||||||
#define RECONFIG_PLL_LCK_MSK (0x00000001 << RECONFIG_PLL_LCK_OFST) //Not used in software
|
|
||||||
#define PLL_A_LCK_OFST (4) //Not used in software
|
|
||||||
#define PLL_A_LCK_MSK (0x00000001 << PLL_A_LCK_OFST) //Not used in software
|
|
||||||
#define DD3_PLL_LCK_OFST (5) //Not used in software
|
|
||||||
#define DD3_PLL_LCK_MSK (0x00000001 << DD3_PLL_LCK_OFST) //Not used in software
|
|
||||||
|
|
||||||
|
#define DDR3_CAL_DONE_OFST (0) // Not used in software
|
||||||
|
#define DDR3_CAL_DONE_MSK \
|
||||||
|
(0x00000001 << DDR3_CAL_DONE_OFST) // Not used in software
|
||||||
|
#define DDR3_CAL_FAIL_OFST (1) // Not used in software
|
||||||
|
#define DDR3_CAL_FAIL_MSK \
|
||||||
|
(0x00000001 << DDR3_CAL_FAIL_OFST) // Not used in software
|
||||||
|
#define DDR3_INIT_DONE_OFST (2) // Not used in software
|
||||||
|
#define DDR3_INIT_DONE_MSK \
|
||||||
|
(0x00000001 << DDR3_INIT_DONE_OFST) // Not used in software
|
||||||
|
#define RECONFIG_PLL_LCK_OFST (3) // Not used in software
|
||||||
|
#define RECONFIG_PLL_LCK_MSK \
|
||||||
|
(0x00000001 << RECONFIG_PLL_LCK_OFST) // Not used in software
|
||||||
|
#define PLL_A_LCK_OFST (4) // Not used in software
|
||||||
|
#define PLL_A_LCK_MSK (0x00000001 << PLL_A_LCK_OFST) // Not used in software
|
||||||
|
#define DD3_PLL_LCK_OFST (5) // Not used in software
|
||||||
|
#define DD3_PLL_LCK_MSK (0x00000001 << DD3_PLL_LCK_OFST) // Not used in software
|
||||||
|
|
||||||
/* Module Control Board Serial Number Register */
|
/* Module Control Board Serial Number Register */
|
||||||
#define MOD_SERIAL_NUM_REG (0x0A << MEM_MAP_SHIFT)
|
#define MOD_SERIAL_NUM_REG (0x0A << MEM_MAP_SHIFT)
|
||||||
@ -62,16 +63,17 @@
|
|||||||
#define HARDWARE_SERIAL_NUM_MSK (0x000000FF << HARDWARE_SERIAL_NUM_OFST)
|
#define HARDWARE_SERIAL_NUM_MSK (0x000000FF << HARDWARE_SERIAL_NUM_OFST)
|
||||||
#define HARDWARE_VERSION_NUM_OFST (16)
|
#define HARDWARE_VERSION_NUM_OFST (16)
|
||||||
#define HARDWARE_VERSION_NUM_MSK (0x0000003F << HARDWARE_VERSION_NUM_OFST)
|
#define HARDWARE_VERSION_NUM_MSK (0x0000003F << HARDWARE_VERSION_NUM_OFST)
|
||||||
#define HARDWARE_VERSION_2_VAL ((0x2 << HARDWARE_VERSION_NUM_OFST) & HARDWARE_VERSION_NUM_MSK)
|
#define HARDWARE_VERSION_2_VAL \
|
||||||
|
((0x2 << HARDWARE_VERSION_NUM_OFST) & HARDWARE_VERSION_NUM_MSK)
|
||||||
|
|
||||||
/* API Version Register */
|
/* API Version Register */
|
||||||
#define API_VERSION_REG (0x0F << MEM_MAP_SHIFT)
|
#define API_VERSION_REG (0x0F << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
#define API_VERSION_OFST (0)
|
#define API_VERSION_OFST (0)
|
||||||
#define API_VERSION_MSK (0x00FFFFFF << API_VERSION_OFST)
|
#define API_VERSION_MSK (0x00FFFFFF << API_VERSION_OFST)
|
||||||
#define API_VERSION_DETECTOR_TYPE_OFST (24) //Not used in software
|
#define API_VERSION_DETECTOR_TYPE_OFST (24) // Not used in software
|
||||||
#define API_VERSION_DETECTOR_TYPE_MSK (0x000000FF << API_VERSION_DETECTOR_TYPE_OFST) //Not used in software
|
#define API_VERSION_DETECTOR_TYPE_MSK \
|
||||||
|
(0x000000FF << API_VERSION_DETECTOR_TYPE_OFST) // Not used in software
|
||||||
|
|
||||||
/* Time from Start 64 bit register */
|
/* Time from Start 64 bit register */
|
||||||
#define TIME_FROM_START_LSB_REG (0x10 << MEM_MAP_SHIFT)
|
#define TIME_FROM_START_LSB_REG (0x10 << MEM_MAP_SHIFT)
|
||||||
@ -94,14 +96,17 @@
|
|||||||
#define GET_PERIOD_MSB_REG (0x19 << MEM_MAP_SHIFT)
|
#define GET_PERIOD_MSB_REG (0x19 << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
/** Get Temperature Carlos, incorrectl as get gates */
|
/** Get Temperature Carlos, incorrectl as get gates */
|
||||||
#define GET_TEMPERATURE_TMP112_REG (0x1c << MEM_MAP_SHIFT) // (after multiplying by 625) in 10ths of millidegrees of TMP112
|
#define GET_TEMPERATURE_TMP112_REG \
|
||||||
|
(0x1c << MEM_MAP_SHIFT) // (after multiplying by 625) in 10ths of
|
||||||
|
// millidegrees of TMP112
|
||||||
|
|
||||||
#define TEMPERATURE_VALUE_BIT (0)
|
#define TEMPERATURE_VALUE_BIT (0)
|
||||||
#define TEMPERATURE_VALUE_MSK (0x000007FF << TEMPERATURE_VALUE_BIT)
|
#define TEMPERATURE_VALUE_MSK (0x000007FF << TEMPERATURE_VALUE_BIT)
|
||||||
#define TEMPERATURE_POLARITY_BIT (11)
|
#define TEMPERATURE_POLARITY_BIT (11)
|
||||||
#define TEMPERATURE_POLARITY_MSK (0x00000001 << TEMPERATURE_POLARITY_BIT)
|
#define TEMPERATURE_POLARITY_MSK (0x00000001 << TEMPERATURE_POLARITY_BIT)
|
||||||
|
|
||||||
/* Get Frames from Start 64 bit register (frames from last reset using CONTROL_CRST) */
|
/* Get Frames from Start 64 bit register (frames from last reset using
|
||||||
|
* CONTROL_CRST) */
|
||||||
#define FRAMES_FROM_START_LSB_REG (0x22 << MEM_MAP_SHIFT)
|
#define FRAMES_FROM_START_LSB_REG (0x22 << MEM_MAP_SHIFT)
|
||||||
#define FRAMES_FROM_START_MSB_REG (0x23 << MEM_MAP_SHIFT)
|
#define FRAMES_FROM_START_MSB_REG (0x23 << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
@ -157,19 +162,25 @@
|
|||||||
/* Configuration Register */
|
/* Configuration Register */
|
||||||
#define CONFIG_REG (0x4D << MEM_MAP_SHIFT)
|
#define CONFIG_REG (0x4D << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
// readout timer (from chip) to stabilize (esp in burst acquisition mode) tRDT = (RDT + 1) * 25ns
|
// readout timer (from chip) to stabilize (esp in burst acquisition mode) tRDT =
|
||||||
|
// (RDT + 1) * 25ns
|
||||||
#define CONFIG_RDT_TMR_OFST (0)
|
#define CONFIG_RDT_TMR_OFST (0)
|
||||||
#define CONFIG_RDT_TMR_MSK (0x0000FFFF << CONFIG_RDT_TMR_OFST)
|
#define CONFIG_RDT_TMR_MSK (0x0000FFFF << CONFIG_RDT_TMR_OFST)
|
||||||
#define CONFIG_OPRTN_MDE_2_X_10GbE_OFST (16)
|
#define CONFIG_OPRTN_MDE_2_X_10GbE_OFST (16)
|
||||||
#define CONFIG_OPRTN_MDE_2_X_10GbE_MSK (0x00000001 << CONFIG_OPRTN_MDE_2_X_10GbE_OFST)
|
#define CONFIG_OPRTN_MDE_2_X_10GbE_MSK \
|
||||||
|
(0x00000001 << CONFIG_OPRTN_MDE_2_X_10GbE_OFST)
|
||||||
// if 0, outer is the primary interface
|
// if 0, outer is the primary interface
|
||||||
#define CONFIG_INNR_PRIMRY_INTRFCE_OFST (17)
|
#define CONFIG_INNR_PRIMRY_INTRFCE_OFST (17)
|
||||||
#define CONFIG_INNR_PRIMRY_INTRFCE_MSK (0x00000001 << CONFIG_INNR_PRIMRY_INTRFCE_OFST)
|
#define CONFIG_INNR_PRIMRY_INTRFCE_MSK \
|
||||||
|
(0x00000001 << CONFIG_INNR_PRIMRY_INTRFCE_OFST)
|
||||||
#define CONFIG_READOUT_SPEED_OFST (20)
|
#define CONFIG_READOUT_SPEED_OFST (20)
|
||||||
#define CONFIG_READOUT_SPEED_MSK (0x00000003 << CONFIG_READOUT_SPEED_OFST)
|
#define CONFIG_READOUT_SPEED_MSK (0x00000003 << CONFIG_READOUT_SPEED_OFST)
|
||||||
#define CONFIG_QUARTER_SPEED_10MHZ_VAL ((0x0 << CONFIG_READOUT_SPEED_OFST) & CONFIG_READOUT_SPEED_MSK)
|
#define CONFIG_QUARTER_SPEED_10MHZ_VAL \
|
||||||
#define CONFIG_HALF_SPEED_20MHZ_VAL ((0x1 << CONFIG_READOUT_SPEED_OFST) & CONFIG_READOUT_SPEED_MSK)
|
((0x0 << CONFIG_READOUT_SPEED_OFST) & CONFIG_READOUT_SPEED_MSK)
|
||||||
#define CONFIG_FULL_SPEED_40MHZ_VAL ((0x2 << CONFIG_READOUT_SPEED_OFST) & CONFIG_READOUT_SPEED_MSK)
|
#define CONFIG_HALF_SPEED_20MHZ_VAL \
|
||||||
|
((0x1 << CONFIG_READOUT_SPEED_OFST) & CONFIG_READOUT_SPEED_MSK)
|
||||||
|
#define CONFIG_FULL_SPEED_40MHZ_VAL \
|
||||||
|
((0x2 << CONFIG_READOUT_SPEED_OFST) & CONFIG_READOUT_SPEED_MSK)
|
||||||
#define CONFIG_TDMA_ENABLE_OFST (24)
|
#define CONFIG_TDMA_ENABLE_OFST (24)
|
||||||
#define CONFIG_TDMA_ENABLE_MSK (0x00000001 << CONFIG_TDMA_ENABLE_OFST)
|
#define CONFIG_TDMA_ENABLE_MSK (0x00000001 << CONFIG_TDMA_ENABLE_OFST)
|
||||||
#define CONFIG_TDMA_TIMESLOT_OFST (25) // 1ms
|
#define CONFIG_TDMA_TIMESLOT_OFST (25) // 1ms
|
||||||
@ -192,29 +203,34 @@
|
|||||||
#define CONTROL_STOP_ACQ_MSK (0x00000001 << CONTROL_STOP_ACQ_OFST)
|
#define CONTROL_STOP_ACQ_MSK (0x00000001 << CONTROL_STOP_ACQ_OFST)
|
||||||
#define CONTROL_CORE_RST_OFST (10)
|
#define CONTROL_CORE_RST_OFST (10)
|
||||||
#define CONTROL_CORE_RST_MSK (0x00000001 << CONTROL_CORE_RST_OFST)
|
#define CONTROL_CORE_RST_MSK (0x00000001 << CONTROL_CORE_RST_OFST)
|
||||||
#define CONTROL_PERIPHERAL_RST_OFST (11) //DDR3 HMem Ctrlr, GBE, Temp
|
#define CONTROL_PERIPHERAL_RST_OFST (11) // DDR3 HMem Ctrlr, GBE, Temp
|
||||||
#define CONTROL_PERIPHERAL_RST_MSK (0x00000001 << CONTROL_PERIPHERAL_RST_OFST) //DDR3 HMem Ctrlr, GBE, Temp
|
#define CONTROL_PERIPHERAL_RST_MSK \
|
||||||
#define CONTROL_DDR3_MEM_RST_OFST (12) //only PHY, not DDR3 PLL ,Not used in software
|
(0x00000001 << CONTROL_PERIPHERAL_RST_OFST) // DDR3 HMem Ctrlr, GBE, Temp
|
||||||
#define CONTROL_DDR3_MEM_RST_MSK (0x00000001 << CONTROL_DDR3_MEM_RST_OFST) //only PHY, not DDR3 PLL ,Not used in software
|
#define CONTROL_DDR3_MEM_RST_OFST \
|
||||||
|
(12) // only PHY, not DDR3 PLL ,Not used in software
|
||||||
|
#define CONTROL_DDR3_MEM_RST_MSK \
|
||||||
|
(0x00000001 << CONTROL_DDR3_MEM_RST_OFST) // only PHY, not DDR3 PLL ,Not
|
||||||
|
// used in software
|
||||||
#define CONTROL_ACQ_FIFO_CLR_OFST (14)
|
#define CONTROL_ACQ_FIFO_CLR_OFST (14)
|
||||||
#define CONTROL_ACQ_FIFO_CLR_MSK (0x00000001 << CONTROL_ACQ_FIFO_CLR_OFST)
|
#define CONTROL_ACQ_FIFO_CLR_MSK (0x00000001 << CONTROL_ACQ_FIFO_CLR_OFST)
|
||||||
#define CONTROL_STORAGE_CELL_NUM_OFST (16)
|
#define CONTROL_STORAGE_CELL_NUM_OFST (16)
|
||||||
#define CONTROL_STORAGE_CELL_NUM_MSK (0x0000000F << CONTROL_STORAGE_CELL_NUM_OFST)
|
#define CONTROL_STORAGE_CELL_NUM_MSK \
|
||||||
|
(0x0000000F << CONTROL_STORAGE_CELL_NUM_OFST)
|
||||||
#define CONTROL_RX_ADDTNL_ENDPTS_NUM_OFST (20)
|
#define CONTROL_RX_ADDTNL_ENDPTS_NUM_OFST (20)
|
||||||
#define CONTROL_RX_ADDTNL_ENDPTS_NUM_MSK (0x0000003F << CONTROL_RX_ADDTNL_ENDPTS_NUM_OFST)
|
#define CONTROL_RX_ADDTNL_ENDPTS_NUM_MSK \
|
||||||
|
(0x0000003F << CONTROL_RX_ADDTNL_ENDPTS_NUM_OFST)
|
||||||
#define CONTROL_RX_ENDPTS_START_OFST (26)
|
#define CONTROL_RX_ENDPTS_START_OFST (26)
|
||||||
#define CONTROL_RX_ENDPTS_START_MSK (0x0000003F << CONTROL_RX_ENDPTS_START_OFST)
|
#define CONTROL_RX_ENDPTS_START_MSK (0x0000003F << CONTROL_RX_ENDPTS_START_OFST)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Reconfiguratble PLL Paramater Register */
|
/* Reconfiguratble PLL Paramater Register */
|
||||||
#define PLL_PARAM_REG (0x50 << MEM_MAP_SHIFT)
|
#define PLL_PARAM_REG (0x50 << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
/* Reconfiguratble PLL Control Regiser */
|
/* Reconfiguratble PLL Control Regiser */
|
||||||
#define PLL_CNTRL_REG (0x51 << MEM_MAP_SHIFT)
|
#define PLL_CNTRL_REG (0x51 << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
#define PLL_CNTRL_RCNFG_PRMTR_RST_OFST (0) //parameter reset
|
#define PLL_CNTRL_RCNFG_PRMTR_RST_OFST (0) // parameter reset
|
||||||
#define PLL_CNTRL_RCNFG_PRMTR_RST_MSK (0x00000001 << PLL_CNTRL_RCNFG_PRMTR_RST_OFST) //parameter reset
|
#define PLL_CNTRL_RCNFG_PRMTR_RST_MSK \
|
||||||
|
(0x00000001 << PLL_CNTRL_RCNFG_PRMTR_RST_OFST) // parameter reset
|
||||||
#define PLL_CNTRL_WR_PRMTR_OFST (2)
|
#define PLL_CNTRL_WR_PRMTR_OFST (2)
|
||||||
#define PLL_CNTRL_WR_PRMTR_MSK (0x00000001 << PLL_CNTRL_WR_PRMTR_OFST)
|
#define PLL_CNTRL_WR_PRMTR_MSK (0x00000001 << PLL_CNTRL_WR_PRMTR_OFST)
|
||||||
#define PLL_CNTRL_PLL_RST_OFST (3)
|
#define PLL_CNTRL_PLL_RST_OFST (3)
|
||||||
@ -229,50 +245,86 @@
|
|||||||
|
|
||||||
#define SAMPLE_ADC_SAMPLE_SEL_OFST (0)
|
#define SAMPLE_ADC_SAMPLE_SEL_OFST (0)
|
||||||
#define SAMPLE_ADC_SAMPLE_SEL_MSK (0x00000007 << SAMPLE_ADC_SAMPLE_SEL_OFST)
|
#define SAMPLE_ADC_SAMPLE_SEL_MSK (0x00000007 << SAMPLE_ADC_SAMPLE_SEL_OFST)
|
||||||
#define SAMPLE_ADC_SAMPLE_0_VAL ((0x0 << SAMPLE_ADC_SAMPLE_SEL_OFST) & SAMPLE_ADC_SAMPLE_SEL_MSK)
|
#define SAMPLE_ADC_SAMPLE_0_VAL \
|
||||||
#define SAMPLE_ADC_SAMPLE_1_VAL ((0x1 << SAMPLE_ADC_SAMPLE_SEL_OFST) & SAMPLE_ADC_SAMPLE_SEL_MSK)
|
((0x0 << SAMPLE_ADC_SAMPLE_SEL_OFST) & SAMPLE_ADC_SAMPLE_SEL_MSK)
|
||||||
#define SAMPLE_ADC_SAMPLE_2_VAL ((0x2 << SAMPLE_ADC_SAMPLE_SEL_OFST) & SAMPLE_ADC_SAMPLE_SEL_MSK)
|
#define SAMPLE_ADC_SAMPLE_1_VAL \
|
||||||
#define SAMPLE_ADC_SAMPLE_3_VAL ((0x3 << SAMPLE_ADC_SAMPLE_SEL_OFST) & SAMPLE_ADC_SAMPLE_SEL_MSK)
|
((0x1 << SAMPLE_ADC_SAMPLE_SEL_OFST) & SAMPLE_ADC_SAMPLE_SEL_MSK)
|
||||||
#define SAMPLE_ADC_SAMPLE_4_VAL ((0x4 << SAMPLE_ADC_SAMPLE_SEL_OFST) & SAMPLE_ADC_SAMPLE_SEL_MSK)
|
#define SAMPLE_ADC_SAMPLE_2_VAL \
|
||||||
#define SAMPLE_ADC_SAMPLE_5_VAL ((0x5 << SAMPLE_ADC_SAMPLE_SEL_OFST) & SAMPLE_ADC_SAMPLE_SEL_MSK)
|
((0x2 << SAMPLE_ADC_SAMPLE_SEL_OFST) & SAMPLE_ADC_SAMPLE_SEL_MSK)
|
||||||
#define SAMPLE_ADC_SAMPLE_6_VAL ((0x6 << SAMPLE_ADC_SAMPLE_SEL_OFST) & SAMPLE_ADC_SAMPLE_SEL_MSK)
|
#define SAMPLE_ADC_SAMPLE_3_VAL \
|
||||||
#define SAMPLE_ADC_SAMPLE_7_VAL ((0x7 << SAMPLE_ADC_SAMPLE_SEL_OFST) & SAMPLE_ADC_SAMPLE_SEL_MSK)
|
((0x3 << SAMPLE_ADC_SAMPLE_SEL_OFST) & SAMPLE_ADC_SAMPLE_SEL_MSK)
|
||||||
|
#define SAMPLE_ADC_SAMPLE_4_VAL \
|
||||||
|
((0x4 << SAMPLE_ADC_SAMPLE_SEL_OFST) & SAMPLE_ADC_SAMPLE_SEL_MSK)
|
||||||
|
#define SAMPLE_ADC_SAMPLE_5_VAL \
|
||||||
|
((0x5 << SAMPLE_ADC_SAMPLE_SEL_OFST) & SAMPLE_ADC_SAMPLE_SEL_MSK)
|
||||||
|
#define SAMPLE_ADC_SAMPLE_6_VAL \
|
||||||
|
((0x6 << SAMPLE_ADC_SAMPLE_SEL_OFST) & SAMPLE_ADC_SAMPLE_SEL_MSK)
|
||||||
|
#define SAMPLE_ADC_SAMPLE_7_VAL \
|
||||||
|
((0x7 << SAMPLE_ADC_SAMPLE_SEL_OFST) & SAMPLE_ADC_SAMPLE_SEL_MSK)
|
||||||
// Decimation = ADF + 1
|
// Decimation = ADF + 1
|
||||||
#define SAMPLE_ADC_DECMT_FACTOR_OFST (4)
|
#define SAMPLE_ADC_DECMT_FACTOR_OFST (4)
|
||||||
#define SAMPLE_ADC_DECMT_FACTOR_MSK (0x00000007 << SAMPLE_ADC_DECMT_FACTOR_OFST)
|
#define SAMPLE_ADC_DECMT_FACTOR_MSK (0x00000007 << SAMPLE_ADC_DECMT_FACTOR_OFST)
|
||||||
#define SAMPLE_ADC_DECMT_FACTOR_0_VAL ((0x0 << SAMPLE_ADC_DECMT_FACTOR_OFST) & SAMPLE_ADC_DECMT_FACTOR_MSK)
|
#define SAMPLE_ADC_DECMT_FACTOR_0_VAL \
|
||||||
#define SAMPLE_ADC_DECMT_FACTOR_1_VAL ((0x1 << SAMPLE_ADC_DECMT_FACTOR_OFST) & SAMPLE_ADC_DECMT_FACTOR_MSK)
|
((0x0 << SAMPLE_ADC_DECMT_FACTOR_OFST) & SAMPLE_ADC_DECMT_FACTOR_MSK)
|
||||||
#define SAMPLE_ADC_DECMT_FACTOR_2_VAL ((0x2 << SAMPLE_ADC_DECMT_FACTOR_OFST) & SAMPLE_ADC_DECMT_FACTOR_MSK)
|
#define SAMPLE_ADC_DECMT_FACTOR_1_VAL \
|
||||||
#define SAMPLE_ADC_DECMT_FACTOR_3_VAL ((0x3 << SAMPLE_ADC_DECMT_FACTOR_OFST) & SAMPLE_ADC_DECMT_FACTOR_MSK)
|
((0x1 << SAMPLE_ADC_DECMT_FACTOR_OFST) & SAMPLE_ADC_DECMT_FACTOR_MSK)
|
||||||
#define SAMPLE_ADC_DECMT_FACTOR_4_VAL ((0x4 << SAMPLE_ADC_DECMT_FACTOR_OFST) & SAMPLE_ADC_DECMT_FACTOR_MSK)
|
#define SAMPLE_ADC_DECMT_FACTOR_2_VAL \
|
||||||
#define SAMPLE_ADC_DECMT_FACTOR_5_VAL ((0x5 << SAMPLE_ADC_DECMT_FACTOR_OFST) & SAMPLE_ADC_DECMT_FACTOR_MSK)
|
((0x2 << SAMPLE_ADC_DECMT_FACTOR_OFST) & SAMPLE_ADC_DECMT_FACTOR_MSK)
|
||||||
#define SAMPLE_ADC_DECMT_FACTOR_6_VAL ((0x6 << SAMPLE_ADC_DECMT_FACTOR_OFST) & SAMPLE_ADC_DECMT_FACTOR_MSK)
|
#define SAMPLE_ADC_DECMT_FACTOR_3_VAL \
|
||||||
#define SAMPLE_ADC_DECMT_FACTOR_7_VAL ((0x7 << SAMPLE_ADC_DECMT_FACTOR_OFST) & SAMPLE_ADC_DECMT_FACTOR_MSK)
|
((0x3 << SAMPLE_ADC_DECMT_FACTOR_OFST) & SAMPLE_ADC_DECMT_FACTOR_MSK)
|
||||||
|
#define SAMPLE_ADC_DECMT_FACTOR_4_VAL \
|
||||||
|
((0x4 << SAMPLE_ADC_DECMT_FACTOR_OFST) & SAMPLE_ADC_DECMT_FACTOR_MSK)
|
||||||
|
#define SAMPLE_ADC_DECMT_FACTOR_5_VAL \
|
||||||
|
((0x5 << SAMPLE_ADC_DECMT_FACTOR_OFST) & SAMPLE_ADC_DECMT_FACTOR_MSK)
|
||||||
|
#define SAMPLE_ADC_DECMT_FACTOR_6_VAL \
|
||||||
|
((0x6 << SAMPLE_ADC_DECMT_FACTOR_OFST) & SAMPLE_ADC_DECMT_FACTOR_MSK)
|
||||||
|
#define SAMPLE_ADC_DECMT_FACTOR_7_VAL \
|
||||||
|
((0x7 << SAMPLE_ADC_DECMT_FACTOR_OFST) & SAMPLE_ADC_DECMT_FACTOR_MSK)
|
||||||
|
|
||||||
#define SAMPLE_DGTL_SAMPLE_SEL_OFST (8)
|
#define SAMPLE_DGTL_SAMPLE_SEL_OFST (8)
|
||||||
#define SAMPLE_DGTL_SAMPLE_SEL_MSK (0x0000000F << SAMPLE_DGTL_SAMPLE_SEL_OFST)
|
#define SAMPLE_DGTL_SAMPLE_SEL_MSK (0x0000000F << SAMPLE_DGTL_SAMPLE_SEL_OFST)
|
||||||
#define SAMPLE_DGTL_SAMPLE_0_VAL ((0x0 << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
|
#define SAMPLE_DGTL_SAMPLE_0_VAL \
|
||||||
#define SAMPLE_DGTL_SAMPLE_1_VAL ((0x1 << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
|
((0x0 << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
|
||||||
#define SAMPLE_DGTL_SAMPLE_2_VAL ((0x2 << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
|
#define SAMPLE_DGTL_SAMPLE_1_VAL \
|
||||||
#define SAMPLE_DGTL_SAMPLE_3_VAL ((0x3 << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
|
((0x1 << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
|
||||||
#define SAMPLE_DGTL_SAMPLE_4_VAL ((0x4 << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
|
#define SAMPLE_DGTL_SAMPLE_2_VAL \
|
||||||
#define SAMPLE_DGTL_SAMPLE_5_VAL ((0x5 << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
|
((0x2 << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
|
||||||
#define SAMPLE_DGTL_SAMPLE_6_VAL ((0x6 << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
|
#define SAMPLE_DGTL_SAMPLE_3_VAL \
|
||||||
#define SAMPLE_DGTL_SAMPLE_7_VAL ((0x7 << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
|
((0x3 << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
|
||||||
#define SAMPLE_DGTL_SAMPLE_8_VAL ((0x8 << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
|
#define SAMPLE_DGTL_SAMPLE_4_VAL \
|
||||||
#define SAMPLE_DGTL_SAMPLE_9_VAL ((0x9 << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
|
((0x4 << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
|
||||||
#define SAMPLE_DGTL_SAMPLE_10_VAL ((0xa << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
|
#define SAMPLE_DGTL_SAMPLE_5_VAL \
|
||||||
#define SAMPLE_DGTL_SAMPLE_11_VAL ((0xb << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
|
((0x5 << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
|
||||||
#define SAMPLE_DGTL_SAMPLE_12_VAL ((0xc << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
|
#define SAMPLE_DGTL_SAMPLE_6_VAL \
|
||||||
#define SAMPLE_DGTL_SAMPLE_13_VAL ((0xd << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
|
((0x6 << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
|
||||||
#define SAMPLE_DGTL_SAMPLE_14_VAL ((0xe << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
|
#define SAMPLE_DGTL_SAMPLE_7_VAL \
|
||||||
#define SAMPLE_DGTL_SAMPLE_15_VAL ((0xf << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
|
((0x7 << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
|
||||||
|
#define SAMPLE_DGTL_SAMPLE_8_VAL \
|
||||||
|
((0x8 << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
|
||||||
|
#define SAMPLE_DGTL_SAMPLE_9_VAL \
|
||||||
|
((0x9 << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
|
||||||
|
#define SAMPLE_DGTL_SAMPLE_10_VAL \
|
||||||
|
((0xa << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
|
||||||
|
#define SAMPLE_DGTL_SAMPLE_11_VAL \
|
||||||
|
((0xb << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
|
||||||
|
#define SAMPLE_DGTL_SAMPLE_12_VAL \
|
||||||
|
((0xc << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
|
||||||
|
#define SAMPLE_DGTL_SAMPLE_13_VAL \
|
||||||
|
((0xd << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
|
||||||
|
#define SAMPLE_DGTL_SAMPLE_14_VAL \
|
||||||
|
((0xe << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
|
||||||
|
#define SAMPLE_DGTL_SAMPLE_15_VAL \
|
||||||
|
((0xf << SAMPLE_DGTL_SAMPLE_SEL_OFST) & SAMPLE_DGTL_SAMPLE_SEL_MSK)
|
||||||
|
|
||||||
#define SAMPLE_DGTL_DECMT_FACTOR_OFST (12)
|
#define SAMPLE_DGTL_DECMT_FACTOR_OFST (12)
|
||||||
#define SAMPLE_DGTL_DECMT_FACTOR_MSK (0x00000003 << SAMPLE_DGTL_DECMT_FACTOR_OFST)
|
#define SAMPLE_DGTL_DECMT_FACTOR_MSK \
|
||||||
#define SAMPLE_DECMT_FACTOR_FULL_VAL ((0x0 << SAMPLE_DGTL_DECMT_FACTOR_OFST) & SAMPLE_DGTL_DECMT_FACTOR_MSK)
|
(0x00000003 << SAMPLE_DGTL_DECMT_FACTOR_OFST)
|
||||||
#define SAMPLE_DECMT_FACTOR_HALF_VAL ((0x1 << SAMPLE_DGTL_DECMT_FACTOR_OFST) & SAMPLE_DGTL_DECMT_FACTOR_MSK)
|
#define SAMPLE_DECMT_FACTOR_FULL_VAL \
|
||||||
#define SAMPLE_DECMT_FACTOR_QUARTER_VAL ((0x2 << SAMPLE_DGTL_DECMT_FACTOR_OFST) & SAMPLE_DGTL_DECMT_FACTOR_MSK)
|
((0x0 << SAMPLE_DGTL_DECMT_FACTOR_OFST) & SAMPLE_DGTL_DECMT_FACTOR_MSK)
|
||||||
|
#define SAMPLE_DECMT_FACTOR_HALF_VAL \
|
||||||
|
((0x1 << SAMPLE_DGTL_DECMT_FACTOR_OFST) & SAMPLE_DGTL_DECMT_FACTOR_MSK)
|
||||||
|
#define SAMPLE_DECMT_FACTOR_QUARTER_VAL \
|
||||||
|
((0x2 << SAMPLE_DGTL_DECMT_FACTOR_OFST) & SAMPLE_DGTL_DECMT_FACTOR_MSK)
|
||||||
|
|
||||||
/** Vref Comp Mod Register */
|
/** Vref Comp Mod Register */
|
||||||
#define EXT_DAQ_CTRL_REG (0x5C << MEM_MAP_SHIFT)
|
#define EXT_DAQ_CTRL_REG (0x5C << MEM_MAP_SHIFT)
|
||||||
@ -280,21 +332,25 @@
|
|||||||
#define EXT_DAQ_CTRL_VREF_COMP_OFST (0)
|
#define EXT_DAQ_CTRL_VREF_COMP_OFST (0)
|
||||||
#define EXT_DAQ_CTRL_VREF_COMP_MSK (0x00000FFF << EXT_DAQ_CTRL_VREF_COMP_OFST)
|
#define EXT_DAQ_CTRL_VREF_COMP_MSK (0x00000FFF << EXT_DAQ_CTRL_VREF_COMP_OFST)
|
||||||
#define EXT_DAQ_CTRL_CMP_LGC_ENBL_OFST (15)
|
#define EXT_DAQ_CTRL_CMP_LGC_ENBL_OFST (15)
|
||||||
#define EXT_DAQ_CTRL_CMP_LGC_ENBL_MSK (0x00000001 << EXT_DAQ_CTRL_CMP_LGC_ENBL_OFST)
|
#define EXT_DAQ_CTRL_CMP_LGC_ENBL_MSK \
|
||||||
|
(0x00000001 << EXT_DAQ_CTRL_CMP_LGC_ENBL_OFST)
|
||||||
#define EXT_DAQ_CTRL_INPT_DETECT_OFST (16)
|
#define EXT_DAQ_CTRL_INPT_DETECT_OFST (16)
|
||||||
#define EXT_DAQ_CTRL_INPT_DETECT_MSK (0x00000007 << EXT_DAQ_CTRL_INPT_DETECT_OFST)
|
#define EXT_DAQ_CTRL_INPT_DETECT_MSK \
|
||||||
|
(0x00000007 << EXT_DAQ_CTRL_INPT_DETECT_OFST)
|
||||||
#define EXT_DAQ_CTRL_INPT_DETECT_ENBL_OFST (19)
|
#define EXT_DAQ_CTRL_INPT_DETECT_ENBL_OFST (19)
|
||||||
#define EXT_DAQ_CTRL_INPT_DETECT_ENBL_MSK (0x00000001 << EXT_DAQ_CTRL_INPT_DETECT_ENBL_OFST)
|
#define EXT_DAQ_CTRL_INPT_DETECT_ENBL_MSK \
|
||||||
|
(0x00000001 << EXT_DAQ_CTRL_INPT_DETECT_ENBL_OFST)
|
||||||
|
|
||||||
/** DAQ Register */
|
/** DAQ Register */
|
||||||
#define DAQ_REG (0x5D << MEM_MAP_SHIFT)
|
#define DAQ_REG (0x5D << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
#define DAQ_SETTINGS_MSK (DAQ_HIGH_GAIN_MSK | DAQ_FIX_GAIN_MSK | DAQ_FRCE_SWTCH_GAIN_MSK)
|
#define DAQ_SETTINGS_MSK \
|
||||||
|
(DAQ_HIGH_GAIN_MSK | DAQ_FIX_GAIN_MSK | DAQ_FRCE_SWTCH_GAIN_MSK)
|
||||||
#define DAQ_HIGH_GAIN_OFST (0)
|
#define DAQ_HIGH_GAIN_OFST (0)
|
||||||
#define DAQ_HIGH_GAIN_MSK (0x00000001 << DAQ_HIGH_GAIN_OFST)
|
#define DAQ_HIGH_GAIN_MSK (0x00000001 << DAQ_HIGH_GAIN_OFST)
|
||||||
#define DAQ_FIX_GAIN_DYNMC_VAL ((0x0 << DAQ_HIGH_GAIN_OFST) & DAQ_HIGH_GAIN_MSK)
|
#define DAQ_FIX_GAIN_DYNMC_VAL ((0x0 << DAQ_HIGH_GAIN_OFST) & DAQ_HIGH_GAIN_MSK)
|
||||||
#define DAQ_FIX_GAIN_HIGHGAIN_VAL ((0x1 << DAQ_HIGH_GAIN_OFST) & DAQ_HIGH_GAIN_MSK)
|
#define DAQ_FIX_GAIN_HIGHGAIN_VAL \
|
||||||
|
((0x1 << DAQ_HIGH_GAIN_OFST) & DAQ_HIGH_GAIN_MSK)
|
||||||
#define DAQ_FIX_GAIN_OFST (1)
|
#define DAQ_FIX_GAIN_OFST (1)
|
||||||
#define DAQ_FIX_GAIN_MSK (0x00000003 << DAQ_FIX_GAIN_OFST)
|
#define DAQ_FIX_GAIN_MSK (0x00000003 << DAQ_FIX_GAIN_OFST)
|
||||||
#define DAQ_FIX_GAIN_STG_1_VAL ((0x1 << DAQ_FIX_GAIN_OFST) & DAQ_FIX_GAIN_MSK)
|
#define DAQ_FIX_GAIN_STG_1_VAL ((0x1 << DAQ_FIX_GAIN_OFST) & DAQ_FIX_GAIN_MSK)
|
||||||
@ -305,8 +361,10 @@
|
|||||||
#define DAQ_STRG_CELL_SLCT_MSK (0x0000000F << DAQ_STRG_CELL_SLCT_OFST)
|
#define DAQ_STRG_CELL_SLCT_MSK (0x0000000F << DAQ_STRG_CELL_SLCT_OFST)
|
||||||
#define DAQ_FRCE_SWTCH_GAIN_OFST (12)
|
#define DAQ_FRCE_SWTCH_GAIN_OFST (12)
|
||||||
#define DAQ_FRCE_SWTCH_GAIN_MSK (0x00000003 << DAQ_FRCE_SWTCH_GAIN_OFST)
|
#define DAQ_FRCE_SWTCH_GAIN_MSK (0x00000003 << DAQ_FRCE_SWTCH_GAIN_OFST)
|
||||||
#define DAQ_FRCE_GAIN_STG_1_VAL ((0x1 << DAQ_FRCE_SWTCH_GAIN_OFST) & DAQ_FRCE_SWTCH_GAIN_MSK)
|
#define DAQ_FRCE_GAIN_STG_1_VAL \
|
||||||
#define DAQ_FRCE_GAIN_STG_2_VAL ((0x3 << DAQ_FRCE_SWTCH_GAIN_OFST) & DAQ_FRCE_SWTCH_GAIN_MSK)
|
((0x1 << DAQ_FRCE_SWTCH_GAIN_OFST) & DAQ_FRCE_SWTCH_GAIN_MSK)
|
||||||
|
#define DAQ_FRCE_GAIN_STG_2_VAL \
|
||||||
|
((0x3 << DAQ_FRCE_SWTCH_GAIN_OFST) & DAQ_FRCE_SWTCH_GAIN_MSK)
|
||||||
#define DAQ_ELCTRN_CLLCTN_MDE_OFST (14)
|
#define DAQ_ELCTRN_CLLCTN_MDE_OFST (14)
|
||||||
#define DAQ_ELCTRN_CLLCTN_MDE_MSK (0x00000001 << DAQ_ELCTRN_CLLCTN_MDE_OFST)
|
#define DAQ_ELCTRN_CLLCTN_MDE_MSK (0x00000001 << DAQ_ELCTRN_CLLCTN_MDE_OFST)
|
||||||
#define DAQ_G2_CNNT_OFST (15)
|
#define DAQ_G2_CNNT_OFST (15)
|
||||||
@ -326,19 +384,18 @@
|
|||||||
#define CHIP_POWER_STATUS_OFST (1)
|
#define CHIP_POWER_STATUS_OFST (1)
|
||||||
#define CHIP_POWER_STATUS_MSK (0x00000001 << CHIP_POWER_STATUS_OFST)
|
#define CHIP_POWER_STATUS_MSK (0x00000001 << CHIP_POWER_STATUS_OFST)
|
||||||
|
|
||||||
|
|
||||||
/** Temperature Control Register */
|
/** Temperature Control Register */
|
||||||
#define TEMP_CTRL_REG (0x5F << MEM_MAP_SHIFT)
|
#define TEMP_CTRL_REG (0x5F << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
#define TEMP_CTRL_PROTCT_THRSHLD_OFST (0)
|
#define TEMP_CTRL_PROTCT_THRSHLD_OFST (0)
|
||||||
#define TEMP_CTRL_PROTCT_THRSHLD_MSK (0x000007FF << TEMP_CTRL_PROTCT_THRSHLD_OFST)
|
#define TEMP_CTRL_PROTCT_THRSHLD_MSK \
|
||||||
|
(0x000007FF << TEMP_CTRL_PROTCT_THRSHLD_OFST)
|
||||||
#define TEMP_CTRL_PROTCT_ENABLE_OFST (16)
|
#define TEMP_CTRL_PROTCT_ENABLE_OFST (16)
|
||||||
#define TEMP_CTRL_PROTCT_ENABLE_MSK (0x00000001 << TEMP_CTRL_PROTCT_ENABLE_OFST)
|
#define TEMP_CTRL_PROTCT_ENABLE_MSK (0x00000001 << TEMP_CTRL_PROTCT_ENABLE_OFST)
|
||||||
// set when temp higher than over threshold, write 1 to clear it
|
// set when temp higher than over threshold, write 1 to clear it
|
||||||
#define TEMP_CTRL_OVR_TMP_EVNT_OFST (31)
|
#define TEMP_CTRL_OVR_TMP_EVNT_OFST (31)
|
||||||
#define TEMP_CTRL_OVR_TMP_EVNT_MSK (0x00000001 << TEMP_CTRL_OVR_TMP_EVNT_OFST)
|
#define TEMP_CTRL_OVR_TMP_EVNT_MSK (0x00000001 << TEMP_CTRL_OVR_TMP_EVNT_OFST)
|
||||||
|
|
||||||
|
|
||||||
/* Set Delay 64 bit register */
|
/* Set Delay 64 bit register */
|
||||||
#define SET_DELAY_LSB_REG (0x60 << MEM_MAP_SHIFT) // different kind of delay
|
#define SET_DELAY_LSB_REG (0x60 << MEM_MAP_SHIFT) // different kind of delay
|
||||||
#define SET_DELAY_MSB_REG (0x61 << MEM_MAP_SHIFT) // different kind of delay
|
#define SET_DELAY_MSB_REG (0x61 << MEM_MAP_SHIFT) // different kind of delay
|
||||||
@ -383,7 +440,6 @@
|
|||||||
#define COORD_COL_INNER_OFST (16)
|
#define COORD_COL_INNER_OFST (16)
|
||||||
#define COORD_COL_INNER_MSK (0x0000FFFF << COORD_COL_INNER_OFST)
|
#define COORD_COL_INNER_MSK (0x0000FFFF << COORD_COL_INNER_OFST)
|
||||||
|
|
||||||
|
|
||||||
/** Module column coordinates */
|
/** Module column coordinates */
|
||||||
#define COORD_RESERVED_REG (0x7E << MEM_MAP_SHIFT)
|
#define COORD_RESERVED_REG (0x7E << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
@ -397,39 +453,42 @@
|
|||||||
// tPC = (PCT + 1) * 25ns
|
// tPC = (PCT + 1) * 25ns
|
||||||
#define ASIC_CTRL_PRCHRG_TMR_OFST (0)
|
#define ASIC_CTRL_PRCHRG_TMR_OFST (0)
|
||||||
#define ASIC_CTRL_PRCHRG_TMR_MSK (0x000000FF << ASIC_CTRL_PRCHRG_TMR_OFST)
|
#define ASIC_CTRL_PRCHRG_TMR_MSK (0x000000FF << ASIC_CTRL_PRCHRG_TMR_OFST)
|
||||||
#define ASIC_CTRL_PRCHRG_TMR_VAL ((0x1F << ASIC_CTRL_PRCHRG_TMR_OFST) & ASIC_CTRL_PRCHRG_TMR_MSK)
|
#define ASIC_CTRL_PRCHRG_TMR_VAL \
|
||||||
|
((0x1F << ASIC_CTRL_PRCHRG_TMR_OFST) & ASIC_CTRL_PRCHRG_TMR_MSK)
|
||||||
// tDS = (DST + 1) * 25ns
|
// tDS = (DST + 1) * 25ns
|
||||||
#define ASIC_CTRL_DS_TMR_OFST (8)
|
#define ASIC_CTRL_DS_TMR_OFST (8)
|
||||||
#define ASIC_CTRL_DS_TMR_MSK (0x000000FF << ASIC_CTRL_DS_TMR_OFST)
|
#define ASIC_CTRL_DS_TMR_MSK (0x000000FF << ASIC_CTRL_DS_TMR_OFST)
|
||||||
#define ASIC_CTRL_DS_TMR_VAL ((0x1F << ASIC_CTRL_DS_TMR_OFST) & ASIC_CTRL_DS_TMR_MSK)
|
#define ASIC_CTRL_DS_TMR_VAL \
|
||||||
// tET = (ET + 1) * 25ns (increase timeout range between 2 consecutive storage cells)
|
((0x1F << ASIC_CTRL_DS_TMR_OFST) & ASIC_CTRL_DS_TMR_MSK)
|
||||||
|
// tET = (ET + 1) * 25ns (increase timeout range between 2 consecutive storage
|
||||||
|
// cells)
|
||||||
#define ASIC_CTRL_EXPSRE_TMR_OFST (16)
|
#define ASIC_CTRL_EXPSRE_TMR_OFST (16)
|
||||||
#define ASIC_CTRL_EXPSRE_TMR_MSK (0x0000FFFF << ASIC_CTRL_EXPSRE_TMR_OFST)
|
#define ASIC_CTRL_EXPSRE_TMR_MSK (0x0000FFFF << ASIC_CTRL_EXPSRE_TMR_OFST)
|
||||||
#define ASIC_CTRL_EXPSRE_TMR_MAX_VAL (0x0000FFFF / (CLK_RUN * 1E-3))
|
#define ASIC_CTRL_EXPSRE_TMR_MAX_VAL (0x0000FFFF / (CLK_RUN * 1E-3))
|
||||||
|
|
||||||
|
|
||||||
/* ADC 0 Deserializer Control */
|
/* ADC 0 Deserializer Control */
|
||||||
#define ADC_DSRLZR_0_REG (0xF0 << MEM_MAP_SHIFT)
|
#define ADC_DSRLZR_0_REG (0xF0 << MEM_MAP_SHIFT)
|
||||||
#define ADC_DSRLZR_0_RFRSH_ALGNMNT_OFST (31) /* Refresh alignment */
|
#define ADC_DSRLZR_0_RFRSH_ALGNMNT_OFST (31) /* Refresh alignment */
|
||||||
#define ADC_DSRLZR_0_RFRSH_ALGNMNT_MSK (0x00000001 << ADC_DSRLZR_0_RFRSH_ALGNMNT_OFST)
|
#define ADC_DSRLZR_0_RFRSH_ALGNMNT_MSK \
|
||||||
|
(0x00000001 << ADC_DSRLZR_0_RFRSH_ALGNMNT_OFST)
|
||||||
|
|
||||||
/* ADC 0 Deserializer Control */
|
/* ADC 0 Deserializer Control */
|
||||||
#define ADC_DSRLZR_1_REG (0xF1 << MEM_MAP_SHIFT)
|
#define ADC_DSRLZR_1_REG (0xF1 << MEM_MAP_SHIFT)
|
||||||
#define ADC_DSRLZR_1_RFRSH_ALGNMNT_OFST (31)
|
#define ADC_DSRLZR_1_RFRSH_ALGNMNT_OFST (31)
|
||||||
#define ADC_DSRLZR_1_RFRSH_ALGNMNT_MSK (0x00000001 << ADC_DSRLZR_1_RFRSH_ALGNMNT_OFST)
|
#define ADC_DSRLZR_1_RFRSH_ALGNMNT_MSK \
|
||||||
|
(0x00000001 << ADC_DSRLZR_1_RFRSH_ALGNMNT_OFST)
|
||||||
|
|
||||||
/* ADC 0 Deserializer Control */
|
/* ADC 0 Deserializer Control */
|
||||||
#define ADC_DSRLZR_2_REG (0xF2 << MEM_MAP_SHIFT)
|
#define ADC_DSRLZR_2_REG (0xF2 << MEM_MAP_SHIFT)
|
||||||
#define ADC_DSRLZR_2_RFRSH_ALGNMNT_OFST (31)
|
#define ADC_DSRLZR_2_RFRSH_ALGNMNT_OFST (31)
|
||||||
#define ADC_DSRLZR_2_RFRSH_ALGNMNT_MSK (0x00000001 << ADC_DSRLZR_2_RFRSH_ALGNMNT_OFST)
|
#define ADC_DSRLZR_2_RFRSH_ALGNMNT_MSK \
|
||||||
|
(0x00000001 << ADC_DSRLZR_2_RFRSH_ALGNMNT_OFST)
|
||||||
|
|
||||||
/* ADC 0 Deserializer Control */
|
/* ADC 0 Deserializer Control */
|
||||||
#define ADC_DSRLZR_3_REG (0xF3 << MEM_MAP_SHIFT)
|
#define ADC_DSRLZR_3_REG (0xF3 << MEM_MAP_SHIFT)
|
||||||
#define ADC_DSRLZR_3_RFRSH_ALGNMNT_OFST (31)
|
#define ADC_DSRLZR_3_RFRSH_ALGNMNT_OFST (31)
|
||||||
#define ADC_DSRLZR_3_RFRSH_ALGNMNT_MSK (0x00000001 << ADC_DSRLZR_3_RFRSH_ALGNMNT_OFST)
|
#define ADC_DSRLZR_3_RFRSH_ALGNMNT_MSK \
|
||||||
|
(0x00000001 << ADC_DSRLZR_3_RFRSH_ALGNMNT_OFST)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Round Robin */
|
/* Round Robin */
|
||||||
#define RXR_ENDPOINTS_MAX (64)
|
#define RXR_ENDPOINTS_MAX (64)
|
||||||
@ -437,8 +496,3 @@
|
|||||||
#define RXR_ENDPOINT_INNER_START_REG (0x2000 << MEM_MAP_SHIFT)
|
#define RXR_ENDPOINT_INNER_START_REG (0x2000 << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
#define RXR_ENDPOINT_OFST (0x10 << MEM_MAP_SHIFT)
|
#define RXR_ENDPOINT_OFST (0x10 << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Binary file not shown.
880
slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c
Executable file → Normal file
880
slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
66
slsDetectorServers/jungfrauDetectorServer/slsDetectorServer_defs.h
Executable file → Normal file
66
slsDetectorServers/jungfrauDetectorServer/slsDetectorServer_defs.h
Executable file → Normal file
@ -1,7 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "sls_detector_defs.h"
|
|
||||||
#include "RegisterDefs.h"
|
#include "RegisterDefs.h"
|
||||||
|
#include "sls_detector_defs.h"
|
||||||
|
|
||||||
#define MIN_REQRD_VRSN_T_RD_API 0x171220
|
#define MIN_REQRD_VRSN_T_RD_API 0x171220
|
||||||
#define REQRD_FRMWRE_VRSN_BOARD2 0x190716 // old
|
#define REQRD_FRMWRE_VRSN_BOARD2 0x190716 // old
|
||||||
@ -16,13 +15,13 @@ typedef struct udp_header_struct {
|
|||||||
uint16_t udp_destmac_lsb;
|
uint16_t udp_destmac_lsb;
|
||||||
uint32_t udp_srcmac_lsb;
|
uint32_t udp_srcmac_lsb;
|
||||||
uint8_t ip_tos;
|
uint8_t ip_tos;
|
||||||
uint8_t ip_ihl: 4, ip_ver: 4;
|
uint8_t ip_ihl : 4, ip_ver : 4;
|
||||||
uint16_t udp_ethertype;
|
uint16_t udp_ethertype;
|
||||||
uint16_t ip_identification;
|
uint16_t ip_identification;
|
||||||
uint16_t ip_totallength;
|
uint16_t ip_totallength;
|
||||||
uint8_t ip_protocol;
|
uint8_t ip_protocol;
|
||||||
uint8_t ip_ttl;
|
uint8_t ip_ttl;
|
||||||
uint16_t ip_fragmentoffset: 13, ip_flags: 3;
|
uint16_t ip_fragmentoffset : 13, ip_flags : 3;
|
||||||
uint16_t ip_srcip_msb;
|
uint16_t ip_srcip_msb;
|
||||||
uint16_t ip_checksum;
|
uint16_t ip_checksum;
|
||||||
uint16_t ip_destip_msb;
|
uint16_t ip_destip_msb;
|
||||||
@ -36,11 +35,21 @@ typedef struct udp_header_struct {
|
|||||||
#define IP_HEADER_SIZE (20)
|
#define IP_HEADER_SIZE (20)
|
||||||
#define UDP_IP_HEADER_LENGTH_BYTES (28)
|
#define UDP_IP_HEADER_LENGTH_BYTES (28)
|
||||||
|
|
||||||
|
|
||||||
/* Enums */
|
/* Enums */
|
||||||
enum ADCINDEX {TEMP_FPGA, TEMP_ADC};
|
enum ADCINDEX { TEMP_FPGA, TEMP_ADC };
|
||||||
enum DACINDEX {J_VB_COMP, J_VDD_PROT, J_VIN_COM, J_VREF_PRECH, J_VB_PIXBUF, J_VB_DS, J_VREF_DS, J_VREF_COMP };
|
enum DACINDEX {
|
||||||
#define DEFAULT_DAC_VALS { 1220, /* J_VB_COMP */ \
|
J_VB_COMP,
|
||||||
|
J_VDD_PROT,
|
||||||
|
J_VIN_COM,
|
||||||
|
J_VREF_PRECH,
|
||||||
|
J_VB_PIXBUF,
|
||||||
|
J_VB_DS,
|
||||||
|
J_VREF_DS,
|
||||||
|
J_VREF_COMP
|
||||||
|
};
|
||||||
|
#define DEFAULT_DAC_VALS \
|
||||||
|
{ \
|
||||||
|
1220, /* J_VB_COMP */ \
|
||||||
3000, /* J_VDD_PROT */ \
|
3000, /* J_VDD_PROT */ \
|
||||||
1053, /* J_VIN_COM */ \
|
1053, /* J_VIN_COM */ \
|
||||||
1450, /* J_VREF_PRECH */ \
|
1450, /* J_VREF_PRECH */ \
|
||||||
@ -50,7 +59,7 @@ enum DACINDEX {J_VB_COMP, J_VDD_PROT, J_VIN_COM, J_VREF_PRECH, J_VB_PIXBUF, J
|
|||||||
420 /* J_VREF_COMP */ \
|
420 /* J_VREF_COMP */ \
|
||||||
};
|
};
|
||||||
enum NETWORKINDEX { TXN_FRAME, FLOWCTRL_10G };
|
enum NETWORKINDEX { TXN_FRAME, FLOWCTRL_10G };
|
||||||
enum CLKINDEX {RUN_CLK, ADC_CLK, DBIT_CLK, NUM_CLOCKS};
|
enum CLKINDEX { RUN_CLK, ADC_CLK, DBIT_CLK, NUM_CLOCKS };
|
||||||
#define CLK_NAMES "run", "adc", "dbit"
|
#define CLK_NAMES "run", "adc", "dbit"
|
||||||
|
|
||||||
/* Hardware Definitions */
|
/* Hardware Definitions */
|
||||||
@ -67,17 +76,17 @@ enum CLKINDEX {RUN_CLK, ADC_CLK, DBIT_CLK, NUM_CLOCKS};
|
|||||||
#define DBIT_CLK_INDEX (0)
|
#define DBIT_CLK_INDEX (0)
|
||||||
|
|
||||||
/** Default Parameters */
|
/** Default Parameters */
|
||||||
#define DEFAULT_NUM_FRAMES (100*1000*1000)
|
#define DEFAULT_NUM_FRAMES (100 * 1000 * 1000)
|
||||||
#define DEFAULT_STARTING_FRAME_NUMBER (1)
|
#define DEFAULT_STARTING_FRAME_NUMBER (1)
|
||||||
#define DEFAULT_NUM_CYCLES (1)
|
#define DEFAULT_NUM_CYCLES (1)
|
||||||
#define DEFAULT_EXPTIME (10*1000) //ns
|
#define DEFAULT_EXPTIME (10 * 1000) // ns
|
||||||
#define DEFAULT_PERIOD (2*1000*1000) //ns
|
#define DEFAULT_PERIOD (2 * 1000 * 1000) // ns
|
||||||
#define DEFAULT_DELAY (0)
|
#define DEFAULT_DELAY (0)
|
||||||
#define DEFAULT_HIGH_VOLTAGE (0)
|
#define DEFAULT_HIGH_VOLTAGE (0)
|
||||||
#define DEFAULT_TIMING_MODE (AUTO_TIMING)
|
#define DEFAULT_TIMING_MODE (AUTO_TIMING)
|
||||||
#define DEFAULT_SETTINGS (DYNAMICGAIN)
|
#define DEFAULT_SETTINGS (DYNAMICGAIN)
|
||||||
#define DEFAULT_TX_UDP_PORT (0x7e9a)
|
#define DEFAULT_TX_UDP_PORT (0x7e9a)
|
||||||
#define DEFAULT_TMP_THRSHLD (65*1000) //milli degree Celsius
|
#define DEFAULT_TMP_THRSHLD (65 * 1000) // milli degree Celsius
|
||||||
#define DEFAULT_NUM_STRG_CLLS (0)
|
#define DEFAULT_NUM_STRG_CLLS (0)
|
||||||
#define DEFAULT_STRG_CLL_STRT (0xf)
|
#define DEFAULT_STRG_CLL_STRT (0xf)
|
||||||
#define DEFAULT_STRG_CLL_DLY (0)
|
#define DEFAULT_STRG_CLL_DLY (0)
|
||||||
@ -89,16 +98,14 @@ enum CLKINDEX {RUN_CLK, ADC_CLK, DBIT_CLK, NUM_CLOCKS};
|
|||||||
|
|
||||||
/* Defines in the Firmware */
|
/* Defines in the Firmware */
|
||||||
#define MAX_TIMESLOT_VAL (0x1F)
|
#define MAX_TIMESLOT_VAL (0x1F)
|
||||||
#define MAX_THRESHOLD_TEMP_VAL (127999) //millidegrees
|
#define MAX_THRESHOLD_TEMP_VAL (127999) // millidegrees
|
||||||
#define MAX_STORAGE_CELL_VAL (15) //0xF
|
#define MAX_STORAGE_CELL_VAL (15) // 0xF
|
||||||
#define MAX_STORAGE_CELL_DLY_NS_VAL (ASIC_CTRL_EXPSRE_TMR_MAX_VAL)
|
#define MAX_STORAGE_CELL_DLY_NS_VAL (ASIC_CTRL_EXPSRE_TMR_MAX_VAL)
|
||||||
#define ACQ_TIME_MIN_CLOCK (2)
|
#define ACQ_TIME_MIN_CLOCK (2)
|
||||||
|
|
||||||
#define MAX_PHASE_SHIFTS (160)
|
#define MAX_PHASE_SHIFTS (160)
|
||||||
#define BIT16_MASK (0xFFFF)
|
#define BIT16_MASK (0xFFFF)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define ADC_OFST_FULL_SPEED_VAL (0xf)
|
#define ADC_OFST_FULL_SPEED_VAL (0xf)
|
||||||
#define ADC_OFST_HALF_SPEED_VAL (0xb)
|
#define ADC_OFST_HALF_SPEED_VAL (0xb)
|
||||||
#define ADC_OFST_QUARTER_SPEED_VAL (0x7)
|
#define ADC_OFST_QUARTER_SPEED_VAL (0x7)
|
||||||
@ -108,18 +115,27 @@ enum CLKINDEX {RUN_CLK, ADC_CLK, DBIT_CLK, NUM_CLOCKS};
|
|||||||
#define ADC_PORT_INVERT_VAL (0x5A5A5A5A)
|
#define ADC_PORT_INVERT_VAL (0x5A5A5A5A)
|
||||||
#define ADC_PORT_INVERT_BOARD2_VAL (0x453b2a9c)
|
#define ADC_PORT_INVERT_BOARD2_VAL (0x453b2a9c)
|
||||||
|
|
||||||
#define SAMPLE_ADC_FULL_SPEED (SAMPLE_ADC_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_0_VAL + SAMPLE_DGTL_SAMPLE_2_VAL + SAMPLE_DECMT_FACTOR_FULL_VAL) // 0x200
|
#define SAMPLE_ADC_FULL_SPEED \
|
||||||
#define SAMPLE_ADC_HALF_SPEED (SAMPLE_ADC_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_1_VAL + SAMPLE_DGTL_SAMPLE_3_VAL + SAMPLE_DECMT_FACTOR_HALF_VAL) // 0x1310
|
(SAMPLE_ADC_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_0_VAL + \
|
||||||
#define SAMPLE_ADC_QUARTER_SPEED (SAMPLE_ADC_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_3_VAL + SAMPLE_DGTL_SAMPLE_6_VAL + SAMPLE_DECMT_FACTOR_QUARTER_VAL) // 0x2630
|
SAMPLE_DGTL_SAMPLE_2_VAL + SAMPLE_DECMT_FACTOR_FULL_VAL) // 0x200
|
||||||
#define SAMPLE_ADC_HALF_SPEED_BOARD2 (SAMPLE_ADC_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_0_VAL + SAMPLE_DGTL_SAMPLE_6_VAL + SAMPLE_DECMT_FACTOR_HALF_VAL) // 0x1600
|
#define SAMPLE_ADC_HALF_SPEED \
|
||||||
#define SAMPLE_ADC_QUARTER_SPEED_BOARD2 (SAMPLE_ADC_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_1_VAL + SAMPLE_DGTL_SAMPLE_11_VAL + SAMPLE_DECMT_FACTOR_QUARTER_VAL) // 0x2b10
|
(SAMPLE_ADC_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_1_VAL + \
|
||||||
|
SAMPLE_DGTL_SAMPLE_3_VAL + SAMPLE_DECMT_FACTOR_HALF_VAL) // 0x1310
|
||||||
|
#define SAMPLE_ADC_QUARTER_SPEED \
|
||||||
|
(SAMPLE_ADC_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_3_VAL + \
|
||||||
|
SAMPLE_DGTL_SAMPLE_6_VAL + SAMPLE_DECMT_FACTOR_QUARTER_VAL) // 0x2630
|
||||||
|
#define SAMPLE_ADC_HALF_SPEED_BOARD2 \
|
||||||
|
(SAMPLE_ADC_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_0_VAL + \
|
||||||
|
SAMPLE_DGTL_SAMPLE_6_VAL + SAMPLE_DECMT_FACTOR_HALF_VAL) // 0x1600
|
||||||
|
#define SAMPLE_ADC_QUARTER_SPEED_BOARD2 \
|
||||||
|
(SAMPLE_ADC_SAMPLE_0_VAL + SAMPLE_ADC_DECMT_FACTOR_1_VAL + \
|
||||||
|
SAMPLE_DGTL_SAMPLE_11_VAL + SAMPLE_DECMT_FACTOR_QUARTER_VAL) // 0x2b10
|
||||||
|
|
||||||
#define ADC_PHASE_FULL_SPEED (28)
|
#define ADC_PHASE_FULL_SPEED (28)
|
||||||
#define ADC_PHASE_HALF_SPEED (35)
|
#define ADC_PHASE_HALF_SPEED (35)
|
||||||
#define ADC_PHASE_QUARTER_SPEED (35)
|
#define ADC_PHASE_QUARTER_SPEED (35)
|
||||||
#define ADC_PHASE_HALF_SPEED_BOARD2 (0x1E) //30
|
#define ADC_PHASE_HALF_SPEED_BOARD2 (0x1E) // 30
|
||||||
#define ADC_PHASE_QUARTER_SPEED_BOARD2 (0x1E) //30
|
#define ADC_PHASE_QUARTER_SPEED_BOARD2 (0x1E) // 30
|
||||||
|
|
||||||
|
|
||||||
#define DBIT_PHASE_FULL_SPEED (37)
|
#define DBIT_PHASE_FULL_SPEED (37)
|
||||||
#define DBIT_PHASE_HALF_SPEED (37)
|
#define DBIT_PHASE_HALF_SPEED (37)
|
||||||
|
@ -31,7 +31,7 @@ target_compile_definitions(moenchDetectorServer_virtual
|
|||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(moenchDetectorServer_virtual
|
target_link_libraries(moenchDetectorServer_virtual
|
||||||
PUBLIC pthread rt slsProjectCWarnings
|
PUBLIC pthread rt slsProjectCSettings
|
||||||
m
|
m
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user