developer: moench empty data callback (#936)

* moench (feature to wait for post processing to be done in new sls_detector_acquire_zmq executable)

READOUT_ACTION_ZMQ added to action enums
sls_detector_acquire_zmq added to executables
empty data call back so that client listens to last dummy zmq packet from moench post processor
processor: remove NEWZMQ ifdefs and remove connect for zmq publisher socket

* fix to compile

* cmds generated and parsed
This commit is contained in:
2024-08-13 11:27:06 +02:00
committed by GitHub
parent c13049f144
commit de33aff077
7 changed files with 30 additions and 52 deletions

View File

@ -397,6 +397,9 @@ class Caller {
using StringMap = std::map<std::string, std::string>;
Detector *ptr; // pointer to the detector that executes the command
static void EmptyDataCallBack(detectorData *data, uint64_t frameIndex,
uint32_t subFrameIndex, void *this_pointer);
FunctionMap functions{
{"list", &Caller::list},

View File

@ -212,6 +212,12 @@ std::string Caller::hostname(int action) {
}
return os.str();
}
void Caller::EmptyDataCallBack(detectorData *data, uint64_t frameIndex,
uint32_t subFrameIndex, void *this_pointer) {
LOG(logDEBUG) << "EmptyDataCallBack to start up zmq sockets";
}
std::string Caller::acquire(int action) {
std::ostringstream os;
if (action == defs::HELP_ACTION) {
@ -232,6 +238,9 @@ std::string Caller::acquire(int action) {
if (det_id >= 0) {
throw RuntimeError("Individual detectors not allowed for readout.");
}
if (action == defs::READOUT_ZMQ_ACTION) {
det->registerDataCallback(&(EmptyDataCallBack), this);
}
det->acquire();
if (det->getUseReceiverFlag().squash(false)) {

View File

@ -20,6 +20,10 @@ int main(int argc, char *argv[]) {
int action = slsDetectorDefs::READOUT_ACTION;
#endif
#ifdef READOUTZMQ
int action = slsDetectorDefs::READOUT_ZMQ_ACTION;
#endif
#ifdef HELP
int action = slsDetectorDefs::HELP_ACTION;
#endif
@ -38,7 +42,7 @@ int main(int argc, char *argv[]) {
sls::CmdParser parser;
parser.Parse(argc, argv);
if (action == slsDetectorDefs::READOUT_ACTION)
if (action == slsDetectorDefs::READOUT_ACTION || action == slsDetectorDefs::READOUT_ZMQ_ACTION)
parser.setCommand("acquire");
if (parser.isHelp())