RTC Toolkit 5.1.0
Loading...
Searching...
No Matches
config.hpp
Go to the documentation of this file.
1
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 destination hostname where MUDPI packets are sent.
45 std::string hostname = "localhost";
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 // thread policies
69 std::optional<numapp::NumaPolicies> thread_policies = std::nullopt;
70};
71
75struct PubCfg : public PubStaticCfg, PubDynamicCfg {};
76
80struct AppCfg {
81 // cppcheck-suppress-begin unusedStructMember
82
83 // Delay between samples in microseconds.
84 std::chrono::microseconds period_us{1'000'000};
85
86 // The maximum number of samples to generate. Negative numbers indicate no maximum.
87 int64_t max_samples = -1;
88
89 // By how much to increment sample id every cycle
90 uint32_t sample_id_increment = 1;
91
92 // Pathname of the FITS file to load
93 std::string data_file;
94
95 // config of individual channels
96 std::vector<std::tuple<std::string, PubCfg>> pubs;
97
98 // cppcheck-suppress-end unusedStructMember
99};
100
101} // namespace rtctk::mudpiPub
102
103#endif // RTCTK_REUSABLECOMPONENT_MUDPIPUB_CONFIG_HPP
Definition businessLogic.cpp:21
Configuration of entire MUDPI Publisher application.
Definition config.hpp:80
std::vector< std::tuple< std::string, PubCfg > > pubs
Definition config.hpp:96
std::chrono::microseconds period_us
Definition config.hpp:84
uint32_t sample_id_increment
Definition config.hpp:90
std::string data_file
Definition config.hpp:93
int64_t max_samples
Definition config.hpp:87
Configuration (Dynamic + Static) of a single MUDPI Publisher object.
Definition config.hpp:75
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:69
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 hostname
Definition config.hpp:45
std::string multicast_group
Definition config.hpp:48
uint16_t application_tag
Definition config.hpp:60