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