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