mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-05-09 02:42:04 +02:00
bit_depth defined via config file
This commit is contained in:
@@ -18,19 +18,16 @@ using namespace live_writer_config;
|
||||
|
||||
int main (int argc, char *argv[])
|
||||
{
|
||||
if (argc != 3) {
|
||||
if (argc != 2) {
|
||||
cout << endl;
|
||||
cout << "Usage: std_det_writer [detector_json_filename]"
|
||||
" [bit_depth]" << endl;
|
||||
cout << "Usage: std_det_writer [detector_json_filename]" << endl;
|
||||
cout << "\tdetector_json_filename: detector config file path." << endl;
|
||||
cout << "\tbit_depth: bit depth of the incoming udp packets." << endl;
|
||||
cout << endl;
|
||||
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
auto const config = DetWriterConfig::from_json_file(string(argv[1]));
|
||||
const int bit_depth = atoi(argv[2]);
|
||||
|
||||
MPI_Init(nullptr, nullptr);
|
||||
|
||||
@@ -45,7 +42,7 @@ int main (int argc, char *argv[])
|
||||
auto receiver = BufferUtils::connect_socket(
|
||||
ctx, config.detector_name, "writer_agent");
|
||||
|
||||
const size_t IMAGE_N_BYTES = config.image_width * config.image_height * bit_depth / 8;
|
||||
const size_t IMAGE_N_BYTES = config.image_width * config.image_height * config.bit_depth / 8;
|
||||
RamBuffer image_buffer(config.detector_name + "_assembler",
|
||||
sizeof(ImageMetadata), IMAGE_N_BYTES, 1, RAM_BUFFER_N_SLOTS);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user