mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-12 21:07:13 +02:00
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:
@ -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},
|
||||
|
||||
|
@ -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)) {
|
||||
|
@ -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())
|
||||
|
Reference in New Issue
Block a user