KUnitConversion
force.cpp
Go to the documentation of this file.
00001 /* 00002 * Copyright (C) 2010 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 "force.h" 00021 #include "converter.h" 00022 #include <klocale.h> 00023 00024 using namespace KUnitConversion; 00025 00026 Force::Force() : UnitCategory(ForceCategory) 00027 { 00028 setName(i18n("Force")); 00029 setSymbolStringFormat(ki18nc("%1 value, %2 unit symbol (force", "%1 %2")); 00030 00031 U(Yottanewton, 1e+24, 00032 i18nc("force unit symbol", "YN"), 00033 i18nc("unit description in lists", "yottanewtons"), 00034 i18nc("unit synonyms for matching user input", "yottanewton;yottanewtons;YN"), 00035 ki18nc("amount in units (real)", "%1 yottanewtons"), 00036 ki18ncp("amount in units (integer)", "%1 yottanewton", "%1 yottanewtons") 00037 ); 00038 U(Zettanewton, 1e+21, 00039 i18nc("force unit symbol", "ZN"), 00040 i18nc("unit description in lists", "zettanewtons"), 00041 i18nc("unit synonyms for matching user input", "zettanewton;zettanewtons;ZN"), 00042 ki18nc("amount in units (real)", "%1 zettanewtons"), 00043 ki18ncp("amount in units (integer)", "%1 zettanewton", "%1 zettanewtons") 00044 ); 00045 U(Exanewton, 1e+18, 00046 i18nc("force unit symbol", "EN"), 00047 i18nc("unit description in lists", "exanewtons"), 00048 i18nc("unit synonyms for matching user input", "exanewton;exanewtons;EN"), 00049 ki18nc("amount in units (real)", "%1 exanewtons"), 00050 ki18ncp("amount in units (integer)", "%1 exanewton", "%1 exanewtons") 00051 ); 00052 U(Petanewton, 1e+15, 00053 i18nc("force unit symbol", "PN"), 00054 i18nc("unit description in lists", "petanewtons"), 00055 i18nc("unit synonyms for matching user input", "petanewton;petanewtons;PN"), 00056 ki18nc("amount in units (real)", "%1 petanewtons"), 00057 ki18ncp("amount in units (integer)", "%1 petanewton", "%1 petanewtons") 00058 ); 00059 U(Teranewton, 1e+12, 00060 i18nc("force unit symbol", "TN"), 00061 i18nc("unit description in lists", "teranewtons"), 00062 i18nc("unit synonyms for matching user input", "teranewton;teranewtons;TN"), 00063 ki18nc("amount in units (real)", "%1 teranewtons"), 00064 ki18ncp("amount in units (integer)", "%1 teranewton", "%1 teranewtons") 00065 ); 00066 U(Giganewton, 1e+09, 00067 i18nc("force unit symbol", "GN"), 00068 i18nc("unit description in lists", "giganewtons"), 00069 i18nc("unit synonyms for matching user input", "giganewton;giganewtons;GN"), 00070 ki18nc("amount in units (real)", "%1 giganewtons"), 00071 ki18ncp("amount in units (integer)", "%1 giganewton", "%1 giganewtons") 00072 ); 00073 U(Meganewton, 1e+06, 00074 i18nc("force unit symbol", "MN"), 00075 i18nc("unit description in lists", "meganewtons"), 00076 i18nc("unit synonyms for matching user input", "meganewton;meganewtons;MN"), 00077 ki18nc("amount in units (real)", "%1 meganewtons"), 00078 ki18ncp("amount in units (integer)", "%1 meganewton", "%1 meganewtons") 00079 ); 00080 U(KilonewtonForce, 1000, 00081 i18nc("force unit symbol", "kN"), 00082 i18nc("unit description in lists", "kilonewtons"), 00083 i18nc("unit synonyms for matching user input", "kilonewton;kilonewtons;kN"), 00084 ki18nc("amount in units (real)", "%1 kilonewtons"), 00085 ki18ncp("amount in units (integer)", "%1 kilonewton", "%1 kilonewtons") 00086 ); 00087 U(Hectonewton, 100, 00088 i18nc("force unit symbol", "hN"), 00089 i18nc("unit description in lists", "hectonewtons"), 00090 i18nc("unit synonyms for matching user input", "hectonewton;hectonewtons;hN"), 00091 ki18nc("amount in units (real)", "%1 hectonewtons"), 00092 ki18ncp("amount in units (integer)", "%1 hectonewton", "%1 hectonewtons") 00093 ); 00094 U(Decanewton, 10, 00095 i18nc("force unit symbol", "daN"), 00096 i18nc("unit description in lists", "decanewtons"), 00097 i18nc("unit synonyms for matching user input", "decanewton;decanewtons;daN"), 00098 ki18nc("amount in units (real)", "%1 decanewtons"), 00099 ki18ncp("amount in units (integer)", "%1 decanewton", "%1 decanewtons") 00100 ); 00101 setDefaultUnit(UP(Newton, 1, 00102 i18nc("force unit symbol", "N"), 00103 i18nc("unit description in lists", "newtons"), 00104 i18nc("unit synonyms for matching user input", "newton;newtons;N"), 00105 ki18nc("amount in units (real)", "%1 newtons"), 00106 ki18ncp("amount in units (integer)", "%1 newton", "%1 newtons") 00107 )); 00108 U(Decinewton, 0.1, 00109 i18nc("force unit symbol", "dN"), 00110 i18nc("unit description in lists", "decinewtons"), 00111 i18nc("unit synonyms for matching user input", "decinewton;decinewtons;dN"), 00112 ki18nc("amount in units (real)", "%1 decinewtons"), 00113 ki18ncp("amount in units (integer)", "%1 decinewton", "%1 decinewtons") 00114 ); 00115 U(Centinewton, 0.01, 00116 i18nc("force unit symbol", "cN"), 00117 i18nc("unit description in lists", "centinewtons"), 00118 i18nc("unit synonyms for matching user input", "centinewton;centinewtons;cN"), 00119 ki18nc("amount in units (real)", "%1 centinewtons"), 00120 ki18ncp("amount in units (integer)", "%1 centinewton", "%1 centinewtons") 00121 ); 00122 U(Millinewton, 0.001, 00123 i18nc("force unit symbol", "mN"), 00124 i18nc("unit description in lists", "millinewtons"), 00125 i18nc("unit synonyms for matching user input", "millinewton;millinewtons;mN"), 00126 ki18nc("amount in units (real)", "%1 millinewtons"), 00127 ki18ncp("amount in units (integer)", "%1 millinewton", "%1 millinewtons") 00128 ); 00129 U(Micronewton, 1e-06, 00130 i18nc("force unit symbol", "µN"), 00131 i18nc("unit description in lists", "micronewtons"), 00132 i18nc("unit synonyms for matching user input", "micronewton;micronewtons;µm;uN"), 00133 ki18nc("amount in units (real)", "%1 micronewtons"), 00134 ki18ncp("amount in units (integer)", "%1 micronewton", "%1 micronewtons") 00135 ); 00136 U(Nanonewton, 1e-09, 00137 i18nc("force unit symbol", "nN"), 00138 i18nc("unit description in lists", "nanonewtons"), 00139 i18nc("unit synonyms for matching user input", "nanonewton;nanonewtons;nN"), 00140 ki18nc("amount in units (real)", "%1 nanonewtons"), 00141 ki18ncp("amount in units (integer)", "%1 nanonewton", "%1 nanonewtons") 00142 ); 00143 U(Piconewton, 1e-12, 00144 i18nc("force unit symbol", "pN"), 00145 i18nc("unit description in lists", "piconewtons"), 00146 i18nc("unit synonyms for matching user input", "piconewton;piconewtons;pN"), 00147 ki18nc("amount in units (real)", "%1 piconewtons"), 00148 ki18ncp("amount in units (integer)", "%1 piconewton", "%1 piconewtons") 00149 ); 00150 U(Femtonewton, 1e-15, 00151 i18nc("force unit symbol", "fN"), 00152 i18nc("unit description in lists", "femtonewtons"), 00153 i18nc("unit synonyms for matching user input", "femtonewton;femtonewtons;fN"), 00154 ki18nc("amount in units (real)", "%1 femtonewtons"), 00155 ki18ncp("amount in units (integer)", "%1 femtonewton", "%1 femtonewtons") 00156 ); 00157 U(Attonewton, 1e-18, 00158 i18nc("force unit symbol", "aN"), 00159 i18nc("unit description in lists", "attonewtons"), 00160 i18nc("unit synonyms for matching user input", "attonewton;attonewtons;aN"), 00161 ki18nc("amount in units (real)", "%1 attonewtons"), 00162 ki18ncp("amount in units (integer)", "%1 attonewton", "%1 attonewtons") 00163 ); 00164 U(Zeptonewton, 1e-21, 00165 i18nc("force unit symbol", "zN"), 00166 i18nc("unit description in lists", "zeptonewtons"), 00167 i18nc("unit synonyms for matching user input", "zeptonewton;zeptonewtons;zN"), 00168 ki18nc("amount in units (real)", "%1 zeptonewtons"), 00169 ki18ncp("amount in units (integer)", "%1 zeptonewton", "%1 zeptonewtons") 00170 ); 00171 U(Yoctonewton, 1e-24, 00172 i18nc("force unit symbol", "yN"), 00173 i18nc("unit description in lists", "yoctonewtons"), 00174 i18nc("unit synonyms for matching user input", "yoctonewton;yoctonewtons;yN"), 00175 ki18nc("amount in units (real)", "%1 yoctonewtons"), 00176 ki18ncp("amount in units (integer)", "%1 yoctonewton", "%1 yoctonewtons") 00177 ); 00178 00179 // http://en.wikipedia.org/wiki/Force#Units_of_measurement 00180 U(Dyne, 0.0001, 00181 i18nc("force unit symbol", "dyn"), 00182 i18nc("unit description in lists", "dynes"), 00183 i18nc("unit synonyms for matching user input", "dyne;dynes;dyn"), 00184 ki18nc("amount in units (real)", "%1 dynes"), 00185 ki18ncp("amount in units (integer)", "%1 dyne", "%1 dynes") 00186 ); 00187 U(Kilopond, 9.80665, 00188 i18nc("force unit symbol", "kp"), 00189 i18nc("unit description in lists", "kiloponds"), 00190 i18nc("unit synonyms for matching user input", "kilogram-force;kilopond;kiloponds;kp"), 00191 ki18nc("amount in units (real)", "%1 kiloponds"), 00192 ki18ncp("amount in units (integer)", "%1 kilopond", "%1 kiloponds") 00193 ); 00194 U(PoundForce, 4.448222, 00195 i18nc("force unit symbol", "lbf"), 00196 i18nc("unit description in lists", "pound-force"), 00197 i18nc("unit synonyms for matching user input", "pound-force;lbf"), 00198 ki18nc("amount in units (real)", "%1 pound-force"), 00199 ki18ncp("amount in units (integer)", "%1 pound-force", "%1 pound-force") 00200 ); 00201 U(Poundal, 0.138255, 00202 i18nc("force unit symbol", "pdl"), 00203 i18nc("unit description in lists", "poundals"), 00204 i18nc("unit synonyms for matching user input", "poundal;poundals;pdl"), 00205 ki18nc("amount in units (real)", "%1 poundals"), 00206 ki18ncp("amount in units (integer)", "%1 poundal", "%1 poundals") 00207 ); 00208 00209 setMostCommonUnits(QList<int>() << KilonewtonForce << Newton); 00210 } 00211
KDE 4.6 API Reference