RTC Toolkit 6.0.0
Loading...
Searching...
No Matches
config.hpp
Go to the documentation of this file.
1
11
12#ifndef RTCTK_REUSABLECOMPONENT_MUDPIPUB_CONFIG_HPP
13#define RTCTK_REUSABLECOMPONENT_MUDPIPUB_CONFIG_HPP
14
15#include <numapp/numapolicies.hpp>
16
17#include <chrono>
18#include <optional>
19#include <string>
20#include <tuple>
21#include <vector>
22
23namespace rtctk::mudpiPub {
24
29 // The total sample size in bytes, i.e. the total size of the payloads across all frames.
30 uint32_t sample_size = 47000;
31
32 // how much to increment the sample id each cycle
33 uint32_t sample_id_increment = 1;
34
35 // An identifier indicating the payload pattern to generate.
36 std::string payload_pattern = "alternating_uint8_ramp";
37};
38
43 // The network_adapter_ip which shall be used for sending multicast MUDPI traffic,
44 // destination IP for unicast MUDPI packets.
45 std::string network_adapter_ip = "127.0.0.1";
46
47 // The multicast group where MUDPI packets are sent.
48 std::string multicast_group;
49
50 // The destination port where packets are sent.
51 uint16_t port = 6000;
52
53 // The topic ID to encode into the packets.
54 int32_t topic_id = 0;
55
56 // The MUDPI component id
57 uint16_t component_id = 25;
58
59 // The MUDPI application tag
60 uint16_t application_tag = 0;
61
62 // The size of the buffer for a single MUDPI packet in bytes (incl. MUDPI header and checksum).
63 uint32_t buffer_size = 8972; // 9000 (ESO MTU) - 20 (IP header) - 8 (UDP header)
64
65 // Flag if MUDPI frame checksum should be calculated
66 bool calculate_checksum = true;
67
68 // Whether this publisher is enabled
69 bool enabled = true;
70
71 // thread policies
72 std::optional<numapp::NumaPolicies> thread_policies = std::nullopt;
73};
74
78struct PubCfg : public PubStaticCfg, PubDynamicCfg {};
79
83struct AppCfg {
84 // cppcheck-suppress-begin unusedStructMember
85
86 // Delay between samples in microseconds.
87 std::chrono::microseconds period_us{1'000'000};
88
89 // The maximum number of samples to generate. Negative numbers indicate no maximum.
90 int64_t max_samples = -1;
91
92 // By how much to increment sample id every cycle
93 uint32_t sample_id_increment = 1;
94
95 // Pathname of the FITS file to load
96 std::string data_file;
97
98 // Optional absolute publication start timestamp.
99 // Empty string means start immediately.
101
102 // config of individual channels
103 std::vector<std::tuple<std::string, PubCfg>> pubs;
104
105 // cppcheck-suppress-end unusedStructMember
106};
107
108} // namespace rtctk::mudpiPub
109
110#endif // RTCTK_REUSABLECOMPONENT_MUDPIPUB_CONFIG_HPP
Definition businessLogic.cpp:23
Configuration of entire MUDPI Publisher application.
Definition config.hpp:83
std::vector< std::tuple< std::string, PubCfg > > pubs
Definition config.hpp:103
std::chrono::microseconds period_us
Definition config.hpp:87
uint32_t sample_id_increment
Definition config.hpp:93
std::string data_file
Definition config.hpp:96
int64_t max_samples
Definition config.hpp:90
std::string publication_start_timestamp
Definition config.hpp:100
Configuration (Dynamic + Static) of a single MUDPI Publisher object.
Definition config.hpp:78
Dynamic Configuration of a single MUDPI Publisher object.
Definition config.hpp:28
uint32_t sample_id_increment
Definition config.hpp:33
uint32_t sample_size
Definition config.hpp:30
std::string payload_pattern
Definition config.hpp:36
Static Configuration of a single MUDPI Publisher object.
Definition config.hpp:42
std::optional< numapp::NumaPolicies > thread_policies
Definition config.hpp:72
uint16_t port
Definition config.hpp:51
uint32_t buffer_size
Definition config.hpp:63
bool calculate_checksum
Definition config.hpp:66
uint16_t component_id
Definition config.hpp:57
int32_t topic_id
Definition config.hpp:54
std::string network_adapter_ip
Definition config.hpp:45
std::string multicast_group
Definition config.hpp:48
bool enabled
Definition config.hpp:69
uint16_t application_tag
Definition config.hpp:60