• Skip to content
  • Skip to link menu
KDE 4.6 API Reference
  • KDE API Reference
  • kdelibs
  • KDE Home
  • Contact Us
 

KUnitConversion

frequency.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 "frequency.h"
00021 #include "converter.h"
00022 #include <klocale.h>
00023 
00024 using namespace KUnitConversion;
00025 
00026 Frequency::Frequency() : UnitCategory(FrequencyCategory)
00027 {
00028     setName(i18n("Frequency"));
00029     setSymbolStringFormat(ki18nc("%1 value, %2 unit symbol (frequency", "%1 %2"));
00030 
00031     U(Yottahertz, 1e+24,
00032       i18nc("frequency unit symbol", "YHz"),
00033       i18nc("unit description in lists", "yottahertzs"),
00034       i18nc("unit synonyms for matching user input", "yottahertz;yottahertzs;YHz"),
00035       ki18nc("amount in units (real)", "%1 yottahertzs"),
00036       ki18ncp("amount in units (integer)", "%1 yottahertz", "%1 yottahertzs")
00037     );
00038     U(Zettahertz, 1e+21,
00039       i18nc("frequency unit symbol", "ZHz"),
00040       i18nc("unit description in lists", "zettahertzs"),
00041       i18nc("unit synonyms for matching user input", "zettahertz;zettahertzs;ZHz"),
00042       ki18nc("amount in units (real)", "%1 zettahertzs"),
00043       ki18ncp("amount in units (integer)", "%1 zettahertz", "%1 zettahertzs")
00044     );
00045     U(Exahertz, 1e+18,
00046       i18nc("frequency unit symbol", "EHz"),
00047       i18nc("unit description in lists", "exahertzs"),
00048       i18nc("unit synonyms for matching user input", "exahertz;exahertzs;EHz"),
00049       ki18nc("amount in units (real)", "%1 exahertzs"),
00050       ki18ncp("amount in units (integer)", "%1 exahertz", "%1 exahertzs")
00051     );
00052     U(Petahertz, 1e+15,
00053       i18nc("frequency unit symbol", "PHz"),
00054       i18nc("unit description in lists", "petahertzs"),
00055       i18nc("unit synonyms for matching user input", "petahertz;petahertzs;PHz"),
00056       ki18nc("amount in units (real)", "%1 petahertzs"),
00057       ki18ncp("amount in units (integer)", "%1 petahertz", "%1 petahertzs")
00058     );
00059     U(Terahertz, 1e+12,
00060       i18nc("frequency unit symbol", "THz"),
00061       i18nc("unit description in lists", "terahertzs"),
00062       i18nc("unit synonyms for matching user input", "terahertz;terahertzs;THz"),
00063       ki18nc("amount in units (real)", "%1 terahertzs"),
00064       ki18ncp("amount in units (integer)", "%1 terahertz", "%1 terahertzs")
00065     );
00066     U(Gigahertz, 1e+09,
00067       i18nc("frequency unit symbol", "GHz"),
00068       i18nc("unit description in lists", "gigahertzs"),
00069       i18nc("unit synonyms for matching user input", "gigahertz;gigahertzs;GHz"),
00070       ki18nc("amount in units (real)", "%1 gigahertzs"),
00071       ki18ncp("amount in units (integer)", "%1 gigahertz", "%1 gigahertzs")
00072     );
00073     U(Megahertz, 1e+06,
00074       i18nc("frequency unit symbol", "MHz"),
00075       i18nc("unit description in lists", "megahertzs"),
00076       i18nc("unit synonyms for matching user input", "megahertz;megahertzs;MHz"),
00077       ki18nc("amount in units (real)", "%1 megahertzs"),
00078       ki18ncp("amount in units (integer)", "%1 megahertz", "%1 megahertzs")
00079     );
00080     U(Kilohertz, 1000,
00081       i18nc("frequency unit symbol", "kHz"),
00082       i18nc("unit description in lists", "kilohertzs"),
00083       i18nc("unit synonyms for matching user input", "kilohertz;kilohertzs;kHz"),
00084       ki18nc("amount in units (real)", "%1 kilohertzs"),
00085       ki18ncp("amount in units (integer)", "%1 kilohertz", "%1 kilohertzs")
00086     );
00087     U(Hectohertz, 100,
00088       i18nc("frequency unit symbol", "hHz"),
00089       i18nc("unit description in lists", "hectohertzs"),
00090       i18nc("unit synonyms for matching user input", "hectohertz;hectohertzs;hHz"),
00091       ki18nc("amount in units (real)", "%1 hectohertzs"),
00092       ki18ncp("amount in units (integer)", "%1 hectohertz", "%1 hectohertzs")
00093     );
00094     U(Decahertz, 10,
00095       i18nc("frequency unit symbol", "daHz"),
00096       i18nc("unit description in lists", "decahertzs"),
00097       i18nc("unit synonyms for matching user input", "decahertz;decahertzs;daHz"),
00098       ki18nc("amount in units (real)", "%1 decahertzs"),
00099       ki18ncp("amount in units (integer)", "%1 decahertz", "%1 decahertzs")
00100     );
00101     setDefaultUnit(UP(Hertz, 1,
00102       i18nc("frequency unit symbol", "Hz"),
00103       i18nc("unit description in lists", "hertzs"),
00104       i18nc("unit synonyms for matching user input", "hertz;hertzs;Hz"),
00105       ki18nc("amount in units (real)", "%1 hertzs"),
00106       ki18ncp("amount in units (integer)", "%1 hertz", "%1 hertzs")
00107     ));
00108     U(Decihertz, 0.1,
00109       i18nc("frequency unit symbol", "dHz"),
00110       i18nc("unit description in lists", "decihertzs"),
00111       i18nc("unit synonyms for matching user input", "decihertz;decihertzs;dHz"),
00112       ki18nc("amount in units (real)", "%1 decihertzs"),
00113       ki18ncp("amount in units (integer)", "%1 decihertz", "%1 decihertzs")
00114     );
00115     U(Centihertz, 0.01,
00116       i18nc("frequency unit symbol", "cHz"),
00117       i18nc("unit description in lists", "centihertzs"),
00118       i18nc("unit synonyms for matching user input", "centihertz;centihertzs;cHz"),
00119       ki18nc("amount in units (real)", "%1 centihertzs"),
00120       ki18ncp("amount in units (integer)", "%1 centihertz", "%1 centihertzs")
00121     );
00122     U(Millihertz, 0.001,
00123       i18nc("frequency unit symbol", "mHz"),
00124       i18nc("unit description in lists", "millihertzs"),
00125       i18nc("unit synonyms for matching user input", "millihertz;millihertzs;mHz"),
00126       ki18nc("amount in units (real)", "%1 millihertzs"),
00127       ki18ncp("amount in units (integer)", "%1 millihertz", "%1 millihertzs")
00128     );
00129     U(Microhertz, 1e-06,
00130       i18nc("frequency unit symbol", "µHz"),
00131       i18nc("unit description in lists", "microhertzs"),
00132       i18nc("unit synonyms for matching user input", "microhertz;microhertzs;µHz;uHz"),
00133       ki18nc("amount in units (real)", "%1 microhertzs"),
00134       ki18ncp("amount in units (integer)", "%1 microhertz", "%1 microhertzs")
00135     );
00136     U(Nanohertz, 1e-09,
00137       i18nc("frequency unit symbol", "nHz"),
00138       i18nc("unit description in lists", "nanohertzs"),
00139       i18nc("unit synonyms for matching user input", "nanohertz;nanohertzs;nHz"),
00140       ki18nc("amount in units (real)", "%1 nanohertzs"),
00141       ki18ncp("amount in units (integer)", "%1 nanohertz", "%1 nanohertzs")
00142     );
00143     U(Picohertz, 1e-12,
00144       i18nc("frequency unit symbol", "pHz"),
00145       i18nc("unit description in lists", "picohertzs"),
00146       i18nc("unit synonyms for matching user input", "picohertz;picohertzs;pHz"),
00147       ki18nc("amount in units (real)", "%1 picohertzs"),
00148       ki18ncp("amount in units (integer)", "%1 picohertz", "%1 picohertzs")
00149     );
00150     U(Femtohertz, 1e-15,
00151       i18nc("frequency unit symbol", "fHz"),
00152       i18nc("unit description in lists", "femtohertzs"),
00153       i18nc("unit synonyms for matching user input", "femtohertz;femtohertzs;fHz"),
00154       ki18nc("amount in units (real)", "%1 femtohertzs"),
00155       ki18ncp("amount in units (integer)", "%1 femtohertz", "%1 femtohertzs")
00156     );
00157     U(Attohertz, 1e-18,
00158       i18nc("frequency unit symbol", "aHz"),
00159       i18nc("unit description in lists", "attohertzs"),
00160       i18nc("unit synonyms for matching user input", "attohertz;attohertzs;aHz"),
00161       ki18nc("amount in units (real)", "%1 attohertzs"),
00162       ki18ncp("amount in units (integer)", "%1 attohertz", "%1 attohertzs")
00163     );
00164     U(Zeptohertz, 1e-21,
00165       i18nc("frequency unit symbol", "zHz"),
00166       i18nc("unit description in lists", "zeptohertzs"),
00167       i18nc("unit synonyms for matching user input", "zeptohertz;zeptohertzs;zHz"),
00168       ki18nc("amount in units (real)", "%1 zeptohertzs"),
00169       ki18ncp("amount in units (integer)", "%1 zeptohertz", "%1 zeptohertzs")
00170     );
00171     U(Yoctohertz, 1e-24,
00172       i18nc("frequency unit symbol", "yHz"),
00173       i18nc("unit description in lists", "yoctohertzs"),
00174       i18nc("unit synonyms for matching user input", "yoctohertz;yoctohertzs;yHz"),
00175       ki18nc("amount in units (real)", "%1 yoctohertzs"),
00176       ki18ncp("amount in units (integer)", "%1 yoctohertz", "%1 yoctohertzs")
00177     );
00178     U(RPM, 1.0 / 60.0,
00179       i18nc("frequency unit symbol", "RPM"),
00180       i18nc("unit description in lists", "revolutions per minute"),
00181       i18nc("unit synonyms for matching user input",
00182             "revolutions per minute;revolution per minute;RPM"),
00183       ki18nc("amount in units (real)", "%1 revolutions per minute"),
00184       ki18ncp("amount in units (integer)", "%1 revolution per minute", "%1 revolutions per minute")
00185     );
00186 
00187     setMostCommonUnits(QList<int>() <<
00188             Kilohertz << Megahertz << Gigahertz << Hertz << RPM);
00189 }
00190 

KUnitConversion

Skip menu "KUnitConversion"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.7.3
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal