KUnitConversion

pressure.cpp
1/*
2 * SPDX-FileCopyrightText: 2009 Petri Damstén <damu@iki.fi>
3 * SPDX-FileCopyrightText: 2014 John Layt <jlayt@kde.org>
4 *
5 * SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7
8#include "pressure_p.h"
9#include "unit_p.h"
10
11#include <KLocalizedString>
12
13namespace KUnitConversion
14{
15UnitCategory Pressure::makeCategory()
16{
17 auto c = UnitCategoryPrivate::makeCategory(PressureCategory, i18n("Pressure"), i18n("Pressure"));
18 auto d = UnitCategoryPrivate::get(c);
19 KLocalizedString symbolString = ki18nc("%1 value, %2 unit symbol (pressure)", "%1 %2");
20
21 d->addUnit(UnitPrivate::makeUnit(PressureCategory,
22 Yottapascal,
23 1e+24,
24 i18nc("pressure unit symbol", "YPa"),
25 i18nc("unit description in lists", "yottapascals"),
26 i18nc("unit synonyms for matching user input", "yottapascal;yottapascals;YPa"),
27 symbolString,
28 ki18nc("amount in units (real)", "%1 yottapascals"),
29 ki18ncp("amount in units (integer)", "%1 yottapascal", "%1 yottapascals")));
30
31 d->addUnit(UnitPrivate::makeUnit(PressureCategory,
32 Zettapascal,
33 1e+21,
34 i18nc("pressure unit symbol", "ZPa"),
35 i18nc("unit description in lists", "zettapascals"),
36 i18nc("unit synonyms for matching user input", "zettapascal;zettapascals;ZPa"),
37 symbolString,
38 ki18nc("amount in units (real)", "%1 zettapascals"),
39 ki18ncp("amount in units (integer)", "%1 zettapascal", "%1 zettapascals")));
40
41 d->addUnit(UnitPrivate::makeUnit(PressureCategory,
42 Exapascal,
43 1e+18,
44 i18nc("pressure unit symbol", "EPa"),
45 i18nc("unit description in lists", "exapascals"),
46 i18nc("unit synonyms for matching user input", "exapascal;exapascals;EPa"),
47 symbolString,
48 ki18nc("amount in units (real)", "%1 exapascals"),
49 ki18ncp("amount in units (integer)", "%1 exapascal", "%1 exapascals")));
50
51 d->addUnit(UnitPrivate::makeUnit(PressureCategory,
52 Petapascal,
53 1e+15,
54 i18nc("pressure unit symbol", "PPa"),
55 i18nc("unit description in lists", "petapascals"),
56 i18nc("unit synonyms for matching user input", "petapascal;petapascals;PPa"),
57 symbolString,
58 ki18nc("amount in units (real)", "%1 petapascals"),
59 ki18ncp("amount in units (integer)", "%1 petapascal", "%1 petapascals")));
60
61 d->addUnit(UnitPrivate::makeUnit(PressureCategory,
62 Terapascal,
63 1e+12,
64 i18nc("pressure unit symbol", "TPa"),
65 i18nc("unit description in lists", "terapascals"),
66 i18nc("unit synonyms for matching user input", "terapascal;terapascals;TPa"),
67 symbolString,
68 ki18nc("amount in units (real)", "%1 terapascals"),
69 ki18ncp("amount in units (integer)", "%1 terapascal", "%1 terapascals")));
70
71 d->addUnit(UnitPrivate::makeUnit(PressureCategory,
72 Gigapascal,
73 1e+09,
74 i18nc("pressure unit symbol", "GPa"),
75 i18nc("unit description in lists", "gigapascals"),
76 i18nc("unit synonyms for matching user input", "gigapascal;gigapascals;GPa"),
77 symbolString,
78 ki18nc("amount in units (real)", "%1 gigapascals"),
79 ki18ncp("amount in units (integer)", "%1 gigapascal", "%1 gigapascals")));
80
81 d->addCommonUnit(UnitPrivate::makeUnit(PressureCategory,
82 Megapascal,
83 1e+06,
84 i18nc("pressure unit symbol", "MPa"),
85 i18nc("unit description in lists", "megapascals"),
86 i18nc("unit synonyms for matching user input", "megapascal;megapascals;MPa"),
87 symbolString,
88 ki18nc("amount in units (real)", "%1 megapascals"),
89 ki18ncp("amount in units (integer)", "%1 megapascal", "%1 megapascals")));
90
91 d->addUnit(UnitPrivate::makeUnit(PressureCategory,
92 Kilopascal,
93 1000,
94 i18nc("pressure unit symbol", "kPa"),
95 i18nc("unit description in lists", "kilopascals"),
96 i18nc("unit synonyms for matching user input", "kilopascal;kilopascals;kPa"),
97 symbolString,
98 ki18nc("amount in units (real)", "%1 kilopascals"),
99 ki18ncp("amount in units (integer)", "%1 kilopascal", "%1 kilopascals")));
100
101 d->addCommonUnit(UnitPrivate::makeUnit(PressureCategory,
102 Hectopascal,
103 100,
104 i18nc("pressure unit symbol", "hPa"),
105 i18nc("unit description in lists", "hectopascals"),
106 i18nc("unit synonyms for matching user input", "hectopascal;hectopascals;hPa"),
107 symbolString,
108 ki18nc("amount in units (real)", "%1 hectopascals"),
109 ki18ncp("amount in units (integer)", "%1 hectopascal", "%1 hectopascals")));
110
111 d->addUnit(UnitPrivate::makeUnit(PressureCategory,
112 Decapascal,
113 10,
114 i18nc("pressure unit symbol", "daPa"),
115 i18nc("unit description in lists", "decapascals"),
116 i18nc("unit synonyms for matching user input", "decapascal;decapascals;daPa"),
117 symbolString,
118 ki18nc("amount in units (real)", "%1 decapascals"),
119 ki18ncp("amount in units (integer)", "%1 decapascal", "%1 decapascals")));
120
121 d->addDefaultUnit(UnitPrivate::makeUnit(PressureCategory,
122 Pascal,
123 1,
124 i18nc("pressure unit symbol", "Pa"),
125 i18nc("unit description in lists", "pascals"),
126 i18nc("unit synonyms for matching user input", "pascal;pascals;Pa"),
127 symbolString,
128 ki18nc("amount in units (real)", "%1 pascals"),
129 ki18ncp("amount in units (integer)", "%1 pascal", "%1 pascals")));
130
131 d->addUnit(UnitPrivate::makeUnit(PressureCategory,
132 Decipascal,
133 0.1,
134 i18nc("pressure unit symbol", "dPa"),
135 i18nc("unit description in lists", "decipascals"),
136 i18nc("unit synonyms for matching user input", "decipascal;decipascals;dPa"),
137 symbolString,
138 ki18nc("amount in units (real)", "%1 decipascals"),
139 ki18ncp("amount in units (integer)", "%1 decipascal", "%1 decipascals")));
140
141 d->addUnit(UnitPrivate::makeUnit(PressureCategory,
142 Centipascal,
143 0.01,
144 i18nc("pressure unit symbol", "cPa"),
145 i18nc("unit description in lists", "centipascals"),
146 i18nc("unit synonyms for matching user input", "centipascal;centipascals;cPa"),
147 symbolString,
148 ki18nc("amount in units (real)", "%1 centipascals"),
149 ki18ncp("amount in units (integer)", "%1 centipascal", "%1 centipascals")));
150
151 d->addUnit(UnitPrivate::makeUnit(PressureCategory,
152 Millipascal,
153 0.001,
154 i18nc("pressure unit symbol", "mPa"),
155 i18nc("unit description in lists", "millipascals"),
156 i18nc("unit synonyms for matching user input", "millipascal;millipascals;mPa"),
157 symbolString,
158 ki18nc("amount in units (real)", "%1 millipascals"),
159 ki18ncp("amount in units (integer)", "%1 millipascal", "%1 millipascals")));
160
161 d->addUnit(UnitPrivate::makeUnit(PressureCategory,
162 Micropascal,
163 1e-06,
164 i18nc("pressure unit symbol", "µPa"),
165 i18nc("unit description in lists", "micropascals"),
166 i18nc("unit synonyms for matching user input", "micropascal;micropascals;µPa;uPa"),
167 symbolString,
168 ki18nc("amount in units (real)", "%1 micropascals"),
169 ki18ncp("amount in units (integer)", "%1 micropascal", "%1 micropascals")));
170
171 d->addUnit(UnitPrivate::makeUnit(PressureCategory,
172 Nanopascal,
173 1e-09,
174 i18nc("pressure unit symbol", "nPa"),
175 i18nc("unit description in lists", "nanopascals"),
176 i18nc("unit synonyms for matching user input", "nanopascal;nanopascals;nPa"),
177 symbolString,
178 ki18nc("amount in units (real)", "%1 nanopascals"),
179 ki18ncp("amount in units (integer)", "%1 nanopascal", "%1 nanopascals")));
180
181 d->addUnit(UnitPrivate::makeUnit(PressureCategory,
182 Picopascal,
183 1e-12,
184 i18nc("pressure unit symbol", "pPa"),
185 i18nc("unit description in lists", "picopascals"),
186 i18nc("unit synonyms for matching user input", "picopascal;picopascals;pPa"),
187 symbolString,
188 ki18nc("amount in units (real)", "%1 picopascals"),
189 ki18ncp("amount in units (integer)", "%1 picopascal", "%1 picopascals")));
190
191 d->addUnit(UnitPrivate::makeUnit(PressureCategory,
192 Femtopascal,
193 1e-15,
194 i18nc("pressure unit symbol", "fPa"),
195 i18nc("unit description in lists", "femtopascals"),
196 i18nc("unit synonyms for matching user input", "femtopascal;femtopascals;fPa"),
197 symbolString,
198 ki18nc("amount in units (real)", "%1 femtopascals"),
199 ki18ncp("amount in units (integer)", "%1 femtopascal", "%1 femtopascals")));
200
201 d->addUnit(UnitPrivate::makeUnit(PressureCategory,
202 Attopascal,
203 1e-18,
204 i18nc("pressure unit symbol", "aPa"),
205 i18nc("unit description in lists", "attopascals"),
206 i18nc("unit synonyms for matching user input", "attopascal;attopascals;aPa"),
207 symbolString,
208 ki18nc("amount in units (real)", "%1 attopascals"),
209 ki18ncp("amount in units (integer)", "%1 attopascal", "%1 attopascals")));
210
211 d->addUnit(UnitPrivate::makeUnit(PressureCategory,
212 Zeptopascal,
213 1e-21,
214 i18nc("pressure unit symbol", "zPa"),
215 i18nc("unit description in lists", "zeptopascals"),
216 i18nc("unit synonyms for matching user input", "zeptopascal;zeptopascals;zPa"),
217 symbolString,
218 ki18nc("amount in units (real)", "%1 zeptopascals"),
219 ki18ncp("amount in units (integer)", "%1 zeptopascal", "%1 zeptopascals")));
220
221 d->addUnit(UnitPrivate::makeUnit(PressureCategory,
222 Yoctopascal,
223 1e-24,
224 i18nc("pressure unit symbol", "yPa"),
225 i18nc("unit description in lists", "yoctopascals"),
226 i18nc("unit synonyms for matching user input", "yoctopascal;yoctopascals;yPa"),
227 symbolString,
228 ki18nc("amount in units (real)", "%1 yoctopascals"),
229 ki18ncp("amount in units (integer)", "%1 yoctopascal", "%1 yoctopascals")));
230
231 d->addCommonUnit(UnitPrivate::makeUnit(PressureCategory,
232 Bar,
233 100000,
234 i18nc("pressure unit symbol", "bar"),
235 i18nc("unit description in lists", "bars"),
236 i18nc("unit synonyms for matching user input", "bar;bars;bar"),
237 symbolString,
238 ki18nc("amount in units (real)", "%1 bars"),
239 ki18ncp("amount in units (integer)", "%1 bar", "%1 bars")));
240
241 d->addUnit(UnitPrivate::makeUnit(PressureCategory,
242 Millibar,
243 100,
244 i18nc("pressure unit symbol", "mbar"),
245 i18nc("unit description in lists", "millibars"),
246 i18nc("unit synonyms for matching user input", "millibar;millibars;mbar;mb"),
247 symbolString,
248 ki18nc("amount in units (real)", "%1 millibars"),
249 ki18ncp("amount in units (integer)", "%1 millibar", "%1 millibars")));
250
251 d->addUnit(UnitPrivate::makeUnit(PressureCategory,
252 Decibar,
253 10000,
254 i18nc("pressure unit symbol", "dbar"),
255 i18nc("unit description in lists", "decibars"),
256 i18nc("unit synonyms for matching user input", "decibar;decibars;dbar"),
257 symbolString,
258 ki18nc("amount in units (real)", "%1 decibars"),
259 ki18ncp("amount in units (integer)", "%1 decibar", "%1 decibars")));
260
261 d->addUnit(UnitPrivate::makeUnit(PressureCategory,
262 Torr,
263 133.322,
264 i18nc("pressure unit symbol", "Torr"),
265 i18nc("unit description in lists", "Torr"),
266 i18nc("unit synonyms for matching user input", "Torr"),
267 symbolString,
268 ki18nc("amount in units (real)", "%1 torr"),
269 ki18ncp("amount in units (integer)", "%1 torr", "%1 torr")));
270
271 d->addUnit(UnitPrivate::makeUnit(PressureCategory,
272 TechnicalAtmosphere,
273 98066.5,
274 i18nc("pressure unit symbol", "at"),
275 i18nc("unit description in lists", "technical atmospheres"),
276 i18nc("unit synonyms for matching user input", "technical atmosphere;technical atmospheres;at"),
277 symbolString,
278 ki18nc("amount in units (real)", "%1 technical atmospheres"),
279 ki18ncp("amount in units (integer)", "%1 technical atmosphere", "%1 technical atmospheres")));
280
281 d->addCommonUnit(UnitPrivate::makeUnit(PressureCategory,
282 Atmosphere,
283 101325,
284 i18nc("pressure unit symbol", "atm"),
285 i18nc("unit description in lists", "atmospheres"),
286 i18nc("unit synonyms for matching user input", "atmosphere;atmospheres;atm"),
287 symbolString,
288 ki18nc("amount in units (real)", "%1 atmospheres"),
289 ki18ncp("amount in units (integer)", "%1 atmosphere", "%1 atmospheres")));
290
291 d->addCommonUnit(UnitPrivate::makeUnit(PressureCategory,
292 PoundForcePerSquareInch,
293 6894.76,
294 i18nc("pressure unit symbol", "psi"),
295 i18nc("unit description in lists", "pound-force per square inch"),
296 i18nc("unit synonyms for matching user input", "pound-force per square inch;pound-force per square inches;psi"),
297 symbolString,
298 ki18nc("amount in units (real)", "%1 pound-force per square inches"),
299 ki18ncp("amount in units (integer)", "%1 pound-force per square inch", "%1 pound-force per square inch")));
300
301 // http://en.wikipedia.org/wiki/InHg
302 d->addCommonUnit(UnitPrivate::makeUnit(PressureCategory,
303 InchesOfMercury,
304 3386.39,
305 i18nc("pressure unit symbol", "inHg"),
306 i18nc("unit description in lists", "inches of mercury"),
307 i18nc("unit synonyms for matching user input", "inch of mercury;inches of mercury;inHg;in\""),
308 symbolString,
309 ki18nc("amount in units (real)", "%1 inches of mercury"),
310 ki18ncp("amount in units (integer)", "%1 inches of mercury", "%1 inches of mercury")));
311
312 // http://en.wikipedia.org/wiki/MmHg#mmHg
313 d->addUnit(UnitPrivate::makeUnit(PressureCategory,
314 MillimetersOfMercury,
315 133.322,
316 i18nc("pressure unit symbol", "mmHg"),
317 i18nc("unit description in lists", "millimeters of mercury"),
318 i18nc("unit synonyms for matching user input", "millimeter of mercury;millimeters of mercury;mmHg"),
319 symbolString,
320 ki18nc("amount in units (real)", "%1 millimeters of mercury"),
321 ki18ncp("amount in units (integer)", "%1 millimeters of mercury", "%1 millimeters of mercury")));
322
323 return c;
324}
325
326} // 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.