File indexing completed on 2024-05-26 06:03:13

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 mass conversions
0030  *
0031  * @category   Zend
0032  * @package    Zend_Measure
0033  * @subpackage Zend_Measure_Flow_Mass
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_Flow_Mass extends Zend_Measure_Abstract
0038 {
0039     const STANDARD = 'KILOGRAM_PER_SECOND';
0040 
0041     const CENTIGRAM_PER_DAY    = 'CENTIGRAM_PER_DAY';
0042     const CENTIGRAM_PER_HOUR   = 'CENTIGRAM_PER_HOUR';
0043     const CENTIGRAM_PER_MINUTE = 'CENTIGRAM_PER_MINUTE';
0044     const CENTIGRAM_PER_SECOND = 'CENTIGRAM_PER_SECOND';
0045     const GRAM_PER_DAY         = 'GRAM_PER_DAY';
0046     const GRAM_PER_HOUR        = 'GRAM_PER_HOUR';
0047     const GRAM_PER_MINUTE      = 'GRAM_PER_MINUTE';
0048     const GRAM_PER_SECOND      = 'GRAM_PER_SECOND';
0049     const KILOGRAM_PER_DAY     = 'KILOGRAM_PER_DAY';
0050     const KILOGRAM_PER_HOUR    = 'KILOGRAM_PER_HOUR';
0051     const KILOGRAM_PER_MINUTE  = 'KILOGRAM_PER_MINUTE';
0052     const KILOGRAM_PER_SECOND  = 'KILOGRAM_PER_SECOND';
0053     const MILLIGRAM_PER_DAY    = 'MILLIGRAM_PER_DAY';
0054     const MILLIGRAM_PER_HOUR   = 'MILLIGRAM_PER_HOUR';
0055     const MILLIGRAM_PER_MINUTE = 'MILLIGRAM_PER_MINUTE';
0056     const MILLIGRAM_PER_SECOND = 'MILLIGRAM_PER_SECOND';
0057     const OUNCE_PER_DAY        = 'OUNCE_PER_DAY';
0058     const OUNCE_PER_HOUR       = 'OUNCE_PER_HOUR';
0059     const OUNCE_PER_MINUTE     = 'OUNCE_PER_MINUTE';
0060     const OUNCE_PER_SECOND     = 'OUNCE_PER_SECOND';
0061     const POUND_PER_DAY        = 'POUND_PER_DAY';
0062     const POUND_PER_HOUR       = 'POUND_PER_HOUR';
0063     const POUND_PER_MINUTE     = 'POUND_PER_MINUTE';
0064     const POUND_PER_SECOND     = 'POUND_PER_SECOND';
0065     const TON_LONG_PER_DAY     = 'TON_LONG_PER_DAY';
0066     const TON_LONG_PER_HOUR    = 'TON_LONG_PER_HOUR';
0067     const TON_LONG_PER_MINUTE  = 'TON_LONG_PER_MINUTE';
0068     const TON_LONG_PER_SECOND  = 'TON_LONG_PER_SECOND';
0069     const TON_PER_DAY          = 'TON_PER_DAY';
0070     const TON_PER_HOUR         = 'TON_PER_HOUR';
0071     const TON_PER_MINUTE       = 'TON_PER_MINUTE';
0072     const TON_PER_SECOND       = 'TON_PER_SECOND';
0073     const TON_SHORT_PER_DAY    = 'TON_SHORT_PER_DAY';
0074     const TON_SHORT_PER_HOUR   = 'TON_SHORT_PER_HOUR';
0075     const TON_SHORT_PER_MINUTE = 'TON_SHORT_PER_MINUTE';
0076     const TON_SHORT_PER_SECOND = 'TON_SHORT_PER_SECOND';
0077 
0078     /**
0079      * Calculations for all flow mass units
0080      *
0081      * @var array
0082      */
0083     protected $_units = array(
0084         'CENTIGRAM_PER_DAY'    => array(array('' => '0.00001', '/' => '86400'),    'cg/day'),
0085         'CENTIGRAM_PER_HOUR'   => array(array('' => '0.00001', '/' => '3600'),     'cg/h'),
0086         'CENTIGRAM_PER_MINUTE' => array(array('' => '0.00001', '/' => '60'),       'cg/m'),
0087         'CENTIGRAM_PER_SECOND' => array('0.00001',                               'cg/s'),
0088         'GRAM_PER_DAY'         => array(array('' => '0.001', '/' => '86400'),      'g/day'),
0089         'GRAM_PER_HOUR'        => array(array('' => '0.001', '/' => '3600'),       'g/h'),
0090         'GRAM_PER_MINUTE'      => array(array('' => '0.001', '/' => '60'),         'g/m'),
0091         'GRAM_PER_SECOND'      => array('0.001',                                 'g/s'),
0092         'KILOGRAM_PER_DAY'     => array(array('' => '1', '/' => '86400'),          'kg/day'),
0093         'KILOGRAM_PER_HOUR'    => array(array('' => '1', '/' => '3600'),           'kg/h'),
0094         'KILOGRAM_PER_MINUTE'  => array(array('' => '1', '/' => '60'),             'kg/m'),
0095         'KILOGRAM_PER_SECOND'  => array('1',                                     'kg/s'),
0096         'MILLIGRAM_PER_DAY'    => array(array('' => '0.000001', '/' => '86400'),   'mg/day'),
0097         'MILLIGRAM_PER_HOUR'   => array(array('' => '0.000001', '/' => '3600'),    'mg/h'),
0098         'MILLIGRAM_PER_MINUTE' => array(array('' => '0.000001', '/' => '60'),      'mg/m'),
0099         'MILLIGRAM_PER_SECOND' => array('0.000001',                              'mg/s'),
0100         'OUNCE_PER_DAY'        => array(array('' => '0.0283495', '/' => '86400'),  'oz/day'),
0101         'OUNCE_PER_HOUR'       => array(array('' => '0.0283495', '/' => '3600'),   'oz/h'),
0102         'OUNCE_PER_MINUTE'     => array(array('' => '0.0283495', '/' => '60'),     'oz/m'),
0103         'OUNCE_PER_SECOND'     => array('0.0283495',                             'oz/s'),
0104         'POUND_PER_DAY'        => array(array('' => '0.453592', '/' => '86400'),   'lb/day'),
0105         'POUND_PER_HOUR'       => array(array('' => '0.453592', '/' => '3600'),    'lb/h'),
0106         'POUND_PER_MINUTE'     => array(array('' => '0.453592', '/' => '60'),      'lb/m'),
0107         'POUND_PER_SECOND'     => array('0.453592',                              'lb/s'),
0108         'TON_LONG_PER_DAY'     => array(array('' => '1016.04608', '/' => '86400'), 't/day'),
0109         'TON_LONG_PER_HOUR'    => array(array('' => '1016.04608', '/' => '3600'),  't/h'),
0110         'TON_LONG_PER_MINUTE'  => array(array('' => '1016.04608', '/' => '60'),    't/m'),
0111         'TON_LONG_PER_SECOND'  => array('1016.04608',                            't/s'),
0112         'TON_PER_DAY'          => array(array('' => '1000', '/' => '86400'),       't/day'),
0113         'TON_PER_HOUR'         => array(array('' => '1000', '/' => '3600'),        't/h'),
0114         'TON_PER_MINUTE'       => array(array('' => '1000', '/' => '60'),          't/m'),
0115         'TON_PER_SECOND'       => array('1000',                                  't/s'),
0116         'TON_SHORT_PER_DAY'    => array(array('' => '907.184', '/' => '86400'),    't/day'),
0117         'TON_SHORT_PER_HOUR'   => array(array('' => '907.184', '/' => '3600'),     't/h'),
0118         'TON_SHORT_PER_MINUTE' => array(array('' => '907.184', '/' => '60'),       't/m'),
0119         'TON_SHORT_PER_SECOND' => array('907.184',                               't/s'),
0120         'STANDARD'             => 'KILOGRAM_PER_SECOND'
0121     );
0122 }