dimval 0.2.0
Modern C++23 header-only library of dimensional values (units, measures, ranges)
Loading...
Searching...
No Matches
common.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
12// -----------------------------------------------------------------------------
13// Geometry / dimensions
14// -----------------------------------------------------------------------------
15
17 ::dimval::Meter,
18 "length",
19 "Length",
20 ::comms::Icon::from("tabler:ruler"),
21 ::comms::Colors::mui::teal[400])
23 ::dimval::Meter,
24 "width",
25 "Width",
26 ::comms::Icon::from("tabler:ruler"),
27 ::comms::Colors::mui::teal[400])
29 ::dimval::Meter,
30 "height",
31 "Height",
32 ::comms::Icon::from("tabler:ruler"),
33 ::comms::Colors::mui::teal[400])
35 ::dimval::Meter,
36 "depth",
37 "Depth",
38 ::comms::Icon::from("tabler:ruler"),
39 ::comms::Colors::mui::teal[400])
41 ::dimval::Meter,
42 "distance",
43 "Distance",
44 ::comms::Icon::from("tabler:ruler"),
45 ::comms::Colors::mui::teal[400])
46
47// -----------------------------------------------------------------------------
48// Mass / weight
49// -----------------------------------------------------------------------------
50
52 ::dimval::Kilogram,
53 "mass",
54 "Mass",
55 ::comms::Icons::mdi::weight,
56 ::comms::Colors::mui::blue_grey[400])
58 ::dimval::Kilogram,
59 "weight",
60 "Weight",
61 ::comms::Icons::mdi::weight,
62 ::comms::Colors::mui::blue_grey[500])
63
64// -----------------------------------------------------------------------------
65// Time
66// -----------------------------------------------------------------------------
67
69 ::dimval::Second,
70 "duration",
71 "Duration",
72 ::comms::Icon::from("ph:clock"),
73 ::comms::Colors::mui::blue[400])
74DIMVAL_DEFINE_MEASURE(ElapsedTime,
75 ::dimval::Second,
76 "elapsed_time",
77 "Elapsed time",
78 ::comms::Icons::mdi::clock_outline,
79 ::comms::Colors::mui::blue[400])
81 ::dimval::Second,
82 "time",
83 "Time",
84 ::comms::Icon::from("ph:clock"),
85 ::comms::Colors::mui::blue[400])
86
87// -----------------------------------------------------------------------------
88// Data size / capacity
89// -----------------------------------------------------------------------------
90
92 ::dimval::Byte,
93 "size",
94 "Size",
95 ::comms::Icons::mdi::memory,
96 ::comms::Colors::mui::cyan[500])
98 ::dimval::Byte,
99 "capacity",
100 "Capacity",
101 ::comms::Icons::mdi::memory,
102 ::comms::Colors::mui::cyan[500])
103
104DIMVAL_DEFINE_MEASURE(Throughput,
105 ::dimval::BytePerSecond,
106 "throughput",
107 "Throughput",
108 ::comms::Icons::mdi::transfer,
109 ::comms::Colors::mui::cyan[500])
110
111// -----------------------------------------------------------------------------
112// Frequency / temperature / dimensionless
113// -----------------------------------------------------------------------------
114
115DIMVAL_DEFINE_MEASURE(Frequency,
116 ::dimval::Hertz,
117 "frequency",
118 "Frequency",
119 ::comms::Icon::from("ph:wave-sine"),
120 ::comms::Colors::mui::light_blue[400])
121
122DIMVAL_DEFINE_MEASURE(Temperature,
123 ::dimval::Celsius,
124 "temperature",
125 "Temperature",
126 ::comms::Icons::mdi::thermometer_lines,
127 ::comms::Colors::mui::orange[400])
128DIMVAL_DEFINE_MEASURE(TemperatureKelvin,
129 ::dimval::Kelvin,
130 "temperature_kelvin",
131 "Thermodynamic Temperature",
132 ::comms::Icon::from("ph:thermometer-light"),
133 ::comms::Colors::mui::orange[400])
134
135DIMVAL_DEFINE_MEASURE(Percentage,
136 ::dimval::Ratio,
137 "percentage",
138 "Percentage",
139 ::comms::Icons::mdi::percent,
140 ::comms::Colors::mui::grey[400])
141
142DIMVAL_DEFINE_MEASURE(CountMeasure,
143 ::dimval::Count,
144 "count",
145 "Count",
146 ::comms::Icons::mdi::counter,
147 ::comms::Colors::mui::grey[400])
148
149DIMVAL_DEFINE_MEASURE(RatioMeasure,
150 ::dimval::Ratio,
151 "ratio",
152 "Ratio",
153 ::comms::Icons::mdi::percent_outline,
154 ::comms::Colors::mui::grey[400])
155
157 ::dimval::Radian,
158 "angle",
159 "Angle",
160 ::comms::Icons::mdi::angle_obtuse,
161 ::comms::Colors::mui::deep_purple[400])
Data size units.
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.
Throughput units.
Canonical SI units (base + derived) and accepted/practical alts.