Merge branch 'master' into eiger

This commit is contained in:
lhdamiani
2021-04-14 18:04:40 +02:00
5 changed files with 30 additions and 4 deletions
+3 -1
View File
@@ -7,8 +7,10 @@ set (SF_DAQ_BUFFER_VERSION "1.0.0")
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
# Download and unpack googletest at configure time
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG_OUTPUT")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG_OUTPUT")
# Download and unpack googletest at configure time
configure_file(googletest.in googletest-download/CMakeLists.txt)
execute_process(
+5
View File
@@ -11,6 +11,7 @@
#include <rapidjson/istreamwrapper.h>
#include <rapidjson/document.h>
#include <rapidjson/stringbuffer.h>
#include <iostream>
using namespace std;
using namespace buffer_config;
@@ -96,6 +97,10 @@ void* BufferUtils::connect_socket(
string ipc_address = BUFFER_LIVE_IPC_URL +
detector_name + "-" +
stream_name;
#ifdef DEBUG_OUTPUT
cout << "[BufferUtils::connect_socket]";
cout << " IPC address: " << ipc_address << endl;
#endif
void* socket = zmq_socket(ctx, ZMQ_SUB);
if (socket == nullptr) {
+3 -1
View File
@@ -13,6 +13,8 @@ docker build -f jf-live-writer/debug.Dockerfile -t jf-live-writer .
(Running this command from the project root is mandatory as the entire project
folder needs to be part of the build context.)
# Build on your local machine
## Building
In order to build this executable you need to specify the cmake variable
```
@@ -21,7 +23,7 @@ cmake3 -DBUILD_JF_LIVE_WRITER=ON
The project will not build if you do not have installed the PHDF5 library.
Please follow instructions below on how to do that manually.
## Install PHDF5 manually
## Install PHDF5
```
wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.0/src/hdf5-1.12.0.tar.gz
tar -xzf hdf5-1.12.0.tar.gz
+17
View File
@@ -3,6 +3,7 @@
#include <sstream>
#include <cstring>
#include <H5version.h>
#include <iostream>
#include "live_writer_config.hpp"
@@ -62,11 +63,27 @@ void JFH5Writer::open_run(const int64_t run_id,
bits_per_pixel_ = bits_per_pixel;
image_n_bytes_ = (image_y_size_ * image_x_size_ * bits_per_pixel_) / 8;
#ifdef DEBUG_OUTPUT
cout << "[JFH5Writer::open_run]";
cout << " run_id:" << current_run_id_;
cout << " output_file:" << output_file;
cout << " bits_per_pixel:" << bits_per_pixel_;
cout << " image_y_size:" << image_y_size_;
cout << " image_x_size:" << image_x_size_;
cout << " image_n_bytes:" << image_n_bytes_;
cout << endl;
#endif
open_file(output_file, n_images);
}
void JFH5Writer::close_run()
{
#ifdef DEBUG_OUTPUT
cout << "[JFH5Writer::close_run] run_id:" << current_run_id_ << endl;
#endif
close_file();
current_run_id_ = NO_RUN_ID;
+2 -2
View File
@@ -16,7 +16,7 @@ using namespace live_writer_config;
int main (int argc, char *argv[])
{
if (argc != 3) {
if (argc != 2) {
cout << endl;
cout << "Usage: jf_live_writer [detector_json_filename]" << endl;
cout << "\tdetector_json_filename: detector config file path." << endl;
@@ -38,7 +38,7 @@ int main (int argc, char *argv[])
auto ctx = zmq_ctx_new();
zmq_ctx_set(ctx, ZMQ_IO_THREADS, LIVE_ZMQ_IO_THREADS);
auto receiver = BufferUtils::connect_socket(
ctx, config.detector_name, "broker-agent");
ctx, config.detector_name, "writer-agent");
RamBuffer ram_buffer(config.detector_name, config.n_modules);