diff --git a/RELEASE.txt b/RELEASE.txt index c9f996499..dcd4f14d8 100755 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -188,7 +188,9 @@ This document describes the differences between 6.0.0 and 5.2.0 releases. Frames caught by the master receiver is added to master file metadata. Hdf5 and Binary version numbers changed to 6.3 - 2. Changing Receiver TCP ports + 2. Removed Padding option for Deactivated half modules. + + 3. Changing Receiver TCP ports This will only affect shared memory and will not try to change the current tcp port of the receiver. diff --git a/python/src/detector.cpp b/python/src/detector.cpp index 4236a5af9..b68758577 100644 --- a/python/src/detector.cpp +++ b/python/src/detector.cpp @@ -953,14 +953,6 @@ void init_det(py::module &m) { (void (Detector::*)(const bool, sls::Positions)) & Detector::setActive, py::arg(), py::arg() = Positions{}) - .def("getRxPadDeactivatedMode", - (Result(Detector::*)(sls::Positions) const) & - Detector::getRxPadDeactivatedMode, - py::arg() = Positions{}) - .def("setRxPadDeactivatedMode", - (void (Detector::*)(bool, sls::Positions)) & - Detector::setRxPadDeactivatedMode, - py::arg(), py::arg() = Positions{}) .def("getPartialReset", (Result(Detector::*)(sls::Positions) const) & Detector::getPartialReset, diff --git a/slsDetectorSoftware/include/sls/Detector.h b/slsDetectorSoftware/include/sls/Detector.h index 01dd0dcb4..c6fc5867d 100644 --- a/slsDetectorSoftware/include/sls/Detector.h +++ b/slsDetectorSoftware/include/sls/Detector.h @@ -1091,12 +1091,6 @@ class Detector { * send data or communicated with FEB or BEB */ void setActive(const bool active, Positions pos = {}); - /** [Eiger] */ - Result getRxPadDeactivatedMode(Positions pos = {}) const; - - /** [Eiger] Pad deactivated modules in receiver. Enabled by default */ - void setRxPadDeactivatedMode(bool pad, Positions pos = {}); - /** [Eiger] Advanced */ Result getPartialReset(Positions pos = {}) const; diff --git a/slsDetectorSoftware/src/CmdProxy.cpp b/slsDetectorSoftware/src/CmdProxy.cpp index 1ccce1aa2..1cfff609d 100644 --- a/slsDetectorSoftware/src/CmdProxy.cpp +++ b/slsDetectorSoftware/src/CmdProxy.cpp @@ -1669,50 +1669,6 @@ std::string CmdProxy::RateCorrection(int action) { return os.str(); } -std::string CmdProxy::Activate(int action) { - std::ostringstream os; - os << cmd << ' '; - if (action == defs::HELP_ACTION) { - os << "[0, 1] [(optional) padding|nopadding]\n\t[Eiger] 1 is default. " - "0 deactivates readout and does not send data. \n\tPadding will " - "pad data files for deactivates readouts." - << '\n'; - } else if (action == defs::GET_ACTION) { - if (!args.empty()) { - WrongNumberOfParameters(0); - } - auto t = det->getActive(std::vector{det_id}); - auto p = det->getRxPadDeactivatedMode(std::vector{det_id}); - Result pResult(p.size()); - for (unsigned int i = 0; i < p.size(); ++i) { - pResult[i] = p[i] ? "padding" : "nopadding"; - } - os << OutString(t) << ' ' << OutString(pResult) << '\n'; - } else if (action == defs::PUT_ACTION) { - if (args.empty() || args.size() > 2) { - WrongNumberOfParameters(2); - } - int t = StringTo(args[0]); - det->setActive(t, std::vector{det_id}); - os << args[0]; - if (args.size() == 2) { - bool p = true; - if (args[1] == "nopadding") { - p = false; - } else if (args[1] != "padding") { - throw sls::RuntimeError( - "Unknown argument for deactivated padding."); - } - det->setRxPadDeactivatedMode(p, std::vector{det_id}); - os << ' ' << args[1]; - } - os << '\n'; - } else { - throw sls::RuntimeError("Unknown action"); - } - return os.str(); -} - std::string CmdProxy::PulsePixel(int action) { std::ostringstream os; os << cmd << ' '; diff --git a/slsDetectorSoftware/src/CmdProxy.h b/slsDetectorSoftware/src/CmdProxy.h index 5adb058e8..2424f89cd 100644 --- a/slsDetectorSoftware/src/CmdProxy.h +++ b/slsDetectorSoftware/src/CmdProxy.h @@ -925,7 +925,7 @@ class CmdProxy { {"interruptsubframe", &CmdProxy::interruptsubframe}, {"measuredperiod", &CmdProxy::measuredperiod}, {"measuredsubperiod", &CmdProxy::measuredsubperiod}, - {"activate", &CmdProxy::Activate}, + {"activate", &CmdProxy::activate}, {"partialreset", &CmdProxy::partialreset}, {"pulse", &CmdProxy::PulsePixel}, {"pulsenmove", &CmdProxy::PulsePixelAndMove}, @@ -1131,7 +1131,6 @@ class CmdProxy { std::string ZMQHWM(int action); /* Eiger Specific */ std::string RateCorrection(int action); - std::string Activate(int action); std::string PulsePixel(int action); std::string PulsePixelAndMove(int action); std::string PulseChip(int action); @@ -1857,6 +1856,11 @@ class CmdProxy { "[(optional unit) ns|us|ms|s]\n\t[Eiger] Measured sub " "frame period between last sub frame and previous one."); + + INTEGER_COMMAND_VEC_ID( + activate, getActive, setActive, StringTo, + "[0, 1] \n\t[Eiger] 1 is default. 0 deactivates readout and does not send data."); + INTEGER_COMMAND_VEC_ID( partialreset, getPartialReset, setPartialReset, StringTo, "[0, 1]\n\t[Eiger] Sets up detector to do partial or complete reset at " diff --git a/slsDetectorSoftware/src/Detector.cpp b/slsDetectorSoftware/src/Detector.cpp index 982d7b3d2..4bdbbe0ff 100644 --- a/slsDetectorSoftware/src/Detector.cpp +++ b/slsDetectorSoftware/src/Detector.cpp @@ -1430,13 +1430,6 @@ void Detector::setActive(const bool active, Positions pos) { pimpl->Parallel(&Module::setActivate, pos, active); } -Result Detector::getRxPadDeactivatedMode(Positions pos) const { - return pimpl->Parallel(&Module::getDeactivatedRxrPaddingMode, pos); -} - -void Detector::setRxPadDeactivatedMode(bool pad, Positions pos) { - pimpl->Parallel(&Module::setDeactivatedRxrPaddingMode, pos, pad); -} Result Detector::getPartialReset(Positions pos) const { return pimpl->Parallel(&Module::getCounterBit, pos); diff --git a/slsDetectorSoftware/src/Module.cpp b/slsDetectorSoftware/src/Module.cpp index b3a7504e3..c14cd84e1 100644 --- a/slsDetectorSoftware/src/Module.cpp +++ b/slsDetectorSoftware/src/Module.cpp @@ -1554,15 +1554,6 @@ void Module::setActivate(const bool enable) { } } -bool Module::getDeactivatedRxrPaddingMode() const { - return sendToReceiver(F_GET_RECEIVER_DEACTIVATED_PADDING); -} - -void Module::setDeactivatedRxrPaddingMode(bool padding) { - sendToReceiver(F_SET_RECEIVER_DEACTIVATED_PADDING, - static_cast(padding), nullptr); -} - bool Module::getCounterBit() const { return ( !static_cast(sendToDetector(F_SET_COUNTER_BIT, GET_FLAG))); diff --git a/slsDetectorSoftware/src/Module.h b/slsDetectorSoftware/src/Module.h index f33e981eb..67e4b0327 100644 --- a/slsDetectorSoftware/src/Module.h +++ b/slsDetectorSoftware/src/Module.h @@ -349,8 +349,6 @@ class Module : public virtual slsDetectorDefs { int64_t getMeasuredSubFramePeriod() const; bool getActivate() const; void setActivate(const bool enable); - bool getDeactivatedRxrPaddingMode() const; - void setDeactivatedRxrPaddingMode(bool padding); bool getCounterBit() const; void setCounterBit(bool cb); void pulsePixel(int n = 0, int x = 0, int y = 0); diff --git a/slsReceiverSoftware/src/ClientInterface.cpp b/slsReceiverSoftware/src/ClientInterface.cpp index bc838b7df..b6cb23af2 100644 --- a/slsReceiverSoftware/src/ClientInterface.cpp +++ b/slsReceiverSoftware/src/ClientInterface.cpp @@ -177,8 +177,6 @@ int ClientInterface::functionTable(){ flist[F_GET_RECEIVER_DISCARD_POLICY] = &ClientInterface::get_discard_policy; flist[F_SET_RECEIVER_PADDING] = &ClientInterface::set_padding_enable; flist[F_GET_RECEIVER_PADDING] = &ClientInterface::get_padding_enable; - flist[F_SET_RECEIVER_DEACTIVATED_PADDING] = &ClientInterface::set_deactivated_padding_enable; - flist[F_GET_RECEIVER_DEACTIVATED_PADDING] = &ClientInterface::get_deactivated_padding_enable; flist[F_RECEIVER_SET_READOUT_MODE] = &ClientInterface::set_readout_mode; flist[F_RECEIVER_SET_ADC_MASK] = &ClientInterface::set_adc_mask; flist[F_SET_RECEIVER_DBIT_LIST] = &ClientInterface::set_dbit_list; @@ -1259,29 +1257,6 @@ int ClientInterface::get_padding_enable(Interface &socket) { return socket.sendResult(retval); } -int ClientInterface::set_deactivated_padding_enable(Interface &socket) { - auto enable = socket.Receive(); - if (detType != EIGER) { - functionNotImplemented(); - } - if (enable < 0) { - throw RuntimeError("Invalid Deactivated padding: " + - std::to_string(enable)); - } - verifyIdle(socket); - LOG(logDEBUG1) << "Setting deactivated padding enable: " << enable; - impl()->setDeactivatedPadding(enable > 0); - return socket.Send(OK); -} - -int ClientInterface::get_deactivated_padding_enable(Interface &socket) { - if (detType != EIGER) - functionNotImplemented(); - auto retval = static_cast(impl()->getDeactivatedPadding()); - LOG(logDEBUG1) << "Deactivated Padding Enable: " << retval; - return socket.sendResult(retval); -} - int ClientInterface::set_readout_mode(Interface &socket) { auto arg = socket.Receive(); diff --git a/slsReceiverSoftware/src/ClientInterface.h b/slsReceiverSoftware/src/ClientInterface.h index dcba1812b..d362edabd 100644 --- a/slsReceiverSoftware/src/ClientInterface.h +++ b/slsReceiverSoftware/src/ClientInterface.h @@ -128,8 +128,6 @@ class ClientInterface : private virtual slsDetectorDefs { int get_discard_policy(sls::ServerInterface &socket); int set_padding_enable(sls::ServerInterface &socket); int get_padding_enable(sls::ServerInterface &socket); - int set_deactivated_padding_enable(sls::ServerInterface &socket); - int get_deactivated_padding_enable(sls::ServerInterface &socket); int set_readout_mode(sls::ServerInterface &socket); int set_adc_mask(sls::ServerInterface &socket); int set_dbit_list(sls::ServerInterface &socket); diff --git a/slsReceiverSoftware/src/DataProcessor.cpp b/slsReceiverSoftware/src/DataProcessor.cpp index 699657b0f..2a420f924 100644 --- a/slsReceiverSoftware/src/DataProcessor.cpp +++ b/slsReceiverSoftware/src/DataProcessor.cpp @@ -27,8 +27,7 @@ const std::string DataProcessor::typeName_ = "DataProcessor"; DataProcessor::DataProcessor(int index, detectorType detectorType, Fifo *fifo, - bool *activated, bool *deactivatedPaddingEnable, - bool *dataStreamEnable, + bool *activated, bool *dataStreamEnable, uint32_t *streamingFrequency, uint32_t *streamingTimerInMs, uint32_t *streamingStartFnum, bool *framePadding, @@ -36,7 +35,6 @@ DataProcessor::DataProcessor(int index, detectorType detectorType, Fifo *fifo, int *ctbAnalogDataBytes, std::mutex *hdf5Lib) : ThreadObject(index, typeName_), fifo_(fifo), detectorType_(detectorType), dataStreamEnable_(dataStreamEnable), activated_(activated), - deactivatedPaddingEnable_(deactivatedPaddingEnable), streamingFrequency_(streamingFrequency), streamingTimerInMs_(streamingTimerInMs), streamingStartFnum_(streamingStartFnum), framePadding_(framePadding), @@ -169,13 +167,8 @@ void DataProcessor::CreateFirstFiles( overWriteEnable, silentMode, attr); } - // deactivated with padding enabled, dont write file - if (!*activated_ && !*deactivatedPaddingEnable_) { - return; - } - - // deactivated port, dont write file - if (!detectorDataStream) { + // deactivated (half module/ single port), dont write file + if ((!*activated_) || (!detectorDataStream)) { return; } @@ -372,10 +365,6 @@ uint64_t DataProcessor::ProcessAnImage(char *buf) { if (*activated_ && *framePadding_ && nump < generalData_->packetsPerFrame) PadMissingPackets(buf); - // deactivated and padding enabled - else if (!*activated_ && *deactivatedPaddingEnable_) - PadMissingPackets(buf); - // rearrange ctb digital bits (if ctbDbitlist is not empty) if (!(*ctbDbitList_).empty()) { RearrangeDbitData(buf); diff --git a/slsReceiverSoftware/src/DataProcessor.h b/slsReceiverSoftware/src/DataProcessor.h index 7b8db99f8..0d51e6a14 100644 --- a/slsReceiverSoftware/src/DataProcessor.h +++ b/slsReceiverSoftware/src/DataProcessor.h @@ -26,8 +26,7 @@ class DataProcessor : private virtual slsDetectorDefs, public ThreadObject { public: DataProcessor(int index, detectorType detectorType, Fifo *fifo, - bool *activated, bool *deactivatedPaddingEnable, - bool *dataStreamEnable, uint32_t *streamingFrequency, + bool *activated, bool *dataStreamEnable, uint32_t *streamingFrequency, uint32_t *streamingTimerInMs, uint32_t *streamingStartFnum, bool *framePadding, std::vector *ctbDbitList, int *ctbDbitOffset, int *ctbAnalogDataBytes, @@ -161,7 +160,6 @@ class DataProcessor : private virtual slsDetectorDefs, public ThreadObject { detectorType detectorType_; bool *dataStreamEnable_; bool *activated_; - bool *deactivatedPaddingEnable_; /** if 0, sending random images with a timer */ uint32_t *streamingFrequency_; uint32_t *streamingTimerInMs_; diff --git a/slsReceiverSoftware/src/Implementation.cpp b/slsReceiverSoftware/src/Implementation.cpp index 0e665708c..8e4976d54 100644 --- a/slsReceiverSoftware/src/Implementation.cpp +++ b/slsReceiverSoftware/src/Implementation.cpp @@ -167,9 +167,9 @@ void Implementation::setDetectorType(const detectorType d) { i, detType, fifo_ptr, &status, &udpPortNum[i], ð[i], &numberOfTotalFrames, &udpSocketBufferSize, &actualUDPSocketBufferSize, &framesPerFile, &frameDiscardMode, - &activated, &detectorDataStream[i], &deactivatedPaddingEnable, &silentMode)); + &activated, &detectorDataStream[i], &silentMode)); dataProcessor.push_back(sls::make_unique( - i, detType, fifo_ptr, &activated, &deactivatedPaddingEnable, + i, detType, fifo_ptr, &activated, &dataStreamEnable, &streamingFrequency, &streamingTimerInMs, &streamingStartFnum, &framePadding, &ctbDbitList, &ctbDbitOffset, &ctbAnalogDataBytes, &hdf5Lib)); @@ -880,12 +880,11 @@ void Implementation::setNumberofUDPInterfaces(const int n) { i, detType, fifo_ptr, &status, &udpPortNum[i], ð[i], &numberOfTotalFrames, &udpSocketBufferSize, &actualUDPSocketBufferSize, &framesPerFile, - &frameDiscardMode, &activated, &detectorDataStream[i], &deactivatedPaddingEnable, - &silentMode)); + &frameDiscardMode, &activated, &detectorDataStream[i], &silentMode)); listener[i]->SetGeneralData(generalData); dataProcessor.push_back(sls::make_unique( - i, detType, fifo_ptr, &activated, &deactivatedPaddingEnable, + i, detType, fifo_ptr, &activated, &dataStreamEnable, &streamingFrequency, &streamingTimerInMs, &streamingStartFnum, &framePadding, &ctbDbitList, &ctbDbitOffset, &ctbAnalogDataBytes, &hdf5Lib)); @@ -1530,16 +1529,6 @@ void Implementation::setDetectorDataStream(const portPosition port, << " Port): " << sls::ToString(detectorDataStream[index]); } -bool Implementation::getDeactivatedPadding() const { - return deactivatedPaddingEnable; -} - -void Implementation::setDeactivatedPadding(bool enable) { - deactivatedPaddingEnable = enable; - LOG(logINFO) << "Deactivated Padding Enable: " - << (deactivatedPaddingEnable ? "enabled" : "disabled"); -} - int Implementation::getReadNRows() const { return readNRows; } void Implementation::setReadNRows(const int value) { diff --git a/slsReceiverSoftware/src/Implementation.h b/slsReceiverSoftware/src/Implementation.h index 4d7093b3c..99708fb86 100644 --- a/slsReceiverSoftware/src/Implementation.h +++ b/slsReceiverSoftware/src/Implementation.h @@ -215,9 +215,6 @@ class Implementation : private virtual slsDetectorDefs { /** [Eiger] If datastream is disabled, receiver will create dummy data if deactivated * padding for that port is enabled (as it will receive nothing from detector) */ void setDetectorDataStream(const portPosition port, const bool enable); - bool getDeactivatedPadding() const; - /* [Eiger] */ - void setDeactivatedPadding(const bool enable); int getReadNRows() const; /* [Eiger][Jungfrau] */ void setReadNRows(const int value); @@ -351,7 +348,6 @@ class Implementation : private virtual slsDetectorDefs { bool quadEnable{false}; bool activated{true}; std::array detectorDataStream = {{true, true}}; - bool deactivatedPaddingEnable{true}; int readNRows{0}; int thresholdEnergyeV{-1}; std::array thresholdAllEnergyeV = {{-1, -1, -1}}; diff --git a/slsReceiverSoftware/src/Listener.cpp b/slsReceiverSoftware/src/Listener.cpp index c275cf941..0a907f786 100644 --- a/slsReceiverSoftware/src/Listener.cpp +++ b/slsReceiverSoftware/src/Listener.cpp @@ -22,11 +22,11 @@ const std::string Listener::TypeName = "Listener"; Listener::Listener(int ind, detectorType dtype, Fifo *f, std::atomic *s, uint32_t *portno, std::string *e, uint64_t *nf, int *us, int *as, uint32_t *fpf, - frameDiscardPolicy *fdp, bool *act, bool* detds, bool *depaden, bool *sm) + frameDiscardPolicy *fdp, bool *act, bool* detds, bool *sm) : ThreadObject(ind, TypeName), fifo(f), myDetectorType(dtype), status(s), udpPortNumber(portno), eth(e), numImages(nf), udpSocketBufferSize(us), actualUDPSocketBufferSize(as), framesPerFile(fpf), frameDiscardMode(fdp), - activated(act), detectorDataStream(detds), deactivatedPaddingEnable(depaden), silentMode(sm) { + activated(act), detectorDataStream(detds), silentMode(sm) { LOG(logDEBUG) << "Listener " << ind << " created"; } @@ -299,24 +299,7 @@ uint32_t Listener::ListenToAnImage(char *buf) { } // deactivated (eiger) if (!(*activated)) { - // no padding - if (!(*deactivatedPaddingEnable)) - return 0; - // padding without setting bitmask (all missing packets padded in - // dataProcessor) - if (currentFrameIndex >= *numImages) - return 0; - - //(eiger) first fnum starts at 1 - if (!currentFrameIndex) { - ++currentFrameIndex; - } - new_header->detHeader.frameNumber = currentFrameIndex; - new_header->detHeader.row = row; - new_header->detHeader.column = column; - new_header->detHeader.detType = (uint8_t)generalData->myDetectorType; - new_header->detHeader.version = (uint8_t)SLS_DETECTOR_HEADER_VERSION; - return imageSize; + return 0; } // look for carry over diff --git a/slsReceiverSoftware/src/Listener.h b/slsReceiverSoftware/src/Listener.h index eff5800dc..a7e432aa6 100644 --- a/slsReceiverSoftware/src/Listener.h +++ b/slsReceiverSoftware/src/Listener.h @@ -38,13 +38,11 @@ class Listener : private virtual slsDetectorDefs, public ThreadObject { * @param fdp frame discard policy * @param act pointer to activated * @param detds pointer to detector data stream - * @param depaden pointer to deactivated padding enable * @param sm pointer to silent mode */ Listener(int ind, detectorType dtype, Fifo *f, std::atomic *s, uint32_t *portno, std::string *e, uint64_t *nf, int *us, int *as, - uint32_t *fpf, frameDiscardPolicy *fdp, bool *act, bool* detds, bool *depaden, - bool *sm); + uint32_t *fpf, frameDiscardPolicy *fdp, bool *act, bool* detds, bool *sm); /** * Destructor @@ -191,9 +189,6 @@ class Listener : private virtual slsDetectorDefs, public ThreadObject { /** detector data stream */ bool* detectorDataStream; - /** Deactivated padding enable */ - bool *deactivatedPaddingEnable; - /** Silent Mode */ bool *silentMode; diff --git a/slsSupportLib/include/sls/sls_detector_funcs.h b/slsSupportLib/include/sls/sls_detector_funcs.h index eba720a2a..f6215dce6 100755 --- a/slsSupportLib/include/sls/sls_detector_funcs.h +++ b/slsSupportLib/include/sls/sls_detector_funcs.h @@ -320,8 +320,6 @@ enum detFuncs { F_GET_RECEIVER_DISCARD_POLICY, F_SET_RECEIVER_PADDING, F_GET_RECEIVER_PADDING, - F_SET_RECEIVER_DEACTIVATED_PADDING, - F_GET_RECEIVER_DEACTIVATED_PADDING, F_RECEIVER_SET_READOUT_MODE, F_RECEIVER_SET_ADC_MASK, F_SET_RECEIVER_DBIT_LIST, @@ -674,8 +672,6 @@ const char* getFunctionNameFromEnum(enum detFuncs func) { case F_GET_RECEIVER_DISCARD_POLICY: return "F_GET_RECEIVER_DISCARD_POLICY"; case F_SET_RECEIVER_PADDING: return "F_SET_RECEIVER_PADDING"; case F_GET_RECEIVER_PADDING: return "F_GET_RECEIVER_PADDING"; - case F_SET_RECEIVER_DEACTIVATED_PADDING: return "F_SET_RECEIVER_DEACTIVATED_PADDING"; - case F_GET_RECEIVER_DEACTIVATED_PADDING: return "F_GET_RECEIVER_DEACTIVATED_PADDING"; case F_RECEIVER_SET_READOUT_MODE: return "F_RECEIVER_SET_READOUT_MODE"; case F_RECEIVER_SET_ADC_MASK: return "F_RECEIVER_SET_ADC_MASK"; case F_SET_RECEIVER_DBIT_LIST: return "F_SET_RECEIVER_DBIT_LIST";