dimval 0.2.0
Modern C++23 header-only library of dimensional values (units, measures, ranges)
Loading...
Searching...
No Matches
digital.hpp
Go to the documentation of this file.
1#pragma once
2
5
6#include <dimval/define.hpp>
10#include <dimval/units/si.hpp>
11
13 ::dimval::BitPerSecond,
14 "bit_rate",
15 "Bit Rate",
16 ::comms::Icons::mdi::transfer,
17 ::comms::Colors::mui::light_blue[400])
18
20 ::dimval::BytePerSecond,
21 "byte_rate",
22 "Byte Rate",
23 ::comms::Icons::mdi::transfer,
24 ::comms::Colors::mui::light_blue[400])
25
27 ::dimval::Percent,
28 "ber",
29 "Bit Error Rate",
30 ::comms::Icons::mdi::percent,
31 ::comms::Colors::mui::red[400],
32 static constexpr int default_precision = 2;)
33
35 ::dimval::Percent,
36 "fer",
37 "Frame Error Rate",
38 ::comms::Icons::mdi::percent,
39 ::comms::Colors::mui::red[400],
40 static constexpr int default_precision = 2;)
41
42DIMVAL_DEFINE_MEASURE(PacketErrorRate,
43 ::dimval::Percent,
44 "packet_error_rate",
45 "Packet Error Rate",
46 ::comms::Icons::mdi::percent,
47 ::comms::Colors::mui::red[400],
48 static constexpr int default_precision = 2;)
49
51 ::dimval::Percent,
52 "per",
53 "Packet Error Rate",
54 ::comms::Icons::mdi::percent,
55 ::comms::Colors::mui::red[400],
56 static constexpr int default_precision = 2;)
57
58DIMVAL_DEFINE_MEASURE(FrameRate,
59 ::dimval::Hertz,
60 "frame_rate",
61 "Frame Rate",
62 ::comms::Icons::mdi::chart_timeline_variant,
63 ::comms::Colors::mui::light_blue[400])
64
66 ::dimval::Second,
67 "latency",
68 "Latency",
69 ::comms::Icons::mdi::timer_sand,
70 ::comms::Colors::mui::blue[400])
71
73 ::dimval::Second,
74 "jitter",
75 "Jitter",
76 ::comms::Icons::mdi::chart_bell_curve,
77 ::comms::Colors::mui::blue[400])
78
79DIMVAL_DEFINE_MEASURE(OffsetTime,
80 ::dimval::Second,
81 "offset_time",
82 "Time Offset",
83 ::comms::Icons::mdi::clock_outline,
84 ::comms::Colors::mui::cyan[400])
85
86DIMVAL_DEFINE_MEASURE(RotationRate,
87 ::dimval::RotationPerMinute,
88 "rotation_rate",
89 "Rotation Rate",
90 ::comms::Icons::mdi::rotate_right,
91 ::comms::Colors::mui::light_green[400])
Macros that expand into a CRTP unit/measure struct and a runtime auto-registration for it.
#define DIMVAL_DEFINE_MEASURE(Tag, BaseUnit, Id, Name, Icon, Color,...)
Define a measure struct in ::dimval and auto-register its descriptor.
Definition define.hpp:102
Dimensionless units.
Practical / accepted units that mostly carry their own kind: clock drift, rotational frequency,...
Throughput units.
Canonical SI units (base + derived) and accepted/practical alts.