KUnitConversion
pressure.cpp
Go to the documentation of this file.
00001 /* 00002 * Copyright (C) 2009 Petri Damstén <damu@iki.fi> 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU Library General Public License as 00006 * published by the Free Software Foundation; either version 2, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details 00013 * 00014 * You should have received a copy of the GNU Library General Public 00015 * License along with this program; if not, write to the 00016 * Free Software Foundation, Inc., 00017 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #include "pressure.h" 00021 #include "converter.h" 00022 #include <klocale.h> 00023 00024 using namespace KUnitConversion; 00025 00026 Pressure::Pressure() : UnitCategory(PressureCategory) 00027 { 00028 setName(i18n("Pressure")); 00029 setSymbolStringFormat(ki18nc("%1 value, %2 unit symbol (pressure)", "%1 %2")); 00030 00031 U(Yottapascal, 1e+24, 00032 i18nc("pressure unit symbol", "YPa"), 00033 i18nc("unit description in lists", "yottapascals"), 00034 i18nc("unit synonyms for matching user input", "yottapascal;yottapascals;YPa"), 00035 ki18nc("amount in units (real)", "%1 yottapascals"), 00036 ki18ncp("amount in units (integer)", "%1 yottapascal", "%1 yottapascals") 00037 ); 00038 U(Zettapascal, 1e+21, 00039 i18nc("pressure unit symbol", "ZPa"), 00040 i18nc("unit description in lists", "zettapascals"), 00041 i18nc("unit synonyms for matching user input", "zettapascal;zettapascals;ZPa"), 00042 ki18nc("amount in units (real)", "%1 zettapascals"), 00043 ki18ncp("amount in units (integer)", "%1 zettapascal", "%1 zettapascals") 00044 ); 00045 U(Exapascal, 1e+18, 00046 i18nc("pressure unit symbol", "EPa"), 00047 i18nc("unit description in lists", "exapascals"), 00048 i18nc("unit synonyms for matching user input", "exapascal;exapascals;EPa"), 00049 ki18nc("amount in units (real)", "%1 exapascals"), 00050 ki18ncp("amount in units (integer)", "%1 exapascal", "%1 exapascals") 00051 ); 00052 U(Petapascal, 1e+15, 00053 i18nc("pressure unit symbol", "PPa"), 00054 i18nc("unit description in lists", "petapascals"), 00055 i18nc("unit synonyms for matching user input", "petapascal;petapascals;PPa"), 00056 ki18nc("amount in units (real)", "%1 petapascals"), 00057 ki18ncp("amount in units (integer)", "%1 petapascal", "%1 petapascals") 00058 ); 00059 U(Terapascal, 1e+12, 00060 i18nc("pressure unit symbol", "TPa"), 00061 i18nc("unit description in lists", "terapascals"), 00062 i18nc("unit synonyms for matching user input", "terapascal;terapascals;TPa"), 00063 ki18nc("amount in units (real)", "%1 terapascals"), 00064 ki18ncp("amount in units (integer)", "%1 terapascal", "%1 terapascals") 00065 ); 00066 U(Gigapascal, 1e+09, 00067 i18nc("pressure unit symbol", "GPa"), 00068 i18nc("unit description in lists", "gigapascals"), 00069 i18nc("unit synonyms for matching user input", "gigapascal;gigapascals;GPa"), 00070 ki18nc("amount in units (real)", "%1 gigapascals"), 00071 ki18ncp("amount in units (integer)", "%1 gigapascal", "%1 gigapascals") 00072 ); 00073 U(Megapascal, 1e+06, 00074 i18nc("pressure unit symbol", "MPa"), 00075 i18nc("unit description in lists", "megapascals"), 00076 i18nc("unit synonyms for matching user input", "megapascal;megapascals;MPa"), 00077 ki18nc("amount in units (real)", "%1 megapascals"), 00078 ki18ncp("amount in units (integer)", "%1 megapascal", "%1 megapascals") 00079 ); 00080 U(Kilopascal, 1000, 00081 i18nc("pressure unit symbol", "kPa"), 00082 i18nc("unit description in lists", "kilopascals"), 00083 i18nc("unit synonyms for matching user input", "kilopascal;kilopascals;kPa"), 00084 ki18nc("amount in units (real)", "%1 kilopascals"), 00085 ki18ncp("amount in units (integer)", "%1 kilopascal", "%1 kilopascals") 00086 ); 00087 U(Hectopascal, 100, 00088 i18nc("pressure unit symbol", "hPa"), 00089 i18nc("unit description in lists", "hectopascals"), 00090 i18nc("unit synonyms for matching user input", "hectopascal;hectopascals;hPa"), 00091 ki18nc("amount in units (real)", "%1 hectopascals"), 00092 ki18ncp("amount in units (integer)", "%1 hectopascal", "%1 hectopascals") 00093 ); 00094 U(Decapascal, 10, 00095 i18nc("pressure unit symbol", "daPa"), 00096 i18nc("unit description in lists", "decapascals"), 00097 i18nc("unit synonyms for matching user input", "decapascal;decapascals;daPa"), 00098 ki18nc("amount in units (real)", "%1 decapascals"), 00099 ki18ncp("amount in units (integer)", "%1 decapascal", "%1 decapascals") 00100 ); 00101 setDefaultUnit(UP(Pascal, 1, 00102 i18nc("pressure unit symbol", "Pa"), 00103 i18nc("unit description in lists", "pascals"), 00104 i18nc("unit synonyms for matching user input", "pascal;pascals;Pa"), 00105 ki18nc("amount in units (real)", "%1 pascals"), 00106 ki18ncp("amount in units (integer)", "%1 pascal", "%1 pascals") 00107 )); 00108 U(Decipascal, 0.1, 00109 i18nc("pressure unit symbol", "dPa"), 00110 i18nc("unit description in lists", "decipascals"), 00111 i18nc("unit synonyms for matching user input", "decipascal;decipascals;dPa"), 00112 ki18nc("amount in units (real)", "%1 decipascals"), 00113 ki18ncp("amount in units (integer)", "%1 decipascal", "%1 decipascals") 00114 ); 00115 U(Centipascal, 0.01, 00116 i18nc("pressure unit symbol", "cPa"), 00117 i18nc("unit description in lists", "centipascals"), 00118 i18nc("unit synonyms for matching user input", "centipascal;centipascals;cPa"), 00119 ki18nc("amount in units (real)", "%1 centipascals"), 00120 ki18ncp("amount in units (integer)", "%1 centipascal", "%1 centipascals") 00121 ); 00122 U(Millipascal, 0.001, 00123 i18nc("pressure unit symbol", "mPa"), 00124 i18nc("unit description in lists", "millipascals"), 00125 i18nc("unit synonyms for matching user input", "millipascal;millipascals;mPa"), 00126 ki18nc("amount in units (real)", "%1 millipascals"), 00127 ki18ncp("amount in units (integer)", "%1 millipascal", "%1 millipascals") 00128 ); 00129 U(Micropascal, 1e-06, 00130 i18nc("pressure unit symbol", "µPa"), 00131 i18nc("unit description in lists", "micropascals"), 00132 i18nc("unit synonyms for matching user input", "micropascal;micropascals;µPa;uPa"), 00133 ki18nc("amount in units (real)", "%1 micropascals"), 00134 ki18ncp("amount in units (integer)", "%1 micropascal", "%1 micropascals") 00135 ); 00136 U(Nanopascal, 1e-09, 00137 i18nc("pressure unit symbol", "nPa"), 00138 i18nc("unit description in lists", "nanopascals"), 00139 i18nc("unit synonyms for matching user input", "nanopascal;nanopascals;nPa"), 00140 ki18nc("amount in units (real)", "%1 nanopascals"), 00141 ki18ncp("amount in units (integer)", "%1 nanopascal", "%1 nanopascals") 00142 ); 00143 U(Picopascal, 1e-12, 00144 i18nc("pressure unit symbol", "pPa"), 00145 i18nc("unit description in lists", "picopascals"), 00146 i18nc("unit synonyms for matching user input", "picopascal;picopascals;pPa"), 00147 ki18nc("amount in units (real)", "%1 picopascals"), 00148 ki18ncp("amount in units (integer)", "%1 picopascal", "%1 picopascals") 00149 ); 00150 U(Femtopascal, 1e-15, 00151 i18nc("pressure unit symbol", "fPa"), 00152 i18nc("unit description in lists", "femtopascals"), 00153 i18nc("unit synonyms for matching user input", "femtopascal;femtopascals;fPa"), 00154 ki18nc("amount in units (real)", "%1 femtopascals"), 00155 ki18ncp("amount in units (integer)", "%1 femtopascal", "%1 femtopascals") 00156 ); 00157 U(Attopascal, 1e-18, 00158 i18nc("pressure unit symbol", "aPa"), 00159 i18nc("unit description in lists", "attopascals"), 00160 i18nc("unit synonyms for matching user input", "attopascal;attopascals;aPa"), 00161 ki18nc("amount in units (real)", "%1 attopascals"), 00162 ki18ncp("amount in units (integer)", "%1 attopascal", "%1 attopascals") 00163 ); 00164 U(Zeptopascal, 1e-21, 00165 i18nc("pressure unit symbol", "zPa"), 00166 i18nc("unit description in lists", "zeptopascals"), 00167 i18nc("unit synonyms for matching user input", "zeptopascal;zeptopascals;zPa"), 00168 ki18nc("amount in units (real)", "%1 zeptopascals"), 00169 ki18ncp("amount in units (integer)", "%1 zeptopascal", "%1 zeptopascals") 00170 ); 00171 U(Yoctopascal, 1e-24, 00172 i18nc("pressure unit symbol", "yPa"), 00173 i18nc("unit description in lists", "yoctopascals"), 00174 i18nc("unit synonyms for matching user input", "yoctopascal;yoctopascals;yPa"), 00175 ki18nc("amount in units (real)", "%1 yoctopascals"), 00176 ki18ncp("amount in units (integer)", "%1 yoctopascal", "%1 yoctopascals") 00177 ); 00178 U(Bar, 100000, 00179 i18nc("pressure unit symbol", "bar"), 00180 i18nc("unit description in lists", "bars"), 00181 i18nc("unit synonyms for matching user input", "bar;bars;bar"), 00182 ki18nc("amount in units (real)", "%1 bars"), 00183 ki18ncp("amount in units (integer)", "%1 bar", "%1 bars") 00184 ); 00185 U(Millibar, 100, 00186 i18nc("pressure unit symbol", "mbar"), 00187 i18nc("unit description in lists", "millibars"), 00188 i18nc("unit synonyms for matching user input", "millibar;millibars;mbar;mb"), 00189 ki18nc("amount in units (real)", "%1 millibars"), 00190 ki18ncp("amount in units (integer)", "%1 millibar", "%1 millibars") 00191 ); 00192 U(Decibar, 10000, 00193 i18nc("pressure unit symbol", "dbar"), 00194 i18nc("unit description in lists", "decibars"), 00195 i18nc("unit synonyms for matching user input", "decibar;decibars;dbar"), 00196 ki18nc("amount in units (real)", "%1 decibars"), 00197 ki18ncp("amount in units (integer)", "%1 decibar", "%1 decibars") 00198 ); 00199 U(Torr, 133.322, 00200 i18nc("pressure unit symbol", "Torr"), 00201 i18nc("unit description in lists", "Torr"), 00202 i18nc("unit synonyms for matching user input", "Torr"), 00203 ki18nc("amount in units (real)", "%1 torr"), 00204 ki18ncp("amount in units (integer)", "%1 torr", "%1 torr") 00205 ); 00206 U(TechnicalAtmosphere, 98066.5, 00207 i18nc("pressure unit symbol", "at"), 00208 i18nc("unit description in lists", "technical atmospheres"), 00209 i18nc("unit synonyms for matching user input", 00210 "technical atmosphere;technical atmospheres;at"), 00211 ki18nc("amount in units (real)", "%1 technical atmospheres"), 00212 ki18ncp("amount in units (integer)", "%1 technical atmosphere", "%1 technical atmospheres") 00213 ); 00214 U(Atmosphere, 101325, 00215 i18nc("pressure unit symbol", "atm"), 00216 i18nc("unit description in lists", "atmospheres"), 00217 i18nc("unit synonyms for matching user input", "atmosphere;atmospheres;atm"), 00218 ki18nc("amount in units (real)", "%1 atmospheres"), 00219 ki18ncp("amount in units (integer)", "%1 atmosphere", "%1 atmospheres") 00220 ); 00221 U(PoundForcePerSquareInch, 6894.76, 00222 i18nc("pressure unit symbol", "psi"), 00223 i18nc("unit description in lists", "pound-force per square inch"), 00224 i18nc("unit synonyms for matching user input", 00225 "pound-force per square inch;pound-force per square inches;psi"), 00226 ki18nc("amount in units (real)", "%1 pound-force per square inches"), 00227 ki18ncp("amount in units (integer)", 00228 "%1 pound-force per square inch", "%1 pound-force per square inch") 00229 ); 00230 // http://en.wikipedia.org/wiki/InHg 00231 U(InchesOfMercury, 3386.39, 00232 i18nc("pressure unit symbol", "inHg"), 00233 i18nc("unit description in lists", "inches of mercury"), 00234 i18nc("unit synonyms for matching user input", 00235 "inch of mercury;inches of mercury;inHg;in\""), 00236 ki18nc("amount in units (real)", "%1 inches of mercury"), 00237 ki18ncp("amount in units (integer)", "%1 inches of mercury", "%1 inches of mercury") 00238 ); 00239 // http://en.wikipedia.org/wiki/MmHg#mmHg 00240 U(MillimetersOfMercury, 133.322, 00241 i18nc("pressure unit symbol", "mmHg"), 00242 i18nc("unit description in lists", "millimeters of mercury"), 00243 i18nc("unit synonyms for matching user input", 00244 "millimeter of mercury;millimeters of mercury;mmHg"), 00245 ki18nc("amount in units (real)", "%1 millimeters of mercury"), 00246 ki18ncp("amount in units (integer)", "%1 millimeters of mercury", "%1 millimeters of mercury") 00247 ); 00248 00249 setMostCommonUnits(QList<int>() << 00250 Hectopascal << Pascal << Bar << Atmosphere << InchesOfMercury); 00251 }
KDE 4.6 API Reference