diff --git a/slsDetectorSoftware/include/Detector.h b/slsDetectorSoftware/include/Detector.h index 7664b96e8..c0fe335f7 100644 --- a/slsDetectorSoftware/include/Detector.h +++ b/slsDetectorSoftware/include/Detector.h @@ -156,7 +156,7 @@ class Detector { * TEMPERATURE_FPGA3 * [CTB] Options: SLOW_ADC_TEMP */ - Result getTemp(defs::dacIndex index, Positions pos = {}) const; + Result getTemperature(defs::dacIndex index, Positions pos = {}) const; Result getDAC(defs::dacIndex index, bool mV, Positions pos = {}) const; @@ -215,6 +215,9 @@ class Detector { /** [Eiger][Jungfrau] */ void setStartingFrameNumber(uint64_t value, Positions pos); + /** [Eiger] Sends an internal software trigger to the detector */ + void sendSoftwareTrigger(Positions pos = {}); + //TODO: remove resetframescaught in receiver @@ -224,7 +227,10 @@ class Detector { * * * ************************************************/ - /** Configures the destination for UDP packets in the detector */ + /** Configures the destination for UDP packets in the detector + * Needed only if you use a custm receiver (not slsReceiver) + * as it is already included in setReceiverHostname. + */ void configureMAC(Positions pos = {});//TODO: find a reasonable name Result getSourceUDPMAC(Positions pos = {}) const; @@ -253,81 +259,47 @@ class Detector { /** MAC of the interface in receiver that the detector sends data to * Only needed if you use a custom receiver (not slsReceiver) + * Must be followed by configuremac. */ void setDestinationUDPMAC(const std::string &udpmac, Positions pos = {}); + Result getDestinationUDPPort(Positions pos = {}) const; - Result getReceiverUDPPort(Positions pos = {}) const; - - void setReceiverUDPPort(int udpport, Positions pos = {}); + /** + * module_id is -1 for all detectors, ports for each module is calculated (increments) + */ + void setDestinationUDPPort(int udpport, int module_id = -1); /** [Eiger right port][Jungfrau bottom half] */ - Result getReceiverUDPPort2(Positions pos = {}) const; + Result getDestinationUDPPort2(Positions pos = {}) const; - /** [Eiger right port][Jungfrau bottom half] */ - void setReceiverUDPPort2(int udpport, Positions pos = {}); + /** [Eiger right port][Jungfrau bottom half] + * module_id is -1 for all detectors, ports for each module is calculated (increments) + */ + void setDestinationUDPPort2(int udpport, int module_id = -1); - Result printReceiverConfiguration(Positions pos = {}) const; + Result printRxConfiguration(Positions pos = {}) const; /** [Eiger, Jungfrau] */ - Result getFlowControl10G(Positions pos = {}) const; + Result getTenGigaGFlowControl(Positions pos = {}) const; /** [Eiger, Jungfrau] */ - void setFlowControl10G(bool enable, Positions pos = {}); + void setTenGigaGFlowControl(bool enable, Positions pos = {}); /** [Eiger, Jungfrau] */ Result 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 + * 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 + * left and right UDP ports. Options: //TODO possible values */ void setTransmissionDelayFrame(int value, Positions pos = {}); - /** [Jungfrau] */ - Result getNumberofUDPInterfaces(Positions pos = {}) const; - - /** [Jungfrau] Also restarts client and receiver sockets */ - void setNumberofUDPInterfaces(int n, Positions pos = {}); - - /** [Jungfrau] */ - Result 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 = {}); - - /** [Jungfrau] bottom half */ - Result getDetectorMAC2(Positions pos = {}) const; - - /** [Jungfrau] bottom half */ - void setDetectorMAC2(const std::string &detectorMAC, Positions pos = {}); - - /** [Jungfrau] bottom half */ - Result getDetectorIP2(Positions pos = {}) const; - - /** [Jungfrau] bottom half */ - void setDetectorIP2(const std::string &detectorIP, Positions pos = {}); - - /** [Jungfrau bottom half] */ - Result getReceiverUDPIP2(Positions pos = {}) const; - - /** [Jungfrau bottom half] */ - void setReceiverUDPIP2(const std::string &udpip, Positions pos = {}); - - /** [Jungfrau bottom half] */ - Result getReceiverUDPMAC2(Positions pos = {}) const; - - /** [Jungfrau bottom half] */ - void setReceiverUDPMAC2(const std::string &udpmac, Positions pos = {}); - /** [Eiger] */ Result getTransmissionDelayLeft(Positions pos = {}) const; + /** * [Eiger] * Sets the transmission delay of first packet streamed out of the left UDP @@ -345,6 +317,47 @@ class Detector { */ void setTransmissionDelayRight(int value, Positions pos = {}); + /** [Jungfrau] */ + Result getNumberofUDPInterfaces(Positions pos = {}) const; + + /** [Jungfrau] Also restarts client and receiver sockets */ + void setNumberofUDPInterfaces(int n, Positions pos = {}); + + /** [Jungfrau] */ + Result getSelectedUDPInterface(Positions pos = {}) const; + + /** + * [Jungfrau: + * Effective only when number of interfaces is 1. + * Options: 0 (outer, default), 1(inner)] //TODO: enum? + */ + void selectUDPInterface(int interface, Positions pos = {}); + + /** [Jungfrau] bottom half */ + Result getDetectorMAC2(Positions pos = {}) const; + + /** [Jungfrau] bottom half */ + void setDetectorMAC2(const std::string &detectorMAC, Positions pos = {}); + + /** [Jungfrau] bottom half */ + Result getDetectorIP2(Positions pos = {}) const; + + /** [Jungfrau] bottom half */ + void setDetectorIP2(const std::string &detectorIP, Positions pos = {}); + + /** [Jungfrau bottom half] */ + Result getDestinationUDPIP2(Positions pos = {}) const; + + /** [Jungfrau bottom half] */ + void setDestinationUDPIP2(const std::string &udpip, Positions pos = {}); + + /** [Jungfrau bottom half] */ + Result getDestinationUDPMAC2(Positions pos = {}) const; + + /** [Jungfrau bottom half] */ + void setDestinationUDPMAC2(const std::string &udpmac, Positions pos = {}); + + /************************************************** @@ -356,7 +369,7 @@ class Detector { /** true when slsReceiver is used */ Result getUseReceiverFlag(Positions pos = {}) const; - Result getReceiverHostname(Positions pos = {}) const; + Result getRxHostname(Positions pos = {}) const; /** * Validates and sets the receiver. @@ -364,49 +377,54 @@ class Detector { * Configures the detector to the receiver as UDP destination * @param receiver receiver hostname or IP address */ - void setReceiverHostname(const std::string &receiver, Positions pos = {}); + void setRxHostname(const std::string &receiver, Positions pos = {}); - Result getReceiverPort(Positions pos = {}) const; + Result getRxPort(Positions pos = {}) const; /** Receiver TCP port (for client communication with Receiver) */ - void setReceiverPort(int value, Positions pos = {}); + void setRxPort(int value, Positions pos = {}); - Result getReceiverFifoDepth(Positions pos = {}) const; + Result getRxFifoDepth(Positions pos = {}) const; - void setReceiverFifoDepth(int nframes, Positions pos = {}); + /** fifo between udp listening and processing threads */ + void setRxFifoDepth(int nframes, Positions pos = {}); - Result getReceiverSilentMode(Positions pos = {}) const; + Result getRxSilentMode(Positions pos = {}) const; - void setReceiverSilentMode(bool value, Positions pos = {}); + /** receiver prints hardly any information while acquiring */ + void setRxSilentMode(bool value, Positions pos = {}); Result - getReceiverFrameDiscardPolicy(Positions pos = {}) const; + getRxFrameDiscardPolicy(Positions pos = {}) const; /** * default NO_DISCARD * Options: NO_DISCARD, DISCARD_EMPTY_FRAMES, DISCARD_PARTIAL_FRAMES + * discard partial frames is the fastest */ - void setReceiverFrameDiscardPolicy(defs::frameDiscardPolicy f, + void setRxFrameDiscardPolicy(defs::frameDiscardPolicy f, Positions pos = {}); Result getPartialFramesPadding(Positions pos = {}) const; - /** padding enabled */ + /** padding enabled. Disabling padding is the fastest */ void setPartialFramesPadding(bool value, Positions pos = {}); - Result getReceiverUDPSocketBufferSize(Positions pos = {}) const; + Result getRxUDPSocketBufferSize(Positions pos = {}) const; - void setReceiverUDPSocketBufferSize(int64_t udpsockbufsize, + void setRxUDPSocketBufferSize(int64_t udpsockbufsize, Positions pos = {}); + /** TODO: + * Linux kernel allocates twice the amount you set for bookkeeping purposes */ Result - getReceiverRealUDPSocketBufferSize(Positions pos = {}) const; + getRxRealUDPSocketBufferSize(Positions pos = {}) const; - Result getReceiverLock(Positions pos = {}); + Result getRxLock(Positions pos = {}); /** locks receiver server to client IP */ - void setReceiverLock(bool value, Positions pos = {}); + void setRxLock(bool value, Positions pos = {}); - Result getReceiverLastClientIP(Positions pos = {}) const; + Result getRxLastClientIP(Positions pos = {}) const; /************************************************** * * @@ -426,12 +444,15 @@ class Detector { Result getFileNamePrefix(Positions pos = {}) const; - /** default run */ + /** default run + * File Name: [file name prefix]_d[module index]_f[file index]_[acquisition index].[file format] + * eg. run_d0_f0_5.raw + */ void setFileNamePrefix(const std::string &fname, Positions pos = {}); - Result getFileIndex(Positions pos = {}) const; + Result getAcquisitonIndex(Positions pos = {}) const; - void setFileIndex(int i, Positions pos = {}); + void setAcquisitionIndex(int i, Positions pos = {}); Result getFileWrite(Positions pos = {}) const; @@ -440,6 +461,7 @@ class Detector { Result getMasterFileWrite(Positions pos = {}) const; + /* default writes */ void setMasterFileWrite(bool value, Positions pos = {}); Result getFileOverWrite(Positions pos = {}) const; @@ -449,108 +471,64 @@ class Detector { Result getFramesPerFile(Positions pos = {}) const; + /** -1 will set frames per file to unlimited //TODO check if it is -1 or 0 */ void setFramesPerFile(int n, Positions pos = {}); /************************************************** * * - * ZMQ Streaming Parameters * + * ZMQ Streaming Parameters (Receiver<->Client)* * * * ************************************************/ + //TODO callback functions - Result getDataStreamingFromReceiver(Positions pos = {}) const; + Result getRxZmqDataStream(Positions pos = {}) const; - void setDataStreamingFromReceiver(bool value, Positions pos = {}); + void setRxZmqDataStream(bool value, Positions pos = {}); - bool getDataStreamingToClient() const; - - void setDataStreamingToClient(bool value); - - Result getReceiverStreamingFrequency(Positions pos = {}) const; + Result getRxZmqFrequency(Positions pos = {}) const; /** @param freq nth frame streamed out of receiver. * If 0, streaming timer is the timeout, * after which current frame sent out. Default is 0 at 200 ms. - * For every frame, set freq to 1. + * Default is 0. This is more for gui purposes to not send every frame. + * If you want every frame, set freq to 1. */ - void setReceiverStreamingFrequency(int freq, Positions pos = {}); + void setRxZmqFrequency(int freq, Positions pos = {}); - Result getReceiverStreamingTimer(Positions pos = {}) const; + Result getRxZmqTimer(Positions pos = {}) const; /** * If receiver streaming frequency is 0 (default), then this timer between * each data stream is set. Default is 200 ms. */ - void setReceiverStreamingTimer(int time_in_ms, Positions pos = {}); + void setRxZmqTimer(int time_in_ms, Positions pos = {}); + + Result getRxZmqPort(Positions pos = {}) const; - Result 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 + * module_id is -1 for all detectors, ports for each module is calculated (increments) + * Restarts receiver zmq sockets only if it was already enabled */ - void setClientDataStreamingInPort(int port, Positions pos = {}); + void setRxZmqPort(int port, int module_id = -1); - Result 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 getRxZmqIP(Positions pos = {}) const; - Result getClientStreamingIP(Positions pos = {}) const; - - // TODO these should probably be the same ?? same as what? - void setClientDataStreamingInIP(const std::string &ip, Positions pos = {}); - - Result getReceiverStreamingIP(Positions pos = {}) const; - - void setReceiverDataStreamingOutIP(const std::string &ip, + void setRxZmqIP(const std::string &ip, Positions pos = {}); - /** [Moench] */ - Result getAdditionalJsonHeader(Positions pos = {}) const; - - /** [Moench] */ - void setAdditionalJsonHeader(const std::string &jsonheader, - Positions pos = {}); - - /** [Moench] */ - Result getAdditionalJsonParameter(const std::string &key, - Positions pos = {}) const; + Result getClientZmqPort(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 + * Needed only when using the client call back to get reconstructed data from multi modules + * module_id is -1 for all detectors, ports for each module is calculated (increments) + * Restarts client zmq sockets oonly if it was already enabled */ - void setAdditionalJsonParameter(const std::string &key, - const std::string &value, - Positions pos = {}); + void setClientZmqPort(int port, int module_id = -1); - /** [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 getDetectorMinMaxEnergyThreshold(const bool isEmax, - Positions pos = {}) const; + Result getClientZmqIp(Positions pos = {}) const; - /** [Moench] */ - void setDetectorMinMaxEnergyThreshold(const bool isEmax, const int value, - Positions pos = {}); - - /** [Moench: -1 if unknown mode] */ - Result getFrameMode(Positions pos = {}) const; - - /** [Moench] */ - void setFrameMode(defs::frameModeType value, Positions pos = {}); - - /** [Moench: -1 if unknown mode] */ - Result getDetectorMode(Positions pos = {}) const; - - /** [Moench] */ - void setDetectorMode(defs::detectorModeType value, Positions pos = {}); + void setClientZmqIp(const std::string &ip, Positions pos = {}); /************************************************** @@ -561,12 +539,6 @@ class Detector { Result getDynamicRange(Positions pos = {}) const; - /** [Eiger] */ - Result getTenGigaEnabled(Positions pos = {}) const; - - /** [Eiger] */ - void setTenGigaEnabled(bool value, Positions pos = {}); - /** * [Eiger] * Options: 4, 8, 16, 32 @@ -574,7 +546,13 @@ class Detector { */ void setDynamicRange(int value); - /** [Eiger] in 32 bit mode */ + /** [Eiger] */ + Result getTenGiga(Positions pos = {}) const; + + /** [Eiger] */ + void setTenGiga(bool enable, Positions pos = {}); + + /** [Eiger] in 32 bit mode */ Result getSubExptime(Positions pos = {}) const; /** [Eiger] in 32 bit mode */ @@ -603,15 +581,15 @@ class Detector { /** [Eiger] */ void loadTrimbits(const std::string &fname, Positions pos = {}); - /**[Eiger] */ - Result getGapPixelsEnable(Positions pos = {}) const; + /**[Eiger] */ + Result getRxAddGapPixels(Positions pos = {}) const; /** * [Eiger] * 4 bit mode not implemented in Receiver, but in client data call back * Fills in gap pixels in data */ - void setGapPixelsEnable(bool enable); + void setRxAddGapPixels(bool enable); /** [Eiger] */ Result getParallelMode(Positions pos = {}) const; @@ -625,15 +603,13 @@ class Detector { /** [Eiger] */ void setOverFlowMode(bool value, Positions pos = {}); - /** [Eiger] */ + /** [Eiger] */ Result getBottom(Positions pos = {}) const; - /** [Eiger] for gui purposes */ + /** [Eiger] for client call back (gui) purposes */ void setBottom(bool value, Positions pos = {}); - /** [Eiger] - * @returns -1 if they are all different - */ + /** [Eiger] -1 if they are all different */ Result getAllTrimbits(Positions pos = {}) const; /**[Eiger] */ @@ -645,19 +621,14 @@ class Detector { /** [Eiger] Set the energies where the detector is trimmed */ void setTrimEnergies(std::vector energies, Positions pos = {}); - /** [Eiger] - * @returns deadtime in ns, 0 = disabled - */ - Result getRateCorrection(Positions pos = {}) const; + /** [Eiger] deadtime in ns, 0 = disabled */ + Result getRateCorrection(Positions pos = {}) const; - /** + /** //TODO: default, get, set * [Eiger] Set Rate correction - * 0 disable correction, <0 set to default, >0 deadtime in ns + * 0 disable correction, < 0: default dead time from trimbit file, > 0 custom deadtime (advanced) */ - void setRateCorrection(int64_t dead_time_ns, Positions pos = {}); - - /** [Eiger] Sends an internal software trigger to the detector */ - void sendSoftwareTrigger(Positions pos = {}); + void setRateCorrection(ns dead_time, Positions pos = {}); /** [Eiger] */ Result getPartialReadout(Positions pos = {}) const; @@ -668,36 +639,17 @@ class Detector { */ void setPartialReadout(const int lines, Positions pos = {}); - /** [Eiger] */ - Result getIODelay(Positions pos = {}) const; - - /** [Eiger] */ - void setIODelay(int value, Positions pos = {}); - /** [Eiger] */ Result getInterruptSubframe(Positions pos = {}) const; - /** [Eiger] when set, the last subframe is interrupted at end of acq */ + /** [Eiger] when set, the last subframe is interrupted at end of acq */ void setInterruptSubframe(const bool enable, Positions pos = {}); + /** [Eiger] minimum two frames */ + Result getMeasuredPeriod(Positions pos = {}) const; + /** [Eiger] */ - Result 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 = {}); - - /** - * [Eiger] Pulse Pixel n times at x and y coordinates - */ - void pulsePixel(int n, int x, int y, Positions pos = {}); - - /** [Eiger] Pulse Pixel n times and move by a relative value of x and y - * coordinates */ - void pulsePixelNMove(int n, int x, int y, Positions pos = {}); - - /** [Eiger] Pulse chip n times */ - void pulseChip(int n, Positions pos = {}); + Result getMeasuredSubFramePeriod(Positions pos = {}) const; /** [Eiger] */ Result getActive(Positions pos = {}) const; @@ -706,12 +658,30 @@ class Detector { void setActive(bool active, Positions pos = {}); /** [Eiger] */ - Result getRxPadDeactivatedMod(Positions pos = {}) const; + Result getRxPadDeactivatedMode(Positions pos = {}) const; - /** - * [Eiger] Set deactivated Receiver padding mode - */ - void setRxPadDeactivatedMod(bool pad, Positions pos = {}); + /** [Eiger] Advanced */ + Result getPartialReset(Positions pos = {}) const; + + /** [Eiger] Advanced + * used for pulsing chips */ + void setPartialReset(bool enable, Positions pos = {}); + + /** [Eiger] Advanced + * Pulse Pixel n times at x and y coordinates */ + void pulsePixel(int n, defs:: pixel, Positions pos = {}); + + /** [Eiger] Advanced + * Pulse Pixel n times and move by a relative value of x and y + * coordinates */ + void pulsePixelNMove(int n, defs:: pixel, Positions pos = {}); + + /** [Eiger] Advanced + * Pulse chip n times */ + void pulseChip(int n, Positions pos = {}); + + /** [Eiger] Pad deactivated modules in receiver */ + void setRxPadDeactivatedMode(bool pad, Positions pos = {}); /** [Eiger] with specific quad hardware */ Result getQuad(Positions pos = {}) const; @@ -719,11 +689,6 @@ class Detector { /** [Eiger] with specific quad hardware */ void setQuad(const bool enable); - /** [Eiger] minimum two frames */ - Result getMeasuredPeriod(Positions pos = {}) const; - - /** [Eiger] */ - Result getMeasuredSubFramePeriod(Positions pos = {}) const; /************************************************** * * @@ -740,7 +705,7 @@ class Detector { * and temperature control is enabled, * power to chip will be switched off and * temperature event will be set - * @param val value in millidegrees TODO! Verify + * @param val value in degrees */ void setThresholdTemperature(int temp, Positions pos = {}); @@ -754,7 +719,7 @@ class Detector { Result getTemperatureEvent(Positions pos = {}) const; /** [Jungfrau] */ - void ResetTemperatureEvent(Positions pos = {}); + void resetTemperatureEvent(Positions pos = {}); /** [Jungfrau] */ Result getPowerChip(Positions pos = {}) const; @@ -765,10 +730,13 @@ class Detector { /** [Jungfrau] */ Result getAutoCompDisable(Positions pos = {}) const; - /** [Jungfrau] TODO??? fix docs ? */ + /** [Jungfrau] Advanced + * //TODO naming + * By default, the on-chip gain switching is active during the entire exposure. + * This mode disables the on-chip gain switching comparator automatically after 93.75% of exposure time (only for longer than 100us). */ void setAutoCompDisable(bool value, Positions pos = {}); - /** [Jungfrau] Advanced */ + /** [Jungfrau] Advanced TODO naming */ Result getNumberOfAdditionalStorageCells() const; /** [Jungfrau] Advanced */ @@ -807,7 +775,7 @@ class Detector { */ void setROI(defs::ROI value, int moduleId); - /** [Gotthard] */ + /** [Gotthard] TODO: check with jiaguo if he needs any of these functions */ Result getExptimeLeft(Positions pos = {}) const; /** [Gotthard] */ @@ -821,11 +789,11 @@ class Detector { void setExternalSignalFlags(defs::externalSignalFlag value, Positions pos = {}); - /** [Gotthard] subset modules not allowed */ - void loadDarkImage(const std::string &fname, Positions pos = {}); + /** [Gotthard] */ + void loadDarkImage(const std::string &fname, int module_id = -1); - /** [Gotthard] subset modules not allowed */ - void loadGainImage(const std::string &fname, Positions pos = {}); + /** [Gotthard] */ + void loadGainImage(const std::string &fname, int module_id = -1); /** * [Gotthard] subset modules not allowed @@ -1061,6 +1029,56 @@ class Detector { */ void setPatternBitMask(uint64_t mask, Positions pos = {}); + /************************************************** + * * + * Moench * + * * + * ************************************************/ + + + /** [Moench] */ + Result getAdditionalJsonHeader(Positions pos = {}) const; + + /** [Moench] */ + void setAdditionalJsonHeader(const std::string &jsonheader, + Positions pos = {}); + + /** [Moench] */ + Result 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 getDetectorMinMaxEnergyThreshold(const bool isEmax, + Positions pos = {}) const; + + /** [Moench] */ + void setDetectorMinMaxEnergyThreshold(const bool isEmax, const int value, + Positions pos = {}); + + /** [Moench: -1 if unknown mode] */ + Result getFrameMode(Positions pos = {}) const; + + /** [Moench] */ + void setFrameMode(defs::frameModeType value, Positions pos = {}); + + /** [Moench: -1 if unknown mode] */ + Result getDetectorMode(Positions pos = {}) const; + + /** [Moench] */ + void setDetectorMode(defs::detectorModeType value, Positions pos = {}); + /************************************************** * * * Advanced * diff --git a/slsDetectorSoftware/src/Detector.cpp b/slsDetectorSoftware/src/Detector.cpp index 8f5bcbc0b..990fa5bac 100644 --- a/slsDetectorSoftware/src/Detector.cpp +++ b/slsDetectorSoftware/src/Detector.cpp @@ -682,11 +682,11 @@ void Detector::setDetectorIP2(const std::string &detectorIP, Positions pos) { pimpl->Parallel(&slsDetector::setDetectorIP2, pos, detectorIP); } -Result Detector::getReceiverHostname(Positions pos) const { +Result Detector::getRxHostname(Positions pos) const { return pimpl->Parallel(&slsDetector::getReceiverHostname, pos); } -void Detector::setReceiverHostname(const std::string &receiver, Positions pos) { +void Detector::setRxHostname(const std::string &receiver, Positions pos) { pimpl->Parallel(&slsDetector::setReceiverHostname, pos, receiver); } @@ -698,7 +698,7 @@ void Detector::setDestinationUDPIP(const std::string &udpip, Positions pos) { pimpl->Parallel(&slsDetector::setReceiverUDPIP, pos, udpip); } -Result Detector::getReceiverUDPIP2(Positions pos) const { +Result Detector::getRxUDPIP2(Positions pos) const { return pimpl->Parallel(&slsDetector::getReceiverUDPIP2, pos); } @@ -778,11 +778,11 @@ void Detector::setClientDataStreamingInPort(int port, Positions pos) { pimpl->setClientDataStreamingInPort(port, pos.empty() ? -1 : pos[0]); } -Result Detector::getReceiverStreamingPort(Positions pos) const { +Result Detector::getRxStreamingPort(Positions pos) const { return pimpl->Parallel(&slsDetector::getReceiverStreamingPort, pos); } -void Detector::setReceiverDataStreamingOutPort(int port, Positions pos) { +void Detector::setRxDataStreamingOutPort(int port, Positions pos) { if (pos.size() > 1 && pos.size() < pimpl->size()) { throw RuntimeError( "Cannot set receiver streaming port to a subset of modules"); @@ -805,11 +805,11 @@ void Detector::setClientDataStreamingInIP(const std::string &ip, } } -Result Detector::getReceiverStreamingIP(Positions pos) const { +Result Detector::getRxStreamingIP(Positions pos) const { return pimpl->Parallel(&slsDetector::getReceiverStreamingIP, pos); } -void Detector::setReceiverDataStreamingOutIP(const std::string &ip, +void Detector::setRxDataStreamingOutIP(const std::string &ip, Positions pos) { bool previouslyReceiverStreaming = getDataStreamingFromReceiver(pos).squash(false); @@ -1011,7 +1011,7 @@ Result Detector::getCounterBit(Positions pos) const { } void Detector::setCounterBit(bool value, Positions pos) { - pimpl->Parallel(&slsDetector::setCounterBit, pos, value); + pimpl->Parallel(&slsDetector::setCounterBit, pos, !value); } Result Detector::getROI(Positions pos) const { @@ -1057,19 +1057,19 @@ void Detector::setExternalSampling(bool value, Positions pos) { pimpl->Parallel(&slsDetector::setExternalSampling, pos, value); } -Result> Detector::getReceiverDbitList(Positions pos) const { +Result> Detector::getRxDbitList(Positions pos) const { return pimpl->Parallel(&slsDetector::getReceiverDbitList, pos); } -void Detector::setReceiverDbitList(std::vector list, Positions pos) { +void Detector::setRxDbitList(std::vector list, Positions pos) { pimpl->Parallel(&slsDetector::setReceiverDbitList, pos, list); } -Result Detector::getReceiverDbitOffset(Positions pos) const { +Result Detector::getRxDbitOffset(Positions pos) const { return pimpl->Parallel(&slsDetector::getReceiverDbitOffset, pos); } -void Detector::setReceiverDbitOffset(int value, Positions pos) { +void Detector::setRxDbitOffset(int value, Positions pos) { pimpl->Parallel(&slsDetector::setReceiverDbitOffset, pos, value); } @@ -1130,11 +1130,15 @@ void Detector::pulseChip(int n, Positions pos) { } Result Detector::getThresholdTemperature(Positions pos) const { - return pimpl->Parallel(&slsDetector::setThresholdTemperature, pos, -1); + auto res = pimpl->Parallel(&slsDetector::setThresholdTemperature, pos, -1); + for (auto &it : res) { + it /= 1000; + } + return res; } void Detector::setThresholdTemperature(int temp, Positions pos) { - pimpl->Parallel(&slsDetector::setThresholdTemperature, pos, temp); + pimpl->Parallel(&slsDetector::setThresholdTemperature, pos, temp * 1000); } Result Detector::getTemperatureControl(Positions pos) const { @@ -1207,7 +1211,7 @@ void Detector::setAutoCompDisable(bool value, Positions pos) { static_cast(value)); } -Result Detector::getRateCorrection(Positions pos) const { +Result Detector::getRateCorrection(Positions pos) const { return pimpl->Parallel(&slsDetector::getRateCorrection, pos); } @@ -1312,43 +1316,43 @@ Result Detector::getUseReceiverFlag(Positions pos) const { return pimpl->Parallel(&slsDetector::getUseReceiverFlag, pos); } -Result Detector::printReceiverConfiguration(Positions pos) const { +Result Detector::printRxConfiguration(Positions pos) const { return pimpl->Parallel(&slsDetector::printReceiverConfiguration, pos); } -Result Detector::getReceiverPort(Positions pos) const { +Result Detector::getRxPort(Positions pos) const { return pimpl->Parallel(&slsDetector::getReceiverPort, pos); } -void Detector::setReceiverPort(int value, Positions pos) { +void Detector::setRxPort(int value, Positions pos) { pimpl->Parallel(&slsDetector::setReceiverPort, pos, value); } -Result Detector::getReceiverLock(Positions pos) { +Result Detector::getRxLock(Positions pos) { return pimpl->Parallel(&slsDetector::lockReceiver, pos, -1); } -void Detector::setReceiverLock(bool value, Positions pos) { +void Detector::setRxLock(bool value, Positions pos) { pimpl->Parallel(&slsDetector::lockReceiver, pos, static_cast(value)); } -Result Detector::getReceiverLastClientIP(Positions pos) const { +Result Detector::getRxLastClientIP(Positions pos) const { return pimpl->Parallel(&slsDetector::getReceiverLastClientIP, pos); } -Result Detector::getReceiverStreamingFrequency(Positions pos) const { +Result Detector::getRxStreamingFrequency(Positions pos) const { return pimpl->Parallel(&slsDetector::setReceiverStreamingTimer, pos, -1); } -void Detector::setReceiverStreamingFrequency(int freq, Positions pos) { +void Detector::setRxStreamingFrequency(int freq, Positions pos) { pimpl->Parallel(&slsDetector::setReceiverStreamingFrequency, pos, freq); } -Result Detector::getReceiverStreamingTimer(Positions pos) const { +Result Detector::getRxStreamingTimer(Positions pos) const { return pimpl->Parallel(&slsDetector::setReceiverStreamingTimer, pos, -1); } -void Detector::setReceiverStreamingTimer(int time_in_ms, Positions pos) { +void Detector::setRxStreamingTimer(int time_in_ms, Positions pos) { pimpl->Parallel(&slsDetector::setReceiverStreamingTimer, pos, time_in_ms); } @@ -1360,39 +1364,39 @@ void Detector::setDataStreamingToClient(bool enable) { pimpl->enableDataStreamingToClient(static_cast(enable)); } -Result Detector::getDataStreamingFromReceiver(Positions pos) const { +Result Detector::getDataStreamingFromRx(Positions pos) const { return pimpl->Parallel(&slsDetector::enableDataStreamingFromReceiver, pos, -1); } -void Detector::setDataStreamingFromReceiver(bool enable, Positions pos) { +void Detector::setDataStreamingFromRx(bool enable, Positions pos) { pimpl->Parallel(&slsDetector::enableDataStreamingFromReceiver, pos, static_cast(enable)); } -Result Detector::getReceiverFifoDepth(Positions pos) const { +Result Detector::getRxFifoDepth(Positions pos) const { return pimpl->Parallel(&slsDetector::setReceiverFifoDepth, pos, -1); } -void Detector::setReceiverFifoDepth(int nframes, Positions pos) { +void Detector::setRxFifoDepth(int nframes, Positions pos) { pimpl->Parallel(&slsDetector::setReceiverFifoDepth, pos, nframes); } -Result Detector::getReceiverSilentMode(Positions pos) const { +Result Detector::getRxSilentMode(Positions pos) const { return pimpl->Parallel(&slsDetector::setReceiverSilentMode, pos, -1); } -void Detector::setReceiverSilentMode(bool value, Positions pos) { +void Detector::setRxSilentMode(bool value, Positions pos) { pimpl->Parallel(&slsDetector::setReceiverSilentMode, pos, static_cast(value)); } Result -Detector::getReceiverFrameDiscardPolicy(Positions pos) const { +Detector::getRxFrameDiscardPolicy(Positions pos) const { return pimpl->Parallel(&slsDetector::setReceiverFramesDiscardPolicy, pos, defs::GET_FRAME_DISCARD_POLICY); } -void Detector::setReceiverFrameDiscardPolicy(defs::frameDiscardPolicy f, +void Detector::setRxFrameDiscardPolicy(defs::frameDiscardPolicy f, Positions pos) { pimpl->Parallel(&slsDetector::setReceiverFramesDiscardPolicy, pos, f); } @@ -1414,18 +1418,18 @@ void Detector::setRxPadDeactivatedMod(bool pad, Positions pos) { static_cast(pad)); } -Result Detector::getReceiverUDPSocketBufferSize(Positions pos) const { +Result Detector::getRxUDPSocketBufferSize(Positions pos) const { return pimpl->Parallel(&slsDetector::getReceiverUDPSocketBufferSize, pos); } -void Detector::setReceiverUDPSocketBufferSize(int64_t udpsockbufsize, +void Detector::setRxUDPSocketBufferSize(int64_t udpsockbufsize, Positions pos) { pimpl->Parallel(&slsDetector::setReceiverUDPSocketBufferSize, pos, udpsockbufsize); } Result -Detector::getReceiverRealUDPSocketBufferSize(Positions pos) const { +Detector::getRxRealUDPSocketBufferSize(Positions pos) const { return pimpl->Parallel(&slsDetector::getReceiverRealUDPSocketBufferSize, pos); } @@ -1455,7 +1459,7 @@ void Detector::sendSoftwareTrigger(Positions pos) { pimpl->Parallel(&slsDetector::sendSoftwareTrigger, pos); } -Result Detector::getReceiverStatus(Positions pos) const { +Result Detector::getRxStatus(Positions pos) const { return pimpl->Parallel(&slsDetector::getReceiverStatus, pos); } @@ -1463,7 +1467,7 @@ Result Detector::getFramesCaught(Positions pos) const { return pimpl->Parallel(&slsDetector::getFramesCaughtByReceiver, pos); } -Result Detector::getReceiverCurrentFrameIndex(Positions pos) const { +Result Detector::getRxCurrentFrameIndex(Positions pos) const { return pimpl->Parallel(&slsDetector::getReceiverCurrentFrameIndex, pos); }