| 1 | /* |
| 2 | * SPDX-FileCopyrightText: 2010 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 "force_p.h" |
| 9 | #include "unit_p.h" |
| 10 | |
| 11 | #include <KLocalizedString> |
| 12 | |
| 13 | namespace KUnitConversion |
| 14 | { |
| 15 | UnitCategory Force::makeCategory() |
| 16 | { |
| 17 | auto c = UnitCategoryPrivate::makeCategory(id: ForceCategory, i18n("Force" ), i18n("Force" )); |
| 18 | auto d = UnitCategoryPrivate::get(category: c); |
| 19 | KLocalizedString symbolString = ki18nc("%1 value, %2 unit symbol (force" , "%1 %2" ); |
| 20 | |
| 21 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ForceCategory, |
| 22 | id: Yottanewton, |
| 23 | multiplier: 1e+24, |
| 24 | i18nc("force unit symbol" , "YN" ), |
| 25 | i18nc("unit description in lists" , "yottanewtons" ), |
| 26 | i18nc("unit synonyms for matching user input" , "yottanewton;yottanewtons;YN" ), |
| 27 | symbolString, |
| 28 | ki18nc("amount in units (real)" , "%1 yottanewtons" ), |
| 29 | ki18ncp("amount in units (integer)" , "%1 yottanewton" , "%1 yottanewtons" ))); |
| 30 | |
| 31 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ForceCategory, |
| 32 | id: Zettanewton, |
| 33 | multiplier: 1e+21, |
| 34 | i18nc("force unit symbol" , "ZN" ), |
| 35 | i18nc("unit description in lists" , "zettanewtons" ), |
| 36 | i18nc("unit synonyms for matching user input" , "zettanewton;zettanewtons;ZN" ), |
| 37 | symbolString, |
| 38 | ki18nc("amount in units (real)" , "%1 zettanewtons" ), |
| 39 | ki18ncp("amount in units (integer)" , "%1 zettanewton" , "%1 zettanewtons" ))); |
| 40 | |
| 41 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ForceCategory, |
| 42 | id: Exanewton, |
| 43 | multiplier: 1e+18, |
| 44 | i18nc("force unit symbol" , "EN" ), |
| 45 | i18nc("unit description in lists" , "exanewtons" ), |
| 46 | i18nc("unit synonyms for matching user input" , "exanewton;exanewtons;EN" ), |
| 47 | symbolString, |
| 48 | ki18nc("amount in units (real)" , "%1 exanewtons" ), |
| 49 | ki18ncp("amount in units (integer)" , "%1 exanewton" , "%1 exanewtons" ))); |
| 50 | |
| 51 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ForceCategory, |
| 52 | id: Petanewton, |
| 53 | multiplier: 1e+15, |
| 54 | i18nc("force unit symbol" , "PN" ), |
| 55 | i18nc("unit description in lists" , "petanewtons" ), |
| 56 | i18nc("unit synonyms for matching user input" , "petanewton;petanewtons;PN" ), |
| 57 | symbolString, |
| 58 | ki18nc("amount in units (real)" , "%1 petanewtons" ), |
| 59 | ki18ncp("amount in units (integer)" , "%1 petanewton" , "%1 petanewtons" ))); |
| 60 | |
| 61 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ForceCategory, |
| 62 | id: Teranewton, |
| 63 | multiplier: 1e+12, |
| 64 | i18nc("force unit symbol" , "TN" ), |
| 65 | i18nc("unit description in lists" , "teranewtons" ), |
| 66 | i18nc("unit synonyms for matching user input" , "teranewton;teranewtons;TN" ), |
| 67 | symbolString, |
| 68 | ki18nc("amount in units (real)" , "%1 teranewtons" ), |
| 69 | ki18ncp("amount in units (integer)" , "%1 teranewton" , "%1 teranewtons" ))); |
| 70 | |
| 71 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ForceCategory, |
| 72 | id: Giganewton, |
| 73 | multiplier: 1e+09, |
| 74 | i18nc("force unit symbol" , "GN" ), |
| 75 | i18nc("unit description in lists" , "giganewtons" ), |
| 76 | i18nc("unit synonyms for matching user input" , "giganewton;giganewtons;GN" ), |
| 77 | symbolString, |
| 78 | ki18nc("amount in units (real)" , "%1 giganewtons" ), |
| 79 | ki18ncp("amount in units (integer)" , "%1 giganewton" , "%1 giganewtons" ))); |
| 80 | |
| 81 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ForceCategory, |
| 82 | id: Meganewton, |
| 83 | multiplier: 1e+06, |
| 84 | i18nc("force unit symbol" , "MN" ), |
| 85 | i18nc("unit description in lists" , "meganewtons" ), |
| 86 | i18nc("unit synonyms for matching user input" , "meganewton;meganewtons;MN" ), |
| 87 | symbolString, |
| 88 | ki18nc("amount in units (real)" , "%1 meganewtons" ), |
| 89 | ki18ncp("amount in units (integer)" , "%1 meganewton" , "%1 meganewtons" ))); |
| 90 | |
| 91 | d->addCommonUnit(unit: UnitPrivate::makeUnit(categoryId: ForceCategory, |
| 92 | id: KilonewtonForce, |
| 93 | multiplier: 1000, |
| 94 | i18nc("force unit symbol" , "kN" ), |
| 95 | i18nc("unit description in lists" , "kilonewtons" ), |
| 96 | i18nc("unit synonyms for matching user input" , "kilonewton;kilonewtons;kN" ), |
| 97 | symbolString, |
| 98 | ki18nc("amount in units (real)" , "%1 kilonewtons" ), |
| 99 | ki18ncp("amount in units (integer)" , "%1 kilonewton" , "%1 kilonewtons" ))); |
| 100 | |
| 101 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ForceCategory, |
| 102 | id: Hectonewton, |
| 103 | multiplier: 100, |
| 104 | i18nc("force unit symbol" , "hN" ), |
| 105 | i18nc("unit description in lists" , "hectonewtons" ), |
| 106 | i18nc("unit synonyms for matching user input" , "hectonewton;hectonewtons;hN" ), |
| 107 | symbolString, |
| 108 | ki18nc("amount in units (real)" , "%1 hectonewtons" ), |
| 109 | ki18ncp("amount in units (integer)" , "%1 hectonewton" , "%1 hectonewtons" ))); |
| 110 | |
| 111 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ForceCategory, |
| 112 | id: Decanewton, |
| 113 | multiplier: 10, |
| 114 | i18nc("force unit symbol" , "daN" ), |
| 115 | i18nc("unit description in lists" , "decanewtons" ), |
| 116 | i18nc("unit synonyms for matching user input" , "decanewton;decanewtons;daN" ), |
| 117 | symbolString, |
| 118 | ki18nc("amount in units (real)" , "%1 decanewtons" ), |
| 119 | ki18ncp("amount in units (integer)" , "%1 decanewton" , "%1 decanewtons" ))); |
| 120 | |
| 121 | d->addDefaultUnit(unit: UnitPrivate::makeUnit(categoryId: ForceCategory, |
| 122 | id: Newton, |
| 123 | multiplier: 1, |
| 124 | i18nc("force unit symbol" , "N" ), |
| 125 | i18nc("unit description in lists" , "newtons" ), |
| 126 | i18nc("unit synonyms for matching user input" , "newton;newtons;N" ), |
| 127 | symbolString, |
| 128 | ki18nc("amount in units (real)" , "%1 newtons" ), |
| 129 | ki18ncp("amount in units (integer)" , "%1 newton" , "%1 newtons" ))); |
| 130 | |
| 131 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ForceCategory, |
| 132 | id: Decinewton, |
| 133 | multiplier: 0.1, |
| 134 | i18nc("force unit symbol" , "dN" ), |
| 135 | i18nc("unit description in lists" , "decinewtons" ), |
| 136 | i18nc("unit synonyms for matching user input" , "decinewton;decinewtons;dN" ), |
| 137 | symbolString, |
| 138 | ki18nc("amount in units (real)" , "%1 decinewtons" ), |
| 139 | ki18ncp("amount in units (integer)" , "%1 decinewton" , "%1 decinewtons" ))); |
| 140 | |
| 141 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ForceCategory, |
| 142 | id: Centinewton, |
| 143 | multiplier: 0.01, |
| 144 | i18nc("force unit symbol" , "cN" ), |
| 145 | i18nc("unit description in lists" , "centinewtons" ), |
| 146 | i18nc("unit synonyms for matching user input" , "centinewton;centinewtons;cN" ), |
| 147 | symbolString, |
| 148 | ki18nc("amount in units (real)" , "%1 centinewtons" ), |
| 149 | ki18ncp("amount in units (integer)" , "%1 centinewton" , "%1 centinewtons" ))); |
| 150 | |
| 151 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ForceCategory, |
| 152 | id: Millinewton, |
| 153 | multiplier: 0.001, |
| 154 | i18nc("force unit symbol" , "mN" ), |
| 155 | i18nc("unit description in lists" , "millinewtons" ), |
| 156 | i18nc("unit synonyms for matching user input" , "millinewton;millinewtons;mN" ), |
| 157 | symbolString, |
| 158 | ki18nc("amount in units (real)" , "%1 millinewtons" ), |
| 159 | ki18ncp("amount in units (integer)" , "%1 millinewton" , "%1 millinewtons" ))); |
| 160 | |
| 161 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ForceCategory, |
| 162 | id: Micronewton, |
| 163 | multiplier: 1e-06, |
| 164 | i18nc("force unit symbol" , "µN" ), |
| 165 | i18nc("unit description in lists" , "micronewtons" ), |
| 166 | i18nc("unit synonyms for matching user input" , "micronewton;micronewtons;µm;uN" ), |
| 167 | symbolString, |
| 168 | ki18nc("amount in units (real)" , "%1 micronewtons" ), |
| 169 | ki18ncp("amount in units (integer)" , "%1 micronewton" , "%1 micronewtons" ))); |
| 170 | |
| 171 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ForceCategory, |
| 172 | id: Nanonewton, |
| 173 | multiplier: 1e-09, |
| 174 | i18nc("force unit symbol" , "nN" ), |
| 175 | i18nc("unit description in lists" , "nanonewtons" ), |
| 176 | i18nc("unit synonyms for matching user input" , "nanonewton;nanonewtons;nN" ), |
| 177 | symbolString, |
| 178 | ki18nc("amount in units (real)" , "%1 nanonewtons" ), |
| 179 | ki18ncp("amount in units (integer)" , "%1 nanonewton" , "%1 nanonewtons" ))); |
| 180 | |
| 181 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ForceCategory, |
| 182 | id: Piconewton, |
| 183 | multiplier: 1e-12, |
| 184 | i18nc("force unit symbol" , "pN" ), |
| 185 | i18nc("unit description in lists" , "piconewtons" ), |
| 186 | i18nc("unit synonyms for matching user input" , "piconewton;piconewtons;pN" ), |
| 187 | symbolString, |
| 188 | ki18nc("amount in units (real)" , "%1 piconewtons" ), |
| 189 | ki18ncp("amount in units (integer)" , "%1 piconewton" , "%1 piconewtons" ))); |
| 190 | |
| 191 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ForceCategory, |
| 192 | id: Femtonewton, |
| 193 | multiplier: 1e-15, |
| 194 | i18nc("force unit symbol" , "fN" ), |
| 195 | i18nc("unit description in lists" , "femtonewtons" ), |
| 196 | i18nc("unit synonyms for matching user input" , "femtonewton;femtonewtons;fN" ), |
| 197 | symbolString, |
| 198 | ki18nc("amount in units (real)" , "%1 femtonewtons" ), |
| 199 | ki18ncp("amount in units (integer)" , "%1 femtonewton" , "%1 femtonewtons" ))); |
| 200 | |
| 201 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ForceCategory, |
| 202 | id: Attonewton, |
| 203 | multiplier: 1e-18, |
| 204 | i18nc("force unit symbol" , "aN" ), |
| 205 | i18nc("unit description in lists" , "attonewtons" ), |
| 206 | i18nc("unit synonyms for matching user input" , "attonewton;attonewtons;aN" ), |
| 207 | symbolString, |
| 208 | ki18nc("amount in units (real)" , "%1 attonewtons" ), |
| 209 | ki18ncp("amount in units (integer)" , "%1 attonewton" , "%1 attonewtons" ))); |
| 210 | |
| 211 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ForceCategory, |
| 212 | id: Zeptonewton, |
| 213 | multiplier: 1e-21, |
| 214 | i18nc("force unit symbol" , "zN" ), |
| 215 | i18nc("unit description in lists" , "zeptonewtons" ), |
| 216 | i18nc("unit synonyms for matching user input" , "zeptonewton;zeptonewtons;zN" ), |
| 217 | symbolString, |
| 218 | ki18nc("amount in units (real)" , "%1 zeptonewtons" ), |
| 219 | ki18ncp("amount in units (integer)" , "%1 zeptonewton" , "%1 zeptonewtons" ))); |
| 220 | |
| 221 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ForceCategory, |
| 222 | id: Yoctonewton, |
| 223 | multiplier: 1e-24, |
| 224 | i18nc("force unit symbol" , "yN" ), |
| 225 | i18nc("unit description in lists" , "yoctonewtons" ), |
| 226 | i18nc("unit synonyms for matching user input" , "yoctonewton;yoctonewtons;yN" ), |
| 227 | symbolString, |
| 228 | ki18nc("amount in units (real)" , "%1 yoctonewtons" ), |
| 229 | ki18ncp("amount in units (integer)" , "%1 yoctonewton" , "%1 yoctonewtons" ))); |
| 230 | |
| 231 | // http://en.wikipedia.org/wiki/Force#Units_of_measurement |
| 232 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ForceCategory, |
| 233 | id: Dyne, |
| 234 | multiplier: 0.0001, |
| 235 | i18nc("force unit symbol" , "dyn" ), |
| 236 | i18nc("unit description in lists" , "dynes" ), |
| 237 | i18nc("unit synonyms for matching user input" , "dyne;dynes;dyn" ), |
| 238 | symbolString, |
| 239 | ki18nc("amount in units (real)" , "%1 dynes" ), |
| 240 | ki18ncp("amount in units (integer)" , "%1 dyne" , "%1 dynes" ))); |
| 241 | |
| 242 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ForceCategory, |
| 243 | id: Kilopond, |
| 244 | multiplier: 9.80665, |
| 245 | i18nc("force unit symbol" , "kp" ), |
| 246 | i18nc("unit description in lists" , "kiloponds" ), |
| 247 | i18nc("unit synonyms for matching user input" , "kilogram-force;kilopond;kiloponds;kp" ), |
| 248 | symbolString, |
| 249 | ki18nc("amount in units (real)" , "%1 kiloponds" ), |
| 250 | ki18ncp("amount in units (integer)" , "%1 kilopond" , "%1 kiloponds" ))); |
| 251 | |
| 252 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ForceCategory, |
| 253 | id: PoundForce, |
| 254 | multiplier: 4.448222, |
| 255 | i18nc("force unit symbol" , "lbf" ), |
| 256 | i18nc("unit description in lists" , "pound-force" ), |
| 257 | i18nc("unit synonyms for matching user input" , "pound-force;lbf" ), |
| 258 | symbolString, |
| 259 | ki18nc("amount in units (real)" , "%1 pound-force" ), |
| 260 | ki18ncp("amount in units (integer)" , "%1 pound-force" , "%1 pound-force" ))); |
| 261 | |
| 262 | d->addUnit(unit: UnitPrivate::makeUnit(categoryId: ForceCategory, |
| 263 | id: Poundal, |
| 264 | multiplier: 0.138255, |
| 265 | i18nc("force unit symbol" , "pdl" ), |
| 266 | i18nc("unit description in lists" , "poundals" ), |
| 267 | i18nc("unit synonyms for matching user input" , "poundal;poundals;pdl" ), |
| 268 | symbolString, |
| 269 | ki18nc("amount in units (real)" , "%1 poundals" ), |
| 270 | ki18ncp("amount in units (integer)" , "%1 poundal" , "%1 poundals" ))); |
| 271 | |
| 272 | return c; |
| 273 | } |
| 274 | |
| 275 | } // KUnitConversion namespace |
| 276 | |