RTC Toolkit 4.0.2
Loading...
Searching...
No Matches
mudpiPubCfg.hpp
Go to the documentation of this file.
1
13#ifndef RTCTK_REUSABLECOMPONENT_MUDPIGENPUB_MUDPI_PUB_CFG_HPP
14#define RTCTK_REUSABLECOMPONENT_MUDPIGENPUB_MUDPI_PUB_CFG_HPP
15
16#include <numapp/numapolicies.hpp>
17
18#include <optional>
19#include <string>
20#include <tuple>
21#include <vector>
22
23namespace rtctk::mudpiPub {
24
28struct PubCfg {
29 // The destination hostname where MUDPI packets are sent.
30 std::string hostname = "localhost";
31
32 // The multicast group where MUDPI packets are sent.
33 std::string multicast_group;
34
35 // The destination port where packets are sent.
36 uint16_t port = 6000;
37
38 // The topic ID to encode into the packets.
39 int32_t topic_id = 0;
40
41 // The MUDPI component id
42 uint16_t component_id = 25;
43
44 // The MUDPI application tag
45 uint16_t application_tag = 0;
46
47 // The size of the buffer for a single MUDPI packet in bytes (incl. MUDPI header and checksum).
48 uint32_t buffer_size = 8972; // 9000 (ESO MTU) - 20 (IP header) - 8 (UDP header)
49
50 // The total sample size in bytes, i.e. the total size of the payloads across all frames.
51 uint32_t sample_size = 47000;
52
53 // how much to increment the sample id each cycle
54 uint32_t sample_id_increment = 1;
55
56 // An identifier indicating the payload pattern to generate.
57 std::string payload_pattern = "alternating_uint8_ramp";
58
59 // Pathname of the FITS file to load (goes together with data_column)
60 std::string data_file;
61
62 // Name of the FITS column to load (goes together with data_file)
63 std::string data_column;
64
65 // Flag if MUDPI frame checksum should be calculated
66 bool calculate_checksum = true;
67
68 // thread policies
69 std::optional<numapp::NumaPolicies> thread_policies = std::nullopt;
70};
71
75struct AppCfg {
76 // Delay between samples in nanoseconds.
77 int64_t period = 1'000'000'000;
78
79 // The maximum number of samples to generate. Negative numbers indicate no maximum.
80 int64_t max_samples = -1;
81
82 // By how much to increment sample id every cycle
83 uint32_t sample_id_increment = 1;
84
85 // config of individual channels
86 std::vector<std::tuple<std::string, PubCfg>> pubs;
87};
88
89} // namespace rtctk::mudpiPub
90
91#endif // RTCTK_REUSABLECOMPONENT_MUDPIGENPUB_MUDPI_PUB_CFG_HPP
Definition: businessLogic.cpp:20
Configuration of anentire MUDPI Publisher application hosting mulitple objects.
Definition: mudpiPubCfg.hpp:75
std::vector< std::tuple< std::string, PubCfg > > pubs
Definition: mudpiPubCfg.hpp:86
uint32_t sample_id_increment
Definition: mudpiPubCfg.hpp:83
int64_t max_samples
Definition: mudpiPubCfg.hpp:80
int64_t period
Definition: mudpiPubCfg.hpp:77
Configuration of a single MUDPI Publisher object.
Definition: mudpiPubCfg.hpp:28
std::string data_file
Definition: mudpiPubCfg.hpp:60
uint16_t component_id
Definition: mudpiPubCfg.hpp:42
std::string payload_pattern
Definition: mudpiPubCfg.hpp:57
int32_t topic_id
Definition: mudpiPubCfg.hpp:39
std::string hostname
Definition: mudpiPubCfg.hpp:30
uint32_t sample_size
Definition: mudpiPubCfg.hpp:51
bool calculate_checksum
Definition: mudpiPubCfg.hpp:66
uint32_t buffer_size
Definition: mudpiPubCfg.hpp:48
std::string data_column
Definition: mudpiPubCfg.hpp:63
uint32_t sample_id_increment
Definition: mudpiPubCfg.hpp:54
std::optional< numapp::NumaPolicies > thread_policies
Definition: mudpiPubCfg.hpp:69
std::string multicast_group
Definition: mudpiPubCfg.hpp:33
uint16_t application_tag
Definition: mudpiPubCfg.hpp:45
uint16_t port
Definition: mudpiPubCfg.hpp:36