Frequency.php 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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-2015 Zend Technologies USA Inc. (http://www.zend.com)
  18. * @license http://framework.zend.com/license/new-bsd New BSD License
  19. * @version $Id$
  20. */
  21. /**
  22. * Implement needed classes
  23. */
  24. #require_once 'Zend/Measure/Abstract.php';
  25. #require_once 'Zend/Locale.php';
  26. /**
  27. * Class for handling flow volume conversions
  28. *
  29. * @category Zend
  30. * @package Zend_Measure
  31. * @subpackage Zend_Measure_Frequency
  32. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  33. * @license http://framework.zend.com/license/new-bsd New BSD License
  34. */
  35. class Zend_Measure_Frequency extends Zend_Measure_Abstract
  36. {
  37. const STANDARD = 'HERTZ';
  38. const ONE_PER_SECOND = 'ONE_PER_SECOND';
  39. const CYCLE_PER_SECOND = 'CYCLE_PER_SECOND';
  40. const DEGREE_PER_HOUR = 'DEGREE_PER_HOUR';
  41. const DEGREE_PER_MINUTE = 'DEGREE_PER_MINUTE';
  42. const DEGREE_PER_SECOND = 'DEGREE_PER_SECOND';
  43. const GIGAHERTZ = 'GIGAHERTZ';
  44. const HERTZ = 'HERTZ';
  45. const KILOHERTZ = 'KILOHERTZ';
  46. const MEGAHERTZ = 'MEGAHERTZ';
  47. const MILLIHERTZ = 'MILLIHERTZ';
  48. const RADIAN_PER_HOUR = 'RADIAN_PER_HOUR';
  49. const RADIAN_PER_MINUTE = 'RADIAN_PER_MINUTE';
  50. const RADIAN_PER_SECOND = 'RADIAN_PER_SECOND';
  51. const REVOLUTION_PER_HOUR = 'REVOLUTION_PER_HOUR';
  52. const REVOLUTION_PER_MINUTE = 'REVOLUTION_PER_MINUTE';
  53. const REVOLUTION_PER_SECOND = 'REVOLUTION_PER_SECOND';
  54. const RPM = 'RPM';
  55. const TERRAHERTZ = 'TERRAHERTZ';
  56. /**
  57. * Calculations for all frequency units
  58. *
  59. * @var array
  60. */
  61. protected $_units = array(
  62. 'ONE_PER_SECOND' => array('1', '1/s'),
  63. 'CYCLE_PER_SECOND' => array('1', 'cps'),
  64. 'DEGREE_PER_HOUR' => array(array('' => '1', '/' => '1296000'), '°/h'),
  65. 'DEGREE_PER_MINUTE' => array(array('' => '1', '/' => '21600'), '°/m'),
  66. 'DEGREE_PER_SECOND' => array(array('' => '1', '/' => '360'), '°/s'),
  67. 'GIGAHERTZ' => array('1000000000', 'GHz'),
  68. 'HERTZ' => array('1', 'Hz'),
  69. 'KILOHERTZ' => array('1000', 'kHz'),
  70. 'MEGAHERTZ' => array('1000000', 'MHz'),
  71. 'MILLIHERTZ' => array('0.001', 'mHz'),
  72. 'RADIAN_PER_HOUR' => array(array('' => '1', '/' => '22619.467'), 'rad/h'),
  73. 'RADIAN_PER_MINUTE' => array(array('' => '1', '/' => '376.99112'), 'rad/m'),
  74. 'RADIAN_PER_SECOND' => array(array('' => '1', '/' => '6.2831853'), 'rad/s'),
  75. 'REVOLUTION_PER_HOUR' => array(array('' => '1', '/' => '3600'), 'rph'),
  76. 'REVOLUTION_PER_MINUTE' => array(array('' => '1', '/' => '60'), 'rpm'),
  77. 'REVOLUTION_PER_SECOND' => array('1', 'rps'),
  78. 'RPM' => array(array('' => '1', '/' => '60'), 'rpm'),
  79. 'TERRAHERTZ' => array('1000000000000', 'THz'),
  80. 'STANDARD' =>'HERTZ'
  81. );
  82. }