Add stub of std-stream-send

This commit is contained in:
2021-07-05 17:59:09 +02:00
parent 13547a5fef
commit 9d56da96f9
9 changed files with 334 additions and 0 deletions
@@ -0,0 +1,33 @@
#ifndef SF_DAQ_BUFFER_UDPRECVCONFIG_HPP
#define SF_DAQ_BUFFER_UDPRECVCONFIG_HPP
#include <rapidjson/istreamwrapper.h>
#include <rapidjson/document.h>
#include <rapidjson/stringbuffer.h>
#include <string>
#include <fstream>
struct StreamSendConfig {
static StreamSendConfig from_json_file(const std::string& filename) {
std::ifstream ifs(filename);
rapidjson::IStreamWrapper isw(ifs);
rapidjson::Document config_parameters;
config_parameters.ParseStream(isw);
return {
config_parameters["detector_name"].GetString(),
config_parameters["detector_type"].GetString(),
config_parameters["n_modules"].GetInt(),
config_parameters["start_udp_port"].GetInt(),
};
}
const std::string detector_name;
const std::string detector_type;
const int n_modules;
const int start_udp_port;
};
#endif //SF_DAQ_BUFFER_UDPRECVCONFIG_HPP
+14
View File
@@ -0,0 +1,14 @@
namespace stream_config
{
// N of IO threads to receive data from modules.
const int STREAM_ZMQ_IO_THREADS = 1;
// How long should the RECV queue be.
const size_t STREAM_RCVHWM = 100;
const int PROCESSING_ZMQ_SNDHWM = 10;
// Keep the last second of pulses in the buffer.
const int PULSE_ZMQ_SNDHWM = 100;
// Number of pulses between each statistics print out.
const size_t STREAM_STATS_MODULO = 1000;
}