* WIP

* WIP

* WIP

* cleaned up multi

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* split up python module

* WIP

* WIP

* WIP

* WIP

* WIP

* ok

* fixed bugs from rebase

* WIP

* fixed broken test

* WIP

* fixed python

* WIP

* sphinx help

* including new commands

* docs

* WIP

* WIP

* more tests

* added missing public header

* WIP
This commit is contained in:
Dhanya Thattil
2019-08-07 11:21:07 +02:00
committed by GitHub
parent 98ddf154b2
commit 4ceee97c03
58 changed files with 2317 additions and 571 deletions

View File

@ -4,7 +4,6 @@
#include "logger.h"
#include "sls_detector_defs.h"
class slsDetector;
class ZmqSocket;
class detectorData;
@ -20,14 +19,17 @@ class detectorData;
#define SHORT_STRING_LENGTH 50
#define DATE_LENGTH 30
#include <future>
#include <numeric>
/**
* @short structure allocated in shared memory to store detector settings
* for IPC and cache
*/
* @short structure allocated in shared memory to store detector settings
* for IPC and cache
*/
struct sharedMultiSlsDetector {
/* FIXED PATTERN FOR STATIC FUNCTIONS. DO NOT CHANGE, ONLY APPEND
* ------*/
* ------*/
/** shared memory version */
int shmversion;
@ -45,7 +47,7 @@ struct sharedMultiSlsDetector {
int numberOfDetectors;
/** END OF FIXED PATTERN
* -----------------------------------------------*/
* -----------------------------------------------*/
/** Number of detectors operated at once */
int numberOfDetector[2];
@ -72,11 +74,11 @@ struct sharedMultiSlsDetector {
int maxNumberOfChannel[2];
/** max number of channels including gap pixels for all detectors in
* one dimension*/
* one dimension*/
int maxNumberOfChannelInclGapPixels[2];
/** max number of channels allowed for the complete set of detectors in
* one dimension */
* one dimension */
int maxNumberOfChannelsPerDetector[2];
/** timer values */
@ -98,8 +100,7 @@ class multiSlsDetector : public virtual slsDetectorDefs {
* one
* @param update true to update last user pid, date etc
*/
explicit multiSlsDetector(int multi_id = 0,
bool verify = true,
explicit multiSlsDetector(int multi_id = 0, bool verify = true,
bool update = true);
/**
@ -107,6 +108,101 @@ class multiSlsDetector : public virtual slsDetectorDefs {
*/
virtual ~multiSlsDetector();
template <class CT> struct NonDeduced { using type = CT; };
template <typename RT, typename... CT>
std::vector<RT> Parallel(RT (slsDetector::*somefunc)(CT...),
std::vector<int> positions,
typename NonDeduced<CT>::type... Args) {
if (positions.empty() || (positions.size() == 1 && positions[0] == -1 )) {
positions.resize(detectors.size());
std::iota(begin(positions), end(positions), 0);
}
std::vector<std::future<RT>> futures;
futures.reserve(positions.size());
for (size_t i : positions) {
if (i >= detectors.size())
throw sls::RuntimeError("Detector out of range");
futures.push_back(std::async(std::launch::async, somefunc,
detectors[i].get(), Args...));
}
std::vector<RT> result;
result.reserve(positions.size());
for (auto &i : futures) {
result.push_back(i.get());
}
return result;
}
template <typename RT, typename... CT>
std::vector<RT> Parallel(RT (slsDetector::*somefunc)(CT...) const,
std::vector<int> positions,
typename NonDeduced<CT>::type... Args) const{
if (positions.empty() || (positions.size() == 1 && positions[0] == -1 )) {
positions.resize(detectors.size());
std::iota(begin(positions), end(positions), 0);
}
std::vector<std::future<RT>> futures;
futures.reserve(positions.size());
for (size_t i : positions) {
if (i >= detectors.size())
throw sls::RuntimeError("Detector out of range");
futures.push_back(std::async(std::launch::async, somefunc,
detectors[i].get(), Args...));
}
std::vector<RT> result;
result.reserve(positions.size());
for (auto &i : futures) {
result.push_back(i.get());
}
return result;
}
template <typename... CT>
void Parallel(void (slsDetector::*somefunc)(CT...),
std::vector<int> positions,
typename NonDeduced<CT>::type... Args) {
if (positions.empty() || (positions.size() == 1 && positions[0] == -1 )) {
positions.resize(detectors.size());
std::iota(begin(positions), end(positions), 0);
}
std::vector<std::future<void>> futures;
futures.reserve(positions.size());
for (size_t i : positions) {
if (i >= detectors.size())
throw sls::RuntimeError("Detector out of range");
futures.push_back(std::async(std::launch::async, somefunc,
detectors[i].get(), Args...));
}
for (auto &i : futures) {
i.get();
}
}
template <typename... CT>
void Parallel(void (slsDetector::*somefunc)(CT...) const,
std::vector<int> positions,
typename NonDeduced<CT>::type... Args) const{
if (positions.empty() || (positions.size() == 1 && positions[0] == -1 )) {
positions.resize(detectors.size());
std::iota(begin(positions), end(positions), 0);
}
std::vector<std::future<void>> futures;
futures.reserve(positions.size());
for (size_t i : positions) {
if (i >= detectors.size())
throw sls::RuntimeError("Detector out of range");
futures.push_back(std::async(std::launch::async, somefunc,
detectors[i].get(), Args...));
}
for (auto &i : futures) {
i.get();
}
}
/**
* Creates/open shared memory, initializes detector structure and members
* Called by constructor/ set hostname / read config file
@ -114,14 +210,12 @@ class multiSlsDetector : public virtual slsDetectorDefs {
* one
* @param update true to update last user pid, date etc
*/
void setupMultiDetector(bool verify = true,
bool update = true);
void setupMultiDetector(bool verify = true, bool update = true);
/**
* Loop through the detectors serially and return the result as a vector
*/
template <class CT>
struct NonDeduced { using type = CT; };
template <typename RT, typename... CT>
std::vector<RT> serialCall(RT (slsDetector::*somefunc)(CT...),
typename NonDeduced<CT>::type... Args);
@ -149,13 +243,13 @@ class multiSlsDetector : public virtual slsDetectorDefs {
std::vector<RT> parallelCall(RT (slsDetector::*somefunc)(CT...) const,
typename NonDeduced<CT>::type... Args) const;
template <typename... CT>
void parallelCall(void (slsDetector::*somefunc)(CT...),
typename NonDeduced<CT>::type... Args);
template <typename... CT>
void parallelCall(void (slsDetector::*somefunc)(CT...), typename NonDeduced<CT>::type... Args);
template <typename... CT>
void parallelCall(void (slsDetector::*somefunc)(CT...) const, typename NonDeduced<CT>::type... Args) const;
void parallelCall(void (slsDetector::*somefunc)(CT...) const,
typename NonDeduced<CT>::type... Args) const;
/**
* Decodes which detector and the corresponding channel numbers for it
@ -210,22 +304,24 @@ class multiSlsDetector : public virtual slsDetectorDefs {
*/
int64_t getId(idMode mode, int detPos = -1);
/**
* Get Client Software version
* @returns client software version
*/
int getMultiId()const{return multiId;}
/**
* Get Client Software version
* @returns client software version
*/
int64_t getClientSoftwareVersion() const;
/**
* Get Receiver software version
* @return receiver software version
*/
/**
* Get Receiver software version
* @return receiver software version
*/
int64_t getReceiverSoftwareVersion(int detPos = -1);
/**
* Get Detector Number
* @returns vector of detector number
*/
/**
* Get Detector Number
* @returns vector of detector number
*/
std::vector<int64_t> getDetectorNumber();
/**
* Free shared memory from the command line
@ -621,7 +717,7 @@ class multiSlsDetector : public virtual slsDetectorDefs {
*/
void setStartingFrameNumber(const uint64_t value, int detPos = -1);
/**
/**
* Get starting frame number for the next acquisition
* @param detPos -1 for all detectors in list or specific detector position
* @returns starting frame number
@ -761,7 +857,8 @@ class multiSlsDetector : public virtual slsDetectorDefs {
* @param detPos -1 for all detectors in list or specific detector position
* @returns value of speed set
*/
int setSpeed(speedVariable index, int value = -1, int mode = 0, int detPos = -1);
int setSpeed(speedVariable index, int value = -1, int mode = 0,
int detPos = -1);
/**
* Set/get dynamic range and updates the number of dataBytes
@ -780,9 +877,9 @@ class multiSlsDetector : public virtual slsDetectorDefs {
*/
int getDataBytes(int detPos = -1);
/**
/**
* Returns the number of detectors in the multi structure*/
size_t size() const{ return detectors.size();}
size_t size() const { return detectors.size(); }
/**
* Set/get dacs value
@ -898,12 +995,14 @@ class multiSlsDetector : public virtual slsDetectorDefs {
std::string getDetectorMAC(int detPos = -1);
/**
* Validates the format of the detector MAC address (bottom half) and sets it (Jungfrau only)
* Validates the format of the detector MAC address (bottom half) and sets
* it (Jungfrau only)
* @param detectorMAC detector MAC address (bottom half)
* @param detPos -1 for all detectors in list or specific detector position
* @returns the detector MAC address (bottom half)
*/
std::string setDetectorMAC2(const std::string &detectorMAC, int detPos = -1);
std::string setDetectorMAC2(const std::string &detectorMAC,
int detPos = -1);
/**
* Returns the detector MAC address (bottom half) Jungfrau only
@ -928,7 +1027,8 @@ class multiSlsDetector : public virtual slsDetectorDefs {
std::string getDetectorIP(int detPos = -1) const;
/**
* Validates the format of the detector IP address (bottom half) and sets it (Jungfrau only)
* Validates the format of the detector IP address (bottom half) and sets it
* (Jungfrau only)
* @param detectorIP detector IP address (bottom half)
* @param detPos -1 for all detectors in list or specific detector position
* @returns the detector IP address (bottom half)
@ -944,13 +1044,15 @@ class multiSlsDetector : public virtual slsDetectorDefs {
/**
* Validates and sets the receiver.
* Also updates the receiver with all the shared memory parameters significant for the receiver
* Also configures the detector to the receiver as UDP destination
* Also updates the receiver with all the shared memory parameters
* significant for the receiver Also configures the detector to the receiver
* as UDP destination
* @param receiver receiver hostname or IP address
* @param detPos -1 for all detectors in list or specific detector position
* @returns the receiver IP address from shared memory
*/
std::string setReceiverHostname(const std::string &receiver, int detPos = -1);
std::string setReceiverHostname(const std::string &receiver,
int detPos = -1);
/**
* Returns the receiver IP address
@ -975,7 +1077,8 @@ class multiSlsDetector : public virtual slsDetectorDefs {
std::string getReceiverUDPIP(int detPos = -1) const;
/**
* Validates the format of the receiver UDP IP address (bottom half) and sets it(Jungfrau only)
* Validates the format of the receiver UDP IP address (bottom half) and
* sets it(Jungfrau only)
* @param udpip receiver UDP IP address (bottom half)
* @param detPos -1 for all detectors in list or specific detector position
* @returns the receiver UDP IP address (bottom half)
@ -1005,7 +1108,8 @@ class multiSlsDetector : public virtual slsDetectorDefs {
std::string getReceiverUDPMAC(int detPos = -1) const;
/**
* Validates the format of the receiver UDP MAC address (bottom half) and sets it (Jungfrau only)
* Validates the format of the receiver UDP MAC address (bottom half) and
* sets it (Jungfrau only)
* @param udpmac receiver UDP MAC address (bottom half)
* @param detPos -1 for all detectors in list or specific detector position
* @returns the receiver UDP MAC address (bottom half)
@ -1043,14 +1147,16 @@ class multiSlsDetector : public virtual slsDetectorDefs {
int setReceiverUDPPort2(int udpport, int detPos = -1);
/**
* Returns the receiver UDP port 2 of same interface (Eiger and Jungfrau only)
* Returns the receiver UDP port 2 of same interface (Eiger and Jungfrau
* only)
* @param detPos -1 for all detectors in list or specific detector position
* @returns the receiver UDP port 2 of same interface
*/
int getReceiverUDPPort2(int detPos = -1) const;
/**
* Sets the number of UDP interfaces to stream data from detector (Jungfrau only)
* Sets the number of UDP interfaces to stream data from detector (Jungfrau
* only)
* @param n number of interfaces. Options 1 or 2.
* @param detPos -1 for all detectors in list or specific detector position
* @returns the number of interfaces
@ -1058,14 +1164,16 @@ class multiSlsDetector : public virtual slsDetectorDefs {
int setNumberofUDPInterfaces(int n, int detPos = -1);
/**
* Returns the number of UDP interfaces to stream data from detector (Jungfrau only)
* Returns the number of UDP interfaces to stream data from detector
* (Jungfrau only)
* @param detPos -1 for all detectors in list or specific detector position
* @returns the number of interfaces
*/
int getNumberofUDPInterfaces(int detPos = -1) const;
/**
* Selects the UDP interfaces to stream data from detector. Effective only when number of interfaces is 1. (Jungfrau only)
* Selects the UDP interfaces to stream data from detector. Effective only
* when number of interfaces is 1. (Jungfrau only)
* @param n selected interface. Options 1 or 2.
* @param detPos -1 for all detectors in list or specific detector position
* @returns the interface selected
@ -1073,7 +1181,8 @@ class multiSlsDetector : public virtual slsDetectorDefs {
int selectUDPInterface(int n, int detPos = -1);
/**
* Returns the UDP interfaces to stream data from detector. Effective only when number of interfaces is 1. (Jungfrau only)
* Returns the UDP interfaces to stream data from detector. Effective only
* when number of interfaces is 1. (Jungfrau only)
* @param detPos -1 for all detectors in list or specific detector position
* @returns the interface selected
*/
@ -1090,11 +1199,12 @@ class multiSlsDetector : public virtual slsDetectorDefs {
void setClientDataStreamingInPort(int i = -1, int detPos = -1);
/**
* Returns the client zmq port
* If detPos is -1(multi module), port returns client streaming port of first module
* Returns the client zmq port
* If detPos is -1(multi module), port returns client streaming port of
* first module
* @param detPos -1 for all detectors in list or specific detector position
* @returns the client zmq port
*/
* @returns the client zmq port
*/
int getClientStreamingPort(int detPos = -1);
/**
@ -1108,11 +1218,12 @@ class multiSlsDetector : public virtual slsDetectorDefs {
void setReceiverDataStreamingOutPort(int i = -1, int detPos = -1);
/**
* Returns the receiver zmq port
* If detPos is -1(multi module), port returns receiver streaming port of first module
* Returns the receiver zmq port
* If detPos is -1(multi module), port returns receiver streaming port of
* first module
* @param detPos -1 for all detectors in list or specific detector position
* @returns the receiver zmq port
*/
* @returns the receiver zmq port
*/
int getReceiverStreamingPort(int detPos = -1);
/**
@ -1126,11 +1237,12 @@ class multiSlsDetector : public virtual slsDetectorDefs {
int detPos = -1);
/**
* Returns the client zmq ip
* If detPos is -1(multi module), ip returns concatenation of all client streaming ip
* Returns the client zmq ip
* If detPos is -1(multi module), ip returns concatenation of all client
* streaming ip
* @param detPos -1 for all detectors in list or specific detector position
* @returns the client zmq ip
*/
* @returns the client zmq ip
*/
std::string getClientStreamingIP(int detPos = -1);
/**
@ -1144,11 +1256,12 @@ class multiSlsDetector : public virtual slsDetectorDefs {
int detPos = -1);
/**
* Returns the receiver zmq ip
* If detPos is -1(multi module), ip returns concatenation of all receiver streaming ip
* @param detPos -1 for all detectors in list or specific detector position
* @returns the receiver zmq ip
*/
* Returns the receiver zmq ip
* If detPos is -1(multi module), ip returns concatenation of all receiver
* streaming ip
* @param detPos -1 for all detectors in list or specific detector position
* @returns the receiver zmq ip
*/
std::string getReceiverStreamingIP(int detPos = -1);
/**
@ -1159,7 +1272,8 @@ class multiSlsDetector : public virtual slsDetectorDefs {
* @param detPos -1 for all detectors in list or specific detector position
* @returns transmission delay
*/
int setDetectorNetworkParameter(networkParameter index, int delay, int detPos = -1);
int setDetectorNetworkParameter(networkParameter index, int delay,
int detPos = -1);
/**
* Sets the additional json header
@ -1167,7 +1281,8 @@ class multiSlsDetector : public virtual slsDetectorDefs {
* @param detPos -1 for all detectors in list or specific detector position
* @returns additional json header, default is empty
*/
std::string setAdditionalJsonHeader(const std::string &jsonheader, int detPos = -1);
std::string setAdditionalJsonHeader(const std::string &jsonheader,
int detPos = -1);
/**
* Returns the additional json header
@ -1177,14 +1292,17 @@ class multiSlsDetector : public virtual slsDetectorDefs {
std::string getAdditionalJsonHeader(int detPos = -1);
/**
* Sets the value for the additional json header parameter if found, else append it
* Sets the value for the additional json header parameter if found, else
* append it
* @param key additional json header parameter
* @param value additional json header parameter value (cannot be empty)
* @param detPos -1 for all detectors in list or specific detector position
* @returns the additional json header parameter value,
* empty if no parameter found in additional json header
*/
std::string setAdditionalJsonParameter(const std::string &key, const std::string &value, int detPos = -1);
std::string setAdditionalJsonParameter(const std::string &key,
const std::string &value,
int detPos = -1);
/**
* Returns the additional json header parameter value
@ -1193,21 +1311,26 @@ class multiSlsDetector : public virtual slsDetectorDefs {
* @returns the additional json header parameter value,
* empty if no parameter found in additional json header
*/
std::string getAdditionalJsonParameter(const std::string &key, int detPos = -1);
std::string getAdditionalJsonParameter(const std::string &key,
int detPos = -1);
/**
* Sets the detector minimum/maximum energy threshold in processor (for Moench only)
* Sets the detector minimum/maximum energy threshold in processor (for
* Moench only)
* @param index 0 for emin, antyhing else for emax
* @param v value to set (-1 gets)
* @returns detector minimum/maximum energy threshold (-1 for not found or error in computing json parameter value)
* @returns detector minimum/maximum energy threshold (-1 for not found or
* error in computing json parameter value)
*/
int setDetectorMinMaxEnergyThreshold(const int index, int value, int detPos = -1);
int setDetectorMinMaxEnergyThreshold(const int index, int value,
int detPos = -1);
/**
* Sets the frame mode in processor (Moench only)
* @param value frameModeType (-1 gets)
* @param detPos -1 for all detectors in list or specific detector position
* @returns frame mode (-1 for not found or error in computing json parameter value)
* @returns frame mode (-1 for not found or error in computing json
* parameter value)
*/
int setFrameMode(frameModeType value, int detPos = -1);
@ -1215,7 +1338,8 @@ class multiSlsDetector : public virtual slsDetectorDefs {
* Sets the detector mode in processor (Moench only)
* @param value detectorModetype (-1 gets)
* @param detPos -1 for all detectors in list or specific detector position
* @returns detector mode (-1 for not found or error in computing json parameter value)
* @returns detector mode (-1 for not found or error in computing json
* parameter value)
*/
int setDetectorMode(detectorModeType value, int detPos = -1);
@ -1225,7 +1349,8 @@ class multiSlsDetector : public virtual slsDetectorDefs {
* @param detPos -1 for all detectors in list or specific detector position
* @returns receiver udp socket buffer size
*/
int64_t setReceiverUDPSocketBufferSize(int64_t udpsockbufsize = -1, int detPos = -1);
int64_t setReceiverUDPSocketBufferSize(int64_t udpsockbufsize = -1,
int detPos = -1);
/**
* Returns the receiver UDP socket buffer size
@ -1324,77 +1449,77 @@ class multiSlsDetector : public virtual slsDetectorDefs {
*/
void setADCEnableMask(uint32_t mask, int detPos = -1);
/**
/**
* Get ADC Enable Mask (CTB, Moench)
* @param detPos -1 for all detectors in list or specific detector position
* @returns ADC Enable mask
*/
uint32_t getADCEnableMask(int detPos = -1);
/**
/**
* Set ADC invert register (CTB, Moench)
* @param value ADC invert value
* @param detPos -1 for all detectors in list or specific detector position
*/
void setADCInvert(uint32_t value, int detPos = -1);
/**
/**
* Get ADC invert register (CTB, Moench)
* @param detPos -1 for all detectors in list or specific detector position
* @returns ADC invert value
*/
uint32_t getADCInvert(int detPos = -1);
/**
/**
* Set external sampling source (CTB only)
* @param value external sampling source (Option: 0-63)
* @param detPos -1 for all detectors in list or specific detector position
*/
void setExternalSamplingSource(int value, int detPos = -1);
/**
/**
* Get external sampling source (CTB only)
* @param detPos -1 for all detectors in list or specific detector position
* @returns external sampling source
*/
int getExternalSamplingSource(int detPos = -1);
/**
/**
* Set external sampling enable (CTB only)
* @param value external sampling source (Option: 0-63)
* @param detPos -1 for all detectors in list or specific detector position
*/
void setExternalSampling(bool value, int detPos = -1);
/**
/**
* Get external sampling source (CTB only)
* @param detPos -1 for all detectors in list or specific detector position
* @returns external sampling enable
*/
int getExternalSampling(int detPos = -1);
/**
/**
* Set external sampling enable (CTB only)
* @param list external sampling source (Option: 0-63)
* @param detPos -1 for all detectors in list or specific detector position
*/
void setReceiverDbitList(std::vector<int> list, int detPos = -1);
/**
/**
* Get external sampling source (CTB only)
* @param detPos -1 for all detectors in list or specific detector position
* @returns external sampling enable
*/
std::vector<int> getReceiverDbitList(int detPos = -1);
/**
/**
* Set digital data offset in bytes (CTB only)
* @param value digital data offset in bytes
* @param detPos -1 for all detectors in list or specific detector position
*/
void setReceiverDbitOffset(int value, int detPos = -1);
/**
/**
* Get digital data offset in bytes (CTB only)
* @param detPos -1 for all detectors in list or specific detector position
* @returns digital data offset in bytes
@ -1565,7 +1690,8 @@ class multiSlsDetector : public virtual slsDetectorDefs {
void rebootController(int detPos = -1);
/**
* Updates the firmware, detector server and then reboots detector controller blackfin. (Not Eiger)
* Updates the firmware, detector server and then reboots detector
* controller blackfin. (Not Eiger)
* @param sname name of detector server binary
* @param hostname name of pc to tftp from
* @param fname programming file name
@ -1589,7 +1715,6 @@ class multiSlsDetector : public virtual slsDetectorDefs {
*/
int setAutoComparatorDisableMode(int ival = -1, int detPos = -1);
/**
* Set Rate correction ( Eiger)
* @param t dead time in ns - if 0 disable correction,
@ -1600,17 +1725,17 @@ class multiSlsDetector : public virtual slsDetectorDefs {
void 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)
*/
* 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);
/**
* Prints receiver configuration
* @param level print level
* @param detPos -1 for all detectors in list or specific detector position
*/
* Prints receiver configuration
* @param level print level
* @param detPos -1 for all detectors in list or specific detector position
*/
void printReceiverConfiguration(TLogLevel level = logINFO, int detPos = -1);
/**
@ -1824,8 +1949,8 @@ class multiSlsDetector : public virtual slsDetectorDefs {
* @returns file write enable
*/
int getFileWrite(int detPos = -1) const;
/**
/**
* Sets/Gets receiver master file write enable
* @param value 1 or 0 to set/reset master file write enable
* @param detPos -1 for all detectors in list or specific detector position
@ -1923,26 +2048,27 @@ class multiSlsDetector : public virtual slsDetectorDefs {
*/
int setPattern(const std::string &fname, int detPos = -1);
/**
* Sets pattern IO control (CTB/ Moench)
* @param word 64bit word to be written, -1 gets
* @param detPos -1 for all detectors in list or specific detector position
* @returns actual value
*/
uint64_t setPatternIOControl(uint64_t word = -1, int detPos = -1);
/**
* Sets pattern IO control (CTB/ Moench)
* @param word 64bit word to be written, -1 gets
* @param detPos -1 for all detectors in list or specific detector position
* @returns actual value
*/
uint64_t setPatternIOControl(uint64_t word = -1, int detPos = -1);
/**
* Sets pattern clock control (CTB/ Moench)
* @param word 64bit word to be written, -1 gets
* @param detPos -1 for all detectors in list or specific detector position
* @returns actual value
*/
uint64_t setPatternClockControl(uint64_t word = -1, int detPos = -1);
/**
* Sets pattern clock control (CTB/ Moench)
* @param word 64bit word to be written, -1 gets
* @param detPos -1 for all detectors in list or specific detector position
* @returns actual value
*/
uint64_t setPatternClockControl(uint64_t word = -1, int detPos = -1);
/**
* Writes a pattern word (CTB/ Moench)
* @param addr address of the word
* @param word 64bit word to be written, -1 reads the addr (same as executing the pattern)
* @param word 64bit word to be written, -1 reads the addr (same as
* executing the pattern)
* @param detPos -1 for all detectors in list or specific detector position
* @returns actual value
*/
@ -1956,15 +2082,16 @@ class multiSlsDetector : public virtual slsDetectorDefs {
* @param n number of loops for level 0-2, -1 gets
* @param detPos -1 for all detectors in list or specific detector position
*/
void setPatternLoops(int level, int start = -1, int stop = -1, int n = -1, int detPos = -1);
void setPatternLoops(int level, int start = -1, int stop = -1, int n = -1,
int detPos = -1);
/**
* Gets the pattern loop limits (CTB/ Moench)
* @param level -1 complete pattern, 0,1,2, loop level
* @param detPos -1 for all detectors in list or specific detector position
* @returns array of start address, stop address and number of loops
*/
std::array<int, 3> getPatternLoops(int level, int detPos = -1);
/**
* Gets the pattern loop limits (CTB/ Moench)
* @param level -1 complete pattern, 0,1,2, loop level
* @param detPos -1 for all detectors in list or specific detector position
* @returns array of start address, stop address and number of loops
*/
std::array<int, 3> getPatternLoops(int level, int detPos = -1);
/**
* Sets the wait address (CTB/ Moench)
@ -1999,14 +2126,16 @@ class multiSlsDetector : public virtual slsDetectorDefs {
uint64_t getPatternMask(int detPos = -1);
/**
* Selects the bits that the mask will be applied to for every pattern (CTB/ Moench)
* Selects the bits that the mask will be applied to for every pattern (CTB/
* Moench)
* @param mask mask to select bits
* @param detPos -1 for all detectors in list or specific detector position
*/
void setPatternBitMask(uint64_t mask, int detPos = -1);
/**
* Gets the bits that the mask will be applied to for every pattern (CTB/ Moench)
* Gets the bits that the mask will be applied to for every pattern (CTB/
* Moench)
* @param detPos -1 for all detectors in list or specific detector position
* @returns mask of bits selected
*/
@ -2132,16 +2261,14 @@ class multiSlsDetector : public virtual slsDetectorDefs {
*/
void addSlsDetector(const std::string &hostname);
/**
* add gap pixels to the image (only for Eiger in 4 bit mode)
* @param image pointer to image without gap pixels
* @param gpImage poiner to image with gap pixels, if NULL, allocated
* inside function
* @returns number of data bytes of image with gap pixels
*/
int processImageWithGapPixels(char *image, char *&gpImage);
/**
* add gap pixels to the image (only for Eiger in 4 bit mode)
* @param image pointer to image without gap pixels
* @param gpImage poiner to image with gap pixels, if NULL, allocated
* inside function
* @returns number of data bytes of image with gap pixels
*/
int processImageWithGapPixels(char *image, char *&gpImage);
/**
* Set total progress (total number of frames/images in an acquisition)
@ -2197,14 +2324,13 @@ class multiSlsDetector : public virtual slsDetectorDefs {
*/
std::vector<char> readPofFile(const std::string &fname);
/**
* Convert a double holding time in seconds to an int64_t with nano seconds
* Used for conversion when sending time to detector
* @param t time in seconds
* @returns time in nano seconds
*/
int64_t secondsToNanoSeconds(double t);
/**
* Convert a double holding time in seconds to an int64_t with nano seconds
* Used for conversion when sending time to detector
* @param t time in seconds
* @returns time in nano seconds
*/
int64_t secondsToNanoSeconds(double t);
/** Multi detector Id */
const int multiId{0};
@ -2260,4 +2386,3 @@ class multiSlsDetector : public virtual slsDetectorDefs {
void (*dataReady)(detectorData *, uint64_t, uint32_t, void *){nullptr};
void *pCallbackArg{nullptr};
};