KUnitConversion

electrical_resistance.cpp
1/*
2 * SPDX-FileCopyrightText: 2010 Petri Damstén <damu@iki.fi>
3 * SPDX-FileCopyrightText: 2014 John Layt <jlayt@kde.org>
4 * SPDX-FileCopyrightText: 2014 Garret Wassermann <gwasser@gmail.com>
5 *
6 * SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8
9#include "electrical_resistance_p.h"
10#include "unit_p.h"
11
12#include <KLocalizedString>
13
14namespace KUnitConversion
15{
16UnitCategory ElectricalResistance::makeCategory()
17{
18 auto c = UnitCategoryPrivate::makeCategory(ElectricalResistanceCategory, i18n("Resistance"), i18n("Resistance"));
19 auto d = UnitCategoryPrivate::get(c);
20 KLocalizedString symbolString = ki18nc("%1 value, %2 unit symbol (electrical resistance", "%1 %2");
21
22 d->addUnit(UnitPrivate::makeUnit(ElectricalResistanceCategory,
23 Yottaohms,
24 1e+24,
25 i18nc("electrical resistance unit symbol", "YΩ"),
26 i18nc("unit description in lists", "yottaohms"),
27 i18nc("unit synonyms for matching user input", "yottaohm;yottaohms;YΩ"),
28 symbolString,
29 ki18nc("amount in units (real)", "%1 yottaohms"),
30 ki18ncp("amount in units (integer)", "%1 yottaohm", "%1 yottaohms")));
31
32 d->addUnit(UnitPrivate::makeUnit(ElectricalResistanceCategory,
33 Zettaohms,
34 1e+21,
35 i18nc("electrical resistance unit symbol", "ZΩ"),
36 i18nc("unit description in lists", "zettaohms"),
37 i18nc("unit synonyms for matching user input", "zettaohm;zettaohms;ZΩ"),
38 symbolString,
39 ki18nc("amount in units (real)", "%1 zettaohms"),
40 ki18ncp("amount in units (integer)", "%1 zettaohm", "%1 zettaohms")));
41
42 d->addUnit(UnitPrivate::makeUnit(ElectricalResistanceCategory,
43 Exaohms,
44 1e+18,
45 i18nc("electrical resistance unit symbol", "EΩ"),
46 i18nc("unit description in lists", "exaohms"),
47 i18nc("unit synonyms for matching user input", "exaohm;exaohms;EΩ"),
48 symbolString,
49 ki18nc("amount in units (real)", "%1 exaohms"),
50 ki18ncp("amount in units (integer)", "%1 exaohm", "%1 exaohms")));
51
52 d->addUnit(UnitPrivate::makeUnit(ElectricalResistanceCategory,
53 Petaohms,
54 1e+15,
55 i18nc("electrical resistance unit symbol", "PΩ"),
56 i18nc("unit description in lists", "petaohms"),
57 i18nc("unit synonyms for matching user input", "petaohm;petaohms;PΩ"),
58 symbolString,
59 ki18nc("amount in units (real)", "%1 petaohms"),
60 ki18ncp("amount in units (integer)", "%1 petaohm", "%1 petaohms")));
61
62 d->addUnit(UnitPrivate::makeUnit(ElectricalResistanceCategory,
63 Teraohms,
64 1e+12,
65 i18nc("electrical resistance unit symbol", "TΩ"),
66 i18nc("unit description in lists", "teraohms"),
67 i18nc("unit synonyms for matching user input", "teraohm;teraohms;TΩ"),
68 symbolString,
69 ki18nc("amount in units (real)", "%1 teraohms"),
70 ki18ncp("amount in units (integer)", "%1 teraohm", "%1 teraohms")));
71
72 d->addCommonUnit(UnitPrivate::makeUnit(ElectricalResistanceCategory,
73 Gigaohms,
74 1e+09,
75 i18nc("electrical resistance unit symbol", "GΩ"),
76 i18nc("unit description in lists", "gigaohms"),
77 i18nc("unit synonyms for matching user input", "gigaohm;gigaohms;GΩ"),
78 symbolString,
79 ki18nc("amount in units (real)", "%1 gigaohms"),
80 ki18ncp("amount in units (integer)", "%1 gigaohm", "%1 gigaohms")));
81
82 d->addCommonUnit(UnitPrivate::makeUnit(ElectricalResistanceCategory,
83 Megaohms,
84 1e+06,
85 i18nc("electrical resistance unit symbol", "MΩ"),
86 i18nc("unit description in lists", "megaohms"),
87 i18nc("unit synonyms for matching user input", "megaohm;megaohms;MΩ"),
88 symbolString,
89 ki18nc("amount in units (real)", "%1 megaohms"),
90 ki18ncp("amount in units (integer)", "%1 megaohm", "%1 megaohms")));
91
92 d->addCommonUnit(UnitPrivate::makeUnit(ElectricalResistanceCategory,
93 Kiloohms,
94 1000,
95 i18nc("electrical resistance unit symbol", "kΩ"),
96 i18nc("unit description in lists", "kiloohms"),
97 i18nc("unit synonyms for matching user input", "kiloohm;kiloohms;kΩ"),
98 symbolString,
99 ki18nc("amount in units (real)", "%1 kiloohms"),
100 ki18ncp("amount in units (integer)", "%1 kiloohm", "%1 kiloohms")));
101
102 d->addUnit(UnitPrivate::makeUnit(ElectricalResistanceCategory,
103 Hectoohms,
104 100,
105 i18nc("electrical resistance unit symbol", "hΩ"),
106 i18nc("unit description in lists", "hectoohms"),
107 i18nc("unit synonyms for matching user input", "hectoohm;hectoohms;hΩ"),
108 symbolString,
109 ki18nc("amount in units (real)", "%1 hectoohms"),
110 ki18ncp("amount in units (integer)", "%1 hectoohm", "%1 hectoohms")));
111
112 d->addUnit(UnitPrivate::makeUnit(ElectricalResistanceCategory,
113 Decaohms,
114 10,
115 i18nc("electrical resistance unit symbol", "daΩ"),
116 i18nc("unit description in lists", "decaohms"),
117 i18nc("unit synonyms for matching user input", "decaohm;decaohms;daΩ"),
118 symbolString,
119 ki18nc("amount in units (real)", "%1 decaohms"),
120 ki18ncp("amount in units (integer)", "%1 decaohm", "%1 decaohms")));
121
122 d->addDefaultUnit(UnitPrivate::makeUnit(ElectricalResistanceCategory,
123 Ohms,
124 1,
125 i18nc("electrical resistance unit symbol", "Ω"),
126 i18nc("unit description in lists", "ohms"),
127 i18nc("unit synonyms for matching user input", "ohm;ohms;Ω"),
128 symbolString,
129 ki18nc("amount in units (real)", "%1 ohms"),
130 ki18ncp("amount in units (integer)", "%1 ohm", "%1 ohms")));
131
132 d->addUnit(UnitPrivate::makeUnit(ElectricalResistanceCategory,
133 Deciohms,
134 0.1,
135 i18nc("electrical resistance unit symbol", "dΩ"),
136 i18nc("unit description in lists", "deciohms"),
137 i18nc("unit synonyms for matching user input", "deciohm;deciohms;dΩ"),
138 symbolString,
139 ki18nc("amount in units (real)", "%1 deciohms"),
140 ki18ncp("amount in units (integer)", "%1 deciohm", "%1 deciohms")));
141
142 d->addUnit(UnitPrivate::makeUnit(ElectricalResistanceCategory,
143 Centiohms,
144 0.01,
145 i18nc("electrical resistance unit symbol", "cΩ"),
146 i18nc("unit description in lists", "centiohms"),
147 i18nc("unit synonyms for matching user input", "centiohm;centiohms;cΩ"),
148 symbolString,
149 ki18nc("amount in units (real)", "%1 centiohms"),
150 ki18ncp("amount in units (integer)", "%1 centiohm", "%1 centiohms")));
151
152 d->addUnit(UnitPrivate::makeUnit(ElectricalResistanceCategory,
153 Milliohms,
154 0.001,
155 i18nc("electrical resistance unit symbol", "mΩ"),
156 i18nc("unit description in lists", "milliohms"),
157 i18nc("unit synonyms for matching user input", "milliohm;milliohms;mΩ"),
158 symbolString,
159 ki18nc("amount in units (real)", "%1 milliohms"),
160 ki18ncp("amount in units (integer)", "%1 milliohm", "%1 milliohms")));
161
162 d->addUnit(UnitPrivate::makeUnit(ElectricalResistanceCategory,
163 Microohms,
164 1e-06,
165 i18nc("electrical resistance unit symbol", "µΩ"),
166 i18nc("unit description in lists", "microohms"),
167 i18nc("unit synonyms for matching user input", "microohm;microohms;µΩ;uΩ"),
168 symbolString,
169 ki18nc("amount in units (real)", "%1 microohms"),
170 ki18ncp("amount in units (integer)", "%1 microohm", "%1 microohms")));
171
172 d->addUnit(UnitPrivate::makeUnit(ElectricalResistanceCategory,
173 Nanoohms,
174 1e-09,
175 i18nc("electrical resistance unit symbol", "nΩ"),
176 i18nc("unit description in lists", "nanoohms"),
177 i18nc("unit synonyms for matching user input", "nanoohm;nanoohms;nΩ"),
178 symbolString,
179 ki18nc("amount in units (real)", "%1 nanoohms"),
180 ki18ncp("amount in units (integer)", "%1 nanoohm", "%1 nanoohms")));
181
182 d->addUnit(UnitPrivate::makeUnit(ElectricalResistanceCategory,
183 Picoohms,
184 1e-12,
185 i18nc("electrical resistance unit symbol", "pΩ"),
186 i18nc("unit description in lists", "picoohms"),
187 i18nc("unit synonyms for matching user input", "picoohm;picoohms;pΩ"),
188 symbolString,
189 ki18nc("amount in units (real)", "%1 picoohms"),
190 ki18ncp("amount in units (integer)", "%1 picoohm", "%1 picoohms")));
191
192 d->addUnit(UnitPrivate::makeUnit(ElectricalResistanceCategory,
193 Femtoohms,
194 1e-15,
195 i18nc("electrical resistance unit symbol", "fΩ"),
196 i18nc("unit description in lists", "femtoohms"),
197 i18nc("unit synonyms for matching user input", "femtoohm;femtoohms;fΩ"),
198 symbolString,
199 ki18nc("amount in units (real)", "%1 femtoohms"),
200 ki18ncp("amount in units (integer)", "%1 femtoohm", "%1 femtoohms")));
201
202 d->addUnit(UnitPrivate::makeUnit(ElectricalResistanceCategory,
203 Attoohms,
204 1e-18,
205 i18nc("electrical resistance unit symbol", "aΩ"),
206 i18nc("unit description in lists", "attoohms"),
207 i18nc("unit synonyms for matching user input", "attoohm;attoohms;aΩ"),
208 symbolString,
209 ki18nc("amount in units (real)", "%1 attoohms"),
210 ki18ncp("amount in units (integer)", "%1 attoohm", "%1 attoohms")));
211
212 d->addUnit(UnitPrivate::makeUnit(ElectricalResistanceCategory,
213 Zeptoohms,
214 1e-21,
215 i18nc("electrical resistance unit symbol", "zΩ"),
216 i18nc("unit description in lists", "zeptoohms"),
217 i18nc("unit synonyms for matching user input", "zeptoohm;zeptoohms;zΩ"),
218 symbolString,
219 ki18nc("amount in units (real)", "%1 zeptoohms"),
220 ki18ncp("amount in units (integer)", "%1 zeptoohm", "%1 zeptoohms")));
221
222 d->addUnit(UnitPrivate::makeUnit(ElectricalResistanceCategory,
223 Yoctoohms,
224 1e-24,
225 i18nc("electrical resistance unit symbol", "yΩ"),
226 i18nc("unit description in lists", "yoctoohms"),
227 i18nc("unit synonyms for matching user input", "yoctoohm;yoctoohms;yΩ"),
228 symbolString,
229 ki18nc("amount in units (real)", "%1 yoctoohms"),
230 ki18ncp("amount in units (integer)", "%1 yoctoohm", "%1 yoctoohms")));
231
232 return c;
233}
234
235} // KUnitConversion namespace
QString i18nc(const char *context, const char *text, const TYPE &arg...)
KLocalizedString KI18N_EXPORT ki18ncp(const char *context, const char *singular, const char *plural)
KLocalizedString KI18N_EXPORT ki18nc(const char *context, const char *text)
QString i18n(const char *text, const TYPE &arg...)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:06:12 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.