diff options
author | Suren A. Chilingaryan <csa@suren.me> | 2020-09-03 03:00:30 +0200 |
---|---|---|
committer | Suren A. Chilingaryan <csa@suren.me> | 2020-09-03 03:00:30 +0200 |
commit | 5172421d248250b4ab3b69eb57fd83656e23a4da (patch) | |
tree | a499d9f1dd0b74b754816884a59927b3171656fc /src/roof-config.h | |
parent | 7b2e6168b049be9e7852b2d364d897592eff69fc (diff) | |
download | ufo-roof-temp-master.tar.gz ufo-roof-temp-master.tar.bz2 ufo-roof-temp-master.tar.xz ufo-roof-temp-master.zip |
Diffstat (limited to 'src/roof-config.h')
-rw-r--r-- | src/roof-config.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/src/roof-config.h b/src/roof-config.h new file mode 100644 index 0000000..f28cb60 --- /dev/null +++ b/src/roof-config.h @@ -0,0 +1,64 @@ +#ifndef __ROOF_CONFIG_H +#define __ROOF_CONFIG_H + +#include <glib.h> + +typedef struct { + // ROOF Hardware + gboolean roof_mode; // Indicates if ROOF is configured (1), otherwise only networking is implemented + guint n_planes; // Number of detector planes, ROOF module serves a ring segment from all planes in a round-robin fashion + guint n_modules; // Number of ROOF modules + guint channels_per_module; // Number of pixels in each module + guint samples_per_rotation; // Number of samples (projections) in a full fan sinogram; computed from sample_rate & image_rate if given + guint sample_rate; // Number of samples (projections) acquired per second, 0 - if unknown + guint imaging_rate; // Number of complete datasets (images) acquired per second, 0 - if unknown + guint bit_depth; // Number of bits per pixel (we currently support only multiples of 8) + + // Geometry + guint fan_projections; // Number of fan projections = samples_per_rotation + guint fan_bins; // Number of fan detectors = n_modules * channels_per_module + guint parallel_projections; + guint parallel_bins; +// guint detector_diameter; + + // Optics + + + // Network Server / Reader + gchar *protocol; // Protocols: tcp, udp, tcp6, udp6, ... + guint port; // First port + guint n_streams; // Number of independent data streams (expected on sequential ports), by default equal to number of ROOF modules + guint header_size; // Expected size of the packet header, for dgram protocols we need at least 32-bit sequence number. Defaults to uint32_t for udp* and 0 - otherwise + guint payload_size; // Expected size of TCP/UDP packet (without header) + guint dataset_size; // Size of a single dataset (image, sinogram, etc.). This is real size in bytes, excluding all technical headers used in communication protocol. Normally, it is computed based on ROOF hardware parameters. + + // Performance parameters + guint max_packets; // limits maximum number of packets which are read at once + guint max_packet_size; // payload_size + header_size + ... (we don't care if tail is variable length provided that the complete packet does not exceed max_packet_size bytes) + guint buffer_size; // How many datasets we can buffer. There is no sense to have more than 2 for odered protocols (default), but having larger number could help for UDP if significant order disturbances are expected + guint drop_buffers; // If we are slow and lost some buffers, we may drop more than minimally necessary to catch up. + guint latency_buffers; // We skip incomplete buffers if later (at least latency_buffer in future) dataset is already ready, 0 - never skip + guint network_timeout; // Maximum time (us) to wait for data on the socket + guint sockets_per_thread; // Number of sockets per thread. Optimally number of therads should not exceed number of CPU cores + + + +/* + guint planes_per_module; +*/ + + + + +} RoofConfig; + +typedef enum { + ROOF_CONFIG_DEFAULT = 0, + ROOF_CONFIG_SIMULATION = 1 +} RoofConfigFlags; + + +RoofConfig *roof_config_new(const char *config, RoofConfigFlags flags, GError **error); +void roof_config_free(RoofConfig *cfg); + +#endif /* __ROOF_CONFIG_H */ |