Merge branch 'apidhanya' of github.com:slsdetectorgroup/slsDetectorPackage into apidhanya

This commit is contained in:
Erik Frojdh 2019-08-12 14:23:21 +02:00
commit 09684518c5
5 changed files with 779 additions and 529 deletions

View File

@ -65,25 +65,9 @@ class Detector {
// Bits and registers
/**
* Clears (sets to 0) bit number bitnr in register at addr.
* @param addr address of the register
* @param bitnr bit number to clear
* @param pos detector position
*/
void clearBit(uint32_t addr, int bitnr, Positions pos = {});
/**
* Sets bit number bitnr in register at addr to 1
* @param addr address of the register
* @param bitnr bit number to clear
* @param pos detector position
*/
void setBit(uint32_t addr, int bitnr, Positions pos = {});
Result<uint32_t> readRegister(uint32_t addr, Positions pos = {}) const;
void writeRegister(uint32_t addr, uint32_t val, Positions pos = {});
/**************************************************
* *
@ -955,6 +939,273 @@ class Detector {
// Erik
/** [Eiger] */
Result<bool> getInterruptSubframe(Positions pos = {}) const;
/** [Eiger] when set, the last subframe is interrupted at end of acq */
void setInterruptSubframe(const bool enable, Positions pos = {});
Result<uint32_t> readRegister(uint32_t addr, Positions pos = {}) const;
void writeRegister(uint32_t addr, uint32_t val, Positions pos = {});
void setBit(uint32_t addr, int bitnr, Positions pos = {});
void clearBit(uint32_t addr, int bitnr, Positions pos = {});
Result<MacAddr> getDetectorMAC(Positions pos = {}) const;
void setDetectorMAC(const std::string &detectorMAC, Positions pos = {});
/** [Jungfrau] bottom half */
Result<MacAddr> getDetectorMAC2(Positions pos = {}) const;
/** [Jungfrau] bottom half */
void setDetectorMAC2(const std::string &detectorMAC, Positions pos = {});
Result<IpAddr> getDetectorIP(Positions pos = {}) const;
void setDetectorIP(const std::string &detectorIP, Positions pos = {});
/** [Jungfrau] bottom half */
Result<IpAddr> getDetectorIP2(Positions pos = {}) const;
/** [Jungfrau] bottom half */
void setDetectorIP2(const std::string &detectorIP, Positions pos = {});
Result<std::string> getReceiverHostname(Positions pos = {}) const;
/**
* Validates and sets the receiver.
* Updates local receiver cache parameters
* Configures the detector to the receiver as UDP destination
* @param receiver receiver hostname or IP address
*/
void setReceiverHostname(const std::string &receiver, Positions pos = {});
Result<IpAddr> getReceiverUDPIP(Positions pos = {}) const;
void setReceiverUDPIP(const std::string &udpip, Positions pos = {});
/** [Jungfrau bottom half] */
Result<IpAddr> getReceiverUDPIP2(Positions pos = {}) const;
/** [Jungfrau bottom half] */
void setReceiverUDPIP2(const std::string &udpip, Positions pos = {});
Result<MacAddr> getReceiverUDPMAC(Positions pos = {}) const;
void setReceiverUDPMAC(const std::string &udpmac, Positions pos = {});
/** [Jungfrau bottom half] */
Result<MacAddr> getReceiverUDPMAC2(Positions pos = {}) const;
/** [Jungfrau bottom half] */
void setReceiverUDPMAC2(const std::string &udpmac, Positions pos = {});
Result<int> getReceiverUDPPort(Positions pos = {}) const;
void setReceiverUDPPort(int udpport, Positions pos = {});
/** [Eiger right port][Jungfrau bottom half] */
Result<int> getReceiverUDPPort2(Positions pos = {}) const;
/** [Eiger right port][Jungfrau bottom half] */
void setReceiverUDPPort2(int udpport, Positions pos = {});
/** [Jungfrau] */
Result<int> getNumberofUDPInterfaces(Positions pos = {}) const;
/** [Jungfrau] Also restarts client and receiver sockets */
void setNumberofUDPInterfaces(int n, Positions pos = {});
/** [Jungfrau] */
Result<int> getSelectedUDPInterface(Positions pos = {}) const;
/**
* [Jungfrau:
* Effective only when number of interfaces is 1.
* Options: 0 (outer, default), 1(inner)]
*/
void selectUDPInterface(int interface, Positions pos = {});
Result<int> getClientStreamingPort(Positions pos = {}) const;
/**
* pos can be for a single module or all modules, not a subset
* If pos for all modules, ports for each module is calculated (increments)
* Restarts client zmq sockets
*/
void setClientDataStreamingInPort(int port, Positions pos = {});
Result<int> getReceiverStreamingPort(Positions pos = {}) const;
/**
* pos can be for a single module or all modules, not a subset
* If pos for all modules, ports for each module is calculated (increments)
* Restarts receiver zmq sockets
*/
void setReceiverDataStreamingOutPort(int port, Positions pos = {});
Result<std::string> getClientStreamingIP(Positions pos = {}) const;
// TODO these should probably be the same ?? same as what?
void setClientDataStreamingInIP(const std::string &ip, Positions pos = {});
Result<std::string> getReceiverStreamingIP(Positions pos = {}) const;
void setReceiverDataStreamingOutIP(const std::string &ip,
Positions pos = {});
/** [Eiger, Jungfrau] */
Result<bool> getFlowControl10G(Positions pos = {}) const;
/** [Eiger, Jungfrau] */
void setFlowControl10G(bool enable, Positions pos = {});
/** [Eiger, Jungfrau] */
Result<int> getTransmissionDelayFrame(Positions pos = {}) const;
/**
* [Jungfrau: Sets the transmission delay of the first UDP packet being streamed out of the module
* Options: 0 - 31, each value represenets 1 ms ]
* [Eiger: Sets the transmission delay of entire frame streamed out for both left and right UDP ports]
*/
void setTransmissionDelayFrame(int value, Positions pos = {});
/** [Eiger] */
Result<int> getTransmissionDelayLeft(Positions pos = {}) const;
/**
* [Eiger]
* Sets the transmission delay of first packet streamed ut of the left UDP port
*/
void setTransmissionDelayLeft(int value, Positions pos = {});
/** [Eiger] */
Result<int> getTransmissionDelayRight(Positions pos = {}) const;
/**
* [Eiger]
* Sets the transmission delay of first packet streamed ut of the right UDP port
*/
void setTransmissionDelayRight(int value, Positions pos = {});
/** [Moench] */
Result<std::string> getAdditionalJsonHeader(Positions pos = {}) const;
/** [Moench] */
void setAdditionalJsonHeader(const std::string &jsonheader,
Positions pos = {});
/** [Moench] */
Result<std::string> getAdditionalJsonParameter(const std::string &key,
Positions pos = {}) const;
/**
* [Moench]
* Sets the value for additional json header parameter if found,
* else appends the parameter key and value
* The value cannot be empty
*/
void setAdditionalJsonParameter(const std::string &key,
const std::string &value,
Positions pos = {});
/** [Moench] TODO! How do we do this best??? Can be refactored to something
* else? Use a generic zmq message passing system...
* For now limiting to all detectors working the same*/
/** [Moench: -1 if not found or cannot convert to int] */
Result<int> getDetectorMinMaxEnergyThreshold(const bool isEmax, Positions pos = {}) const;
/** [Moench] */
void setDetectorMinMaxEnergyThreshold(const bool isEmax, const int value, Positions pos = {});
/** [Moench: -1 if unknown mode] */
Result<int> getFrameMode(Positions pos = {}) const;
/** [Moench] */
void setFrameMode(defs::frameModeType value, Positions pos = {});
/** [Moench: -1 if unknown mode] */
Result<int> getDetectorMode(Positions pos = {}) const;
/** [Moench] */
void setDetectorMode(defs::detectorModeType value, Positions pos = {});
/** [Gotthard] */
Result<int> getDigitalTestBit(Positions pos = {});
/** [Gotthard] */
Result<int> setDigitalTestBit(const int value, Positions pos = {});
/** [Gotthard, Jungfrau, CTB] */
Result<int> executeFirmwareTest(Positions pos = {});
/** [Gotthard, Jungfrau, CTB] */
Result<int> executeBusTest(Positions pos = {});
/** [Gotthard] subset modules not allowed */
void loadDarkImage(const std::string &fname, Positions pos = {});
/** [Gotthard] subset modules not allowed */
void loadGainImage(const std::string &fname, Positions pos = {});
/**
* [Gotthard] subset modules not allowed
* @param startACQ if start acq after reading counter
*/
void getCounterMemoryBlock(const std::string &fname, bool startACQ, Positions pos = {});
/**
* [Gotthard]
* @param startACQ if start acq after resetting counter
* TODO! does it make sense to call one detector?
*/
void resetCounterBlock(bool startACQ, Positions pos = {});
/** [Eiger] */
Result<bool> getCounterBit(Positions pos = {}) const;
/** [Eiger] If it is set, it resets chips completely (else partially) before an acquisition TODO: if it makes sense */
void setCounterBit(bool value, Positions pos = {});
/** [Gotthard, CTB] subset modules not allowed */
Result<std::vector<defs::ROI>> getROI(Positions pos = {}) const;
/**
* [Gotthard Options: Only a single chip or all chips, only 1 ROI allowed]
* [CTB: multiple ROIs allowed]
* subset modules not allowed
*/
void setROI(std::vector<defs::ROI> value, Positions pos = {});
/** [CTB]*/
Result<uint32_t> getADCEnableMask(Positions pos = {}) const;
/** [CTB]*/
void setADCEnableMask(uint32_t mask, Positions pos = {});
/** [CTB] */
Result<uint32_t> getADCInvert(Positions pos = {}) const;
/** [CTB]*/
void setADCInvert(uint32_t value, Positions pos = {});
/** [CTB] */
Result<int> getExternalSamplingSource(Positions pos = {}) const;
/** [CTB] Value between 0-63 */
void setExternalSamplingSource(int value, Positions pos = {});
/** [CTB] */
Result<int> getExternalSampling(Positions pos = {}) const;
/** [CTB] */
void setExternalSampling(bool value, Positions pos = {});
/** [CTB] */
Result<std::vector<int>> getReceiverDbitList(Positions pos = {}) const;
/** [CTB] list contains the set of bits (0-63) to save */
void setReceiverDbitList(std::vector<int> list, Positions pos = {});
/** [CTB] */
Result<int> getReceiverDbitOffset(Positions pos = {}) const;
/** [CTB] Set number of bytes of digital data to skip in the Receiver */
void setReceiverDbitOffset(int value, Positions pos = {});
/** [Gotthard][Jungfrau][CTB] not possible to read back*/
void writeAdcRegister(uint32_t addr, uint32_t value, Positions pos = {});
Result<int64_t> getReceiverUDPSocketBufferSize(Positions pos = {}) const;
void setReceiverUDPSocketBufferSize(int64_t udpsockbufsize,
Positions pos = {});
Result<int64_t>
getReceiverRealUDPSocketBufferSize(Positions pos = {}) const;
Result<int> getFramesCaughtByReceiver(Positions pos = {}) const;
Result<uint64_t> getReceiverCurrentFrameIndex(Positions pos = {}) const;
@ -979,9 +1230,11 @@ class Detector {
/** [All] */
Result<int> getReceiverStreamingTimer(Positions pos = {}) const;
// TODO!
// int enableDataStreamingToClient(int enable = -1);
void enableDataStreamingFromReceiver(bool enable, Positions pos = {});
bool getDataStreamingToClient() const;
void setDataStreamingToClient(bool value);
Result<bool> getDataStreamingFromReceiver(Positions pos = {}) const;
void setDataStreamingFromReceiver(bool value, Positions pos = {});
/** [TODO! All?] */
void setTenGigaEnabled(bool value, Positions pos = {});
@ -1272,203 +1525,8 @@ class Detector {
Result<bool> getActive(Positions pos = {}) const;
/** [Gotthard][Jungfrau][CTB] not possible to read back*/
void writeAdcRegister(uint32_t addr, uint32_t value, Positions pos = {});
/** [CTB] How much digital data in bytes is skipped */
Result<int> getReceiverDbitOffset(Positions pos = {}) const;
/** [CTB] Set how many bytes of digital data to skip */
void setReceiverDbitOffset(int value, Positions pos = {});
/** [CTB] Which of the bits 0-63 to save*/
Result<std::vector<int>> getReceiverDbitList(Positions pos = {}) const;
/** [CTB] Which of the bits 0-63 to save*/
void setReceiverDbitList(std::vector<int> list, Positions pos = {});
/** [CTB] */
Result<int> getExternalSampling(Positions pos = {}) const;
/** [CTB] */
void setExternalSampling(bool value, Positions pos = {});
/** [CTB] */
Result<int> getExternalSamplingSource(Positions pos = {}) const;
/** [CTB] Value between 0-63 */
void setExternalSamplingSource(int value, Positions pos = {});
// TODO! does any of them need the option to take positions
/** [CTB] */
uint32_t getADCInvert() const;
/** [CTB]*/
void setADCInvert(uint32_t value);
/** [CTB]*/
uint32_t getADCEnableMask() const;
/** [CTB]*/
void setADCEnableMask(uint32_t mask);
/** [Gotthard] */
Result<int> getCounterBit(Positions pos = {}) const;
/** [Gotthard] possible values? */
void setCounterBit(int i, Positions pos = {});
/**
* [Gotthard] startACQ = 1 to start acq after resetting counter
* TODO! does it make sense to call one detector?
*
*/
void resetCounterBlock(int startACQ = 0, Positions pos = {});
// TODO getROI, setROI, verifyMinMaxROI
// writeCounterBlockFile
void loadImageToDetector(defs::imageType index, const std::string &fname,
Positions pos = {});
/** [Gotthard]
* @param value 1 to set or 0 to clear the digital test bit -1?
*/
Result<int> digitalTest(defs::digitalTestMode mode, int ival = -1,
Positions pos = {});
/** [Eiger] */
void setFlowControl10G(bool enable, Positions pos = {});
/** [Eiger] */
Result<bool> getFlowControl10G(Positions pos = {}) const;
Result<int64_t>
getReceiverRealUDPSocketBufferSize(Positions pos = {}) const;
Result<int64_t> getReceiverUDPSocketBufferSize(Positions pos = {}) const;
void setReceiverUDPSocketBufferSize(int64_t udpsockbufsize,
Positions pos = {});
/** [Moench] TODO! How do we do this best??? Can be refactored to something
* else? Use a generic zmq message passing system...
* For now limiting to all detectors working the same*/
int setDetectorMode(defs::detectorModeType value);
int setFrameMode(defs::frameModeType value);
int setDetectorMinMaxEnergyThreshold(const int index, int value);
void setAdditionalJsonHeader(const std::string &jsonheader,
Positions pos = {});
Result<std::string> getAdditionalJsonHeader(Positions pos = {}) const;
Result<std::string> getAdditionalJsonParameter(const std::string &key,
Positions pos = {}) const;
void setAdditionalJsonParameter(const std::string &key,
const std::string &value,
Positions pos = {});
// TODO these should probably be the same
Result<std::string> getReceiverStreamingIP(Positions pos = {}) const;
void setReceiverDataStreamingOutIP(const std::string &ip,
Positions pos = {});
Result<std::string> getClientStreamingIP(Positions pos = {}) const;
// TODO these should probably be the same
void setClientDataStreamingInIP(const std::string &ip, Positions pos = {});
Result<int> getReceiverStreamingPort(Positions pos = {}) const;
/** Single detector or all since ports are calculated*/
void setReceiverDataStreamingOutPort(int port, int module_id = -1);
Result<int> getClientStreamingPort(Positions pos = {}) const;
/** Single detector or all since ports are calculated*/
void setClientDataStreamingInPort(int port, int module_id = -1);
/** [Jungfrau] */
Result<int> getSelectedUDPInterface(Positions pos = {}) const;
/**
* [Jungfrau]
* @param interface interface to select, either 1 or 2
* */
void selectUDPInterface(int interface, Positions pos = {});
Result<int> getNumberofUDPInterfaces(Positions pos = {}) const;
void setNumberofUDPInterfaces(int n, Positions pos = {});
/** [Eiger][Jungfrau] */
Result<int> getReceiverUDPPort2(Positions pos = {}) const;
/** [Eiger][Jungfrau] */
void setReceiverUDPPort2(int udpport, Positions pos = {});
/** [Eiger][Jungfrau] */
Result<int> getReceiverUDPPort(Positions pos = {}) const;
/** [Eiger][Jungfrau] */
void setReceiverUDPPort(int udpport, Positions pos = {});
/** [Jungfrau] */
Result<MacAddr> getReceiverUDPMAC2(Positions pos = {}) const;
/** [Jungfrau] */
void setReceiverUDPMAC2(const std::string &udpmac, Positions pos = {});
Result<MacAddr> getReceiverUDPMAC(Positions pos = {}) const;
void setReceiverUDPMAC(const std::string &udpmac, Positions pos = {});
/** [Jungfrau] */
Result<IpAddr> getReceiverUDPIP2(Positions pos = {}) const;
/** [Jungfrau] */
void setReceiverUDPIP2(const std::string &udpip, Positions pos = {});
Result<IpAddr> getReceiverUDPIP(Positions pos = {}) const;
void setReceiverUDPIP(const std::string &udpip, Positions pos = {});
Result<std::string> getReceiverHostname(Positions pos = {}) const;
/**
* 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
* @param receiver receiver hostname or IP address */
void setReceiverHostname(const std::string &receiver, Positions pos = {});
/** [Jungfrau] */
Result<IpAddr> getDetectorIP2(Positions pos = {}) const;
/** [Jungfrau] */
void setDetectorIP2(const std::string &detectorIP, Positions pos = {});
Result<IpAddr> getDetectorIP(Positions pos = {}) const;
void setDetectorIP(const std::string &detectorIP, Positions pos = {});
Result<MacAddr> getDetectorMAC(Positions pos = {}) const;
void setDetectorMAC(const std::string &detectorMAC, Positions pos = {});
/** [Jungfrau] */
Result<MacAddr> getDetectorMAC2(Positions pos = {}) const;
/** [Jungfrau] */
void setDetectorMAC2(const std::string &detectorMAC, Positions pos = {});
/** [Eiger] */
Result<bool> getInterruptSubframe(Positions pos = {}) const;
/** [Eiger] when set the last subframe is interrupted at end of acq*/
void setInterruptSubframe(const bool enable, Positions pos = {});
};
} // namespace sls

View File

@ -1387,7 +1387,7 @@ class multiSlsDetector : public virtual slsDetectorDefs {
void resetCounterBlock(int startACQ = 0, int detPos = -1); //
/**
* Set/get counter bit in detector (Gotthard)
* Set/get counter bit in detector (Eiger)
* @param i is -1 to get, 0 to reset and any other value to set the counter
* bit
* @param detPos -1 for all detectors in list or specific detector position
@ -1395,13 +1395,6 @@ class multiSlsDetector : public virtual slsDetectorDefs {
*/
int setCounterBit(int i = -1, int detPos = -1); //
/**
* Ensures that min is less than max in both dimensions (Gotthard)
* @param n number of rois
* @param r array of rois
*/
void verifyMinMaxROI(int n, ROI r[]);
/**
* Set ROI (Gotthard)
* At the moment only one set allowed
@ -1976,7 +1969,7 @@ class multiSlsDetector : public virtual slsDetectorDefs {
* @param enable 0 to disable, 1 to enable, -1 to get the value
* @returns data streaming to client enable
*/
int enableDataStreamingToClient(int enable = -1);
bool enableDataStreamingToClient(int enable = -1);
/**
* Enable or disable streaming data from receiver to client
@ -2283,6 +2276,13 @@ class multiSlsDetector : public virtual slsDetectorDefs {
*/
void addSlsDetector(const std::string &hostname);
/**
* Ensures that min is less than max in both dimensions (Gotthard)
* @param n number of rois
* @param r array of rois
*/
void verifyMinMaxROI(int n, ROI r[]);
/**
* add gap pixels to the image (only for Eiger in 4 bit mode)
* @param image pointer to image without gap pixels

View File

@ -41,19 +41,9 @@ void Detector::setConfig(const std::string &fname) {
pimpl->readConfigurationFile(fname);
}
void Detector::clearBit(uint32_t addr, int bitnr, Positions pos) {
pimpl->Parallel(&slsDetector::clearBit, pos, addr, bitnr);
}
void Detector::setBit(uint32_t addr, int bitnr, Positions pos) {
pimpl->Parallel(&slsDetector::setBit, pos, addr, bitnr);
}
void Detector::writeRegister(uint32_t addr, uint32_t val, Positions pos) {
pimpl->Parallel(&slsDetector::writeRegister, pos, addr, val);
}
Result<uint32_t> Detector::readRegister(uint32_t addr, Positions pos) const {
return pimpl->Parallel(&slsDetector::readRegister, pos, addr);
}
Result<uint64_t> Detector::getStartingFrameNumber(Positions pos) const {
return pimpl->Parallel(&slsDetector::getStartingFrameNumber, pos);
@ -156,7 +146,7 @@ defs::coordinates Detector::getNumberOfDetectors() const {
}
Result<defs::coordinates> Detector::getNumberOfChannels(Positions pos) const {
if (pos.empty() || (pos.size() == 1 && pos[0] == -1)) {
if (pos.empty() || (pos.size() == 1 && pos[0] == -1)) {// TODO: also check condition that pos.size == pimpl->size()?? for other occurences as well
return {pimpl->getNumberOfChannels()};
}
return pimpl->Parallel(&slsDetector::getNumberOfChannels, pos);
@ -775,6 +765,470 @@ void Detector::setDAC(int value, defs::dacIndex index, bool mV, Positions pos) {
}
// Erik
Result<bool> Detector::getInterruptSubframe(Positions pos) const {
return pimpl->Parallel(&slsDetector::getInterruptSubframe, pos);
}
void Detector::setInterruptSubframe(const bool enable, Positions pos){
pimpl->Parallel(&slsDetector::setInterruptSubframe, pos, enable);
}
void Detector::writeRegister(uint32_t addr, uint32_t val, Positions pos) {
pimpl->Parallel(&slsDetector::writeRegister, pos, addr, val);
}
Result<uint32_t> Detector::readRegister(uint32_t addr, Positions pos) const {
return pimpl->Parallel(&slsDetector::readRegister, pos, addr);
}
void Detector::setBit(uint32_t addr, int bitnr, Positions pos) {
pimpl->Parallel(&slsDetector::setBit, pos, addr, bitnr);
}
void Detector::clearBit(uint32_t addr, int bitnr, Positions pos) {
pimpl->Parallel(&slsDetector::clearBit, pos, addr, bitnr);
}
Result<MacAddr> Detector::getDetectorMAC(Positions pos) const {
return pimpl->Parallel(&slsDetector::getDetectorMAC, pos);
}
void Detector::setDetectorMAC(const std::string &detectorMAC, Positions pos) {
pimpl->Parallel(&slsDetector::setDetectorMAC, pos, detectorMAC);
}
Result<MacAddr> Detector::getDetectorMAC2(Positions pos) const {
return pimpl->Parallel(&slsDetector::getDetectorMAC2, pos);
}
void Detector::setDetectorMAC2(const std::string &detectorMAC, Positions pos) {
pimpl->Parallel(&slsDetector::setDetectorMAC2, pos, detectorMAC);
}
Result<IpAddr> Detector::getDetectorIP(Positions pos) const {
return pimpl->Parallel(&slsDetector::getDetectorIP, pos);
}
void Detector::setDetectorIP(const std::string &detectorIP, Positions pos) {
pimpl->Parallel(&slsDetector::setDetectorIP, pos, detectorIP);
}
Result<IpAddr> Detector::getDetectorIP2(Positions pos) const {
return pimpl->Parallel(&slsDetector::getDetectorIP2, pos);
}
void Detector::setDetectorIP2(const std::string &detectorIP, Positions pos) {
pimpl->Parallel(&slsDetector::setDetectorIP2, pos, detectorIP);
}
Result<std::string> Detector::getReceiverHostname(Positions pos) const {
return pimpl->Parallel(&slsDetector::getReceiverHostname, pos);
}
void Detector::setReceiverHostname(const std::string &receiver, Positions pos) {
pimpl->Parallel(&slsDetector::setReceiverHostname, pos, receiver);
}
Result<IpAddr> Detector::getReceiverUDPIP(Positions pos) const {
return pimpl->Parallel(&slsDetector::getReceiverUDPIP, pos);
}
void Detector::setReceiverUDPIP(const std::string &udpip, Positions pos) {
pimpl->Parallel(&slsDetector::setReceiverUDPIP, pos, udpip);
}
Result<IpAddr> Detector::getReceiverUDPIP2(Positions pos) const {
return pimpl->Parallel(&slsDetector::getReceiverUDPIP2, pos);
}
void Detector::setReceiverUDPIP2(const std::string &udpip, Positions pos) {
pimpl->Parallel(&slsDetector::setReceiverUDPIP2, pos, udpip);
}
Result<MacAddr> Detector::getReceiverUDPMAC(Positions pos) const {
return pimpl->Parallel(&slsDetector::getReceiverUDPMAC, pos);
}
void Detector::setReceiverUDPMAC(const std::string &udpmac, Positions pos) {
pimpl->Parallel(&slsDetector::setReceiverUDPMAC, pos, udpmac);
}
Result<MacAddr> Detector::getReceiverUDPMAC2(Positions pos) const {
return pimpl->Parallel(&slsDetector::getReceiverUDPMAC2, pos);
}
void Detector::setReceiverUDPMAC2(const std::string &udpmac, Positions pos) {
pimpl->Parallel(&slsDetector::setReceiverUDPMAC2, pos, udpmac);
}
Result<int> Detector::getReceiverUDPPort(Positions pos) const {
return pimpl->Parallel(&slsDetector::getReceiverUDPPort, pos);
}
void Detector::setReceiverUDPPort(int udpport, Positions pos) {
pimpl->Parallel(&slsDetector::setReceiverUDPPort, pos, udpport);
}
Result<int> Detector::getReceiverUDPPort2(Positions pos) const {
return pimpl->Parallel(&slsDetector::getReceiverUDPPort2, pos);
}
void Detector::setReceiverUDPPort2(int udpport, Positions pos) {
pimpl->Parallel(&slsDetector::setReceiverUDPPort2, pos, udpport);
}
Result<int> Detector::getNumberofUDPInterfaces(Positions pos) const {
return pimpl->Parallel(&slsDetector::getNumberofUDPInterfaces, pos);
}
void Detector::setNumberofUDPInterfaces(int n, Positions pos) {
bool previouslyClientStreaming = getDataStreamingToClient();
bool previouslyReceiverStreaming = getDataStreamingFromReceiver(pos).squash(false);
pimpl->Parallel(&slsDetector::setNumberofUDPInterfaces, pos, n);
// redo the zmq sockets if enabled
if (previouslyClientStreaming) {
setDataStreamingToClient(false);
setDataStreamingToClient(true);
}
if (previouslyReceiverStreaming) {
setDataStreamingFromReceiver(false, pos);
setDataStreamingFromReceiver(true, pos);
}
}
Result<int> Detector::getSelectedUDPInterface(Positions pos) const {
return pimpl->Parallel(&slsDetector::getSelectedUDPInterface, pos);
}
void Detector::selectUDPInterface(int interface, Positions pos) {
pimpl->Parallel(&slsDetector::selectUDPInterface, pos, interface);
}
Result<int> Detector::getClientStreamingPort(Positions pos) const {
return pimpl->Parallel(&slsDetector::getClientStreamingPort, pos);
}
void Detector::setClientDataStreamingInPort(int port, Positions pos) {
if (pos.size() > 1 && pos.size() < pimpl->size()) {
throw RuntimeError("Cannot set client streaming port to a subset of modules");
}
pimpl->setClientDataStreamingInPort(port, pos.empty() ? -1 : pos[0]);
}
Result<int> Detector::getReceiverStreamingPort(Positions pos) const {
return pimpl->Parallel(&slsDetector::getReceiverStreamingPort, pos);
}
void Detector::setReceiverDataStreamingOutPort(int port, Positions pos) {
if (pos.size() > 1 && pos.size() < pimpl->size()) {
throw RuntimeError("Cannot set receiver streaming port to a subset of modules");
}
pimpl->setReceiverDataStreamingOutPort(port, pos.empty() ? -1 : pos[0]);
}
Result<std::string> Detector::getClientStreamingIP(Positions pos) const {
return pimpl->Parallel(&slsDetector::getClientStreamingIP, pos);
}
void Detector::setClientDataStreamingInIP(const std::string &ip,
Positions pos) {
bool previouslyClientStreaming = getDataStreamingToClient();
// TODO! probably in one call ??
pimpl->Parallel(&slsDetector::setClientStreamingIP, pos, ip);
if (previouslyClientStreaming) {
setDataStreamingToClient(false);
setDataStreamingToClient(true);
}
}
Result<std::string> Detector::getReceiverStreamingIP(Positions pos) const {
return pimpl->Parallel(&slsDetector::getReceiverStreamingIP, pos);
}
void Detector::setReceiverDataStreamingOutIP(const std::string &ip,
Positions pos) {
bool previouslyReceiverStreaming = getDataStreamingFromReceiver(pos).squash(false);
// TODO! probably in one call
pimpl->Parallel(&slsDetector::setReceiverStreamingIP, pos, ip);
if (previouslyReceiverStreaming) {
setDataStreamingFromReceiver(false, pos);
setDataStreamingFromReceiver(true, pos);
}
}
Result<bool> Detector::getFlowControl10G(Positions pos) const {
return pimpl->Parallel(&slsDetector::setDetectorNetworkParameter, pos,
defs::FLOW_CONTROL_10G, -1);
}
void Detector::setFlowControl10G(bool enable, Positions pos) {
pimpl->Parallel(&slsDetector::setDetectorNetworkParameter, pos,
defs::FLOW_CONTROL_10G, static_cast<int>(enable));
}
Result<int> Detector::getTransmissionDelayFrame(Positions pos) const {
return pimpl->Parallel(&slsDetector::setDetectorNetworkParameter, pos,
defs::DETECTOR_TXN_DELAY_FRAME, -1);
}
void Detector::setTransmissionDelayFrame(int value, Positions pos) {
pimpl->Parallel(&slsDetector::setDetectorNetworkParameter, pos,
defs::DETECTOR_TXN_DELAY_FRAME, value);
}
Result<int> Detector::getTransmissionDelayLeft(Positions pos) const {
return pimpl->Parallel(&slsDetector::setDetectorNetworkParameter, pos,
defs::DETECTOR_TXN_DELAY_LEFT, -1);
}
void Detector::setTransmissionDelayLeft(int value, Positions pos) {
pimpl->Parallel(&slsDetector::setDetectorNetworkParameter, pos,
defs::DETECTOR_TXN_DELAY_LEFT, value);
}
Result<int> Detector::getTransmissionDelayRight(Positions pos) const {
return pimpl->Parallel(&slsDetector::setDetectorNetworkParameter, pos,
defs::DETECTOR_TXN_DELAY_RIGHT, -1);
}
void Detector::setTransmissionDelayRight(int value, Positions pos) {
pimpl->Parallel(&slsDetector::setDetectorNetworkParameter, pos,
defs::DETECTOR_TXN_DELAY_RIGHT, value);
}
void Detector::setAdditionalJsonHeader(const std::string &jsonheader,
Positions pos) {
pimpl->Parallel(&slsDetector::setAdditionalJsonHeader, pos, jsonheader);
}
Result<std::string> Detector::getAdditionalJsonHeader(Positions pos) const {
return pimpl->Parallel(&slsDetector::getAdditionalJsonHeader, pos);
}
Result<std::string> Detector::getAdditionalJsonParameter(const std::string &key,
Positions pos) const {
return pimpl->Parallel(&slsDetector::getAdditionalJsonParameter, pos, key);
}
void Detector::setAdditionalJsonParameter(const std::string &key,
const std::string &value,
Positions pos) {
pimpl->Parallel(&slsDetector::setAdditionalJsonParameter, pos, key, value);
}
Result<int> Detector::getDetectorMinMaxEnergyThreshold(const bool isEmax, Positions pos) const {
auto res = pimpl->Parallel(&slsDetector::getAdditionalJsonParameter, pos, isEmax ? "emax" : "emin");
Result<int> intResult;
try{
for (unsigned int i = 0; i < res.size(); ++i) {
intResult[i] = stoi(res[i]);
}
} catch(...) {
throw RuntimeError("Cannot find or convert emin/emax string to integer");
}
return intResult;
}
void Detector::setDetectorMinMaxEnergyThreshold(const bool isEmax, const int value, Positions pos) {
pimpl->Parallel(&slsDetector::setAdditionalJsonParameter, pos, isEmax ? "emax" : "emin", std::to_string(value));
}
Result<int> Detector::getFrameMode(Positions pos) const {
auto res = pimpl->Parallel(&slsDetector::getAdditionalJsonParameter, pos, "frameMode");
Result<int> intResult;
try{
for (unsigned int i = 0; i < res.size(); ++i) {
intResult[i] = defs::getFrameModeType(res[i]);
}
} catch(...) {
throw RuntimeError("Cannot find or convert frameMode string to integer");
}
return intResult;
}
void Detector::setFrameMode(defs::frameModeType value, Positions pos) {
pimpl->Parallel(&slsDetector::setAdditionalJsonParameter, pos, "frameMode", defs::getFrameModeType(value));
}
Result<int> Detector::getDetectorMode(Positions pos) const {
auto res = pimpl->Parallel(&slsDetector::getAdditionalJsonParameter, pos, "detectorMode");
Result<int> intResult;
try{
for (unsigned int i = 0; i < res.size(); ++i) {
intResult[i] = defs::getDetectorModeType(res[i]);
}
} catch(...) {
throw RuntimeError("Cannot find or convert detectorMode string to integer");
}
return intResult;
}
void Detector::setDetectorMode(defs::detectorModeType value, Positions pos) {
pimpl->Parallel(&slsDetector::setAdditionalJsonParameter, pos, "detectorMode", defs::getDetectorModeType(value));
}
Result<int> Detector::getDigitalTestBit(Positions pos) {
return pimpl->Parallel(&slsDetector::digitalTest, pos, defs::DIGITAL_BIT_TEST, -1);
}
Result<int> Detector::setDigitalTestBit(int value, Positions pos) {
return pimpl->Parallel(&slsDetector::digitalTest, pos, defs::DIGITAL_BIT_TEST, value);
}
Result<int> Detector::executeFirmwareTest(Positions pos) {
return pimpl->Parallel(&slsDetector::digitalTest, pos, defs::DETECTOR_FIRMWARE_TEST, -1);
}
Result<int> Detector::executeBusTest(Positions pos) {
return pimpl->Parallel(&slsDetector::digitalTest, pos, defs::DETECTOR_BUS_TEST, -1);
}
void Detector::loadDarkImage(const std::string &fname, Positions pos) {
// TODO! optimize away multiple loads in multi
if (pos.empty() || (pos.size() == 1 && pos[0] == -1)) {
pimpl->loadImageToDetector(defs::DARK_IMAGE, fname, -1);
}
if (pos.size() > 1) {
throw RuntimeError("Cannot load dark image on a subset of modules");
}
pimpl->Parallel(&slsDetector::loadImageToDetector, pos, defs::DARK_IMAGE, fname);
}
void Detector::loadGainImage(const std::string &fname, Positions pos) {
// TODO! optimize away multiple loadsin multi
if (pos.empty() || (pos.size() == 1 && pos[0] == -1)) {
pimpl->loadImageToDetector(defs::GAIN_IMAGE, fname, -1);
}
if (pos.size() > 1) {
throw RuntimeError("Cannot load gain image on a subset of modules");
}
pimpl->Parallel(&slsDetector::loadImageToDetector, pos, defs::GAIN_IMAGE, fname);
}
void Detector::getCounterMemoryBlock(const std::string &fname, bool startACQ, Positions pos) {
if (pos.empty() || (pos.size() == 1 && pos[0] == -1)) {
pimpl->writeCounterBlockFile(fname, static_cast<int>(startACQ), -1);
}
if (pos.size() > 1) {
throw RuntimeError("Cannot load get counter memory block on a subset of modules");
}
pimpl->Parallel(&slsDetector::writeCounterBlockFile, pos, fname, static_cast<int>(startACQ));
}
void Detector::resetCounterBlock(bool startACQ, Positions pos) {
pimpl->Parallel(&slsDetector::resetCounterBlock, pos, static_cast<int>(startACQ));
}
Result<bool> Detector::getCounterBit(Positions pos) const {
return pimpl->Parallel(&slsDetector::setCounterBit, pos, -1);
}
void Detector::setCounterBit(bool value, Positions pos) {
pimpl->Parallel(&slsDetector::setCounterBit, pos, value);
}
Result<std::vector<defs::ROI>> Detector::getROI(Positions pos) const {
int n = 0;
if (pos.empty() || (pos.size() == 1 && pos[0] == -1)) {
auto res = pimpl->getROI(n, -1);
std::vector<defs::ROI> arrayRes(n);
std::copy_n(res, n * sizeof(defs::ROI), arrayRes.begin());
return arrayRes;
} else if (pos.size() > 1) {
throw RuntimeError("Cannot get roi from a subset of modules");
} else {
auto res = pimpl->Parallel(&slsDetector::getROI, pos, n);
std::vector<defs::ROI> arrayRes(n);
std::copy_n(res, n * sizeof(defs::ROI), arrayRes.begin());
return arrayRes;
}
}
void Detector::setROI(std::vector<defs::ROI> value, Positions pos) {
if (pos.empty() || (pos.size() == 1 && pos[0] == -1)) {
pimpl->setROI(static_cast<int>(value.size()), value.data(), -1);
} else if (pos.size() > 1) {
throw RuntimeError("Cannot set roi to a subset of modules");
} else {
pimpl->Parallel(&slsDetector::setROI, pos, static_cast<int>(value.size()), value.data());
}
}
Result<uint32_t> Detector::getADCEnableMask(Positions pos) const {
return pimpl->Parallel(&slsDetector::getADCEnableMask, pos);
}
void Detector::setADCEnableMask(uint32_t mask, Positions pos) {
pimpl->Parallel(&slsDetector::setADCEnableMask, pos, mask);
}
Result<uint32_t> Detector::getADCInvert(Positions pos) const {
return pimpl->Parallel(&slsDetector::getADCInvert, pos);
}
void Detector::setADCInvert(uint32_t value, Positions pos) {
pimpl->Parallel(&slsDetector::setADCInvert, pos, value);
}
Result<int> Detector::getExternalSamplingSource(Positions pos) const {
return pimpl->Parallel(&slsDetector::getExternalSamplingSource, pos);
}
void Detector::setExternalSamplingSource(int value, Positions pos) {
pimpl->Parallel(&slsDetector::setExternalSamplingSource, pos, value);
}
Result<int> Detector::getExternalSampling(Positions pos) const {
return pimpl->Parallel(&slsDetector::getExternalSampling, pos);
}
void Detector::setExternalSampling(bool value, Positions pos) {
pimpl->Parallel(&slsDetector::setExternalSampling, pos, value);
}
Result<std::vector<int>> Detector::getReceiverDbitList(Positions pos) const {
return pimpl->Parallel(&slsDetector::getReceiverDbitList, pos);
}
void Detector::setReceiverDbitList(std::vector<int> list, Positions pos) {
pimpl->Parallel(&slsDetector::setReceiverDbitList, pos, list);
}
Result<int> Detector::getReceiverDbitOffset(Positions pos) const {
return pimpl->Parallel(&slsDetector::getReceiverDbitOffset, pos);
}
void Detector::setReceiverDbitOffset(int value, Positions pos) {
pimpl->Parallel(&slsDetector::setReceiverDbitOffset, pos, value);
}
void Detector::writeAdcRegister(uint32_t addr, uint32_t value, Positions pos) {
pimpl->Parallel(&slsDetector::writeAdcRegister, pos, addr, value);
}
Result<int64_t> Detector::getReceiverUDPSocketBufferSize(Positions pos) const {
return pimpl->Parallel(&slsDetector::getReceiverUDPSocketBufferSize, pos);
}
void Detector::setReceiverUDPSocketBufferSize(int64_t udpsockbufsize,
Positions pos) {
pimpl->Parallel(&slsDetector::setReceiverUDPSocketBufferSize, pos,
udpsockbufsize);
}
Result<int64_t>
Detector::getReceiverRealUDPSocketBufferSize(Positions pos) const {
return pimpl->Parallel(&slsDetector::getReceiverRealUDPSocketBufferSize,
pos);
}
Result<int> Detector::getFramesCaughtByReceiver(Positions pos) const {
return pimpl->Parallel(&slsDetector::getFramesCaughtByReceiver, pos);
}
@ -803,7 +1257,19 @@ Result<int> Detector::getReceiverStreamingTimer(Positions pos) const {
return pimpl->Parallel(&slsDetector::setReceiverStreamingTimer, pos, -1);
}
void Detector::enableDataStreamingFromReceiver(bool enable, Positions pos) {
bool Detector::getDataStreamingToClient() const {
return pimpl->enableDataStreamingToClient(-1);
}
void Detector::setDataStreamingToClient(bool enable) {
pimpl->enableDataStreamingToClient(static_cast<int>(enable));
}
Result<bool> Detector::getDataStreamingFromReceiver(Positions pos) const {
return pimpl->Parallel(&slsDetector::enableDataStreamingFromReceiver, pos, -1);
}
void Detector::setDataStreamingFromReceiver(bool enable, Positions pos) {
pimpl->Parallel(&slsDetector::enableDataStreamingFromReceiver, pos,
static_cast<int>(enable));
}
@ -1123,292 +1589,11 @@ Result<bool> Detector::getActive(Positions pos) const {
return pimpl->Parallel(&slsDetector::activate, pos, -1);
}
void Detector::writeAdcRegister(uint32_t addr, uint32_t value, Positions pos) {
pimpl->Parallel(&slsDetector::writeAdcRegister, pos, addr, value);
}
Result<int> Detector::getReceiverDbitOffset(Positions pos) const {
return pimpl->Parallel(&slsDetector::getReceiverDbitOffset, pos);
}
void Detector::setReceiverDbitOffset(int value, Positions pos) {
pimpl->Parallel(&slsDetector::setReceiverDbitOffset, pos, value);
}
Result<std::vector<int>> Detector::getReceiverDbitList(Positions pos) const {
return pimpl->Parallel(&slsDetector::getReceiverDbitList, pos);
}
void Detector::setReceiverDbitList(std::vector<int> list, Positions pos) {
pimpl->Parallel(&slsDetector::setReceiverDbitList, pos, list);
}
Result<int> Detector::getExternalSampling(Positions pos) const {
return pimpl->Parallel(&slsDetector::getExternalSampling, pos);
}
void Detector::setExternalSampling(bool value, Positions pos) {
pimpl->Parallel(&slsDetector::setExternalSampling, pos, value);
}
Result<int> Detector::getExternalSamplingSource(Positions pos) const {
return pimpl->Parallel(&slsDetector::getExternalSamplingSource, pos);
}
void Detector::setExternalSamplingSource(int value, Positions pos) {
pimpl->Parallel(&slsDetector::setExternalSamplingSource, pos, value);
}
uint32_t Detector::getADCInvert() const {
return pimpl->Parallel(&slsDetector::getADCInvert, {})
.tsquash("Different Values for function getADCInvert");
}
void Detector::setADCInvert(uint32_t value) {
pimpl->Parallel(&slsDetector::setADCInvert, {}, value);
}
uint32_t Detector::getADCEnableMask() const {
return pimpl->Parallel(&slsDetector::getADCEnableMask, {})
.tsquash("Values of ADC enable mask cannot be different");
}
void Detector::setADCEnableMask(uint32_t mask) {
pimpl->Parallel(&slsDetector::setADCEnableMask, {}, mask);
}
Result<int> Detector::getCounterBit(Positions pos) const {
return pimpl->Parallel(&slsDetector::setCounterBit, pos, -1);
}
void Detector::setCounterBit(int i, Positions pos) {
pimpl->Parallel(&slsDetector::setCounterBit, pos, i);
}
void Detector::resetCounterBlock(int startACQ, Positions pos) {
pimpl->Parallel(&slsDetector::resetCounterBlock, pos, startACQ);
}
void Detector::loadImageToDetector(defs::imageType index,
const std::string &fname, Positions pos) {
// TODO! optimize away multiple loads
pimpl->Parallel(&slsDetector::loadImageToDetector, pos, index, fname);
}
Result<int> Detector::digitalTest(defs::digitalTestMode mode, int ival,
Positions pos) {
return pimpl->Parallel(&slsDetector::digitalTest, pos, mode, ival);
}
void Detector::setFlowControl10G(bool enable, Positions pos) {
pimpl->Parallel(&slsDetector::setDetectorNetworkParameter, pos,
defs::FLOW_CONTROL_10G, static_cast<int>(enable));
}
Result<bool> Detector::getFlowControl10G(Positions pos) const {
return pimpl->Parallel(&slsDetector::setDetectorNetworkParameter, pos,
defs::FLOW_CONTROL_10G, -1);
}
Result<int64_t>
Detector::getReceiverRealUDPSocketBufferSize(Positions pos) const {
return pimpl->Parallel(&slsDetector::getReceiverRealUDPSocketBufferSize,
pos);
}
Result<int64_t> Detector::getReceiverUDPSocketBufferSize(Positions pos) const {
return pimpl->Parallel(&slsDetector::getReceiverUDPSocketBufferSize, pos);
}
void Detector::setReceiverUDPSocketBufferSize(int64_t udpsockbufsize,
Positions pos) {
pimpl->Parallel(&slsDetector::setReceiverUDPSocketBufferSize, pos,
udpsockbufsize);
}
int Detector::setDetectorMode(defs::detectorModeType value) {
return pimpl->setDetectorMode(value);
}
int Detector::setFrameMode(defs::frameModeType value) {
return pimpl->setFrameMode(value);
}
int Detector::setDetectorMinMaxEnergyThreshold(const int index, int value) {
return pimpl->setDetectorMinMaxEnergyThreshold(index, value);
}
void Detector::setAdditionalJsonHeader(const std::string &jsonheader,
Positions pos) {
pimpl->Parallel(&slsDetector::setAdditionalJsonHeader, pos, jsonheader);
}
Result<std::string> Detector::getAdditionalJsonHeader(Positions pos) const {
return pimpl->Parallel(&slsDetector::getAdditionalJsonHeader, pos);
}
Result<std::string> Detector::getAdditionalJsonParameter(const std::string &key,
Positions pos) const {
return pimpl->Parallel(&slsDetector::getAdditionalJsonParameter, pos, key);
}
void Detector::setAdditionalJsonParameter(const std::string &key,
const std::string &value,
Positions pos) {
pimpl->Parallel(&slsDetector::setAdditionalJsonParameter, pos, key, value);
}
Result<std::string> Detector::getReceiverStreamingIP(Positions pos) const {
return pimpl->Parallel(&slsDetector::getReceiverStreamingIP, pos);
}
void Detector::setReceiverDataStreamingOutIP(const std::string &ip,
Positions pos) {
// TODO! probably in one call
pimpl->Parallel(&slsDetector::setReceiverStreamingIP, pos, ip);
enableDataStreamingFromReceiver(false, pos);
enableDataStreamingFromReceiver(true, pos);
}
Result<std::string> Detector::getClientStreamingIP(Positions pos) const {
return pimpl->Parallel(&slsDetector::getClientStreamingIP, pos);
}
void Detector::setClientDataStreamingInIP(const std::string &ip,
Positions pos) {
// TODO! probably in one call
pimpl->Parallel(&slsDetector::setClientStreamingIP, pos, ip);
pimpl->enableDataStreamingToClient(0);
pimpl->enableDataStreamingToClient(1);
}
Result<int> Detector::getReceiverStreamingPort(Positions pos) const {
return pimpl->Parallel(&slsDetector::getReceiverStreamingPort, pos);
}
void Detector::setReceiverDataStreamingOutPort(int port, int module_id) {
pimpl->setReceiverDataStreamingOutPort(port, module_id);
}
Result<int> Detector::getClientStreamingPort(Positions pos) const {
return pimpl->Parallel(&slsDetector::getClientStreamingPort, pos);
}
void Detector::setClientDataStreamingInPort(int port, int module_id) {
pimpl->setClientDataStreamingInPort(port, module_id);
}
Result<int> Detector::getSelectedUDPInterface(Positions pos) const {
return pimpl->Parallel(&slsDetector::getSelectedUDPInterface, pos);
}
void Detector::selectUDPInterface(int interface, Positions pos) {
pimpl->Parallel(&slsDetector::selectUDPInterface, pos, interface);
}
Result<int> Detector::getNumberofUDPInterfaces(Positions pos) const {
return pimpl->Parallel(&slsDetector::getNumberofUDPInterfaces, pos);
}
void Detector::setNumberofUDPInterfaces(int n, Positions pos) {
pimpl->Parallel(&slsDetector::setNumberofUDPInterfaces, pos, n);
pimpl->enableDataStreamingToClient(0);
pimpl->enableDataStreamingToClient(1);
enableDataStreamingFromReceiver(false, pos);
enableDataStreamingFromReceiver(true, pos);
}
Result<int> Detector::getReceiverUDPPort2(Positions pos) const {
return pimpl->Parallel(&slsDetector::getReceiverUDPPort2, pos);
}
void Detector::setReceiverUDPPort2(int udpport, Positions pos) {
pimpl->Parallel(&slsDetector::setReceiverUDPPort2, pos, udpport);
}
Result<int> Detector::getReceiverUDPPort(Positions pos) const {
return pimpl->Parallel(&slsDetector::getReceiverUDPPort, pos);
}
void Detector::setReceiverUDPPort(int udpport, Positions pos) {
pimpl->Parallel(&slsDetector::setReceiverUDPPort, pos, udpport);
}
Result<MacAddr> Detector::getReceiverUDPMAC2(Positions pos) const {
return pimpl->Parallel(&slsDetector::getReceiverUDPMAC2, pos);
}
void Detector::setReceiverUDPMAC2(const std::string &udpmac, Positions pos) {
pimpl->Parallel(&slsDetector::setReceiverUDPMAC2, pos, udpmac);
}
Result<MacAddr> Detector::getReceiverUDPMAC(Positions pos) const {
return pimpl->Parallel(&slsDetector::getReceiverUDPMAC, pos);
}
void Detector::setReceiverUDPMAC(const std::string &udpmac, Positions pos) {
pimpl->Parallel(&slsDetector::setReceiverUDPMAC, pos, udpmac);
}
Result<IpAddr> Detector::getReceiverUDPIP2(Positions pos) const {
return pimpl->Parallel(&slsDetector::getReceiverUDPIP2, pos);
}
void Detector::setReceiverUDPIP2(const std::string &udpip, Positions pos) {
pimpl->Parallel(&slsDetector::setReceiverUDPIP2, pos, udpip);
}
Result<IpAddr> Detector::getReceiverUDPIP(Positions pos) const {
return pimpl->Parallel(&slsDetector::getReceiverUDPIP, pos);
}
void Detector::setReceiverUDPIP(const std::string &udpip, Positions pos) {
pimpl->Parallel(&slsDetector::setReceiverUDPIP, pos, udpip);
}
Result<std::string> Detector::getReceiverHostname(Positions pos) const {
return pimpl->Parallel(&slsDetector::getReceiverHostname, pos);
}
void Detector::setReceiverHostname(const std::string &receiver, Positions pos) {
pimpl->Parallel(&slsDetector::setReceiverHostname, pos, receiver);
}
Result<IpAddr> Detector::getDetectorIP2(Positions pos) const {
return pimpl->Parallel(&slsDetector::getDetectorIP2, pos);
}
void Detector::setDetectorIP2(const std::string &detectorIP, Positions pos) {
pimpl->Parallel(&slsDetector::setDetectorIP2, pos, detectorIP);
}
Result<IpAddr> Detector::getDetectorIP(Positions pos) const {
return pimpl->Parallel(&slsDetector::getDetectorIP, pos);
}
void Detector::setDetectorIP(const std::string &detectorIP, Positions pos) {
pimpl->Parallel(&slsDetector::setDetectorIP, pos, detectorIP);
}
Result<MacAddr> Detector::getDetectorMAC(Positions pos) const {
return pimpl->Parallel(&slsDetector::getDetectorMAC, pos);
}
void Detector::setDetectorMAC(const std::string &detectorMAC, Positions pos) {
pimpl->Parallel(&slsDetector::setDetectorMAC, pos, detectorMAC);
}
Result<MacAddr> Detector::getDetectorMAC2(Positions pos) const {
return pimpl->Parallel(&slsDetector::getDetectorMAC2, pos);
}
void Detector::setDetectorMAC2(const std::string &detectorMAC, Positions pos) {
pimpl->Parallel(&slsDetector::setDetectorMAC2, pos, detectorMAC);
}
Result<bool> Detector::getInterruptSubframe(Positions pos) const {
return pimpl->Parallel(&slsDetector::getInterruptSubframe, pos);
}
void Detector::setInterruptSubframe(const bool enable, Positions pos){
pimpl->Parallel(&slsDetector::setInterruptSubframe, pos, enable);
}
} // namespace sls

View File

@ -1726,7 +1726,7 @@ int multiSlsDetector::getReceiverUDPPort2(int detPos) const {
int multiSlsDetector::setNumberofUDPInterfaces(int n, int detPos) {
int previouslyClientStreaming = enableDataStreamingToClient();
bool previouslyClientStreaming = enableDataStreamingToClient();
int previouslyReceiverStreaming = enableDataStreamingFromReceiver();
// single
@ -1739,7 +1739,7 @@ int multiSlsDetector::setNumberofUDPInterfaces(int n, int detPos) {
auto r = parallelCall(&slsDetector::setNumberofUDPInterfaces, n);
// redo the zmq sockets
if (previouslyClientStreaming != 0) {
if (previouslyClientStreaming) {
enableDataStreamingToClient(0);
enableDataStreamingToClient(1);
}
@ -1791,7 +1791,7 @@ int multiSlsDetector::getSelectedUDPInterface(int detPos) const {
void multiSlsDetector::setClientDataStreamingInPort(int i, int detPos) {
if (i >= 0) {
int prev_streaming = enableDataStreamingToClient();
bool prev_streaming = enableDataStreamingToClient();
// single
if (detPos >= 0) {
@ -1811,7 +1811,7 @@ void multiSlsDetector::setClientDataStreamingInPort(int i, int detPos) {
}
}
if (prev_streaming != 0) {
if (prev_streaming) {
enableDataStreamingToClient(0);
enableDataStreamingToClient(1);
}
@ -1872,7 +1872,7 @@ int multiSlsDetector::getReceiverStreamingPort(int detPos) {
void multiSlsDetector::setClientDataStreamingInIP(const std::string &ip,
int detPos) {
if (ip.length() != 0u) {
int prev_streaming = enableDataStreamingToClient(-1);
bool prev_streaming = enableDataStreamingToClient(-1);
// single
if (detPos >= 0) {
@ -1885,7 +1885,7 @@ void multiSlsDetector::setClientDataStreamingInIP(const std::string &ip,
}
}
if (prev_streaming != 0) {
if (prev_streaming) {
enableDataStreamingToClient(0);
enableDataStreamingToClient(1);
}
@ -2142,6 +2142,13 @@ void multiSlsDetector::writeCounterBlockFile(const std::string &fname,
imageVals + idet * detectors[idet]->getTotalNumberOfChannels(),
startACQ);
}
if (writeDataFile(fname, nch, imageVals) < nch * (int)sizeof(short int)) {
throw RuntimeError(
"Could not open file to write or did not write enough data"
" in file to write counter block file from detector.");
}
}
void multiSlsDetector::resetCounterBlock(int startACQ, int detPos) {
@ -3693,7 +3700,7 @@ int multiSlsDetector::setReceiverStreamingTimer(int time_in_ms, int detPos) {
return sls::minusOneIfDifferent(r);
}
int multiSlsDetector::enableDataStreamingToClient(int enable) {
bool multiSlsDetector::enableDataStreamingToClient(int enable) {
if (enable >= 0) {
// destroy data threads
if (enable == 0) {
@ -3705,7 +3712,7 @@ int multiSlsDetector::enableDataStreamingToClient(int enable) {
}
}
}
return static_cast<int>(client_downstream);
return client_downstream;
}
int multiSlsDetector::enableDataStreamingFromReceiver(int enable, int detPos) {

View File

@ -235,7 +235,7 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) {
++i;
/*! \page acquisition
- <b>resmat i </b> sets/resets counter bit in detector.gets the counter bit in detector ????
- <b>resmat i </b> sets/resets counter bit in detector.gets the counter bit in Eiger
*/
descrToFuncMap[i].m_pFuncName = "resmat";
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdCounter;