Mole.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 mole conversions
  28. *
  29. * @category Zend
  30. * @package Zend_Measure
  31. * @subpackage Zend_Measure_Flow_Mole
  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_Flow_Mole extends Zend_Measure_Abstract
  36. {
  37. const STANDARD = 'MOLE_PER_SECOND';
  38. const CENTIMOLE_PER_DAY = 'CENTIMOLE_PER_DAY';
  39. const CENTIMOLE_PER_HOUR = 'CENTIMOLE_PER_HOUR';
  40. const CENTIMOLE_PER_MINUTE = 'CENTIMOLE_PER_MINUTE';
  41. const CENTIMOLE_PER_SECOND = 'CENTIMOLE_PER_SECOND';
  42. const MEGAMOLE_PER_DAY = 'MEGAMOLE_PER_DAY';
  43. const MEGAMOLE_PER_HOUR = 'MEGAMOLE_PER_HOUR';
  44. const MEGAMOLE_PER_MINUTE = 'MEGAMOLE_PER_MINUTE';
  45. const MEGAMOLE_PER_SECOND = 'MEGAMOLE_PER_SECOND';
  46. const MICROMOLE_PER_DAY = 'MICROMOLE_PER_DAY';
  47. const MICROMOLE_PER_HOUR = 'MICROMOLE_PER_HOUR';
  48. const MICROMOLE_PER_MINUTE = 'MICROMOLE_PER_MINUTE';
  49. const MICROMOLE_PER_SECOND = 'MICROMOLE_PER_SECOND';
  50. const MILLIMOLE_PER_DAY = 'MILLIMOLE_PER_DAY';
  51. const MILLIMOLE_PER_HOUR = 'MILLIMOLE_PER_HOUR';
  52. const MILLIMOLE_PER_MINUTE = 'MILLIMOLE_PER_MINUTE';
  53. const MILLIMOLE_PER_SECOND = 'MILLIMOLE_PER_SECOND';
  54. const MOLE_PER_DAY = 'MOLE_PER_DAY';
  55. const MOLE_PER_HOUR = 'MOLE_PER_HOUR';
  56. const MOLE_PER_MINUTE = 'MOLE_PER_MINUTE';
  57. const MOLE_PER_SECOND = 'MOLE_PER_SECOND';
  58. /**
  59. * Calculations for all flow mole units
  60. *
  61. * @var array
  62. */
  63. protected $_units = array(
  64. 'CENTIMOLE_PER_DAY' => array(array('' => '0.01', '/' => '86400'), 'cmol/day'),
  65. 'CENTIMOLE_PER_HOUR' => array(array('' => '0.01', '/' => '3600'), 'cmol/h'),
  66. 'CENTIMOLE_PER_MINUTE' => array(array('' => '0.01', '/' => '60'), 'cmol/m'),
  67. 'CENTIMOLE_PER_SECOND' => array('0.01', 'cmol/s'),
  68. 'MEGAMOLE_PER_DAY' => array(array('' => '1000000', '/' => '86400'), 'Mmol/day'),
  69. 'MEGAMOLE_PER_HOUR' => array(array('' => '1000000', '/' => '3600'), 'Mmol/h'),
  70. 'MEGAMOLE_PER_MINUTE' => array(array('' => '1000000', '/' => '60'), 'Mmol/m'),
  71. 'MEGAMOLE_PER_SECOND' => array('1000000', 'Mmol/s'),
  72. 'MICROMOLE_PER_DAY' => array(array('' => '0.000001', '/' => '86400'), 'µmol/day'),
  73. 'MICROMOLE_PER_HOUR' => array(array('' => '0.000001', '/' => '3600'), 'µmol/h'),
  74. 'MICROMOLE_PER_MINUTE' => array(array('' => '0.000001', '/' => '60'), 'µmol/m'),
  75. 'MICROMOLE_PER_SECOND' => array('0.000001', 'µmol/s'),
  76. 'MILLIMOLE_PER_DAY' => array(array('' => '0.001', '/' => '86400'), 'mmol/day'),
  77. 'MILLIMOLE_PER_HOUR' => array(array('' => '0.001', '/' => '3600'), 'mmol/h'),
  78. 'MILLIMOLE_PER_MINUTE' => array(array('' => '0.001', '/' => '60'), 'mmol/m'),
  79. 'MILLIMOLE_PER_SECOND' => array('0.001', 'mmol/s'),
  80. 'MOLE_PER_DAY' => array(array('' => '1', '/' => '86400'), 'mol/day'),
  81. 'MOLE_PER_HOUR' => array(array('' => '1', '/' => '3600'), 'mol/h'),
  82. 'MOLE_PER_MINUTE' => array(array('' => '1', '/' => '60'), 'mol/m'),
  83. 'MOLE_PER_SECOND' => array('1', 'mol/s'),
  84. 'STANDARD' => 'MOLE_PER_SECOND'
  85. );
  86. }