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(id: ElectricalResistanceCategory, i18n("Resistance"), i18n("Resistance"));
19 auto d = UnitCategoryPrivate::get(category: c);
20 KLocalizedString symbolString = ki18nc("%1 value, %2 unit symbol (electrical resistance", "%1 %2");
21
22 d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ElectricalResistanceCategory,
23 id: Yottaohms,
24 multiplier: 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(unit: UnitPrivate::makeUnit(categoryId: ElectricalResistanceCategory,
33 id: Zettaohms,
34 multiplier: 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(unit: UnitPrivate::makeUnit(categoryId: ElectricalResistanceCategory,
43 id: Exaohms,
44 multiplier: 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(unit: UnitPrivate::makeUnit(categoryId: ElectricalResistanceCategory,
53 id: Petaohms,
54 multiplier: 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(unit: UnitPrivate::makeUnit(categoryId: ElectricalResistanceCategory,
63 id: Teraohms,
64 multiplier: 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(unit: UnitPrivate::makeUnit(categoryId: ElectricalResistanceCategory,
73 id: Gigaohms,
74 multiplier: 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(unit: UnitPrivate::makeUnit(categoryId: ElectricalResistanceCategory,
83 id: Megaohms,
84 multiplier: 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(unit: UnitPrivate::makeUnit(categoryId: ElectricalResistanceCategory,
93 id: Kiloohms,
94 multiplier: 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(unit: UnitPrivate::makeUnit(categoryId: ElectricalResistanceCategory,
103 id: Hectoohms,
104 multiplier: 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(unit: UnitPrivate::makeUnit(categoryId: ElectricalResistanceCategory,
113 id: Decaohms,
114 multiplier: 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(unit: UnitPrivate::makeUnit(categoryId: ElectricalResistanceCategory,
123 id: Ohms,
124 multiplier: 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(unit: UnitPrivate::makeUnit(categoryId: ElectricalResistanceCategory,
133 id: Deciohms,
134 multiplier: 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(unit: UnitPrivate::makeUnit(categoryId: ElectricalResistanceCategory,
143 id: Centiohms,
144 multiplier: 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(unit: UnitPrivate::makeUnit(categoryId: ElectricalResistanceCategory,
153 id: Milliohms,
154 multiplier: 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(unit: UnitPrivate::makeUnit(categoryId: ElectricalResistanceCategory,
163 id: Microohms,
164 multiplier: 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(unit: UnitPrivate::makeUnit(categoryId: ElectricalResistanceCategory,
173 id: Nanoohms,
174 multiplier: 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(unit: UnitPrivate::makeUnit(categoryId: ElectricalResistanceCategory,
183 id: Picoohms,
184 multiplier: 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(unit: UnitPrivate::makeUnit(categoryId: ElectricalResistanceCategory,
193 id: Femtoohms,
194 multiplier: 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(unit: UnitPrivate::makeUnit(categoryId: ElectricalResistanceCategory,
203 id: Attoohms,
204 multiplier: 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(unit: UnitPrivate::makeUnit(categoryId: ElectricalResistanceCategory,
213 id: Zeptoohms,
214 multiplier: 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(unit: UnitPrivate::makeUnit(categoryId: ElectricalResistanceCategory,
223 id: Yoctoohms,
224 multiplier: 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
236

source code of kunitconversion/src/electrical_resistance.cpp