File indexing completed on 2024-12-22 05:36:51

0001 <?php
0002 /**
0003  * Zend Framework
0004  *
0005  * LICENSE
0006  *
0007  * This source file is subject to the new BSD license that is bundled
0008  * with this package in the file LICENSE.txt.
0009  * It is also available through the world-wide-web at this URL:
0010  * http://framework.zend.com/license/new-bsd
0011  * If you did not receive a copy of the license and are unable to
0012  * obtain it through the world-wide-web, please send an email
0013  * to license@zend.com so we can send you a copy immediately.
0014  *
0015  * @category  Zend
0016  * @package   Zend_Measure
0017  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0018  * @license   http://framework.zend.com/license/new-bsd     New BSD License
0019  * @version   $Id$
0020  */
0021 
0022 /**
0023  * Implement needed classes
0024  */
0025 // require_once 'Zend/Measure/Abstract.php';
0026 // require_once 'Zend/Locale.php';
0027 
0028 /**
0029  * Class for handling flow volume conversions
0030  *
0031  * @category   Zend
0032  * @package    Zend_Measure
0033  * @subpackage Zend_Measure_Frequency
0034  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0035  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0036  */
0037 class Zend_Measure_Frequency extends Zend_Measure_Abstract
0038 {
0039     const STANDARD = 'HERTZ';
0040 
0041     const ONE_PER_SECOND        = 'ONE_PER_SECOND';
0042     const CYCLE_PER_SECOND      = 'CYCLE_PER_SECOND';
0043     const DEGREE_PER_HOUR       = 'DEGREE_PER_HOUR';
0044     const DEGREE_PER_MINUTE     = 'DEGREE_PER_MINUTE';
0045     const DEGREE_PER_SECOND     = 'DEGREE_PER_SECOND';
0046     const GIGAHERTZ             = 'GIGAHERTZ';
0047     const HERTZ                 = 'HERTZ';
0048     const KILOHERTZ             = 'KILOHERTZ';
0049     const MEGAHERTZ             = 'MEGAHERTZ';
0050     const MILLIHERTZ            = 'MILLIHERTZ';
0051     const RADIAN_PER_HOUR       = 'RADIAN_PER_HOUR';
0052     const RADIAN_PER_MINUTE     = 'RADIAN_PER_MINUTE';
0053     const RADIAN_PER_SECOND     = 'RADIAN_PER_SECOND';
0054     const REVOLUTION_PER_HOUR   = 'REVOLUTION_PER_HOUR';
0055     const REVOLUTION_PER_MINUTE = 'REVOLUTION_PER_MINUTE';
0056     const REVOLUTION_PER_SECOND = 'REVOLUTION_PER_SECOND';
0057     const RPM                   = 'RPM';
0058     const TERRAHERTZ            = 'TERRAHERTZ';
0059 
0060     /**
0061      * Calculations for all frequency units
0062      *
0063      * @var array
0064      */
0065     protected $_units = array(
0066         'ONE_PER_SECOND'        => array('1',             '1/s'),
0067         'CYCLE_PER_SECOND'      => array('1',             'cps'),
0068         'DEGREE_PER_HOUR'       => array(array('' => '1', '/' => '1296000'), '°/h'),
0069         'DEGREE_PER_MINUTE'     => array(array('' => '1', '/' => '21600'),   '°/m'),
0070         'DEGREE_PER_SECOND'     => array(array('' => '1', '/' => '360'),     '°/s'),
0071         'GIGAHERTZ'             => array('1000000000',    'GHz'),
0072         'HERTZ'                 => array('1',             'Hz'),
0073         'KILOHERTZ'             => array('1000',          'kHz'),
0074         'MEGAHERTZ'             => array('1000000',       'MHz'),
0075         'MILLIHERTZ'            => array('0.001',         'mHz'),
0076         'RADIAN_PER_HOUR'       => array(array('' => '1', '/' => '22619.467'), 'rad/h'),
0077         'RADIAN_PER_MINUTE'     => array(array('' => '1', '/' => '376.99112'), 'rad/m'),
0078         'RADIAN_PER_SECOND'     => array(array('' => '1', '/' => '6.2831853'), 'rad/s'),
0079         'REVOLUTION_PER_HOUR'   => array(array('' => '1', '/' => '3600'), 'rph'),
0080         'REVOLUTION_PER_MINUTE' => array(array('' => '1', '/' => '60'),   'rpm'),
0081         'REVOLUTION_PER_SECOND' => array('1',             'rps'),
0082         'RPM'                   => array(array('' => '1', '/' => '60'), 'rpm'),
0083         'TERRAHERTZ'            => array('1000000000000', 'THz'),
0084         'STANDARD'              =>'HERTZ'
0085     );
0086 }