8.0.2.rc: moench empty data callback (#935)

* moench: empty data call back so that zmq sockets are still made and listened to in acquire that it waits for the dummy packet to be done

* moench zmq postprocessor: remove NEWZMQ ifdefs and remove connect for publisher socket

* changed enum from READOUT_ACTION_ZMQ to READOUT_ZMQ_ACTION for consistency
This commit is contained in:
2024-08-13 11:26:33 +02:00
committed by GitHub
parent 8d185988c1
commit 550ad4486a
6 changed files with 28 additions and 53 deletions

View File

@@ -79,9 +79,10 @@ if(SLS_USE_TEXTCLIENT)
# Loop over list to generate command line binaries
set(bin_names "sls_detector_put"
"sls_detector_get"
"sls_detector_acquire"
"sls_detector_acquire"
"sls_detector_acquire_zmq"
"sls_detector_help")
set(cmd_name "PUT" "GET" "READOUT" "HELP")
set(cmd_name "PUT" "GET" "READOUT" "READOUTZMQ" "HELP")
list(LENGTH bin_names len1)
math(EXPR len2 "${len1} - 1")

View File

@@ -30,6 +30,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
@@ -46,7 +50,7 @@ int main(int argc, char *argv[]) {
parser.Parse(argc, argv);
// If we called sls_detector_acquire, add the acquire command
if (action == slsDetectorDefs::READOUT_ACTION)
if (action == slsDetectorDefs::READOUT_ACTION || action == slsDetectorDefs::READOUT_ZMQ_ACTION)
parser.setCommand("acquire");
if (parser.isHelp())

View File

@@ -205,6 +205,12 @@ std::string CmdProxy::VirtualServer(int action) {
return os.str();
}
void CmdProxy::EmptyDataCallBack(detectorData *data, uint64_t frameIndex,
uint32_t subFrameIndex, void *this_pointer) {
LOG(logDEBUG) << "EmptyDataCallBack to start up zmq sockets";
}
std::string CmdProxy::Acquire(int action) {
std::ostringstream os;
if (action == defs::HELP_ACTION) {
@@ -226,6 +232,9 @@ std::string CmdProxy::Acquire(int action) {
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

@@ -1350,6 +1350,7 @@ class CmdProxy {
std::string GapPixels(int action);
std::string BadChannels(int action);
/* acquisition parameters */
static void EmptyDataCallBack(detectorData *data, uint64_t frameIndex, uint32_t subFrameIndex, void *this_pointer);
std::string Acquire(int action);
std::string Exptime(int action);
std::string ReadoutSpeed(int action);