mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-07 10:30:41 +02:00
format
This commit is contained in:
parent
af550b4c70
commit
3d40d5d058
@ -6,7 +6,7 @@ option (USE_HDF5 "HDF5 File format" OFF)
|
||||
option (USE_TEXTCLIENT "Text Client" OFF)
|
||||
option (USE_RECEIVER "Receiver" OFF)
|
||||
option (USE_GUI "GUI" OFF)
|
||||
option (USE_TESTS "TESTS" ON)
|
||||
option (USE_TESTS "TESTS" OFF)
|
||||
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11 -Wno-misleading-indentation")
|
||||
|
@ -8,8 +8,6 @@
|
||||
#include "slsDetector.h"
|
||||
#include "sls_detector_exceptions.h"
|
||||
#include "utilities.h"
|
||||
#include "detectorData.h"
|
||||
|
||||
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
@ -2109,9 +2107,9 @@ int multiSlsDetector::writeAdcRegister(int addr, int val, int detPos) {
|
||||
return detectors[detPos]->writeAdcRegister(addr, val);
|
||||
}
|
||||
|
||||
// multi
|
||||
auto r = parallelCall(&slsDetector::writeAdcRegister, addr, val);
|
||||
return sls::allEqualTo(r, static_cast<int>(OK)) ? OK : FAIL;
|
||||
// multi
|
||||
auto r = parallelCall(&slsDetector::writeAdcRegister, addr, val);
|
||||
return sls::allEqualTo(r, static_cast<int>(OK)) ? OK : FAIL;
|
||||
}
|
||||
|
||||
int multiSlsDetector::activate(int const enable, int detPos) {
|
||||
@ -2348,24 +2346,24 @@ int multiSlsDetector::setAutoComparatorDisableMode(int ival, int detPos) {
|
||||
return sls::minusOneIfDifferent(r);
|
||||
}
|
||||
|
||||
int multiSlsDetector::getChanRegs(double* retval, int detPos) {
|
||||
int multiSlsDetector::getChanRegs(double *retval, int detPos) {
|
||||
|
||||
int offset = 0;
|
||||
std::vector<int> r;
|
||||
for (auto& d : detectors) {
|
||||
int nch = d->getTotalNumberOfChannels();
|
||||
double result[nch];
|
||||
r.push_back(d->getChanRegs(result));
|
||||
memcpy(retval + offset, result, nch * sizeof(double));
|
||||
}
|
||||
return sls::minusOneIfDifferent(r);
|
||||
int offset = 0;
|
||||
std::vector<int> r;
|
||||
for (auto &d : detectors) {
|
||||
int nch = d->getTotalNumberOfChannels();
|
||||
double result[nch];
|
||||
r.push_back(d->getChanRegs(result));
|
||||
memcpy(retval + offset, result, nch * sizeof(double));
|
||||
}
|
||||
return sls::minusOneIfDifferent(r);
|
||||
}
|
||||
|
||||
int multiSlsDetector::setRateCorrection(int64_t t, int detPos) {
|
||||
// single
|
||||
if (detPos >= 0) {
|
||||
return detectors[detPos]->setRateCorrection(t);
|
||||
}
|
||||
// single
|
||||
if (detPos >= 0) {
|
||||
return detectors[detPos]->setRateCorrection(t);
|
||||
}
|
||||
|
||||
// multi
|
||||
auto r = parallelCall(&slsDetector::setRateCorrection, t);
|
||||
@ -2373,10 +2371,10 @@ int multiSlsDetector::setRateCorrection(int64_t t, int detPos) {
|
||||
}
|
||||
|
||||
int64_t multiSlsDetector::getRateCorrection(int detPos) {
|
||||
// single
|
||||
if (detPos >= 0) {
|
||||
return detectors[detPos]->getRateCorrection();
|
||||
}
|
||||
// single
|
||||
if (detPos >= 0) {
|
||||
return detectors[detPos]->getRateCorrection();
|
||||
}
|
||||
|
||||
// multi
|
||||
auto r = parallelCall(&slsDetector::getRateCorrection);
|
||||
@ -2384,14 +2382,14 @@ int64_t multiSlsDetector::getRateCorrection(int detPos) {
|
||||
}
|
||||
|
||||
void multiSlsDetector::printReceiverConfiguration(int detPos) {
|
||||
// single
|
||||
if (detPos >= 0) {
|
||||
return detectors[detPos]->printReceiverConfiguration();
|
||||
}
|
||||
// single
|
||||
if (detPos >= 0) {
|
||||
return detectors[detPos]->printReceiverConfiguration();
|
||||
}
|
||||
|
||||
// multi
|
||||
for (auto& d : detectors)
|
||||
d->printReceiverConfiguration();
|
||||
// multi
|
||||
for (auto &d : detectors)
|
||||
d->printReceiverConfiguration();
|
||||
}
|
||||
|
||||
int multiSlsDetector::setReceiverOnline(int off, int detPos) {
|
||||
|
@ -7,10 +7,9 @@
|
||||
* @short This is the base class for multi detector system functionalities
|
||||
* @author Anna Bergamaschi
|
||||
*/
|
||||
#include "sls_detector_defs.h"
|
||||
#include "error_defs.h"
|
||||
#include "logger.h"
|
||||
|
||||
#include "sls_detector_defs.h"
|
||||
|
||||
class slsDetector;
|
||||
class SharedMemory;
|
||||
@ -1178,15 +1177,15 @@ class multiSlsDetector : public virtual slsDetectorDefs,
|
||||
*/
|
||||
int setAutoComparatorDisableMode(int ival = -1, int detPos = -1);
|
||||
|
||||
/**
|
||||
/**
|
||||
* Returns the trimbits from the detector's shared memmory (Mythen, Eiger)
|
||||
* @param retval is the array with the trimbits
|
||||
* @param detPos -1 for all detectors in list or specific detector position
|
||||
* @returns total number of channels for the detector
|
||||
*/
|
||||
int getChanRegs(double* retval, int detPos = -1);
|
||||
int getChanRegs(double *retval, int detPos = -1);
|
||||
|
||||
/**
|
||||
/**
|
||||
* Set Rate correction ( Eiger)
|
||||
* @param t dead time in ns - if 0 disable correction,
|
||||
* if >0 set dead time to t, if < 0 set deadtime to default dead time
|
||||
@ -1194,20 +1193,20 @@ class multiSlsDetector : public virtual slsDetectorDefs,
|
||||
* @param detPos -1 for all detectors in list or specific detector position
|
||||
* @returns 0 if rate correction disabled, >0 otherwise
|
||||
*/
|
||||
int setRateCorrection(int64_t t = 0, int detPos = -1);
|
||||
int setRateCorrection(int64_t t = 0, int detPos = -1);
|
||||
|
||||
/**
|
||||
/**
|
||||
* Get rate correction ( Eiger)
|
||||
* @param detPos -1 for all detectors in list or specific detector position
|
||||
* @returns 0 if rate correction disabled, > 0 otherwise (ns)
|
||||
*/
|
||||
int64_t getRateCorrection(int detPos = -1);
|
||||
int64_t getRateCorrection(int detPos = -1);
|
||||
|
||||
/**
|
||||
/**
|
||||
* Prints receiver configuration
|
||||
* @param detPos -1 for all detectors in list or specific detector position
|
||||
*/
|
||||
void printReceiverConfiguration(int detPos = -1);
|
||||
void printReceiverConfiguration(int detPos = -1);
|
||||
|
||||
/**
|
||||
* Sets up receiver socket if online and sets the flag
|
||||
|
Loading…
x
Reference in New Issue
Block a user