mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-07-28 09:32:52 +02:00
bit_depth defined via config file
This commit is contained in:
@@ -24,28 +24,25 @@ using namespace assembler_config;
|
||||
|
||||
int main (int argc, char *argv[])
|
||||
{
|
||||
if (argc != 3) {
|
||||
if (argc != 2) {
|
||||
cout << endl;
|
||||
#ifndef USE_EIGER
|
||||
cout << "Usage: jf_assembler [detector_json_filename] "
|
||||
" [bit_depth]" << endl;
|
||||
<< endl;
|
||||
#else
|
||||
cout << "Usage: eiger_assembler [detector_json_filename] "
|
||||
" [bit_depth]" << endl;
|
||||
<< endl;
|
||||
#endif
|
||||
cout << "\tdetector_json_filename: detector config file path.";
|
||||
cout << endl;
|
||||
cout << "\tbit_depth: bit depth of the image.";
|
||||
cout << endl;
|
||||
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
auto config = BufferUtils::read_json_config(string(argv[1]));
|
||||
const int bit_depth = atoi(argv[2]);
|
||||
auto const stream_name = "assembler";
|
||||
|
||||
const size_t IMAGE_N_BYTES = config.image_height * config.image_width * bit_depth / 8;
|
||||
const size_t IMAGE_N_BYTES = config.image_height * config.image_width * config.bit_depth / 8;
|
||||
auto ctx = zmq_ctx_new();
|
||||
zmq_ctx_set(ctx, ZMQ_IO_THREADS, ASSEMBLER_ZMQ_IO_THREADS);
|
||||
auto sender = BufferUtils::bind_socket(
|
||||
@@ -62,13 +59,14 @@ int main (int argc, char *argv[])
|
||||
cout << " || n_modules: " << config.n_modules;
|
||||
cout << " || img width: " << config.image_width;
|
||||
cout << " || img height: " << config.image_height;
|
||||
cout << " || bit_depth: " << config.bit_depth;
|
||||
cout << endl;
|
||||
#endif
|
||||
|
||||
const size_t FRAME_N_BYTES = MODULE_N_PIXELS * bit_depth / 8;
|
||||
const size_t FRAME_N_BYTES = MODULE_N_PIXELS * config.bit_depth / 8;
|
||||
const size_t N_PACKETS_PER_FRAME = FRAME_N_BYTES / DATA_BYTES_PER_PACKET;
|
||||
|
||||
EigerAssembler assembler(config.n_modules, bit_depth,
|
||||
EigerAssembler assembler(config.n_modules, config.bit_depth,
|
||||
config.image_width, config.image_height);
|
||||
|
||||
#ifdef DEBUG_OUTPUT
|
||||
|
||||
Reference in New Issue
Block a user