mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-30 01:40:04 +02:00
clang tidy
This commit is contained in:
parent
39221f1230
commit
70b2a41d5e
18
.clang-tidy
18
.clang-tidy
@ -1,5 +1,21 @@
|
|||||||
---
|
---
|
||||||
Checks: '*, -google-runtime-references, -hicpp-no-array-decay, -cppcoreguidelines-pro-bounds-array-to-pointer-decay, -cppcoreguidelines-pro-bounds-pointer-arithmetic, -fuchsia*,-readability-else-after-return,-readability-avoid-const-params-in-decls,-hicpp-signed-bitwise,-cppcoreguidelines-pro-bounds-constant-array-index,-llvm-header-guard,-readability-static-accessed-through-instance,-google-readability-todo'
|
Checks: '*,
|
||||||
|
-google-runtime-references,
|
||||||
|
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
|
||||||
|
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
|
||||||
|
-fuchsia*,
|
||||||
|
-readability-else-after-return,
|
||||||
|
-readability-avoid-const-params-in-decls,
|
||||||
|
-cppcoreguidelines-pro-bounds-constant-array-index,
|
||||||
|
-cppcoreguidelines-pro-type-reinterpret-cast,
|
||||||
|
-llvm-header-guard,
|
||||||
|
-readability-static-accessed-through-instance,
|
||||||
|
-readability-braces-around-statements,
|
||||||
|
-hicpp-signed-bitwise,
|
||||||
|
-hicpp-no-array-decay,
|
||||||
|
-hicpp-braces-around-statements,
|
||||||
|
-google-readability-todo,
|
||||||
|
-google-readability-braces-around-statements'
|
||||||
WarningsAsErrors: '*'
|
WarningsAsErrors: '*'
|
||||||
HeaderFilterRegex: '.*'
|
HeaderFilterRegex: '.*'
|
||||||
AnalyzeTemporaryDtors: false
|
AnalyzeTemporaryDtors: false
|
||||||
|
@ -2,13 +2,8 @@ cmake_minimum_required(VERSION 3.9)
|
|||||||
project(slsDetectorPackage)
|
project(slsDetectorPackage)
|
||||||
set(PROJECT_VERSION 5.0.0)
|
set(PROJECT_VERSION 5.0.0)
|
||||||
|
|
||||||
|
|
||||||
include(CheckIPOSupported)
|
include(CheckIPOSupported)
|
||||||
check_ipo_supported(RESULT result)
|
|
||||||
if(result)
|
|
||||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
|
|
||||||
# set(CMAKE_INTERPROCEDURAL_OPTIMIZATION FALSE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -69,6 +64,8 @@ target_compile_options(slsProjectWarnings INTERFACE
|
|||||||
-Wdouble-promotion
|
-Wdouble-promotion
|
||||||
-Wformat=2
|
-Wformat=2
|
||||||
-Wredundant-decls
|
-Wredundant-decls
|
||||||
|
# -Wconversion
|
||||||
|
-Wdouble-promotion
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -163,6 +160,8 @@ if (SLS_USE_PYTHON)
|
|||||||
add_subdirectory(python)
|
add_subdirectory(python)
|
||||||
endif(SLS_USE_PYTHON)
|
endif(SLS_USE_PYTHON)
|
||||||
|
|
||||||
|
configure_file( .clang-tidy
|
||||||
|
${CMAKE_BINARY_DIR}/.clang-tidy )
|
||||||
|
|
||||||
if(SLS_MASTER_PROJECT)
|
if(SLS_MASTER_PROJECT)
|
||||||
# Set install dir CMake packages
|
# Set install dir CMake packages
|
||||||
|
@ -16,6 +16,8 @@ if(SLS_USE_TESTS)
|
|||||||
|
|
||||||
target_link_libraries(detector_test
|
target_link_libraries(detector_test
|
||||||
slsDetectorShared
|
slsDetectorShared
|
||||||
|
slsProjectOptions
|
||||||
|
slsProjectWarnings
|
||||||
slsSupportLib
|
slsSupportLib
|
||||||
pthread
|
pthread
|
||||||
rt
|
rt
|
||||||
@ -23,9 +25,11 @@ if(SLS_USE_TESTS)
|
|||||||
set_target_properties(detector_test PROPERTIES
|
set_target_properties(detector_test PROPERTIES
|
||||||
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
||||||
)
|
)
|
||||||
add_executable(a src/a.cpp)
|
|
||||||
|
|
||||||
|
add_executable(a src/a.cpp)
|
||||||
target_link_libraries(a
|
target_link_libraries(a
|
||||||
|
slsProjectOptions
|
||||||
|
slsProjectWarnings
|
||||||
slsDetectorShared
|
slsDetectorShared
|
||||||
slsSupportLib
|
slsSupportLib
|
||||||
pthread
|
pthread
|
||||||
|
@ -35,6 +35,10 @@ std::ostream &operator<<(std::ostream &out, const ROI &r) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
|
||||||
|
int ret[3]{};
|
||||||
|
for (auto i: ret)
|
||||||
|
std::cout << i << "\n";
|
||||||
// uint32_t imageSize = 101;
|
// uint32_t imageSize = 101;
|
||||||
// uint32_t packetSize = 100;
|
// uint32_t packetSize = 100;
|
||||||
// std::cout << "a: " << std::ceil((double)imageSize / (double)packetSize) <<'\n';
|
// std::cout << "a: " << std::ceil((double)imageSize / (double)packetSize) <<'\n';
|
||||||
|
@ -42,4 +42,5 @@ endforeach(FILE ${PYTHON_FILES})
|
|||||||
|
|
||||||
|
|
||||||
configure_file( scripts/basic.py
|
configure_file( scripts/basic.py
|
||||||
${CMAKE_BINARY_DIR}/basic.py )
|
${CMAKE_BINARY_DIR}/basic.py
|
||||||
|
)
|
@ -12,6 +12,15 @@ add_library(slsDetectorShared SHARED
|
|||||||
${SOURCES}
|
${SOURCES}
|
||||||
${HEADERS}
|
${HEADERS}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
check_ipo_supported(RESULT result)
|
||||||
|
if(result)
|
||||||
|
set_property(TARGET slsDetectorShared PROPERTY INTERPROCEDURAL_OPTIMIZATION True)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
target_include_directories(slsDetectorShared PUBLIC
|
target_include_directories(slsDetectorShared PUBLIC
|
||||||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
|
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
|
||||||
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
|
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
|
||||||
@ -105,6 +114,14 @@ set_target_properties(sls_detector_help PROPERTIES
|
|||||||
COMPILE_DEFINITIONS HELP=1
|
COMPILE_DEFINITIONS HELP=1
|
||||||
)
|
)
|
||||||
|
|
||||||
|
check_ipo_supported(RESULT result)
|
||||||
|
if(result)
|
||||||
|
set_property(TARGET sls_detector_help PROPERTY INTERPROCEDURAL_OPTIMIZATION True)
|
||||||
|
set_property(TARGET sls_detector_get PROPERTY INTERPROCEDURAL_OPTIMIZATION True)
|
||||||
|
set_property(TARGET sls_detector_put PROPERTY INTERPROCEDURAL_OPTIMIZATION True)
|
||||||
|
set_property(TARGET sls_detector_acquire PROPERTY INTERPROCEDURAL_OPTIMIZATION True)
|
||||||
|
endif()
|
||||||
|
|
||||||
install(TARGETS sls_detector_put sls_detector_get sls_detector_acquire sls_detector_help DESTINATION bin)
|
install(TARGETS sls_detector_put sls_detector_get sls_detector_acquire sls_detector_help DESTINATION bin)
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ class MySocketTCP;
|
|||||||
/**
|
/**
|
||||||
* parameter list that has to be initialized depending on the detector type
|
* parameter list that has to be initialized depending on the detector type
|
||||||
*/
|
*/
|
||||||
struct detParameterList {
|
struct detParameters {
|
||||||
int nChanX;
|
int nChanX;
|
||||||
int nChanY;
|
int nChanY;
|
||||||
int nChipX;
|
int nChipX;
|
||||||
@ -1725,7 +1725,7 @@ class slsDetector : public virtual slsDetectorDefs{
|
|||||||
* @param type detector type
|
* @param type detector type
|
||||||
* @param list structure of parameters to initialize depending on detector type
|
* @param list structure of parameters to initialize depending on detector type
|
||||||
*/
|
*/
|
||||||
void setDetectorSpecificParameters(detectorType type, detParameterList &list);
|
void setDetectorSpecificParameters(detectorType type, detParameters &list);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize detector structure to defaults
|
* Initialize detector structure to defaults
|
||||||
|
@ -170,7 +170,7 @@ int64_t slsDetector::getReceiverSoftwareVersion() const {
|
|||||||
ret = receiver.sendCommandThenRead(fnum, nullptr, 0, &retval, sizeof(retval));
|
ret = receiver.sendCommandThenRead(fnum, nullptr, 0, &retval, sizeof(retval));
|
||||||
}
|
}
|
||||||
if (ret == FORCE_UPDATE) {
|
if (ret == FORCE_UPDATE) {
|
||||||
ret = updateCachedReceiverVariables();
|
updateCachedReceiverVariables();
|
||||||
}
|
}
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
@ -213,7 +213,7 @@ void slsDetector::initSharedMemory(detectorType type, int multi_id, bool verify)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void slsDetector::setDetectorSpecificParameters(detectorType type, detParameterList &list) {
|
void slsDetector::setDetectorSpecificParameters(detectorType type, detParameters &list) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case GOTTHARD:
|
case GOTTHARD:
|
||||||
list.nChanX = 128;
|
list.nChanX = 128;
|
||||||
@ -374,16 +374,16 @@ void slsDetector::initializeDetectorStructure(detectorType type) {
|
|||||||
detector_shm()->receiver_overWriteEnable = true;
|
detector_shm()->receiver_overWriteEnable = true;
|
||||||
|
|
||||||
// get the detector parameters based on type
|
// get the detector parameters based on type
|
||||||
detParameterList detlist;
|
detParameters parameters{};
|
||||||
setDetectorSpecificParameters(type, detlist);
|
setDetectorSpecificParameters(type, parameters);
|
||||||
detector_shm()->nChan[X] = detlist.nChanX;
|
detector_shm()->nChan[X] = parameters.nChanX;
|
||||||
detector_shm()->nChan[Y] = detlist.nChanY;
|
detector_shm()->nChan[Y] = parameters.nChanY;
|
||||||
detector_shm()->nChip[X] = detlist.nChipX;
|
detector_shm()->nChip[X] = parameters.nChipX;
|
||||||
detector_shm()->nChip[Y] = detlist.nChipY;
|
detector_shm()->nChip[Y] = parameters.nChipY;
|
||||||
detector_shm()->nDacs = detlist.nDacs;
|
detector_shm()->nDacs = parameters.nDacs;
|
||||||
detector_shm()->dynamicRange = detlist.dynamicRange;
|
detector_shm()->dynamicRange = parameters.dynamicRange;
|
||||||
detector_shm()->nGappixels[X] = detlist.nGappixelsX;
|
detector_shm()->nGappixels[X] = parameters.nGappixelsX;
|
||||||
detector_shm()->nGappixels[Y] = detlist.nGappixelsY;
|
detector_shm()->nGappixels[Y] = parameters.nGappixelsY;
|
||||||
|
|
||||||
// derived parameters
|
// derived parameters
|
||||||
detector_shm()->nChans = detector_shm()->nChan[X] * detector_shm()->nChan[Y];
|
detector_shm()->nChans = detector_shm()->nChan[X] * detector_shm()->nChan[Y];
|
||||||
@ -413,13 +413,13 @@ slsDetectorDefs::sls_detector_module *slsDetector::createModule() {
|
|||||||
|
|
||||||
slsDetectorDefs::sls_detector_module *slsDetector::createModule(detectorType type) {
|
slsDetectorDefs::sls_detector_module *slsDetector::createModule(detectorType type) {
|
||||||
// get the detector parameters based on type
|
// get the detector parameters based on type
|
||||||
detParameterList detlist;
|
detParameters parameters{};
|
||||||
int nch = 0, nc = 0, nd = 0;
|
int nch = 0, nc = 0, nd = 0;
|
||||||
try {
|
try {
|
||||||
setDetectorSpecificParameters(type, detlist);
|
setDetectorSpecificParameters(type, parameters);
|
||||||
nch = detlist.nChanX * detlist.nChanY;
|
nch = parameters.nChanX * parameters.nChanY;
|
||||||
nc = detlist.nChipX * detlist.nChipY;
|
nc = parameters.nChipX * parameters.nChipY;
|
||||||
nd = detlist.nDacs;
|
nd = parameters.nDacs;
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@ -575,18 +575,16 @@ int slsDetector::setDetectorType(detectorType const type) {
|
|||||||
// receiver
|
// receiver
|
||||||
if ((detector_shm()->receiverOnlineFlag == ONLINE_FLAG) && ret == OK) {
|
if ((detector_shm()->receiverOnlineFlag == ONLINE_FLAG) && ret == OK) {
|
||||||
fnum = F_GET_RECEIVER_TYPE;
|
fnum = F_GET_RECEIVER_TYPE;
|
||||||
ret = FAIL;
|
auto arg = static_cast<int>(detector_shm()->myDetectorType);
|
||||||
int arg = (int)detector_shm()->myDetectorType;
|
|
||||||
retval = GENERIC;
|
retval = GENERIC;
|
||||||
FILE_LOG(logDEBUG1) << "Sending detector type to Receiver: "
|
FILE_LOG(logDEBUG1) << "Sending detector type to Receiver: " << arg;
|
||||||
<< (int)detector_shm()->myDetectorType;
|
|
||||||
auto receiver =
|
auto receiver =
|
||||||
ReceiverSocket(detector_shm()->receiver_hostname, detector_shm()->receiverTCPPort);
|
ReceiverSocket(detector_shm()->receiver_hostname, detector_shm()->receiverTCPPort);
|
||||||
ret = receiver.sendCommandThenRead(fnum, &arg, sizeof(arg), &retval, sizeof(retval));
|
ret = receiver.sendCommandThenRead(fnum, &arg, sizeof(arg), &retval, sizeof(retval));
|
||||||
FILE_LOG(logDEBUG1) << "Receiver Type: " << retval;
|
FILE_LOG(logDEBUG1) << "Receiver Type: " << retval;
|
||||||
if (ret == FORCE_UPDATE) {
|
if (ret == FORCE_UPDATE) {
|
||||||
receiver.close(); // TODO! Should find a better solution
|
receiver.close(); // TODO! Should find a better solution
|
||||||
ret = updateCachedReceiverVariables();
|
updateCachedReceiverVariables();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return retval;
|
return retval;
|
||||||
@ -728,7 +726,7 @@ int slsDetector::setControlPort(int port_number) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ret == FORCE_UPDATE) {
|
if (ret == FORCE_UPDATE) {
|
||||||
ret = updateDetector();
|
updateDetector();
|
||||||
}
|
}
|
||||||
return detector_shm()->controlPort;
|
return detector_shm()->controlPort;
|
||||||
}
|
}
|
||||||
@ -752,7 +750,7 @@ int slsDetector::setStopPort(int port_number) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ret == FORCE_UPDATE) {
|
if (ret == FORCE_UPDATE) {
|
||||||
ret = updateDetector();
|
updateDetector();
|
||||||
}
|
}
|
||||||
return detector_shm()->stopPort;
|
return detector_shm()->stopPort;
|
||||||
}
|
}
|
||||||
@ -778,7 +776,7 @@ int slsDetector::setReceiverPort(int port_number) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ret == FORCE_UPDATE) {
|
if (ret == FORCE_UPDATE) {
|
||||||
ret = updateCachedReceiverVariables();
|
updateCachedReceiverVariables();
|
||||||
}
|
}
|
||||||
return detector_shm()->receiverTCPPort;
|
return detector_shm()->receiverTCPPort;
|
||||||
}
|
}
|
||||||
@ -801,7 +799,7 @@ int slsDetector::lockServer(int lock) {
|
|||||||
FILE_LOG(logDEBUG1) << "Lock: " << retval;
|
FILE_LOG(logDEBUG1) << "Lock: " << retval;
|
||||||
}
|
}
|
||||||
if (ret == FORCE_UPDATE) {
|
if (ret == FORCE_UPDATE) {
|
||||||
ret = updateDetector();
|
updateDetector();
|
||||||
}
|
}
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
@ -809,7 +807,7 @@ int slsDetector::lockServer(int lock) {
|
|||||||
std::string slsDetector::getLastClientIP() {
|
std::string slsDetector::getLastClientIP() {
|
||||||
int fnum = F_GET_LAST_CLIENT_IP;
|
int fnum = F_GET_LAST_CLIENT_IP;
|
||||||
int ret = FAIL;
|
int ret = FAIL;
|
||||||
char retval[INET_ADDRSTRLEN] = {0};
|
char retval[INET_ADDRSTRLEN]{};
|
||||||
FILE_LOG(logDEBUG1) << "Getting last client ip to detector server";
|
FILE_LOG(logDEBUG1) << "Getting last client ip to detector server";
|
||||||
|
|
||||||
if (detector_shm()->onlineFlag == ONLINE_FLAG) {
|
if (detector_shm()->onlineFlag == ONLINE_FLAG) {
|
||||||
@ -818,9 +816,9 @@ std::string slsDetector::getLastClientIP() {
|
|||||||
FILE_LOG(logDEBUG1) << "Last client IP to detector: " << retval;
|
FILE_LOG(logDEBUG1) << "Last client IP to detector: " << retval;
|
||||||
}
|
}
|
||||||
if (ret == FORCE_UPDATE) {
|
if (ret == FORCE_UPDATE) {
|
||||||
ret = updateDetector();
|
updateDetector();
|
||||||
}
|
}
|
||||||
return std::string(retval);
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsDetector::exitServer() {
|
int slsDetector::exitServer() {
|
||||||
@ -2438,7 +2436,7 @@ std::string slsDetector::getReceiverStreamingIP() {
|
|||||||
int slsDetector::setDetectorNetworkParameter(networkParameter index, int delay) {
|
int slsDetector::setDetectorNetworkParameter(networkParameter index, int delay) {
|
||||||
int fnum = F_SET_NETWORK_PARAMETER;
|
int fnum = F_SET_NETWORK_PARAMETER;
|
||||||
int ret = FAIL;
|
int ret = FAIL;
|
||||||
int args[2] = {(int)index, delay};
|
int args[2]{static_cast<int>(index), delay};
|
||||||
int retval = -1;
|
int retval = -1;
|
||||||
FILE_LOG(logDEBUG1) << "Setting network parameter index " << index << " to " << delay;
|
FILE_LOG(logDEBUG1) << "Setting network parameter index " << index << " to " << delay;
|
||||||
|
|
||||||
@ -2691,7 +2689,7 @@ int slsDetector::setUDPConnection() {
|
|||||||
int slsDetector::digitalTest(digitalTestMode mode, int ival) {
|
int slsDetector::digitalTest(digitalTestMode mode, int ival) {
|
||||||
int fnum = F_DIGITAL_TEST;
|
int fnum = F_DIGITAL_TEST;
|
||||||
int ret = FAIL;
|
int ret = FAIL;
|
||||||
int args[2] = {(int)mode, ival};
|
int args[2]{static_cast<int>(mode), ival};
|
||||||
int retval = -1;
|
int retval = -1;
|
||||||
FILE_LOG(logDEBUG1) << "Sending digital test of mode " << mode << ", ival " << ival;
|
FILE_LOG(logDEBUG1) << "Sending digital test of mode " << mode << ", ival " << ival;
|
||||||
|
|
||||||
@ -2701,7 +2699,7 @@ int slsDetector::digitalTest(digitalTestMode mode, int ival) {
|
|||||||
FILE_LOG(logDEBUG1) << "Digital Test returned: " << retval;
|
FILE_LOG(logDEBUG1) << "Digital Test returned: " << retval;
|
||||||
}
|
}
|
||||||
if (ret == FORCE_UPDATE) {
|
if (ret == FORCE_UPDATE) {
|
||||||
ret = updateDetector();
|
updateDetector();
|
||||||
}
|
}
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
@ -3007,7 +3005,7 @@ int slsDetector::activate(int const enable) {
|
|||||||
ret = receiver.sendCommandThenRead(fnum, &arg, sizeof(arg), &retval, sizeof(retval));
|
ret = receiver.sendCommandThenRead(fnum, &arg, sizeof(arg), &retval, sizeof(retval));
|
||||||
if (ret == FORCE_UPDATE) {
|
if (ret == FORCE_UPDATE) {
|
||||||
receiver.close();
|
receiver.close();
|
||||||
ret = updateCachedReceiverVariables();
|
updateCachedReceiverVariables();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return detector_shm()->activated;
|
return detector_shm()->activated;
|
||||||
@ -4315,18 +4313,23 @@ uint64_t slsDetector::setPatternWord(int addr, uint64_t word) {
|
|||||||
FILE_LOG(logDEBUG1) << "Set Pattern word: " << retval;
|
FILE_LOG(logDEBUG1) << "Set Pattern word: " << retval;
|
||||||
}
|
}
|
||||||
if (ret == FORCE_UPDATE) {
|
if (ret == FORCE_UPDATE) {
|
||||||
ret = updateDetector();
|
updateDetector();
|
||||||
}
|
}
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsDetector::setPatternLoops(int level, int &start, int &stop, int &n) {
|
int slsDetector::setPatternLoops(int level, int &start, int &stop, int &n) {
|
||||||
|
//TODO!(Erik) Should we change function signature to accept uint64_t?
|
||||||
int fnum = F_SET_PATTERN;
|
int fnum = F_SET_PATTERN;
|
||||||
int ret = FAIL;
|
int ret = FAIL;
|
||||||
int mode = 1; // sets loop
|
uint64_t mode = 1; // sets loop
|
||||||
uint64_t args[5] = {(uint64_t)mode, (uint64_t)level, (uint64_t)start, (uint64_t)stop,
|
uint64_t args[5]{
|
||||||
(uint64_t)n};
|
mode,
|
||||||
int retvals[3] = {0, 0, 0};
|
static_cast<uint64_t>(level),
|
||||||
|
static_cast<uint64_t>(start),
|
||||||
|
static_cast<uint64_t>(stop),
|
||||||
|
static_cast<uint64_t>(n)};
|
||||||
|
int retvals[3]{};
|
||||||
FILE_LOG(logDEBUG1) << "Setting Pat Loops, level: " << level << ", start: " << start
|
FILE_LOG(logDEBUG1) << "Setting Pat Loops, level: " << level << ", start: " << start
|
||||||
<< ", stop: " << stop << ", n: " << n;
|
<< ", stop: " << stop << ", n: " << n;
|
||||||
|
|
||||||
@ -4340,7 +4343,7 @@ int slsDetector::setPatternLoops(int level, int &start, int &stop, int &n) {
|
|||||||
n = retvals[2];
|
n = retvals[2];
|
||||||
}
|
}
|
||||||
if (ret == FORCE_UPDATE) {
|
if (ret == FORCE_UPDATE) {
|
||||||
ret = updateDetector();
|
updateDetector();
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -4361,7 +4364,7 @@ int slsDetector::setPatternWaitAddr(uint64_t level, uint64_t addr) {
|
|||||||
FILE_LOG(logDEBUG1) << "Set Pat Wait Addr: " << retval;
|
FILE_LOG(logDEBUG1) << "Set Pat Wait Addr: " << retval;
|
||||||
}
|
}
|
||||||
if (ret == FORCE_UPDATE) {
|
if (ret == FORCE_UPDATE) {
|
||||||
ret = updateDetector();
|
updateDetector();
|
||||||
}
|
}
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
@ -4379,7 +4382,7 @@ uint64_t slsDetector::setPatternWaitTime(uint64_t level, uint64_t t) {
|
|||||||
FILE_LOG(logDEBUG1) << "Set Pat Wait Time: " << retval;
|
FILE_LOG(logDEBUG1) << "Set Pat Wait Time: " << retval;
|
||||||
}
|
}
|
||||||
if (ret == FORCE_UPDATE) {
|
if (ret == FORCE_UPDATE) {
|
||||||
ret = updateDetector();
|
updateDetector();
|
||||||
}
|
}
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
@ -4395,7 +4398,7 @@ int slsDetector::setPatternMask(uint64_t mask) {
|
|||||||
FILE_LOG(logDEBUG1) << "Pattern Mask successful";
|
FILE_LOG(logDEBUG1) << "Pattern Mask successful";
|
||||||
}
|
}
|
||||||
if (ret == FORCE_UPDATE) {
|
if (ret == FORCE_UPDATE) {
|
||||||
ret = updateDetector();
|
updateDetector();
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -4411,7 +4414,7 @@ uint64_t slsDetector::getPatternMask() {
|
|||||||
FILE_LOG(logDEBUG1) << "Pattern Mask:" << retval;
|
FILE_LOG(logDEBUG1) << "Pattern Mask:" << retval;
|
||||||
}
|
}
|
||||||
if (ret == FORCE_UPDATE) {
|
if (ret == FORCE_UPDATE) {
|
||||||
ret = updateDetector();
|
updateDetector();
|
||||||
}
|
}
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
@ -4427,7 +4430,7 @@ int slsDetector::setPatternBitMask(uint64_t mask) {
|
|||||||
FILE_LOG(logDEBUG1) << "Pattern Bit Mask successful";
|
FILE_LOG(logDEBUG1) << "Pattern Bit Mask successful";
|
||||||
}
|
}
|
||||||
if (ret == FORCE_UPDATE) {
|
if (ret == FORCE_UPDATE) {
|
||||||
ret = updateDetector();
|
updateDetector();
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -4443,7 +4446,7 @@ uint64_t slsDetector::getPatternBitMask() {
|
|||||||
FILE_LOG(logDEBUG1) << "Pattern Bit Mask:" << retval;
|
FILE_LOG(logDEBUG1) << "Pattern Bit Mask:" << retval;
|
||||||
}
|
}
|
||||||
if (ret == FORCE_UPDATE) {
|
if (ret == FORCE_UPDATE) {
|
||||||
ret = updateDetector();
|
updateDetector();
|
||||||
}
|
}
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
@ -4460,7 +4463,7 @@ int slsDetector::setLEDEnable(int enable) {
|
|||||||
FILE_LOG(logDEBUG1) << "LED Enable: " << retval;
|
FILE_LOG(logDEBUG1) << "LED Enable: " << retval;
|
||||||
}
|
}
|
||||||
if (ret == FORCE_UPDATE) {
|
if (ret == FORCE_UPDATE) {
|
||||||
ret = updateDetector();
|
updateDetector();
|
||||||
}
|
}
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
@ -4468,7 +4471,7 @@ int slsDetector::setLEDEnable(int enable) {
|
|||||||
int slsDetector::setDigitalIODelay(uint64_t pinMask, int delay) {
|
int slsDetector::setDigitalIODelay(uint64_t pinMask, int delay) {
|
||||||
int fnum = F_DIGITAL_IO_DELAY;
|
int fnum = F_DIGITAL_IO_DELAY;
|
||||||
int ret = FAIL;
|
int ret = FAIL;
|
||||||
uint64_t args[2] = {pinMask, (uint64_t)delay};
|
uint64_t args[2] = {pinMask, static_cast<uint64_t>(delay)};
|
||||||
FILE_LOG(logDEBUG1) << "Sending Digital IO Delay, pin mask: " << std::hex << args[0]
|
FILE_LOG(logDEBUG1) << "Sending Digital IO Delay, pin mask: " << std::hex << args[0]
|
||||||
<< ", delay: " << std::dec << args[1] << " ps";
|
<< ", delay: " << std::dec << args[1] << " ps";
|
||||||
|
|
||||||
@ -4478,7 +4481,7 @@ int slsDetector::setDigitalIODelay(uint64_t pinMask, int delay) {
|
|||||||
FILE_LOG(logDEBUG1) << "Digital IO Delay successful";
|
FILE_LOG(logDEBUG1) << "Digital IO Delay successful";
|
||||||
}
|
}
|
||||||
if (ret == FORCE_UPDATE) {
|
if (ret == FORCE_UPDATE) {
|
||||||
ret = updateDetector();
|
updateDetector();
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ TEST_CASE("Set and get trimen", "[detector]") {
|
|||||||
|
|
||||||
// At the beginning there should be no trimen set
|
// At the beginning there should be no trimen set
|
||||||
auto res = d.getTrimEn();
|
auto res = d.getTrimEn();
|
||||||
CHECK(res.size() == 0);
|
CHECK(res.empty() == 0);
|
||||||
|
|
||||||
std::vector<int> energies{5200, 6400, 8500, 9900, 12000};
|
std::vector<int> energies{5200, 6400, 8500, 9900, 12000};
|
||||||
d.setTrimEn(energies);
|
d.setTrimEn(energies);
|
||||||
@ -41,7 +41,7 @@ TEST_CASE("Set and get trimen", "[detector]") {
|
|||||||
|
|
||||||
// Setting trimen without arguments resets to zero
|
// Setting trimen without arguments resets to zero
|
||||||
d.setTrimEn();
|
d.setTrimEn();
|
||||||
CHECK(d.getTrimEn().size() == 0);
|
CHECK(d.getTrimEn().empty());
|
||||||
|
|
||||||
// Clean up before next test
|
// Clean up before next test
|
||||||
d.freeSharedMemory();
|
d.freeSharedMemory();
|
||||||
|
@ -29,15 +29,16 @@ if (SLS_USE_HDF5)
|
|||||||
endif (SLS_USE_HDF5)
|
endif (SLS_USE_HDF5)
|
||||||
|
|
||||||
|
|
||||||
# include_directories(
|
|
||||||
# ${SLS_SUPPORT_LIB_INCLUDE_DIRS}
|
|
||||||
# )
|
|
||||||
|
|
||||||
add_library(slsReceiverShared SHARED
|
add_library(slsReceiverShared SHARED
|
||||||
${SOURCES}
|
${SOURCES}
|
||||||
${HEADERS}
|
${HEADERS}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
check_ipo_supported(RESULT result)
|
||||||
|
if(result)
|
||||||
|
set_property(TARGET slsReceiverShared PROPERTY INTERPROCEDURAL_OPTIMIZATION True)
|
||||||
|
endif()
|
||||||
|
|
||||||
target_link_libraries(slsReceiverShared PUBLIC
|
target_link_libraries(slsReceiverShared PUBLIC
|
||||||
slsProjectOptions
|
slsProjectOptions
|
||||||
slsProjectWarnings
|
slsProjectWarnings
|
||||||
|
@ -39,6 +39,11 @@ add_library(slsSupportLib SHARED
|
|||||||
${HEADERS}
|
${HEADERS}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
check_ipo_supported(RESULT result)
|
||||||
|
if(result)
|
||||||
|
set_property(TARGET slsSupportLib PROPERTY INTERPROCEDURAL_OPTIMIZATION True)
|
||||||
|
endif()
|
||||||
|
|
||||||
target_include_directories(slsSupportLib PUBLIC
|
target_include_directories(slsSupportLib PUBLIC
|
||||||
${ZeroMQ_INCLUDE_DIRS}
|
${ZeroMQ_INCLUDE_DIRS}
|
||||||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
|
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user