dimval 0.2.0
Modern C++23 header-only library of dimensional values (units, measures, ranges)
Loading...
Searching...
No Matches
practical.hpp
Go to the documentation of this file.
1#pragma once
2
6
7#include <dimval/define.hpp>
8
9DIMVAL_DEFINE_UNIT(SecondsPerDay,
10 "s_per_day",
11 "s/day",
12 "s/day",
13 "seconds per day",
14 "clock_drift",
15 1.0,
16 ::comms::Icons::mdi::clock_alert_outline,
17 ::comms::Colors::mui::blue[300],
18 static constexpr int default_precision = 2;)
19
20DIMVAL_DEFINE_UNIT(RotationPerMinute,
21 "rpm",
22 "rpm",
23 "rpm",
24 "rotation per minute",
25 "rotational_frequency",
26 1.0,
27 ::comms::Icons::mdi::rotate_right,
28 ::comms::Colors::mui::light_blue[500],
29 static constexpr int default_precision = 0;)
30
31DIMVAL_DEFINE_UNIT(MeterPerSecond,
32 "m_per_s",
33 "m/s",
34 "m/s",
35 "meter per second",
36 "velocity",
37 1.0,
38 ::comms::Icons::mdi::speedometer,
39 ::comms::Colors::mui::light_green[400],
40 static constexpr int default_precision = 2;)
41
42DIMVAL_DEFINE_UNIT(Wavelength,
43 "wavelength",
44 "λ",
45 "λ",
46 "wavelength",
47 "length",
48 1.0,
49 ::comms::Icon::from("ph:wave-sine"),
50 ::comms::Colors::mui::teal[500],
51 static constexpr int default_precision = 2;)
52
53DIMVAL_DEFINE_UNIT(KilometerPerHour,
54 "km_per_h",
55 "km/h",
56 "km/h",
57 "kilometer per hour",
58 "velocity",
59 0.2777777777777778,
60 ::comms::Icons::mdi::speedometer,
61 ::comms::Colors::mui::light_green[500],
62 static constexpr int default_precision = 1;)
63
65 "kn",
66 "kn",
67 "kn",
68 "knot",
69 "velocity",
70 0.5144444444444445,
71 ::comms::Icons::mdi::sail_boat,
72 ::comms::Colors::mui::light_green[600],
73 static constexpr int default_precision = 1;)
Macros that expand into a CRTP unit/measure struct and a runtime auto-registration for it.
#define DIMVAL_DEFINE_UNIT(Tag, Id, Symbol, ShortName, LongName, Kind, Factor, Icon, Color,...)
Define a unit struct in ::dimval and auto-register its descriptor at static-init time.
Definition define.hpp:72