dimval 0.2.0
Modern C++23 header-only library of dimensional values (units, measures, ranges)
Loading...
Searching...
No Matches
electrical.hpp
Go to the documentation of this file.
1#pragma once
2
6
7#include <dimval/define.hpp>
9#include <dimval/units/si.hpp>
10
11// -----------------------------------------------------------------------------
12// Core electrical
13// -----------------------------------------------------------------------------
14
16 ::dimval::Volt,
17 "voltage",
18 "Voltage",
19 ::comms::Icon::from("material-symbols:electric-bolt-rounded"),
20 ::comms::Colors::mui::amber[500])
21
23 ::dimval::Ampere,
24 "current",
25 "Electric Current",
26 ::comms::Icon::from("material-symbols:electric-bolt-rounded"),
27 ::comms::Colors::mui::amber[600])
28
29DIMVAL_DEFINE_MEASURE(Resistance,
30 ::dimval::Ohm,
31 "resistance",
32 "Electrical Resistance",
33 ::comms::Icons::mdi::resistor,
34 ::comms::Colors::mui::brown[400])
35
36DIMVAL_DEFINE_MEASURE(Conductance,
37 ::dimval::Siemens,
38 "conductance",
39 "Electrical Conductance",
40 ::comms::Icons::mdi::resistor_nodes,
41 ::comms::Colors::mui::brown[500])
42
43DIMVAL_DEFINE_MEASURE(Capacitance,
44 ::dimval::Farad,
45 "capacitance",
46 "Capacitance",
47 ::comms::Icon::from("mdi:capacitor"),
48 ::comms::Colors::mui::brown[300])
49
50DIMVAL_DEFINE_MEASURE(Inductance,
51 ::dimval::Henry,
52 "inductance",
53 "Inductance",
54 ::comms::Icon::from("mdi:coil"),
55 ::comms::Colors::mui::brown[600])
56
58 ::dimval::Watt,
59 "power",
60 "Power",
61 ::comms::Icons::mdi::lightning_bolt,
62 ::comms::Colors::mui::deep_orange[400])
63
65 ::dimval::Joule,
66 "energy",
67 "Energy",
68 ::comms::Icons::mdi::flash,
69 ::comms::Colors::mui::deep_orange[500])
70
72 ::dimval::Coulomb,
73 "charge",
74 "Electric Charge",
75 ::comms::Icons::mdi::transmission_tower,
76 ::comms::Colors::mui::amber[700])
77
78// -----------------------------------------------------------------------------
79// Field / material properties
80// -----------------------------------------------------------------------------
81
82DIMVAL_DEFINE_MEASURE(ElectricFieldStrength,
83 ::dimval::VoltPerMeter,
84 "electric_field_strength",
85 "Electric Field Strength",
86 ::comms::Icons::mdi::arrow_expand_horizontal,
87 ::comms::Colors::mui::amber[400])
88
89DIMVAL_DEFINE_MEASURE(MagneticFieldStrength,
90 ::dimval::AmperePerMeter,
91 "magnetic_field_strength",
92 "Magnetic Field Strength",
93 ::comms::Icon::from("ph:magnet"),
94 ::comms::Colors::mui::indigo[300])
95
96DIMVAL_DEFINE_MEASURE(MagneticFlux,
97 ::dimval::Weber,
98 "magnetic_flux",
99 "Magnetic Flux",
100 ::comms::Icon::from("ph:magnet"),
101 ::comms::Colors::mui::indigo[400])
102
103DIMVAL_DEFINE_MEASURE(MagneticFluxDensity,
104 ::dimval::Tesla,
105 "magnetic_flux_density",
106 "Magnetic Flux Density",
107 ::comms::Icon::from("ph:magnet"),
108 ::comms::Colors::mui::indigo[500])
109
110DIMVAL_DEFINE_MEASURE(Resistivity,
111 ::dimval::OhmMeter,
112 "resistivity",
113 "Electrical Resistivity",
114 ::comms::Icons::mdi::resistor,
115 ::comms::Colors::mui::brown[500])
116
117DIMVAL_DEFINE_MEASURE(Conductivity,
118 ::dimval::SiemensPerMeter,
119 "conductivity",
120 "Electrical Conductivity",
121 ::comms::Icons::mdi::resistor_nodes,
122 ::comms::Colors::mui::brown[600])
123
124DIMVAL_DEFINE_MEASURE(Permittivity,
125 ::dimval::FaradPerMeter,
126 "permittivity",
127 "Permittivity",
128 ::comms::Icon::from("mdi:capacitor"),
129 ::comms::Colors::mui::brown[200])
130
131DIMVAL_DEFINE_MEASURE(Permeability,
132 ::dimval::HenryPerMeter,
133 "permeability",
134 "Permeability",
135 ::comms::Icon::from("mdi:coil"),
136 ::comms::Colors::mui::brown[700])
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
Canonical SI units (base + derived) and accepted/practical alts.
Electronics-specific compound and alternate units.