|
1 <?php |
|
2 /** |
|
3 * Zend Framework |
|
4 * |
|
5 * LICENSE |
|
6 * |
|
7 * This source file is subject to the new BSD license that is bundled |
|
8 * with this package in the file LICENSE.txt. |
|
9 * It is also available through the world-wide-web at this URL: |
|
10 * http://framework.zend.com/license/new-bsd |
|
11 * If you did not receive a copy of the license and are unable to |
|
12 * obtain it through the world-wide-web, please send an email |
|
13 * to license@zend.com so we can send you a copy immediately. |
|
14 * |
|
15 * @category Zend |
|
16 * @package Zend_Measure |
|
17 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
|
18 * @license http://framework.zend.com/license/new-bsd New BSD License |
|
19 * @version $Id: Frequency.php 20096 2010-01-06 02:05:09Z bkarwin $ |
|
20 */ |
|
21 |
|
22 /** |
|
23 * Implement needed classes |
|
24 */ |
|
25 require_once 'Zend/Measure/Abstract.php'; |
|
26 require_once 'Zend/Locale.php'; |
|
27 |
|
28 /** |
|
29 * Class for handling flow volume conversions |
|
30 * |
|
31 * @category Zend |
|
32 * @package Zend_Measure |
|
33 * @subpackage Zend_Measure_Frequency |
|
34 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
|
35 * @license http://framework.zend.com/license/new-bsd New BSD License |
|
36 */ |
|
37 class Zend_Measure_Frequency extends Zend_Measure_Abstract |
|
38 { |
|
39 const STANDARD = 'HERTZ'; |
|
40 |
|
41 const ONE_PER_SECOND = 'ONE_PER_SECOND'; |
|
42 const CYCLE_PER_SECOND = 'CYCLE_PER_SECOND'; |
|
43 const DEGREE_PER_HOUR = 'DEGREE_PER_HOUR'; |
|
44 const DEGREE_PER_MINUTE = 'DEGREE_PER_MINUTE'; |
|
45 const DEGREE_PER_SECOND = 'DEGREE_PER_SECOND'; |
|
46 const GIGAHERTZ = 'GIGAHERTZ'; |
|
47 const HERTZ = 'HERTZ'; |
|
48 const KILOHERTZ = 'KILOHERTZ'; |
|
49 const MEGAHERTZ = 'MEGAHERTZ'; |
|
50 const MILLIHERTZ = 'MILLIHERTZ'; |
|
51 const RADIAN_PER_HOUR = 'RADIAN_PER_HOUR'; |
|
52 const RADIAN_PER_MINUTE = 'RADIAN_PER_MINUTE'; |
|
53 const RADIAN_PER_SECOND = 'RADIAN_PER_SECOND'; |
|
54 const REVOLUTION_PER_HOUR = 'REVOLUTION_PER_HOUR'; |
|
55 const REVOLUTION_PER_MINUTE = 'REVOLUTION_PER_MINUTE'; |
|
56 const REVOLUTION_PER_SECOND = 'REVOLUTION_PER_SECOND'; |
|
57 const RPM = 'RPM'; |
|
58 const TERRAHERTZ = 'TERRAHERTZ'; |
|
59 |
|
60 /** |
|
61 * Calculations for all frequency units |
|
62 * |
|
63 * @var array |
|
64 */ |
|
65 protected $_units = array( |
|
66 'ONE_PER_SECOND' => array('1', '1/s'), |
|
67 'CYCLE_PER_SECOND' => array('1', 'cps'), |
|
68 'DEGREE_PER_HOUR' => array(array('' => '1', '/' => '1296000'), '°/h'), |
|
69 'DEGREE_PER_MINUTE' => array(array('' => '1', '/' => '21600'), '°/m'), |
|
70 'DEGREE_PER_SECOND' => array(array('' => '1', '/' => '360'), '°/s'), |
|
71 'GIGAHERTZ' => array('1000000000', 'GHz'), |
|
72 'HERTZ' => array('1', 'Hz'), |
|
73 'KILOHERTZ' => array('1000', 'kHz'), |
|
74 'MEGAHERTZ' => array('1000000', 'MHz'), |
|
75 'MILLIHERTZ' => array('0.001', 'mHz'), |
|
76 'RADIAN_PER_HOUR' => array(array('' => '1', '/' => '22619.467'), 'rad/h'), |
|
77 'RADIAN_PER_MINUTE' => array(array('' => '1', '/' => '376.99112'), 'rad/m'), |
|
78 'RADIAN_PER_SECOND' => array(array('' => '1', '/' => '6.2831853'), 'rad/s'), |
|
79 'REVOLUTION_PER_HOUR' => array(array('' => '1', '/' => '3600'), 'rph'), |
|
80 'REVOLUTION_PER_MINUTE' => array(array('' => '1', '/' => '60'), 'rpm'), |
|
81 'REVOLUTION_PER_SECOND' => array('1', 'rps'), |
|
82 'RPM' => array(array('' => '1', '/' => '60'), 'rpm'), |
|
83 'TERRAHERTZ' => array('1000000000000', 'THz'), |
|
84 'STANDARD' =>'HERTZ' |
|
85 ); |
|
86 } |