import v1.0.0-RC4 | 2009-05-20
This commit is contained in:
376
libs/Zend/Measure/Abstract.php
Normal file
376
libs/Zend/Measure/Abstract.php
Normal file
@ -0,0 +1,376 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Abstract.php 12060 2008-10-21 17:23:55Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Locale
|
||||
*/
|
||||
require_once 'Zend/Locale.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Locale_Math
|
||||
*/
|
||||
require_once 'Zend/Locale/Math.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Locale_Format
|
||||
*/
|
||||
require_once 'Zend/Locale/Format.php';
|
||||
|
||||
/**
|
||||
* Abstract class for all measurements
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @subpackage Zend_Measure_Abstract
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
abstract class Zend_Measure_Abstract
|
||||
{
|
||||
/**
|
||||
* Plain value in standard unit
|
||||
*
|
||||
* @var string $_value
|
||||
*/
|
||||
protected $_value;
|
||||
|
||||
/**
|
||||
* Original type for this unit
|
||||
*
|
||||
* @var string $_type
|
||||
*/
|
||||
protected $_type;
|
||||
|
||||
/**
|
||||
* Locale identifier
|
||||
*
|
||||
* @var string $_locale
|
||||
*/
|
||||
protected $_locale = null;
|
||||
|
||||
/**
|
||||
* Unit types for this measurement
|
||||
*/
|
||||
protected $_units = array();
|
||||
|
||||
/**
|
||||
* Zend_Measure_Abstract is an abstract class for the different measurement types
|
||||
*
|
||||
* @param $value mixed - Value as string, integer, real or float
|
||||
* @param $type type - OPTIONAL a Zend_Measure_Area Type
|
||||
* @param $locale locale - OPTIONAL a Zend_Locale Type
|
||||
* @throws Zend_Measure_Exception
|
||||
*/
|
||||
public function __construct($value, $type = null, $locale = null)
|
||||
{
|
||||
if (($type !== null) and (Zend_Locale::isLocale($type, null, false))) {
|
||||
$locale = $type;
|
||||
$type = null;
|
||||
}
|
||||
|
||||
if (empty($locale)) {
|
||||
require_once 'Zend/Registry.php';
|
||||
if (Zend_Registry::isRegistered('Zend_Locale') === true) {
|
||||
$locale = Zend_Registry::get('Zend_Locale');
|
||||
}
|
||||
}
|
||||
|
||||
if ($locale === null) {
|
||||
$locale = new Zend_Locale();
|
||||
}
|
||||
|
||||
if (!Zend_Locale::isLocale($locale, true, false)) {
|
||||
if (!Zend_Locale::isLocale($locale, false, false)) {
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
throw new Zend_Measure_Exception("Language (" . (string) $locale . ") is unknown");
|
||||
}
|
||||
|
||||
$locale = new Zend_Locale($locale);
|
||||
}
|
||||
|
||||
$this->_locale = (string) $locale;
|
||||
|
||||
if ($type === null) {
|
||||
$type = $this->_units['STANDARD'];
|
||||
}
|
||||
|
||||
if (isset($this->_units[$type]) === false) {
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
throw new Zend_Measure_Exception("Type ($type) is unknown");
|
||||
}
|
||||
|
||||
$this->setValue($value, $type, $this->_locale);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the internal value
|
||||
*
|
||||
* @param integer $round (Optional) Rounds the value to an given precision,
|
||||
* Default is 2, -1 returns without rounding
|
||||
*/
|
||||
public function getValue($round = 2)
|
||||
{
|
||||
if ($round < 0) {
|
||||
return $this->_value;
|
||||
}
|
||||
|
||||
return Zend_Locale_Math::round($this->_value, $round);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a new value
|
||||
*
|
||||
* @param integer|string $value Value as string, integer, real or float
|
||||
* @param string $type OPTIONAL A Zend_Measure_Acceleration Type
|
||||
* @param string|Zend_Locale $locale OPTIONAL Locale for parsing numbers
|
||||
* @throws Zend_Measure_Exception
|
||||
*/
|
||||
public function setValue($value, $type = null, $locale = null)
|
||||
{
|
||||
if (($type !== null) and (Zend_Locale::isLocale($type, null, false))) {
|
||||
$locale = $type;
|
||||
$type = null;
|
||||
}
|
||||
|
||||
if ($locale === null) {
|
||||
$locale = $this->_locale;
|
||||
}
|
||||
|
||||
if (!Zend_Locale::isLocale($locale, true, false)) {
|
||||
if (!Zend_Locale::isLocale($locale, false, false)) {
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
throw new Zend_Measure_Exception("Language (" . (string) $locale . ") is unknown");
|
||||
}
|
||||
|
||||
$locale = new Zend_Locale($locale);
|
||||
}
|
||||
|
||||
$locale = (string) $locale;
|
||||
if ($type === null) {
|
||||
$type = $this->_units['STANDARD'];
|
||||
}
|
||||
|
||||
if (empty($this->_units[$type])) {
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
throw new Zend_Measure_Exception("Type ($type) is unknown");
|
||||
}
|
||||
|
||||
try {
|
||||
$value = Zend_Locale_Format::getNumber($value, array('locale' => $locale));
|
||||
} catch(Exception $e) {
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
throw new Zend_Measure_Exception($e->getMessage());
|
||||
}
|
||||
|
||||
$this->_value = $value;
|
||||
$this->setType($type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the original type
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a new type, and convert the value
|
||||
*
|
||||
* @param string $type New type to set
|
||||
* @throws Zend_Measure_Exception
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
if (empty($this->_units[$type])) {
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
throw new Zend_Measure_Exception("Type ($type) is unknown");
|
||||
}
|
||||
|
||||
if (empty($this->_type)) {
|
||||
$this->_type = $type;
|
||||
} else {
|
||||
|
||||
// Convert to standard value
|
||||
$value = $this->getValue(-1);
|
||||
if (is_array($this->_units[$this->getType()][0])) {
|
||||
foreach ($this->_units[$this->getType()][0] as $key => $found) {
|
||||
switch ($key) {
|
||||
case "/":
|
||||
if ($found != 0) {
|
||||
$value = @call_user_func(Zend_Locale_Math::$div, $value, $found, 25);
|
||||
}
|
||||
break;
|
||||
case "+":
|
||||
$value = call_user_func(Zend_Locale_Math::$add, $value, $found, 25);
|
||||
break;
|
||||
case "-":
|
||||
$value = call_user_func(Zend_Locale_Math::$sub, $value, $found, 25);
|
||||
break;
|
||||
default:
|
||||
$value = call_user_func(Zend_Locale_Math::$mul, $value, $found, 25);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$value = call_user_func(Zend_Locale_Math::$mul, $value, $this->_units[$this->getType()][0], 25);
|
||||
}
|
||||
|
||||
// Convert to expected value
|
||||
if (is_array($this->_units[$type][0])) {
|
||||
foreach (array_reverse($this->_units[$type][0]) as $key => $found) {
|
||||
switch ($key) {
|
||||
case "/":
|
||||
$value = call_user_func(Zend_Locale_Math::$mul, $value, $found, 25);
|
||||
break;
|
||||
case "+":
|
||||
$value = call_user_func(Zend_Locale_Math::$sub, $value, $found, 25);
|
||||
break;
|
||||
case "-":
|
||||
$value = call_user_func(Zend_Locale_Math::$add, $value, $found, 25);
|
||||
break;
|
||||
default:
|
||||
if ($found != 0) {
|
||||
$value = @call_user_func(Zend_Locale_Math::$div, $value, $found, 25);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$value = @call_user_func(Zend_Locale_Math::$div, $value, $this->_units[$type][0], 25);
|
||||
}
|
||||
|
||||
$this->_value = $value;
|
||||
$this->_type = $type;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare if the value and type is equal
|
||||
*
|
||||
* @param Zend_Measure_Detailtype $object object to compare
|
||||
* @return boolean
|
||||
*/
|
||||
public function equals($object)
|
||||
{
|
||||
if ((string) $object == $this->toString()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation
|
||||
*
|
||||
* @param integer $round OPTIONAL rounds the value to an given exception
|
||||
* @return string
|
||||
*/
|
||||
public function toString($round = -1)
|
||||
{
|
||||
return $this->getValue($round) . ' ' . $this->_units[$this->getType()][1];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return $this->toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the conversion list
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getConversionList()
|
||||
{
|
||||
return $this->_units;
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias function for setType returning the converted unit
|
||||
*
|
||||
* @param $type type
|
||||
* @param $round integer OPTIONAL rounds the value to a given precision
|
||||
* @return string
|
||||
*/
|
||||
public function convertTo($type, $round = 2)
|
||||
{
|
||||
$this->setType($type);
|
||||
return $this->toString($round);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an unit to another one
|
||||
*
|
||||
* @param $object object of same unit type
|
||||
* @return Zend_Measure object
|
||||
*/
|
||||
public function add($object)
|
||||
{
|
||||
$object->setType($this->getType());
|
||||
$value = $this->getValue(-1) + $object->getValue(-1);
|
||||
|
||||
$this->setValue($value, $this->getType(), $this->_locale);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Substracts an unit from another one
|
||||
*
|
||||
* @param $object object of same unit type
|
||||
* @return Zend_Measure object
|
||||
*/
|
||||
public function sub($object)
|
||||
{
|
||||
$object->setType($this->getType());
|
||||
$value = $this->getValue(-1) - $object->getValue(-1);
|
||||
|
||||
$this->setValue($value, $this->getType(), $this->_locale);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compares two units
|
||||
*
|
||||
* @param $object object of same unit type
|
||||
* @return boolean
|
||||
*/
|
||||
public function compare($object)
|
||||
{
|
||||
$object->setType($this->getType());
|
||||
$value = $this->getValue(-1) - $object->getValue(-1);
|
||||
|
||||
if ($value < 0) {
|
||||
return -1;
|
||||
} else if ($value > 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
92
libs/Zend/Measure/Acceleration.php
Normal file
92
libs/Zend/Measure/Acceleration.php
Normal file
@ -0,0 +1,92 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Acceleration.php 9508 2008-05-23 10:56:41Z thomas $
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Implement needed classes
|
||||
*/
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
require_once 'Zend/Measure/Abstract.php';
|
||||
require_once 'Zend/Locale.php';
|
||||
|
||||
/**
|
||||
* Class for handling acceleration conversions
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @subpackage Zend_Measure_Acceleration
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Measure_Acceleration extends Zend_Measure_Abstract
|
||||
{
|
||||
const STANDARD = 'METER_PER_SQUARE_SECOND';
|
||||
|
||||
const CENTIGAL = 'CENTIGAL';
|
||||
const CENTIMETER_PER_SQUARE_SECOND = 'CENTIMETER_PER_SQUARE_SECOND';
|
||||
const DECIGAL = 'DECIGAL';
|
||||
const DECIMETER_PER_SQUARE_SECOND = 'DECIMETER_PER_SQUARE_SECOND';
|
||||
const DEKAMETER_PER_SQUARE_SECOND = 'DEKAMETER_PER_SQUARE_SECOND';
|
||||
const FOOT_PER_SQUARE_SECOND = 'FOOT_PER_SQUARE_SECOND';
|
||||
const G = 'G';
|
||||
const GAL = 'GAL';
|
||||
const GALILEO = 'GALILEO';
|
||||
const GRAV = 'GRAV';
|
||||
const HECTOMETER_PER_SQUARE_SECOND = 'HECTOMETER_PER_SQUARE_SECOND';
|
||||
const INCH_PER_SQUARE_SECOND = 'INCH_PER_SQUARE_SECOND';
|
||||
const KILOMETER_PER_HOUR_SECOND = 'KILOMETER_PER_HOUR_SECOND';
|
||||
const KILOMETER_PER_SQUARE_SECOND = 'KILOMETER_PER_SQUARE_SECOND';
|
||||
const METER_PER_SQUARE_SECOND = 'METER_PER_SQUARE_SECOND';
|
||||
const MILE_PER_HOUR_MINUTE = 'MILE_PER_HOUR_MINUTE';
|
||||
const MILE_PER_HOUR_SECOND = 'MILE_PER_HOUR_SECOND';
|
||||
const MILE_PER_SQUARE_SECOND = 'MILE_PER_SQUARE_SECOND';
|
||||
const MILLIGAL = 'MILLIGAL';
|
||||
const MILLIMETER_PER_SQUARE_SECOND = 'MILLIMETER_PER_SQUARE_SECOND';
|
||||
|
||||
/**
|
||||
* Calculations for all acceleration units
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_units = array(
|
||||
'CENTIGAL' => array('0.0001', 'cgal'),
|
||||
'CENTIMETER_PER_SQUARE_SECOND' => array('0.01', 'cm/s²'),
|
||||
'DECIGAL' => array('0.001', 'dgal'),
|
||||
'DECIMETER_PER_SQUARE_SECOND' => array('0.1', 'dm/s²'),
|
||||
'DEKAMETER_PER_SQUARE_SECOND' => array('10', 'dam/s²'),
|
||||
'FOOT_PER_SQUARE_SECOND' => array('0.3048', 'ft/s²'),
|
||||
'G' => array('9.80665', 'g'),
|
||||
'GAL' => array('0.01', 'gal'),
|
||||
'GALILEO' => array('0.01', 'gal'),
|
||||
'GRAV' => array('9.80665', 'g'),
|
||||
'HECTOMETER_PER_SQUARE_SECOND' => array('100', 'h/s²'),
|
||||
'INCH_PER_SQUARE_SECOND' => array('0.0254', 'in/s²'),
|
||||
'KILOMETER_PER_HOUR_SECOND' => array(array('' => '5','/' => '18'), 'km/h²'),
|
||||
'KILOMETER_PER_SQUARE_SECOND' => array('1000', 'km/s²'),
|
||||
'METER_PER_SQUARE_SECOND' => array('1', 'm/s²'),
|
||||
'MILE_PER_HOUR_MINUTE' => array(array('' => '22', '/' => '15', '*' => '0.3048', '/' => '60'), 'mph/m'),
|
||||
'MILE_PER_HOUR_SECOND' => array(array('' => '22', '/' => '15', '*' => '0.3048'), 'mph/s'),
|
||||
'MILE_PER_SQUARE_SECOND' => array('1609.344', 'mi/s²'),
|
||||
'MILLIGAL' => array('0.00001', 'mgal'),
|
||||
'MILLIMETER_PER_SQUARE_SECOND' => array('0.001', 'mm/s²'),
|
||||
'STANDARD' => 'METER_PER_SQUARE_SECOND'
|
||||
);
|
||||
}
|
79
libs/Zend/Measure/Angle.php
Normal file
79
libs/Zend/Measure/Angle.php
Normal file
@ -0,0 +1,79 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Angle.php 9508 2008-05-23 10:56:41Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implement needed classes
|
||||
*/
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
require_once 'Zend/Measure/Abstract.php';
|
||||
require_once 'Zend/Locale.php';
|
||||
|
||||
/**
|
||||
* Class for handling angle conversions
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @subpackage Zend_Measure_Angle
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Measure_Angle extends Zend_Measure_Abstract
|
||||
{
|
||||
const STANDARD = 'RADIAN';
|
||||
|
||||
const RADIAN = 'RADIAN';
|
||||
const MIL = 'MIL';
|
||||
const GRAD = 'GRAD';
|
||||
const DEGREE = 'DEGREE';
|
||||
const MINUTE = 'MINUTE';
|
||||
const SECOND = 'SECOND';
|
||||
const POINT = 'POINT';
|
||||
const CIRCLE_16 = 'CIRCLE_16';
|
||||
const CIRCLE_10 = 'CIRCLE_10';
|
||||
const CIRCLE_8 = 'CIRCLE_8';
|
||||
const CIRCLE_6 = 'CIRCLE_6';
|
||||
const CIRCLE_4 = 'CIRCLE_4';
|
||||
const CIRCLE_2 = 'CIRCLE_2';
|
||||
const FULL_CIRCLE = 'FULL_CIRCLE';
|
||||
|
||||
/**
|
||||
* Calculations for all angle units
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_units = array(
|
||||
'RADIAN' => array('1','rad'),
|
||||
'MIL' => array(array('' => M_PI,'/' => '3200'), 'mil'),
|
||||
'GRAD' => array(array('' => M_PI,'/' => '200'), 'gr'),
|
||||
'DEGREE' => array(array('' => M_PI,'/' => '180'), '°'),
|
||||
'MINUTE' => array(array('' => M_PI,'/' => '10800'), "'"),
|
||||
'SECOND' => array(array('' => M_PI,'/' => '648000'), '"'),
|
||||
'POINT' => array(array('' => M_PI,'/' => '16'), 'pt'),
|
||||
'CIRCLE_16' => array(array('' => M_PI,'/' => '8'), 'per 16 circle'),
|
||||
'CIRCLE_10' => array(array('' => M_PI,'/' => '5'), 'per 10 circle'),
|
||||
'CIRCLE_8' => array(array('' => M_PI,'/' => '4'), 'per 8 circle'),
|
||||
'CIRCLE_6' => array(array('' => M_PI,'/' => '3'), 'per 6 circle'),
|
||||
'CIRCLE_4' => array(array('' => M_PI,'/' => '2'), 'per 4 circle'),
|
||||
'CIRCLE_2' => array(M_PI, 'per 2 circle'),
|
||||
'FULL_CIRCLE' => array(array('' => M_PI,'*' => '2'), 'cir'),
|
||||
'STANDARD' => 'RADIAN'
|
||||
);
|
||||
}
|
311
libs/Zend/Measure/Area.php
Normal file
311
libs/Zend/Measure/Area.php
Normal file
@ -0,0 +1,311 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Area.php 9508 2008-05-23 10:56:41Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implement needed classes
|
||||
*/
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
require_once 'Zend/Measure/Abstract.php';
|
||||
require_once 'Zend/Locale.php';
|
||||
|
||||
/**
|
||||
* Class for handling area conversions
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @subpackage Zend_Measure_Area
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Measure_Area extends Zend_Measure_Abstract
|
||||
{
|
||||
const STANDARD = 'SQUARE_METER';
|
||||
|
||||
const ACRE = 'ACRE';
|
||||
const ACRE_COMMERCIAL = 'ACRE_COMMERCIAL';
|
||||
const ACRE_SURVEY = 'ACRE_SURVEY';
|
||||
const ACRE_IRELAND = 'ACRE_IRELAND';
|
||||
const ARE = 'ARE';
|
||||
const ARPENT = 'ARPENT';
|
||||
const BARN = 'BARN';
|
||||
const BOVATE = 'BOVATE';
|
||||
const BUNDER = 'BUNDER';
|
||||
const CABALLERIA = 'CABALLERIA';
|
||||
const CABALLERIA_AMERICA = 'CABALLERIA_AMERICA';
|
||||
const CABALLERIA_CUBA = 'CABALLERIA_CUBA';
|
||||
const CARREAU = 'CARREAU';
|
||||
const CARUCATE = 'CARUCATE';
|
||||
const CAWNEY = 'CAWNEY';
|
||||
const CENTIARE = 'CENTIARE';
|
||||
const CONG = 'CONG';
|
||||
const COVER = 'COVER';
|
||||
const CUERDA = 'CUERDA';
|
||||
const DEKARE = 'DEKARE';
|
||||
const DESSIATINA = 'DESSIATINA';
|
||||
const DHUR = 'DHUR';
|
||||
const DUNUM = 'DUNUM';
|
||||
const DUNHAM = 'DUNHAM';
|
||||
const FALL_SCOTS = 'FALL_SCOTS';
|
||||
const FALL = 'FALL';
|
||||
const FANEGA = 'FANEGA';
|
||||
const FARTHINGDALE = 'FARTHINGDALE';
|
||||
const HACIENDA = 'HACIENDA';
|
||||
const HECTARE = 'HECTARE';
|
||||
const HIDE = 'HIDE';
|
||||
const HOMESTEAD = 'HOMESTEAD';
|
||||
const HUNDRED = 'HUNDRED';
|
||||
const JERIB = 'JERIB';
|
||||
const JITRO = 'JITRO';
|
||||
const JOCH = 'JOCH';
|
||||
const JUTRO = 'JUTRO';
|
||||
const JO = 'JO';
|
||||
const KAPPLAND = 'KAPPLAND';
|
||||
const KATTHA = 'KATTHA';
|
||||
const LABOR = 'LABOR';
|
||||
const LEGUA = 'LEGUA';
|
||||
const MANZANA_COSTA_RICA = 'MANZANA_COSTA_RICA';
|
||||
const MANZANA = 'MANZANA';
|
||||
const MORGEN = 'MORGEN';
|
||||
const MORGEN_AFRICA = 'MORGEN_AFRICA';
|
||||
const MU = 'MU';
|
||||
const NGARN = 'NGARN';
|
||||
const NOOK = 'NOOK';
|
||||
const OXGANG = 'OXGANG';
|
||||
const PERCH = 'PERCH';
|
||||
const PERCHE = 'PERCHE';
|
||||
const PING = 'PING';
|
||||
const PYONG = 'PYONG';
|
||||
const RAI = 'RAI';
|
||||
const ROOD = 'ROOD';
|
||||
const SECTION = 'SECTION';
|
||||
const SHED = 'SHED';
|
||||
const SITIO = 'SITIO';
|
||||
const SQUARE = 'SQUARE';
|
||||
const SQUARE_ANGSTROM = 'SQUARE_ANGSTROM';
|
||||
const SQUARE_ASTRONOMICAL_UNIT = 'SQUARE_ASTRONOMICAL_UNIT';
|
||||
const SQUARE_ATTOMETER = 'SQUARE_ATTOMETER';
|
||||
const SQUARE_BICRON = 'SQUARE_BICRON';
|
||||
const SQUARE_CENTIMETER = 'SQUARE_CENTIMETER';
|
||||
const SQUARE_CHAIN = 'SQUARE_CHAIN';
|
||||
const SQUARE_CHAIN_ENGINEER = 'SQUARE_CHAIN_ENGINEER';
|
||||
const SQUARE_CITY_BLOCK_US_EAST = 'SQUARE_CITY_BLOCK_US_EAST';
|
||||
const SQUARE_CITY_BLOCK_US_WEST = 'SQUARE_CITY_BLOCK_US_WEST';
|
||||
const SQUARE_CITY_BLOCK_US_SOUTH = 'SQUARE_CITY_BLOCK_US_SOUTH';
|
||||
const SQUARE_CUBIT = 'SQUARE_CUBIT';
|
||||
const SQUARE_DECIMETER = 'SQUARE_DECIMETER';
|
||||
const SQUARE_DEKAMETER = 'SQUARE_DEKAMETER';
|
||||
const SQUARE_EXAMETER = 'SQUARE_EXAMETER';
|
||||
const SQUARE_FATHOM = 'SQUARE_FATHOM';
|
||||
const SQUARE_FEMTOMETER = 'SQUARE_FEMTOMETER';
|
||||
const SQUARE_FERMI = 'SQUARE_FERMI';
|
||||
const SQUARE_FOOT = 'SQUARE_FOOT';
|
||||
const SQUARE_FOOT_SURVEY = 'SQUARE_FOOT_SURVEY';
|
||||
const SQUARE_FURLONG = 'SQUARE_FURLONG';
|
||||
const SQUARE_GIGAMETER = 'SQUARE_GIGAMETER';
|
||||
const SQUARE_HECTOMETER = 'SQUARE_HECTOMETER';
|
||||
const SQUARE_INCH = 'SQUARE_INCH';
|
||||
const SQUARE_INCH_SURVEY = 'SQUARE_INCH_SURVEY';
|
||||
const SQUARE_KILOMETER = 'SQUARE_KILOMETER';
|
||||
const SQUARE_LEAGUE_NAUTIC = 'SQUARE_LEAGUE_NAUTIC';
|
||||
const SQUARE_LEAGUE = 'SQUARE_LEAGUE';
|
||||
const SQUARE_LIGHT_YEAR = 'SQUARE_LIGHT_YEAR';
|
||||
const SQUARE_LINK = 'SQUARE_LINK';
|
||||
const SQUARE_LINK_ENGINEER = 'SQUARE_LINK_ENGINEER';
|
||||
const SQUARE_MEGAMETER = 'SQUARE_MEGAMETER';
|
||||
const SQUARE_METER = 'SQUARE_METER';
|
||||
const SQUARE_MICROINCH = 'SQUARE_MICROINCH';
|
||||
const SQUARE_MICROMETER = 'SQUARE_MICROMETER';
|
||||
const SQUARE_MICROMICRON = 'SQUARE_MICROMICRON';
|
||||
const SQUARE_MICRON = 'SQUARE_MICRON';
|
||||
const SQUARE_MIL = 'SQUARE_MIL';
|
||||
const SQUARE_MILE = 'SQUARE_MILE';
|
||||
const SQUARE_MILE_NAUTIC = 'SQUARE_MILE_NAUTIC';
|
||||
const SQUARE_MILE_SURVEY = 'SQUARE_MILE_SURVEY';
|
||||
const SQUARE_MILLIMETER = 'SQUARE_MILLIMETER';
|
||||
const SQUARE_MILLIMICRON = 'SQUARE_MILLIMICRON';
|
||||
const SQUARE_MYRIAMETER = 'SQUARE_MYRIAMETER';
|
||||
const SQUARE_NANOMETER = 'SQUARE_NANOMETER';
|
||||
const SQUARE_PARIS_FOOT = 'SQUARE_PARIS_FOOT';
|
||||
const SQUARE_PARSEC = 'SQUARE_PARSEC';
|
||||
const SQUARE_PERCH = 'SQUARE_PERCH';
|
||||
const SQUARE_PERCHE = 'SQUARE_PERCHE';
|
||||
const SQUARE_PETAMETER = 'SQUARE_PETAMETER';
|
||||
const SQUARE_PICOMETER = 'SQUARE_PICOMETER';
|
||||
const SQUARE_ROD = 'SQUARE_ROD';
|
||||
const SQUARE_TENTHMETER = 'SQUARE_TENTHMETER';
|
||||
const SQUARE_TERAMETER = 'SQUARE_TERAMETER';
|
||||
const SQUARE_THOU = 'SQUARE_THOU';
|
||||
const SQUARE_VARA = 'SQUARE_VARA';
|
||||
const SQUARE_VARA_TEXAS = 'SQUARE_VARA_TEXAS';
|
||||
const SQUARE_YARD = 'SQUARE_YARD';
|
||||
const SQUARE_YARD_SURVEY = 'SQUARE_YARD_SURVEY';
|
||||
const SQUARE_YOCTOMETER = 'SQUARE_YOCTOMETER';
|
||||
const SQUARE_YOTTAMETER = 'SQUARE_YOTTAMETER';
|
||||
const STANG = 'STANG';
|
||||
const STREMMA = 'STREMMA';
|
||||
const TAREA = 'TAREA';
|
||||
const TATAMI = 'TATAMI';
|
||||
const TONDE_LAND = 'TONDE_LAND';
|
||||
const TOWNSHIP = 'TOWNSHIP';
|
||||
const TSUBO = 'TSUBO';
|
||||
const TUNNLAND = 'TUNNLAND';
|
||||
const YARD = 'YARD';
|
||||
const VIRGATE = 'VIRGATE';
|
||||
|
||||
/**
|
||||
* Calculations for all area units
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_units = array(
|
||||
'ACRE' => array('4046.856422', 'A'),
|
||||
'ACRE_COMMERCIAL' => array('3344.50944', 'A'),
|
||||
'ACRE_SURVEY' => array('4046.872627', 'A'),
|
||||
'ACRE_IRELAND' => array('6555', 'A'),
|
||||
'ARE' => array('100', 'a'),
|
||||
'ARPENT' => array('3418.89', 'arpent'),
|
||||
'BARN' => array('1e-28', 'b'),
|
||||
'BOVATE' => array('60000', 'bovate'),
|
||||
'BUNDER' => array('10000', 'bunder'),
|
||||
'CABALLERIA' => array('400000', 'caballeria'),
|
||||
'CABALLERIA_AMERICA' => array('450000', 'caballeria'),
|
||||
'CABALLERIA_CUBA' => array('134200', 'caballeria'),
|
||||
'CARREAU' => array('12900', 'carreau'),
|
||||
'CARUCATE' => array('486000', 'carucate'),
|
||||
'CAWNEY' => array('5400', 'cawney'),
|
||||
'CENTIARE' => array('1', 'ca'),
|
||||
'CONG' => array('1000', 'cong'),
|
||||
'COVER' => array('2698', 'cover'),
|
||||
'CUERDA' => array('3930', 'cda'),
|
||||
'DEKARE' => array('1000', 'dekare'),
|
||||
'DESSIATINA' => array('10925', 'dessiantina'),
|
||||
'DHUR' => array('16.929', 'dhur'),
|
||||
'DUNUM' => array('1000', 'dunum'),
|
||||
'DUNHAM' => array('1000', 'dunham'),
|
||||
'FALL_SCOTS' => array('32.15', 'fall'),
|
||||
'FALL' => array('47.03', 'fall'),
|
||||
'FANEGA' => array('6430', 'fanega'),
|
||||
'FARTHINGDALE' => array('1012', 'farthingdale'),
|
||||
'HACIENDA' => array('89600000', 'hacienda'),
|
||||
'HECTARE' => array('10000', 'ha'),
|
||||
'HIDE' => array('486000', 'hide'),
|
||||
'HOMESTEAD' => array('647500', 'homestead'),
|
||||
'HUNDRED' => array('50000000', 'hundred'),
|
||||
'JERIB' => array('2000', 'jerib'),
|
||||
'JITRO' => array('5755', 'jitro'),
|
||||
'JOCH' => array('5755', 'joch'),
|
||||
'JUTRO' => array('5755', 'jutro'),
|
||||
'JO' => array('1.62', 'jo'),
|
||||
'KAPPLAND' => array('154.26', 'kappland'),
|
||||
'KATTHA' => array('338', 'kattha'),
|
||||
'LABOR' => array('716850', 'labor'),
|
||||
'LEGUA' => array('17920000', 'legua'),
|
||||
'MANZANA_COSTA_RICA' => array('6988.96', 'manzana'),
|
||||
'MANZANA' => array('10000', 'manzana'),
|
||||
'MORGEN' => array('2500', 'morgen'),
|
||||
'MORGEN_AFRICA' => array('8567', 'morgen'),
|
||||
'MU' => array(array('' => '10000', '/' => '15'), 'mu'),
|
||||
'NGARN' => array('400', 'ngarn'),
|
||||
'NOOK' => array('80937.128', 'nook'),
|
||||
'OXGANG' => array('60000', 'oxgang'),
|
||||
'PERCH' => array('25.29285264', 'perch'),
|
||||
'PERCHE' => array('34.19', 'perche'),
|
||||
'PING' => array('3.305', 'ping'),
|
||||
'PYONG' => array('3.306', 'pyong'),
|
||||
'RAI' => array('1600', 'rai'),
|
||||
'ROOD' => array('1011.7141', 'rood'),
|
||||
'SECTION' => array('2589998.5', 'sec'),
|
||||
'SHED' => array('10e-52', 'shed'),
|
||||
'SITIO' => array('18000000', 'sitio'),
|
||||
'SQUARE' => array('9.290304', 'sq'),
|
||||
'SQUARE_ANGSTROM' => array('1.0e-20', 'A²'),
|
||||
'SQUARE_ASTRONOMICAL_UNIT' => array('2.2379523e+22', 'AU²'),
|
||||
'SQUARE_ATTOMETER' => array('1.0e-36', 'am²'),
|
||||
'SQUARE_BICRON' => array('1.0e-24', 'µµ²'),
|
||||
'SQUARE_CENTIMETER' => array('0.0001', 'cm²'),
|
||||
'SQUARE_CHAIN' => array('404.68726', 'ch²'),
|
||||
'SQUARE_CHAIN_ENGINEER' => array('929.03412', 'ch²'),
|
||||
'SQUARE_CITY_BLOCK_US_EAST' => array('4.97027584', 'sq block'),
|
||||
'SQUARE_CITY_BLOCK_US_WEST' => array('17.141056', 'sq block'),
|
||||
'SQUARE_CITY_BLOCK_US_SOUTH' => array('99.88110336', 'sq block'),
|
||||
'SQUARE_CUBIT' => array('0.20903184', 'sq cubit'),
|
||||
'SQUARE_DECIMETER' => array('0.01', 'dm²'),
|
||||
'SQUARE_DEKAMETER' => array('100', 'dam²'),
|
||||
'SQUARE_EXAMETER' => array('1.0e+36', 'Em²'),
|
||||
'SQUARE_FATHOM' => array('3.3445228', 'fth²'),
|
||||
'SQUARE_FEMTOMETER' => array('1.0e-30', 'fm²'),
|
||||
'SQUARE_FERMI' => array('1.0e-30', 'f²'),
|
||||
'SQUARE_FOOT' => array('0.09290304', 'ft²'),
|
||||
'SQUARE_FOOT_SURVEY' => array('0.092903412', 'ft²'),
|
||||
'SQUARE_FURLONG' => array('40468.726', 'fur²'),
|
||||
'SQUARE_GIGAMETER' => array('1.0e+18', 'Gm²'),
|
||||
'SQUARE_HECTOMETER' => array('10000', 'hm²'),
|
||||
'SQUARE_INCH' => array(array('' => '0.09290304','/' => '144'), 'in²'),
|
||||
'SQUARE_INCH_SURVEY' => array(array('' => '0.092903412','/' => '144'), 'in²'),
|
||||
'SQUARE_KILOMETER' => array('1000000', 'km²'),
|
||||
'SQUARE_LEAGUE_NAUTIC' => array('3.0869136e+07', 'sq league'),
|
||||
'SQUARE_LEAGUE' => array('2.3309986e+07', 'sq league'),
|
||||
'SQUARE_LIGHT_YEAR' => array('8.9505412e+31', 'ly²'),
|
||||
'SQUARE_LINK' => array('0.040468726', 'sq link'),
|
||||
'SQUARE_LINK_ENGINEER' => array('0.092903412', 'sq link'),
|
||||
'SQUARE_MEGAMETER' => array('1.0e+12', 'Mm²'),
|
||||
'SQUARE_METER' => array('1', 'm²'),
|
||||
'SQUARE_MICROINCH' => array(array('' => '1.0e-6','*' => '6.4516e-10'), 'µin²'),
|
||||
'SQUARE_MICROMETER' => array('1.0e-12', 'µm²'),
|
||||
'SQUARE_MICROMICRON' => array('1.0e-24', 'µµ²'),
|
||||
'SQUARE_MICRON' => array('1.0e-12', 'µ²'),
|
||||
'SQUARE_MIL' => array('6.4516e-10', 'sq mil'),
|
||||
'SQUARE_MILE' => array(array('' => '0.09290304','*' => '27878400'), 'mi²'),
|
||||
'SQUARE_MILE_NAUTIC' => array('3429904', 'mi²'),
|
||||
'SQUARE_MILE_SURVEY' => array('2589998.5', 'mi²'),
|
||||
'SQUARE_MILLIMETER' => array('0.000001', 'mm²'),
|
||||
'SQUARE_MILLIMICRON' => array('1.0e-18', 'mµ²'),
|
||||
'SQUARE_MYRIAMETER' => array('1.0e+8', 'mym²'),
|
||||
'SQUARE_NANOMETER' => array('1.0e-18', 'nm²'),
|
||||
'SQUARE_PARIS_FOOT' => array('0.1055', 'sq paris foot'),
|
||||
'SQUARE_PARSEC' => array('9.5214087e+32', 'pc²'),
|
||||
'SQUARE_PERCH' => array('25.292954', 'sq perch'),
|
||||
'SQUARE_PERCHE' => array('51.072', 'sq perche'),
|
||||
'SQUARE_PETAMETER' => array('1.0e+30', 'Pm²'),
|
||||
'SQUARE_PICOMETER' => array('1.0e-24', 'pm²'),
|
||||
'SQUARE_ROD' => array(array('' => '0.092903412','*' => '272.25'), 'rd²'),
|
||||
'SQUARE_TENTHMETER' => array('1.0e-20', 'sq tenth-meter'),
|
||||
'SQUARE_TERAMETER' => array('1.0e+24', 'Tm²'),
|
||||
'SQUARE_THOU' => array('6.4516e-10', 'sq thou'),
|
||||
'SQUARE_VARA' => array('0.70258205', 'sq vara'),
|
||||
'SQUARE_VARA_TEXAS' => array('0.71684731', 'sq vara'),
|
||||
'SQUARE_YARD' => array('0.83612736', 'yd²'),
|
||||
'SQUARE_YARD_SURVEY' => array('0.836130708', 'yd²'),
|
||||
'SQUARE_YOCTOMETER' => array('1.0e-48', 'ym²'),
|
||||
'SQUARE_YOTTAMETER' => array('1.0e+48', 'Ym²'),
|
||||
'STANG' => array('2709', 'stang'),
|
||||
'STREMMA' => array('1000', 'stremma'),
|
||||
'TAREA' => array('628.8', 'tarea'),
|
||||
'TATAMI' => array('1.62', 'tatami'),
|
||||
'TONDE_LAND' => array('5516', 'tonde land'),
|
||||
'TOWNSHIP' => array('93239945.3196288', 'twp'),
|
||||
'TSUBO' => array('3.3058', 'tsubo'),
|
||||
'TUNNLAND' => array('4936.4', 'tunnland'),
|
||||
'YARD' => array('0.83612736', 'yd'),
|
||||
'VIRGATE' => array('120000', 'virgate'),
|
||||
'STANDARD' => 'SQUARE_METER'
|
||||
);
|
||||
}
|
123
libs/Zend/Measure/Binary.php
Normal file
123
libs/Zend/Measure/Binary.php
Normal file
@ -0,0 +1,123 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Binary.php 9508 2008-05-23 10:56:41Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implement needed classes
|
||||
*/
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
require_once 'Zend/Measure/Abstract.php';
|
||||
require_once 'Zend/Locale.php';
|
||||
|
||||
/**
|
||||
* Class for handling binary conversions
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @subpackage Zend_Measure_Binary
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Measure_Binary extends Zend_Measure_Abstract
|
||||
{
|
||||
const STANDARD = 'BYTE';
|
||||
|
||||
const BIT = 'BIT';
|
||||
const CRUMB = 'CRUMB';
|
||||
const NIBBLE = 'NIBBLE';
|
||||
const BYTE = 'BYTE';
|
||||
const KILOBYTE = 'KILOBYTE';
|
||||
const KIBIBYTE = 'KIBIBYTE';
|
||||
const KILO_BINARY_BYTE = 'KILO_BINARY_BYTE';
|
||||
const KILOBYTE_SI = 'KILOBYTE_SI';
|
||||
const MEGABYTE = 'MEGABYTE';
|
||||
const MEBIBYTE = 'MEBIBYTE';
|
||||
const MEGA_BINARY_BYTE = 'MEGA_BINARY_BYTE';
|
||||
const MEGABYTE_SI = 'MEGABYTE_SI';
|
||||
const GIGABYTE = 'GIGABYTE';
|
||||
const GIBIBYTE = 'GIBIBYTE';
|
||||
const GIGA_BINARY_BYTE = 'GIGA_BINARY_BYTE';
|
||||
const GIGABYTE_SI = 'GIGABYTE_SI';
|
||||
const TERABYTE = 'TERABYTE';
|
||||
const TEBIBYTE = 'TEBIBYTE';
|
||||
const TERA_BINARY_BYTE = 'TERA_BINARY_BYTE';
|
||||
const TERABYTE_SI = 'TERABYTE_SI';
|
||||
const PETABYTE = 'PETABYTE';
|
||||
const PEBIBYTE = 'PEBIBYTE';
|
||||
const PETA_BINARY_BYTE = 'PETA_BINARY_BYTE';
|
||||
const PETABYTE_SI = 'PETABYTE_SI';
|
||||
const EXABYTE = 'EXABYTE';
|
||||
const EXBIBYTE = 'EXBIBYTE';
|
||||
const EXA_BINARY_BYTE = 'EXA_BINARY_BYTE';
|
||||
const EXABYTE_SI = 'EXABYTE_SI';
|
||||
const ZETTABYTE = 'ZETTABYTE';
|
||||
const ZEBIBYTE = 'ZEBIBYTE';
|
||||
const ZETTA_BINARY_BYTE = 'ZETTA_BINARY_BYTE';
|
||||
const ZETTABYTE_SI = 'ZETTABYTE_SI';
|
||||
const YOTTABYTE = 'YOTTABYTE';
|
||||
const YOBIBYTE = 'YOBIBYTE';
|
||||
const YOTTA_BINARY_BYTE = 'YOTTA_BINARY_BYTE';
|
||||
const YOTTABYTE_SI = 'YOTTABYTE_SI';
|
||||
|
||||
/**
|
||||
* Calculations for all binary units
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_units = array(
|
||||
'BIT' => array('0.125', 'b'),
|
||||
'CRUMB' => array('0.25', 'crumb'),
|
||||
'NIBBLE' => array('0.5', 'nibble'),
|
||||
'BYTE' => array('1', 'B'),
|
||||
'KILOBYTE' => array('1024', 'kB'),
|
||||
'KIBIBYTE' => array('1024', 'KiB'),
|
||||
'KILO_BINARY_BYTE' => array('1024', 'KiB'),
|
||||
'KILOBYTE_SI' => array('1000', 'kB.'),
|
||||
'MEGABYTE' => array('1048576', 'MB'),
|
||||
'MEBIBYTE' => array('1048576', 'MiB'),
|
||||
'MEGA_BINARY_BYTE' => array('1048576', 'MiB'),
|
||||
'MEGABYTE_SI' => array('1000000', 'MB.'),
|
||||
'GIGABYTE' => array('1073741824', 'GB'),
|
||||
'GIBIBYTE' => array('1073741824', 'GiB'),
|
||||
'GIGA_BINARY_BYTE' => array('1073741824', 'GiB'),
|
||||
'GIGABYTE_SI' => array('1000000000', 'GB.'),
|
||||
'TERABYTE' => array('1099511627776', 'TB'),
|
||||
'TEBIBYTE' => array('1099511627776', 'TiB'),
|
||||
'TERA_BINARY_BYTE' => array('1099511627776', 'TiB'),
|
||||
'TERABYTE_SI' => array('1000000000000', 'TB.'),
|
||||
'PETABYTE' => array('1125899906842624', 'PB'),
|
||||
'PEBIBYTE' => array('1125899906842624', 'PiB'),
|
||||
'PETA_BINARY_BYTE' => array('1125899906842624', 'PiB'),
|
||||
'PETABYTE_SI' => array('1000000000000000', 'PB.'),
|
||||
'EXABYTE' => array('1152921504606846976', 'EB'),
|
||||
'EXBIBYTE' => array('1152921504606846976', 'EiB'),
|
||||
'EXA_BINARY_BYTE' => array('1152921504606846976', 'EiB'),
|
||||
'EXABYTE_SI' => array('1000000000000000000', 'EB.'),
|
||||
'ZETTABYTE' => array('1180591620717411303424', 'ZB'),
|
||||
'ZEBIBYTE' => array('1180591620717411303424', 'ZiB'),
|
||||
'ZETTA_BINARY_BYTE'=> array('1180591620717411303424', 'ZiB'),
|
||||
'ZETTABYTE_SI' => array('1000000000000000000000', 'ZB.'),
|
||||
'YOTTABYTE' => array('1208925819614629174706176', 'YB'),
|
||||
'YOBIBYTE' => array('1208925819614629174706176', 'YiB'),
|
||||
'YOTTA_BINARY_BYTE'=> array('1208925819614629174706176', 'YiB'),
|
||||
'YOTTABYTE_SI' => array('1000000000000000000000000', 'YB.'),
|
||||
'STANDARD' => 'BYTE'
|
||||
);
|
||||
}
|
99
libs/Zend/Measure/Capacitance.php
Normal file
99
libs/Zend/Measure/Capacitance.php
Normal file
@ -0,0 +1,99 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Capacitance.php 9508 2008-05-23 10:56:41Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implement needed classes
|
||||
*/
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
require_once 'Zend/Measure/Abstract.php';
|
||||
require_once 'Zend/Locale.php';
|
||||
|
||||
/**
|
||||
* Class for handling capacitance conversions
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @subpackage Zend_Measure_Capacitance
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Measure_Capacitance extends Zend_Measure_Abstract
|
||||
{
|
||||
const STANDARD = 'FARAD';
|
||||
|
||||
const ABFARAD = 'ABFARAD';
|
||||
const AMPERE_PER_SECOND_VOLT = 'AMPERE_PER_SECOND_VOLT';
|
||||
const CENTIFARAD = 'CENTIFARAD';
|
||||
const COULOMB_PER_VOLT = 'COULOMB_PER_VOLT';
|
||||
const DECIFARAD = 'DECIFARAD';
|
||||
const DEKAFARAD = 'DEKAFARAD';
|
||||
const ELECTROMAGNETIC_UNIT = 'ELECTROMAGNETIC_UNIT';
|
||||
const ELECTROSTATIC_UNIT = 'ELECTROSTATIC_UNIT';
|
||||
const FARAD = 'FARAD';
|
||||
const FARAD_INTERNATIONAL = 'FARAD_INTERNATIONAL';
|
||||
const GAUSSIAN = 'GAUSSIAN';
|
||||
const GIGAFARAD = 'GIGAFARAD';
|
||||
const HECTOFARAD = 'HECTOFARAD';
|
||||
const JAR = 'JAR';
|
||||
const KILOFARAD = 'KILOFARAD';
|
||||
const MEGAFARAD = 'MEGAFARAD';
|
||||
const MICROFARAD = 'MICROFARAD';
|
||||
const MILLIFARAD = 'MILLIFARAD';
|
||||
const NANOFARAD = 'NANOFARAD';
|
||||
const PICOFARAD = 'PICOFARAD';
|
||||
const PUFF = 'PUFF';
|
||||
const SECOND_PER_OHM = 'SECOND_PER_OHM';
|
||||
const STATFARAD = 'STATFARAD';
|
||||
const TERAFARAD = 'TERAFARAD';
|
||||
|
||||
/**
|
||||
* Calculations for all capacitance units
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_units = array(
|
||||
'ABFARAD' => array('1.0e+9', 'abfarad'),
|
||||
'AMPERE_PER_SECOND_VOLT' => array('1', 'A/sV'),
|
||||
'CENTIFARAD' => array('0.01', 'cF'),
|
||||
'COULOMB_PER_VOLT' => array('1', 'C/V'),
|
||||
'DECIFARAD' => array('0.1', 'dF'),
|
||||
'DEKAFARAD' => array('10', 'daF'),
|
||||
'ELECTROMAGNETIC_UNIT' => array('1.0e+9', 'capacity emu'),
|
||||
'ELECTROSTATIC_UNIT' => array('1.11265e-12', 'capacity esu'),
|
||||
'FARAD' => array('1', 'F'),
|
||||
'FARAD_INTERNATIONAL' => array('0.99951', 'F'),
|
||||
'GAUSSIAN' => array('1.11265e-12', 'G'),
|
||||
'GIGAFARAD' => array('1.0e+9', 'GF'),
|
||||
'HECTOFARAD' => array('100', 'hF'),
|
||||
'JAR' => array('1.11265e-9', 'jar'),
|
||||
'KILOFARAD' => array('1000', 'kF'),
|
||||
'MEGAFARAD' => array('1000000', 'MF'),
|
||||
'MICROFARAD' => array('0.000001', 'µF'),
|
||||
'MILLIFARAD' => array('0.001', 'mF'),
|
||||
'NANOFARAD' => array('1.0e-9', 'nF'),
|
||||
'PICOFARAD' => array('1.0e-12', 'pF'),
|
||||
'PUFF' => array('1.0e-12', 'pF'),
|
||||
'SECOND_PER_OHM' => array('1', 's/Ohm'),
|
||||
'STATFARAD' => array('1.11265e-12', 'statfarad'),
|
||||
'TERAFARAD' => array('1.0e+12', 'TF'),
|
||||
'STANDARD' => 'FARAD'
|
||||
);
|
||||
}
|
191
libs/Zend/Measure/Cooking/Volume.php
Normal file
191
libs/Zend/Measure/Cooking/Volume.php
Normal file
@ -0,0 +1,191 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Volume.php 9508 2008-05-23 10:56:41Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implement needed classes
|
||||
*/
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
require_once 'Zend/Measure/Abstract.php';
|
||||
require_once 'Zend/Locale.php';
|
||||
|
||||
/**
|
||||
* Class for handling cooking volume conversions
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @subpackage Zend_Measure_Cooking_Volume
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Measure_Cooking_Volume extends Zend_Measure_Abstract
|
||||
{
|
||||
const STANDARD = 'CUBIC_METER';
|
||||
|
||||
const CAN_2POINT5 = 'CAN_2POINT5';
|
||||
const CAN_10 = 'CAN_10';
|
||||
const BARREL_WINE = 'BARREL_WINE';
|
||||
const BARREL = 'BARREL';
|
||||
const BARREL_US_DRY = 'BARREL_US_DRY';
|
||||
const BARREL_US_FEDERAL = 'BARREL_US_FEDERAL';
|
||||
const BARREL_US = 'BARREL_US';
|
||||
const BUCKET = 'BUCKET';
|
||||
const BUCKET_US = 'BUCKET_US';
|
||||
const BUSHEL = 'BUSHEL';
|
||||
const BUSHEL_US = 'BUSHEL_US';
|
||||
const CENTILITER = 'CENTILITER';
|
||||
const COFFEE_SPOON = 'COFFEE_SPOON';
|
||||
const CUBIC_CENTIMETER = 'CUBIC_CENTIMETER';
|
||||
const CUBIC_DECIMETER = 'CUBIC_DECIMETER';
|
||||
const CUBIC_FOOT = 'CUBIC_FOOT';
|
||||
const CUBIC_INCH = 'CUBIC_INCH';
|
||||
const CUBIC_METER = 'CUBIC_METER';
|
||||
const CUBIC_MICROMETER = 'CUBIC_MICROMETER';
|
||||
const CUBIC_MILLIMETER = 'CUBIC_MILLIMETER';
|
||||
const CUP_CANADA = 'CUP_CANADA';
|
||||
const CUP = 'CUP';
|
||||
const CUP_US = 'CUP_US';
|
||||
const DASH = 'DASH';
|
||||
const DECILITER = 'DECILITER';
|
||||
const DEKALITER = 'DEKALITER';
|
||||
const DEMI = 'DEMI';
|
||||
const DRAM = 'DRAM';
|
||||
const DROP = 'DROP';
|
||||
const FIFTH = 'FIFTH';
|
||||
const GALLON = 'GALLON';
|
||||
const GALLON_US_DRY = 'GALLON_US_DRY';
|
||||
const GALLON_US = 'GALLON_US';
|
||||
const GILL = 'GILL';
|
||||
const GILL_US = 'GILL_US';
|
||||
const HECTOLITER = 'HECTOLITER';
|
||||
const HOGSHEAD = 'HOGSHEAD';
|
||||
const HOGSHEAD_US = 'HOGSHEAD_US';
|
||||
const JIGGER = 'JIGGER';
|
||||
const KILOLITER = 'KILOLITER';
|
||||
const LITER = 'LITER';
|
||||
const MEASURE = 'MEASURE';
|
||||
const MEGALITER = 'MEGALITER';
|
||||
const MICROLITER = 'MICROLITER';
|
||||
const MILLILITER = 'MILLILITER';
|
||||
const MINIM = 'MINIM';
|
||||
const MINIM_US = 'MINIM_US';
|
||||
const OUNCE = 'OUNCE';
|
||||
const OUNCE_US = 'OUNCE_US';
|
||||
const PECK = 'PECK';
|
||||
const PECK_US = 'PECK_US';
|
||||
const PINCH = 'PINCH';
|
||||
const PINT = 'PINT';
|
||||
const PINT_US_DRY = 'PINT_US_DRY';
|
||||
const PINT_US = 'PINT_US';
|
||||
const PIPE = 'PIPE';
|
||||
const PIPE_US = 'PIPE_US';
|
||||
const PONY = 'PONY';
|
||||
const QUART_GERMANY = 'QUART_GERMANY';
|
||||
const QUART_ANCIENT = 'QUART_ANCIENT';
|
||||
const QUART = 'QUART';
|
||||
const QUART_US_DRY = 'QUART_US_DRY';
|
||||
const QUART_US = 'QUART_US';
|
||||
const SHOT = 'SHOT';
|
||||
const TABLESPOON = 'TABLESPOON';
|
||||
const TABLESPOON_UK = 'TABLESPOON_UK';
|
||||
const TABLESPOON_US = 'TABLESPOON_US';
|
||||
const TEASPOON = 'TEASPOON';
|
||||
const TEASPOON_UK = 'TEASPOON_UK';
|
||||
const TEASPOON_US = 'TEASPOON_US';
|
||||
|
||||
/**
|
||||
* Calculations for all cooking volume units
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_units = array(
|
||||
'CAN_2POINT5' => array(array('' => '0.0037854118', '/' => '16', '' => '3.5'), '2.5th can'),
|
||||
'CAN_10' => array(array('' => '0.0037854118', '*' => '0.75'), '10th can'),
|
||||
'BARREL_WINE' => array('0.143201835', 'bbl'),
|
||||
'BARREL' => array('0.16365924', 'bbl'),
|
||||
'BARREL_US_DRY' => array(array('' => '26.7098656608', '/' => '231'), 'bbl'),
|
||||
'BARREL_US_FEDERAL' => array('0.1173477658', 'bbl'),
|
||||
'BARREL_US' => array('0.1192404717', 'bbl'),
|
||||
'BUCKET' => array('0.01818436', 'bucket'),
|
||||
'BUCKET_US' => array('0.018927059', 'bucket'),
|
||||
'BUSHEL' => array('0.03636872', 'bu'),
|
||||
'BUSHEL_US' => array('0.03523907', 'bu'),
|
||||
'CENTILITER' => array('0.00001', 'cl'),
|
||||
'COFFEE_SPOON' => array(array('' => '0.0037854118', '/' => '1536'), 'coffee spoon'),
|
||||
'CUBIC_CENTIMETER' => array('0.000001', 'cm³'),
|
||||
'CUBIC_DECIMETER' => array('0.001', 'dm³'),
|
||||
'CUBIC_FOOT' => array(array('' => '6.54119159', '/' => '231'), 'ft³'),
|
||||
'CUBIC_INCH' => array(array('' => '0.0037854118', '/' => '231'), 'in³'),
|
||||
'CUBIC_METER' => array('1', 'm³'),
|
||||
'CUBIC_MICROMETER' => array('1.0e-18', 'µm³'),
|
||||
'CUBIC_MILLIMETER' => array('1.0e-9', 'mm³'),
|
||||
'CUP_CANADA' => array('0.0002273045', 'c'),
|
||||
'CUP' => array('0.00025', 'c'),
|
||||
'CUP_US' => array(array('' => '0.0037854118', '/' => '16'), 'c'),
|
||||
'DASH' => array(array('' => '0.0037854118', '/' => '6144'), 'ds'),
|
||||
'DECILITER' => array('0.0001', 'dl'),
|
||||
'DEKALITER' => array('0.001', 'dal'),
|
||||
'DEMI' => array('0.00025', 'demi'),
|
||||
'DRAM' => array(array('' => '0.0037854118', '/' => '1024'), 'dr'),
|
||||
'DROP' => array(array('' => '0.0037854118', '/' => '73728'), 'ggt'),
|
||||
'FIFTH' => array('0.00075708236', 'fifth'),
|
||||
'GALLON' => array('0.00454609', 'gal'),
|
||||
'GALLON_US_DRY' => array('0.0044048838', 'gal'),
|
||||
'GALLON_US' => array('0.0037854118', 'gal'),
|
||||
'GILL' => array(array('' => '0.00454609', '/' => '32'), 'gi'),
|
||||
'GILL_US' => array(array('' => '0.0037854118', '/' => '32'), 'gi'),
|
||||
'HECTOLITER' => array('0.1', 'hl'),
|
||||
'HOGSHEAD' => array('0.28640367', 'hhd'),
|
||||
'HOGSHEAD_US' => array('0.2384809434', 'hhd'),
|
||||
'JIGGER' => array(array('' => '0.0037854118', '/' => '128', '*' => '1.5'), 'jigger'),
|
||||
'KILOLITER' => array('1', 'kl'),
|
||||
'LITER' => array('0.001', 'l'),
|
||||
'MEASURE' => array('0.0077', 'measure'),
|
||||
'MEGALITER' => array('1000', 'Ml'),
|
||||
'MICROLITER' => array('1.0e-9', 'µl'),
|
||||
'MILLILITER' => array('0.000001', 'ml'),
|
||||
'MINIM' => array(array('' => '0.00454609', '/' => '76800'), 'min'),
|
||||
'MINIM_US' => array(array('' => '0.0037854118','/' => '61440'), 'min'),
|
||||
'OUNCE' => array(array('' => '0.00454609', '/' => '160'), 'oz'),
|
||||
'OUNCE_US' => array(array('' => '0.0037854118', '/' => '128'), 'oz'),
|
||||
'PECK' => array('0.00909218', 'pk'),
|
||||
'PECK_US' => array('0.0088097676', 'pk'),
|
||||
'PINCH' => array(array('' => '0.0037854118', '/' => '12288'), 'pinch'),
|
||||
'PINT' => array(array('' => '0.00454609', '/' => '8'), 'pt'),
|
||||
'PINT_US_DRY' => array(array('' => '0.0044048838', '/' => '8'), 'pt'),
|
||||
'PINT_US' => array(array('' => '0.0037854118', '/' => '8'), 'pt'),
|
||||
'PIPE' => array('0.49097772', 'pipe'),
|
||||
'PIPE_US' => array('0.4769618868', 'pipe'),
|
||||
'PONY' => array(array('' => '0.0037854118', '/' => '128'), 'pony'),
|
||||
'QUART_GERMANY' => array('0.00114504', 'qt'),
|
||||
'QUART_ANCIENT' => array('0.00108', 'qt'),
|
||||
'QUART' => array(array('' => '0.00454609', '/' => '4'), 'qt'),
|
||||
'QUART_US_DRY' => array(array('' => '0.0044048838', '/' => '4'), 'qt'),
|
||||
'QUART_US' => array(array('' => '0.0037854118', '/' => '4'), 'qt'),
|
||||
'SHOT' => array(array('' => '0.0037854118', '/' => '128'), 'shot'),
|
||||
'TABLESPOON' => array('0.000015', 'tbsp'),
|
||||
'TABLESPOON_UK' => array(array('' => '0.00454609', '/' => '320'), 'tbsp'),
|
||||
'TABLESPOON_US' => array(array('' => '0.0037854118', '/' => '256'), 'tbsp'),
|
||||
'TEASPOON' => array('0.000005', 'tsp'),
|
||||
'TEASPOON_UK' => array(array('' => '0.00454609', '/' => '1280'), 'tsp'),
|
||||
'TEASPOON_US' => array(array('' => '0.0037854118', '/' => '768'), 'tsp'),
|
||||
'STANDARD' => 'CUBIC_METER'
|
||||
);
|
||||
}
|
71
libs/Zend/Measure/Cooking/Weight.php
Normal file
71
libs/Zend/Measure/Cooking/Weight.php
Normal file
@ -0,0 +1,71 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Weight.php 9508 2008-05-23 10:56:41Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implement needed classes
|
||||
*/
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
require_once 'Zend/Measure/Abstract.php';
|
||||
require_once 'Zend/Locale.php';
|
||||
|
||||
/**
|
||||
* Class for handling cooking weight conversions
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @subpackage Zend_Measure_Cooking_Weight
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Measure_Cooking_Weight extends Zend_Measure_Abstract
|
||||
{
|
||||
const STANDARD = 'GRAM';
|
||||
|
||||
const HALF_STICK = 'HALF_STICK';
|
||||
const STICK = 'STICK';
|
||||
const CUP = 'CUP';
|
||||
const GRAM = 'GRAM';
|
||||
const OUNCE = 'OUNCE';
|
||||
const POUND = 'POUND';
|
||||
const TEASPOON = 'TEASPOON';
|
||||
const TEASPOON_US = 'TEASPOON_US';
|
||||
const TABLESPOON = 'TABLESPOON';
|
||||
const TABLESPOON_US = 'TABLESPOON_US';
|
||||
|
||||
/**
|
||||
* Calculations for all cooking weight units
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_units = array(
|
||||
'HALF_STICK' => array(array('' => '453.59237', '/' => '8'), 'half stk'),
|
||||
'STICK' => array(array('' => '453.59237', '/' => '4'), 'stk'),
|
||||
'CUP' => array(array('' => '453.59237', '/' => '2'), 'c'),
|
||||
'GRAM' => array('1', 'g'),
|
||||
'OUNCE' => array(array('' => '453.59237', '/' => '16'), 'oz'),
|
||||
'POUND' => array('453.59237', 'lb'),
|
||||
'TEASPOON' => array(array('' => '1.2503332', '' => '453.59237', '/' => '128'), 'tsp'),
|
||||
'TEASPOON_US' => array(array('' => '453.59237', '/' => '96'), 'tsp'),
|
||||
'TABLESPOON' => array(array('' => '1.2503332', '' => '453.59237', '/' => '32'), 'tbsp'),
|
||||
'TABLESPOON_US' => array(array('' => '453.59237', '/' => '32'), 'tbsp'),
|
||||
'STANDARD' => 'GRAM'
|
||||
);
|
||||
}
|
103
libs/Zend/Measure/Current.php
Normal file
103
libs/Zend/Measure/Current.php
Normal file
@ -0,0 +1,103 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Current.php 9508 2008-05-23 10:56:41Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implement needed classes
|
||||
*/
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
require_once 'Zend/Measure/Abstract.php';
|
||||
require_once 'Zend/Locale.php';
|
||||
|
||||
/**
|
||||
* Class for handling current conversions
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @subpackage Zend_Measure_Current
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Measure_Current extends Zend_Measure_Abstract
|
||||
{
|
||||
const STANDARD = 'AMPERE';
|
||||
|
||||
const ABAMPERE = 'ABAMPERE';
|
||||
const AMPERE = 'AMPERE';
|
||||
const BIOT = 'BIOT';
|
||||
const CENTIAMPERE = 'CENTIAMPERE';
|
||||
const COULOMB_PER_SECOND = 'COULOMB_PER_SECOND';
|
||||
const DECIAMPERE = 'DECIAMPERE';
|
||||
const DEKAAMPERE = 'DEKAAMPERE';
|
||||
const ELECTROMAGNETIC_UNIT = 'ELECTROMAGNATIC_UNIT';
|
||||
const ELECTROSTATIC_UNIT = 'ELECTROSTATIC_UNIT';
|
||||
const FRANCLIN_PER_SECOND = 'FRANCLIN_PER_SECOND';
|
||||
const GAUSSIAN = 'GAUSSIAN';
|
||||
const GIGAAMPERE = 'GIGAAMPERE';
|
||||
const GILBERT = 'GILBERT';
|
||||
const HECTOAMPERE = 'HECTOAMPERE';
|
||||
const KILOAMPERE = 'KILOAMPERE';
|
||||
const MEGAAMPERE = 'MEGAAMPERE';
|
||||
const MICROAMPERE = 'MICROAMPERE';
|
||||
const MILLIAMPERE = 'MILLIAMPERE';
|
||||
const NANOAMPERE = 'NANOAMPERE';
|
||||
const PICOAMPERE = 'PICOAMPERE';
|
||||
const SIEMENS_VOLT = 'SIEMENS_VOLT';
|
||||
const STATAMPERE = 'STATAMPERE';
|
||||
const TERAAMPERE = 'TERAAMPERE';
|
||||
const VOLT_PER_OHM = 'VOLT_PER_OHM';
|
||||
const WATT_PER_VOLT = 'WATT_PER_VOLT';
|
||||
const WEBER_PER_HENRY = 'WEBER_PER_HENRY';
|
||||
|
||||
/**
|
||||
* Calculations for all current units
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_units = array(
|
||||
'ABAMPERE' => array('10', 'abampere'),
|
||||
'AMPERE' => array('1', 'A'),
|
||||
'BIOT' => array('10', 'Bi'),
|
||||
'CENTIAMPERE' => array('0.01', 'cA'),
|
||||
'COULOMB_PER_SECOND' => array('1', 'C/s'),
|
||||
'DECIAMPERE' => array('0.1', 'dA'),
|
||||
'DEKAAMPERE' => array('10', 'daA'),
|
||||
'ELECTROMAGNATIC_UNIT' => array('10', 'current emu'),
|
||||
'ELECTROSTATIC_UNIT' => array('3.335641e-10', 'current esu'),
|
||||
'FRANCLIN_PER_SECOND' => array('3.335641e-10', 'Fr/s'),
|
||||
'GAUSSIAN' => array('3.335641e-10', 'G current'),
|
||||
'GIGAAMPERE' => array('1.0e+9', 'GA'),
|
||||
'GILBERT' => array('0.79577472', 'Gi'),
|
||||
'HECTOAMPERE' => array('100', 'hA'),
|
||||
'KILOAMPERE' => array('1000', 'kA'),
|
||||
'MEGAAMPERE' => array('1000000', 'MA') ,
|
||||
'MICROAMPERE' => array('0.000001', 'µA'),
|
||||
'MILLIAMPERE' => array('0.001', 'mA'),
|
||||
'NANOAMPERE' => array('1.0e-9', 'nA'),
|
||||
'PICOAMPERE' => array('1.0e-12', 'pA'),
|
||||
'SIEMENS_VOLT' => array('1', 'SV'),
|
||||
'STATAMPERE' => array('3.335641e-10', 'statampere'),
|
||||
'TERAAMPERE' => array('1.0e+12', 'TA'),
|
||||
'VOLT_PER_OHM' => array('1', 'V/Ohm'),
|
||||
'WATT_PER_VOLT' => array('1', 'W/V'),
|
||||
'WEBER_PER_HENRY' => array('1', 'Wb/H'),
|
||||
'STANDARD' => 'AMPERE'
|
||||
);
|
||||
}
|
207
libs/Zend/Measure/Density.php
Normal file
207
libs/Zend/Measure/Density.php
Normal file
@ -0,0 +1,207 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Density.php 9508 2008-05-23 10:56:41Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implement needed classes
|
||||
*/
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
require_once 'Zend/Measure/Abstract.php';
|
||||
require_once 'Zend/Locale.php';
|
||||
|
||||
/**
|
||||
* Class for handling density conversions
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @subpackage Zend_Measure_Density
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Measure_Density extends Zend_Measure_Abstract
|
||||
{
|
||||
const STANDARD = 'KILOGRAM_PER_CUBIC_METER';
|
||||
|
||||
const ALUMINIUM = 'ALUMINIUM';
|
||||
const COPPER = 'COPPER';
|
||||
const GOLD = 'GOLD';
|
||||
const GRAIN_PER_CUBIC_FOOT = 'GRAIN_PER_CUBIC_FOOT';
|
||||
const GRAIN_PER_CUBIC_INCH = 'GRAIN_PER_CUBIC_INCH';
|
||||
const GRAIN_PER_CUBIC_YARD = 'GRAIN_PER_CUBIC_YARD';
|
||||
const GRAIN_PER_GALLON = 'GRAIN_PER_GALLON';
|
||||
const GRAIN_PER_GALLON_US = 'GRAIN_PER_GALLON_US';
|
||||
const GRAM_PER_CUBIC_CENTIMETER = 'GRAM_PER_CUBIC_CENTIMETER';
|
||||
const GRAM_PER_CUBIC_DECIMETER = 'GRAM_PER_CUBIC_DECIMETER';
|
||||
const GRAM_PER_CUBIC_METER = 'GRAM_PER_CUBIC_METER';
|
||||
const GRAM_PER_LITER = 'GRAM_PER_LITER';
|
||||
const GRAM_PER_MILLILITER = 'GRAM_PER_MILLILITER';
|
||||
const IRON = 'IRON';
|
||||
const KILOGRAM_PER_CUBIC_CENTIMETER = 'KILOGRAM_PER_CUBIC_CENTIMETER';
|
||||
const KILOGRAM_PER_CUBIC_DECIMETER = 'KILOGRAM_PER_CUBIC_DECIMETER';
|
||||
const KILOGRAM_PER_CUBIC_METER = 'KILOGRAM_PER_CUBIC_METER';
|
||||
const KILOGRAM_PER_CUBIC_MILLIMETER = 'KILOGRAM_PER_CUBIC_MILLIMETER';
|
||||
const KILOGRAM_PER_LITER = 'KILOGRAM_PER_LITER';
|
||||
const KILOGRAM_PER_MILLILITER = 'KILOGRAM_PER_MILLILITER';
|
||||
const LEAD = 'LEAD';
|
||||
const MEGAGRAM_PER_CUBIC_CENTIMETER = 'MEGAGRAM_PER_CUBIC_CENTIMETER';
|
||||
const MEGAGRAM_PER_CUBIC_DECIMETER = 'MEGAGRAM_PER_CUBIC_DECIMETER';
|
||||
const MEGAGRAM_PER_CUBIC_METER = 'MEGAGRAM_PER_CUBIC_METER';
|
||||
const MEGAGRAM_PER_LITER = 'MEGAGRAM_PER_LITER';
|
||||
const MEGAGRAM_PER_MILLILITER = 'MEGAGRAM_PER_MILLILITER';
|
||||
const MICROGRAM_PER_CUBIC_CENTIMETER = 'MICROGRAM_PER_CUBIC_CENTIMETER';
|
||||
const MICROGRAM_PER_CUBIC_DECIMETER = 'MICROGRAM_PER_CUBIC_DECIMETER';
|
||||
const MICROGRAM_PER_CUBIC_METER = 'MICROGRAM_PER_CUBIC_METER';
|
||||
const MICROGRAM_PER_LITER = 'MICROGRAM_PER_LITER';
|
||||
const MICROGRAM_PER_MILLILITER = 'MICROGRAM_PER_MILLILITER';
|
||||
const MILLIGRAM_PER_CUBIC_CENTIMETER = 'MILLIGRAM_PER_CUBIC_CENTIMETER';
|
||||
const MILLIGRAM_PER_CUBIC_DECIMETER = 'MILLIGRAM_PER_CUBIC_DECIMETER';
|
||||
const MILLIGRAM_PER_CUBIC_METER = 'MILLIGRAM_PER_CUBIC_METER';
|
||||
const MILLIGRAM_PER_LITER = 'MILLIGRAM_PER_LITER';
|
||||
const MILLIGRAM_PER_MILLILITER = 'MILLIGRAM_PER_MILLILITER';
|
||||
const OUNCE_PER_CUBIC_FOOT = 'OUNCE_PER_CUBIC_FOOT';
|
||||
const OUNCR_PER_CUBIC_FOOT_TROY = 'OUNCE_PER_CUBIC_FOOT_TROY';
|
||||
const OUNCE_PER_CUBIC_INCH = 'OUNCE_PER_CUBIC_INCH';
|
||||
const OUNCE_PER_CUBIC_INCH_TROY = 'OUNCE_PER_CUBIC_INCH_TROY';
|
||||
const OUNCE_PER_CUBIC_YARD = 'OUNCE_PER_CUBIC_YARD';
|
||||
const OUNCE_PER_CUBIC_YARD_TROY = 'OUNCE_PER_CUBIC_YARD_TROY';
|
||||
const OUNCE_PER_GALLON = 'OUNCE_PER_GALLON';
|
||||
const OUNCE_PER_GALLON_US = 'OUNCE_PER_GALLON_US';
|
||||
const OUNCE_PER_GALLON_TROY = 'OUNCE_PER_GALLON_TROY';
|
||||
const OUNCE_PER_GALLON_US_TROY = 'OUNCE_PER_GALLON_US_TROY';
|
||||
const POUND_PER_CIRCULAR_MIL_FOOT = 'POUND_PER_CIRCULAR_MIL_FOOT';
|
||||
const POUND_PER_CUBIC_FOOT = 'POUND_PER_CUBIC_FOOT';
|
||||
const POUND_PER_CUBIC_INCH = 'POUND_PER_CUBIC_INCH';
|
||||
const POUND_PER_CUBIC_YARD = 'POUND_PER_CUBIC_YARD';
|
||||
const POUND_PER_GALLON = 'POUND_PER_GALLON';
|
||||
const POUND_PER_KILOGALLON = 'POUND_PER_KILOGALLON';
|
||||
const POUND_PER_MEGAGALLON = 'POUND_PER_MEGAGALLON';
|
||||
const POUND_PER_GALLON_US = 'POUND_PER_GALLON_US';
|
||||
const POUND_PER_KILOGALLON_US = 'POUND_PER_KILOGALLON_US';
|
||||
const POUND_PER_MEGAGALLON_US = 'POUND_PER_MEGAGALLON_US';
|
||||
const SILVER = 'SILVER';
|
||||
const SLUG_PER_CUBIC_FOOT = 'SLUG_PER_CUBIC_FOOT';
|
||||
const SLUG_PER_CUBIC_INCH = 'SLUG_PER_CUBIC_INCH';
|
||||
const SLUG_PER_CUBIC_YARD = 'SLUG_PER_CUBIC_YARD';
|
||||
const SLUG_PER_GALLON = 'SLUG_PER_GALLON';
|
||||
const SLUG_PER_GALLON_US = 'SLUG_PER_GALLON_US';
|
||||
const TON_PER_CUBIC_FOOT_LONG = 'TON_PER_CUBIC_FOOT_LONG';
|
||||
const TON_PER_CUBIC_FOOT = 'TON_PER_CUBIC_FOOT';
|
||||
const TON_PER_CUBIC_INCH_LONG = 'TON_PER_CUBIC_INCH_LONG';
|
||||
const TON_PER_CUBIC_INCH = 'TON_PER_CUBIC_INCH';
|
||||
const TON_PER_CUBIC_YARD_LONG = 'TON_PER_CUBIC_YARD_LONG';
|
||||
const TON_PER_CUBIC_YARD = 'TON_PER_CUBIC_YARD';
|
||||
const TON_PER_GALLON_LONG = 'TON_PER_GALLON_LONG';
|
||||
const TON_PER_GALLON_US_LONG = 'TON_PER_GALLON_US_LONG';
|
||||
const TON_PER_GALLON = 'TON_PER_GALLON';
|
||||
const TON_PER_GALLON_US = 'TON_PER_GALLON_US';
|
||||
const TONNE_PER_CUBIC_CENTIMETER = 'TONNE_PER_CUBIC_CENTIMETER';
|
||||
const TONNE_PER_CUBIC_DECIMETER = 'TONNE_PER_CUBIC_DECIMETER';
|
||||
const TONNE_PER_CUBIC_METER = 'TONNE_PER_CUBIC_METER';
|
||||
const TONNE_PER_LITER = 'TONNE_PER_LITER';
|
||||
const TONNE_PER_MILLILITER = 'TONNE_PER_MILLILITER';
|
||||
const WATER = 'WATER';
|
||||
|
||||
/**
|
||||
* Calculations for all density units
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_units = array(
|
||||
'ALUMINIUM' => array('2643', 'aluminium'),
|
||||
'COPPER' => array('8906', 'copper'),
|
||||
'GOLD' => array('19300', 'gold'),
|
||||
'GRAIN_PER_CUBIC_FOOT' => array('0.0022883519', 'gr/ft³'),
|
||||
'GRAIN_PER_CUBIC_INCH' => array('3.9542721', 'gr/in³'),
|
||||
'GRAIN_PER_CUBIC_YARD' => array('0.000084753774', 'gr/yd³'),
|
||||
'GRAIN_PER_GALLON' => array('0.014253768', 'gr/gal'),
|
||||
'GRAIN_PER_GALLON_US' => array('0.017118061', 'gr/gal'),
|
||||
'GRAM_PER_CUBIC_CENTIMETER' => array('1000', 'g/cm³'),
|
||||
'GRAM_PER_CUBIC_DECIMETER' => array('1', 'g/dm³'),
|
||||
'GRAM_PER_CUBIC_METER' => array('0.001', 'g/m³'),
|
||||
'GRAM_PER_LITER' => array('1', 'g/l'),
|
||||
'GRAM_PER_MILLILITER' => array('1000', 'g/ml'),
|
||||
'IRON' => array('7658', 'iron'),
|
||||
'KILOGRAM_PER_CUBIC_CENTIMETER' => array('1000000', 'kg/cm³'),
|
||||
'KILOGRAM_PER_CUBIC_DECIMETER' => array('1000', 'kg/dm³'),
|
||||
'KILOGRAM_PER_CUBIC_METER' => array('1', 'kg/m³'),
|
||||
'KILOGRAM_PER_CUBIC_MILLIMETER' => array('1000000000', 'kg/l'),
|
||||
'KILOGRAM_PER_LITER' => array('1000', 'kg/ml'),
|
||||
'KILOGRAM_PER_MILLILITER' => array('1000000', 'kg/ml'),
|
||||
'LEAD' => array('11370', 'lead'),
|
||||
'MEGAGRAM_PER_CUBIC_CENTIMETER' => array('1.0e+9', 'Mg/cm³'),
|
||||
'MEGAGRAM_PER_CUBIC_DECIMETER' => array('1000000', 'Mg/dm³'),
|
||||
'MEGAGRAM_PER_CUBIC_METER' => array('1000', 'Mg/m³'),
|
||||
'MEGAGRAM_PER_LITER' => array('1000000', 'Mg/l'),
|
||||
'MEGAGRAM_PER_MILLILITER' => array('1.0e+9', 'Mg/ml'),
|
||||
'MICROGRAM_PER_CUBIC_CENTIMETER' => array('0.001', 'µg/cm³'),
|
||||
'MICROGRAM_PER_CUBIC_DECIMETER' => array('1.0e-6', 'µg/dm³'),
|
||||
'MICROGRAM_PER_CUBIC_METER' => array('1.0e-9', 'µg/m³'),
|
||||
'MICROGRAM_PER_LITER' => array('1.0e-6', 'µg/l'),
|
||||
'MICROGRAM_PER_MILLILITER' => array('0.001', 'µg/ml'),
|
||||
'MILLIGRAM_PER_CUBIC_CENTIMETER' => array('1', 'mg/cm³'),
|
||||
'MILLIGRAM_PER_CUBIC_DECIMETER' => array('0.001', 'mg/dm³'),
|
||||
'MILLIGRAM_PER_CUBIC_METER' => array('0.000001', 'mg/m³'),
|
||||
'MILLIGRAM_PER_LITER' => array('0.001', 'mg/l'),
|
||||
'MILLIGRAM_PER_MILLILITER' => array('1', 'mg/ml'),
|
||||
'OUNCE_PER_CUBIC_FOOT' => array('1.001154', 'oz/ft³'),
|
||||
'OUNCE_PER_CUBIC_FOOT_TROY' => array('1.0984089', 'oz/ft³'),
|
||||
'OUNCE_PER_CUBIC_INCH' => array('1729.994', 'oz/in³'),
|
||||
'OUNCE_PER_CUBIC_INCH_TROY' => array('1898.0506', 'oz/in³'),
|
||||
'OUNCE_PER_CUBIC_YARD' => array('0.037079776', 'oz/yd³'),
|
||||
'OUNCE_PER_CUBIC_YARD_TROY' => array('0.040681812', 'oz/yd³'),
|
||||
'OUNCE_PER_GALLON' => array('6.2360233', 'oz/gal'),
|
||||
'OUNCE_PER_GALLON_US' => array('7.4891517', 'oz/gal'),
|
||||
'OUNCE_PER_GALLON_TROY' => array('6.8418084', 'oz/gal'),
|
||||
'OUNCE_PER_GALLON_US_TROY' => array('8.2166693', 'oz/gal'),
|
||||
'POUND_PER_CIRCULAR_MIL_FOOT' => array('2.9369291', 'lb/cmil ft'),
|
||||
'POUND_PER_CUBIC_FOOT' => array('16.018463', 'lb/in³'),
|
||||
'POUND_PER_CUBIC_INCH' => array('27679.905', 'lb/in³'),
|
||||
'POUND_PER_CUBIC_YARD' => array('0.59327642', 'lb/yd³'),
|
||||
'POUND_PER_GALLON' => array('99.776373', 'lb/gal'),
|
||||
'POUND_PER_KILOGALLON' => array('0.099776373', 'lb/kgal'),
|
||||
'POUND_PER_MEGAGALLON' => array('0.000099776373', 'lb/Mgal'),
|
||||
'POUND_PER_GALLON_US' => array('119.82643', 'lb/gal'),
|
||||
'POUND_PER_KILOGALLON_US' => array('0.11982643', 'lb/kgal'),
|
||||
'POUND_PER_MEGAGALLON_US' => array('0.00011982643', 'lb/Mgal'),
|
||||
'SILVER' => array('10510', 'silver'),
|
||||
'SLUG_PER_CUBIC_FOOT' => array('515.37882', 'slug/ft³'),
|
||||
'SLUG_PER_CUBIC_INCH' => array('890574.6', 'slug/in³'),
|
||||
'SLUG_PER_CUBIC_YARD' => array('19.088104', 'slug/yd³'),
|
||||
'SLUG_PER_GALLON' => array('3210.2099', 'slug/gal'),
|
||||
'SLUG_PER_GALLON_US' => array('3855.3013', 'slug/gal'),
|
||||
'TON_PER_CUBIC_FOOT_LONG' => array('35881.358', 't/ft³'),
|
||||
'TON_PER_CUBIC_FOOT' => array('32036.927', 't/ft³'),
|
||||
'TON_PER_CUBIC_INCH_LONG' => array('6.2202987e+7', 't/in³'),
|
||||
'TON_PER_CUBIC_INCH' => array('5.5359809e+7', 't/in³'),
|
||||
'TON_PER_CUBIC_YARD_LONG' => array('1328.9392', 't/yd³'),
|
||||
'TON_PER_CUBIC_YARD' => array('1186.5528', 't/yd³'),
|
||||
'TON_PER_GALLON_LONG' => array('223499.07', 't/gal'),
|
||||
'TON_PER_GALLON_US_LONG' => array('268411.2', 't/gal'),
|
||||
'TON_PER_GALLON' => array('199522.75', 't/gal'),
|
||||
'TON_PER_GALLON_US' => array('239652.85', 't/gal'),
|
||||
'TONNE_PER_CUBIC_CENTIMETER' => array('1.0e+9', 't/cm³'),
|
||||
'TONNE_PER_CUBIC_DECIMETER' => array('1000000', 't/dm³'),
|
||||
'TONNE_PER_CUBIC_METER' => array('1000', 't/m³'),
|
||||
'TONNE_PER_LITER' => array('1000000', 't/l'),
|
||||
'TONNE_PER_MILLILITER' => array('1.0e+9', 't/ml'),
|
||||
'WATER' => array('1000', 'water'),
|
||||
'STANDARD' => 'KILOGRAM_PER_CUBIC_METER'
|
||||
);
|
||||
}
|
253
libs/Zend/Measure/Energy.php
Normal file
253
libs/Zend/Measure/Energy.php
Normal file
@ -0,0 +1,253 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Energy.php 9508 2008-05-23 10:56:41Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implement needed classes
|
||||
*/
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
require_once 'Zend/Measure/Abstract.php';
|
||||
require_once 'Zend/Locale.php';
|
||||
|
||||
/**
|
||||
* Class for handling energy conversions
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @subpackage Zend_Measure_Energy
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Measure_Energy extends Zend_Measure_Abstract
|
||||
{
|
||||
const STANDARD = 'JOULE';
|
||||
|
||||
const ATTOJOULE = 'ATTOJOULE';
|
||||
const BOARD_OF_TRADE_UNIT = 'BOARD_OF_TRADE_UNIT';
|
||||
const BTU = 'BTU';
|
||||
const BTU_THERMOCHEMICAL = 'BTU_TERMOCHEMICAL';
|
||||
const CALORIE = 'CALORIE';
|
||||
const CALORIE_15C = 'CALORIE_15C';
|
||||
const CALORIE_NUTRITIONAL = 'CALORIE_NUTRITIONAL';
|
||||
const CALORIE_THERMOCHEMICAL = 'CALORIE_THERMOCHEMICAL';
|
||||
const CELSIUS_HEAT_UNIT = 'CELSIUS_HEAT_UNIT';
|
||||
const CENTIJOULE = 'CENTIJOULE';
|
||||
const CHEVAL_VAPEUR_HEURE = 'CHEVAL_VAPEUR_HEURE';
|
||||
const DECIJOULE = 'DECIJOULE';
|
||||
const DEKAJOULE = 'DEKAJOULE';
|
||||
const DEKAWATT_HOUR = 'DEKAWATT_HOUR';
|
||||
const DEKATHERM = 'DEKATHERM';
|
||||
const ELECTRONVOLT = 'ELECTRONVOLT';
|
||||
const ERG = 'ERG';
|
||||
const EXAJOULE = 'EXAJOULE';
|
||||
const EXAWATT_HOUR = 'EXAWATT_HOUR';
|
||||
const FEMTOJOULE = 'FEMTOJOULE';
|
||||
const FOOT_POUND = 'FOOT_POUND';
|
||||
const FOOT_POUNDAL = 'FOOT_POUNDAL';
|
||||
const GALLON_UK_AUTOMOTIVE = 'GALLON_UK_AUTOMOTIVE';
|
||||
const GALLON_US_AUTOMOTIVE = 'GALLON_US_AUTOMOTIVE';
|
||||
const GALLON_UK_AVIATION = 'GALLON_UK_AVIATION';
|
||||
const GALLON_US_AVIATION = 'GALLON_US_AVIATION';
|
||||
const GALLON_UK_DIESEL = 'GALLON_UK_DIESEL';
|
||||
const GALLON_US_DIESEL = 'GALLON_US_DIESEL';
|
||||
const GALLON_UK_DISTILATE = 'GALLON_UK_DISTILATE';
|
||||
const GALLON_US_DISTILATE = 'GALLON_US_DISTILATE';
|
||||
const GALLON_UK_KEROSINE_JET = 'GALLON_UK_KEROSINE_JET';
|
||||
const GALLON_US_KEROSINE_JET = 'GALLON_US_KEROSINE_JET';
|
||||
const GALLON_UK_LPG = 'GALLON_UK_LPG';
|
||||
const GALLON_US_LPG = 'GALLON_US_LPG';
|
||||
const GALLON_UK_NAPHTA = 'GALLON_UK_NAPHTA';
|
||||
const GALLON_US_NAPHTA = 'GALLON_US_NAPHTA';
|
||||
const GALLON_UK_KEROSENE = 'GALLON_UK_KEROSINE';
|
||||
const GALLON_US_KEROSENE = 'GALLON_US_KEROSINE';
|
||||
const GALLON_UK_RESIDUAL = 'GALLON_UK_RESIDUAL';
|
||||
const GALLON_US_RESIDUAL = 'GALLON_US_RESIDUAL';
|
||||
const GIGAELECTRONVOLT = 'GIGAELECTRONVOLT';
|
||||
const GIGACALORIE = 'GIGACALORIE';
|
||||
const GIGACALORIE_15C = 'GIGACALORIE_15C';
|
||||
const GIGAJOULE = 'GIGAJOULE';
|
||||
const GIGAWATT_HOUR = 'GIGAWATT_HOUR';
|
||||
const GRAM_CALORIE = 'GRAM_CALORIE';
|
||||
const HARTREE = 'HARTREE';
|
||||
const HECTOJOULE = 'HECTOJOULE';
|
||||
const HECTOWATT_HOUR = 'HECTOWATT_HOUR';
|
||||
const HORSEPOWER_HOUR = 'HORSEPOWER_HOUR';
|
||||
const HUNDRED_CUBIC_FOOT_GAS = 'HUNDRED_CUBIC_FOOT_GAS';
|
||||
const INCH_OUNCE = 'INCH_OUNCE';
|
||||
const INCH_POUND = 'INCH_POUND';
|
||||
const JOULE = 'JOULE';
|
||||
const KILOCALORIE_15C = 'KILOCALORIE_15C';
|
||||
const KILOCALORIE = 'KILOCALORIE';
|
||||
const KILOCALORIE_THERMOCHEMICAL = 'KILOCALORIE_THERMOCHEMICAL';
|
||||
const KILOELECTRONVOLT = 'KILOELECTRONVOLT';
|
||||
const KILOGRAM_CALORIE = 'KILOGRAM_CALORIE';
|
||||
const KILOGRAM_FORCE_METER = 'KILOGRAM_FORCE_METER';
|
||||
const KILOJOULE = 'KILOJOULE';
|
||||
const KILOPOND_METER = 'KILOPOND_METER';
|
||||
const KILOTON = 'KILOTON';
|
||||
const KILOWATT_HOUR = 'KILOWATT_HOUR';
|
||||
const LITER_ATMOSPHERE = 'LITER_ATMOSPHERE';
|
||||
const MEGAELECTRONVOLT = 'MEGAELECTRONVOLT';
|
||||
const MEGACALORIE = 'MEGACALORIE';
|
||||
const MEGACALORIE_15C = 'MEGACALORIE_15C';
|
||||
const MEGAJOULE = 'MEGAJOULE';
|
||||
const MEGALERG = 'MEGALERG';
|
||||
const MEGATON = 'MEGATON';
|
||||
const MEGAWATTHOUR = 'MEGAWATTHOUR';
|
||||
const METER_KILOGRAM_FORCE = 'METER_KILOGRAM_FORCE';
|
||||
const MICROJOULE = 'MICROJOULE';
|
||||
const MILLIJOULE = 'MILLIJOULE';
|
||||
const MYRIAWATT_HOUR = 'MYRIAWATT_HOUR';
|
||||
const NANOJOULE = 'NANOJOULE';
|
||||
const NEWTON_METER = 'NEWTON_METER';
|
||||
const PETAJOULE = 'PETAJOULE';
|
||||
const PETAWATTHOUR = 'PETAWATTHOUR';
|
||||
const PFERDESTAERKENSTUNDE = 'PFERDESTAERKENSTUNDE';
|
||||
const PICOJOULE = 'PICOJOULE';
|
||||
const Q_UNIT = 'Q_UNIT';
|
||||
const QUAD = 'QUAD';
|
||||
const TERAELECTRONVOLT = 'TERAELECTRONVOLT';
|
||||
const TERAJOULE = 'TERAJOULE';
|
||||
const TERAWATTHOUR = 'TERAWATTHOUR';
|
||||
const THERM = 'THERM';
|
||||
const THERM_US = 'THERM_US';
|
||||
const THERMIE = 'THERMIE';
|
||||
const TON = 'TON';
|
||||
const TONNE_COAL = 'TONNE_COAL';
|
||||
const TONNE_OIL = 'TONNE_OIL';
|
||||
const WATTHOUR = 'WATTHOUR';
|
||||
const WATTSECOND = 'WATTSECOND';
|
||||
const YOCTOJOULE = 'YOCTOJOULE';
|
||||
const YOTTAJOULE = 'YOTTAJOULE';
|
||||
const YOTTAWATTHOUR = 'YOTTAWATTHOUR';
|
||||
const ZEPTOJOULE = 'ZEPTOJOULE';
|
||||
const ZETTAJOULE = 'ZETTAJOULE';
|
||||
const ZETTAWATTHOUR = 'ZETTAWATTHOUR';
|
||||
|
||||
/**
|
||||
* Calculations for all energy units
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_units = array(
|
||||
'ATTOJOULE' => array('1.0e-18', 'aJ'),
|
||||
'BOARD_OF_TRADE_UNIT' => array('3600000', 'BOTU'),
|
||||
'BTU' => array('1055.0559', 'Btu'),
|
||||
'BTU_TERMOCHEMICAL' => array('1054.3503', 'Btu'),
|
||||
'CALORIE' => array('4.1868', 'cal'),
|
||||
'CALORIE_15C' => array('6.1858', 'cal'),
|
||||
'CALORIE_NUTRITIONAL' => array('4186.8', 'cal'),
|
||||
'CALORIE_THERMOCHEMICAL' => array('4.184', 'cal'),
|
||||
'CELSIUS_HEAT_UNIT' => array('1899.1005', 'Chu'),
|
||||
'CENTIJOULE' => array('0.01', 'cJ'),
|
||||
'CHEVAL_VAPEUR_HEURE' => array('2647795.5', 'cv heure'),
|
||||
'DECIJOULE' => array('0.1', 'dJ'),
|
||||
'DEKAJOULE' => array('10', 'daJ'),
|
||||
'DEKAWATT_HOUR' => array('36000', 'daWh'),
|
||||
'DEKATHERM' => array('1.055057e+9', 'dathm'),
|
||||
'ELECTRONVOLT' => array('1.6021773e-19', 'eV'),
|
||||
'ERG' => array('0.0000001', 'erg'),
|
||||
'EXAJOULE' => array('1.0e+18', 'EJ'),
|
||||
'EXAWATT_HOUR' => array('3.6e+21', 'EWh'),
|
||||
'FEMTOJOULE' => array('1.0e-15', 'fJ'),
|
||||
'FOOT_POUND' => array('1.3558179', 'ft lb'),
|
||||
'FOOT_POUNDAL' => array('0.04214011', 'ft poundal'),
|
||||
'GALLON_UK_AUTOMOTIVE' => array('158237172', 'gal car gasoline'),
|
||||
'GALLON_US_AUTOMOTIVE' => array('131760000', 'gal car gasoline'),
|
||||
'GALLON_UK_AVIATION' => array('158237172', 'gal jet gasoline'),
|
||||
'GALLON_US_AVIATION' => array('131760000', 'gal jet gasoline'),
|
||||
'GALLON_UK_DIESEL' => array('175963194', 'gal diesel'),
|
||||
'GALLON_US_DIESEL' => array('146520000', 'gal diesel'),
|
||||
'GALLON_UK_DISTILATE' => array('175963194', 'gal destilate fuel'),
|
||||
'GALLON_US_DISTILATE' => array('146520000', 'gal destilate fuel'),
|
||||
'GALLON_UK_KEROSINE_JET' => array('170775090', 'gal jet kerosine'),
|
||||
'GALLON_US_KEROSINE_JET' => array('142200000', 'gal jet kerosine'),
|
||||
'GALLON_UK_LPG' => array('121005126.0865275', 'gal lpg'),
|
||||
'GALLON_US_LPG' => array('100757838.45', 'gal lpg'),
|
||||
'GALLON_UK_NAPHTA' => array('160831224', 'gal jet fuel'),
|
||||
'GALLON_US_NAPHTA' => array('133920000', 'gal jet fuel'),
|
||||
'GALLON_UK_KEROSINE' => array('170775090', 'gal kerosine'),
|
||||
'GALLON_US_KEROSINE' => array('142200000', 'gal kerosine'),
|
||||
'GALLON_UK_RESIDUAL' => array('189798138', 'gal residual fuel'),
|
||||
'GALLON_US_RESIDUAL' => array('158040000', 'gal residual fuel'),
|
||||
'GIGAELECTRONVOLT' => array('1.6021773e-10', 'GeV'),
|
||||
'GIGACALORIE' => array('4186800000', 'Gcal'),
|
||||
'GIGACALORIE_15C' => array('4185800000', 'Gcal'),
|
||||
'GIGAJOULE' => array('1.0e+9', 'GJ'),
|
||||
'GIGAWATT_HOUR' => array('3.6e+12', 'GWh'),
|
||||
'GRAM_CALORIE' => array('4.1858', 'g cal'),
|
||||
'HARTREE' => array('4.3597482e-18', 'Eh'),
|
||||
'HECTOJOULE' => array('100', 'hJ'),
|
||||
'HECTOWATT_HOUR' => array('360000', 'hWh'),
|
||||
'HORSEPOWER_HOUR' => array('2684519.5', 'hph'),
|
||||
'HUNDRED_CUBIC_FOOT_GAS' => array('108720000', 'hundred ft<66> gas'),
|
||||
'INCH_OUNCE' => array('0.0070615518', 'in oc'),
|
||||
'INCH_POUND' => array('0.112984825', 'in lb'),
|
||||
'JOULE' => array('1', 'J'),
|
||||
'KILOCALORIE_15C' => array('4185.8', 'kcal'),
|
||||
'KILOCALORIE' => array('4186','8', 'kcal'),
|
||||
'KILOCALORIE_THERMOCHEMICAL' => array('4184', 'kcal'),
|
||||
'KILOELECTRONVOLT' => array('1.6021773e-16', 'keV'),
|
||||
'KILOGRAM_CALORIE' => array('4185.8', 'kg cal'),
|
||||
'KILOGRAM_FORCE_METER' => array('9.80665', 'kgf m'),
|
||||
'KILOJOULE' => array('1000', 'kJ'),
|
||||
'KILOPOND_METER' => array('9.80665', 'kp m'),
|
||||
'KILOTON' => array('4.184e+12', 'kt'),
|
||||
'KILOWATT_HOUR' => array('3600000', 'kWh'),
|
||||
'LITER_ATMOSPHERE' => array('101.325', 'l atm'),
|
||||
'MEGAELECTRONVOLT' => array('1.6021773e-13', 'MeV'),
|
||||
'MEGACALORIE' => array('4186800', 'Mcal'),
|
||||
'MEGACALORIE_15C' => array('4185800', 'Mcal'),
|
||||
'MEGAJOULE' => array('1000000', 'MJ'),
|
||||
'MEGALERG' => array('0.1', 'megalerg'),
|
||||
'MEGATON' => array('4.184e+15', 'Mt'),
|
||||
'MEGAWATTHOUR' => array('3.6e+9', 'MWh'),
|
||||
'METER_KILOGRAM_FORCE' => array('9.80665', 'm kgf'),
|
||||
'MICROJOULE' => array('0.000001', '<27>J'),
|
||||
'MILLIJOULE' => array('0.001', 'mJ'),
|
||||
'MYRIAWATT_HOUR' => array('3.6e+7', 'myWh'),
|
||||
'NANOJOULE' => array('1.0e-9', 'nJ'),
|
||||
'NEWTON_METER' => array('1', 'Nm'),
|
||||
'PETAJOULE' => array('1.0e+15', 'PJ'),
|
||||
'PETAWATTHOUR' => array('3.6e+18', 'PWh'),
|
||||
'PFERDESTAERKENSTUNDE' => array('2647795.5', 'ps h'),
|
||||
'PICOJOULE' => array('1.0e-12', 'pJ'),
|
||||
'Q_UNIT' => array('1.0550559e+21', 'Q unit'),
|
||||
'QUAD' => array('1.0550559e+18', 'quad'),
|
||||
'TERAELECTRONVOLT' => array('1.6021773e-7', 'TeV'),
|
||||
'TERAJOULE' => array('1.0e+12', 'TJ'),
|
||||
'TERAWATTHOUR' => array('3.6e+15', 'TWh'),
|
||||
'THERM' => array('1.0550559e+8', 'thm'),
|
||||
'THERM_US' => array('1.054804e+8', 'thm'),
|
||||
'THERMIE' => array('4185800', 'th'),
|
||||
'TON' => array('4.184e+9', 'T explosive'),
|
||||
'TONNE_COAL' => array('2.93076e+10', 'T coal'),
|
||||
'TONNE_OIL' => array('4.1868e+10', 'T oil'),
|
||||
'WATTHOUR' => array('3600', 'Wh'),
|
||||
'WATTSECOND' => array('1', 'Ws'),
|
||||
'YOCTOJOULE' => array('1.0e-24', 'yJ'),
|
||||
'YOTTAJOULE' => array('1.0e+24', 'YJ'),
|
||||
'YOTTAWATTHOUR' => array('3.6e+27', 'YWh'),
|
||||
'ZEPTOJOULE' => array('1.0e-21', 'zJ'),
|
||||
'ZETTAJOULE' => array('1.0e+21', 'ZJ'),
|
||||
'ZETTAWATTHOUR' => array('3.6e+24', 'ZWh'),
|
||||
'STANDARD' => 'JOULE'
|
||||
);
|
||||
}
|
37
libs/Zend/Measure/Exception.php
Normal file
37
libs/Zend/Measure/Exception.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Exception.php 9508 2008-05-23 10:56:41Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Zend_Exception
|
||||
*/
|
||||
require_once 'Zend/Exception.php';
|
||||
|
||||
/**
|
||||
* Exception class
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Measure_Exception extends Zend_Exception
|
||||
{
|
||||
}
|
123
libs/Zend/Measure/Flow/Mass.php
Normal file
123
libs/Zend/Measure/Flow/Mass.php
Normal file
@ -0,0 +1,123 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Mass.php 9508 2008-05-23 10:56:41Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implement needed classes
|
||||
*/
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
require_once 'Zend/Measure/Abstract.php';
|
||||
require_once 'Zend/Locale.php';
|
||||
|
||||
/**
|
||||
* Class for handling flow mass conversions
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @subpackage Zend_Measure_Flow_Mass
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Measure_Flow_Mass extends Zend_Measure_Abstract
|
||||
{
|
||||
const STANDARD = 'KILOGRAM_PER_SECOND';
|
||||
|
||||
const CENTIGRAM_PER_DAY = 'CENTIGRAM_PER_DAY';
|
||||
const CENTIGRAM_PER_HOUR = 'CENTIGRAM_PER_HOUR';
|
||||
const CENTIGRAM_PER_MINUTE = 'CENTIGRAM_PER_MINUTE';
|
||||
const CENTIGRAM_PER_SECOND = 'CENTIGRAM_PER_SECOND';
|
||||
const GRAM_PER_DAY = 'GRAM_PER_DAY';
|
||||
const GRAM_PER_HOUR = 'GRAM_PER_HOUR';
|
||||
const GRAM_PER_MINUTE = 'GRAM_PER_MINUTE';
|
||||
const GRAM_PER_SECOND = 'GRAM_PER_SECOND';
|
||||
const KILOGRAM_PER_DAY = 'KILOGRAM_PER_DAY';
|
||||
const KILOGRAM_PER_HOUR = 'KILOGRAM_PER_HOUR';
|
||||
const KILOGRAM_PER_MINUTE = 'KILOGRAM_PER_MINUTE';
|
||||
const KILOGRAM_PER_SECOND = 'KILOGRAM_PER_SECOND';
|
||||
const MILLIGRAM_PER_DAY = 'MILLIGRAM_PER_DAY';
|
||||
const MILLIGRAM_PER_HOUR = 'MILLIGRAM_PER_HOUR';
|
||||
const MILLIGRAM_PER_MINUTE = 'MILLIGRAM_PER_MINUTE';
|
||||
const MILLIGRAM_PER_SECOND = 'MILLIGRAM_PER_SECOND';
|
||||
const OUNCE_PER_DAY = 'OUNCE_PER_DAY';
|
||||
const OUNCE_PER_HOUR = 'OUNCE_PER_HOUR';
|
||||
const OUNCE_PER_MINUTE = 'OUNCE_PER_MINUTE';
|
||||
const OUNCE_PER_SECOND = 'OUNCE_PER_SECOND';
|
||||
const POUND_PER_DAY = 'POUND_PER_DAY';
|
||||
const POUND_PER_HOUR = 'POUND_PER_HOUR';
|
||||
const POUND_PER_MINUTE = 'POUND_PER_MINUTE';
|
||||
const POUND_PER_SECOND = 'POUND_PER_SECOND';
|
||||
const TON_LONG_PER_DAY = 'TON_LONG_PER_DAY';
|
||||
const TON_LONG_PER_HOUR = 'TON_LONG_PER_HOUR';
|
||||
const TON_LONG_PER_MINUTE = 'TON_LONG_PER_MINUTE';
|
||||
const TON_LONG_PER_SECOND = 'TON_LONG_PER_SECOND';
|
||||
const TON_PER_DAY = 'TON_PER_DAY';
|
||||
const TON_PER_HOUR = 'TON_PER_HOUR';
|
||||
const TON_PER_MINUTE = 'TON_PER_MINUTE';
|
||||
const TON_PER_SECOND = 'TON_PER_SECOND';
|
||||
const TON_SHORT_PER_DAY = 'TON_SHORT_PER_DAY';
|
||||
const TON_SHORT_PER_HOUR = 'TON_SHORT_PER_HOUR';
|
||||
const TON_SHORT_PER_MINUTE = 'TON_SHORT_PER_MINUTE';
|
||||
const TON_SHORT_PER_SECOND = 'TON_SHORT_PER_SECOND';
|
||||
|
||||
/**
|
||||
* Calculations for all flow mass units
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_units = array(
|
||||
'CENTIGRAM_PER_DAY' => array(array('' => '0.00001', '/' => '86400'), 'cg/day'),
|
||||
'CENTIGRAM_PER_HOUR' => array(array('' => '0.00001', '/' => '3600'), 'cg/h'),
|
||||
'CENTIGRAM_PER_MINUTE' => array(array('' => '0.00001', '/' => '60'), 'cg/m'),
|
||||
'CENTIGRAM_PER_SECOND' => array('0.00001', 'cg/s'),
|
||||
'GRAM_PER_DAY' => array(array('' => '0.001', '/' => '86400'), 'g/day'),
|
||||
'GRAM_PER_HOUR' => array(array('' => '0.001', '/' => '3600'), 'g/h'),
|
||||
'GRAM_PER_MINUTE' => array(array('' => '0.001', '/' => '60'), 'g/m'),
|
||||
'GRAM_PER_SECOND' => array('0.001', 'g/s'),
|
||||
'KILOGRAM_PER_DAY' => array(array('' => '1', '/' => '86400'), 'kg/day'),
|
||||
'KILOGRAM_PER_HOUR' => array(array('' => '1', '/' => '3600'), 'kg/h'),
|
||||
'KILOGRAM_PER_MINUTE' => array(array('' => '1', '/' => '60'), 'kg/m'),
|
||||
'KILOGRAM_PER_SECOND' => array('1', 'kg/s'),
|
||||
'MILLIGRAM_PER_DAY' => array(array('' => '0.000001', '/' => '86400'), 'mg/day'),
|
||||
'MILLIGRAM_PER_HOUR' => array(array('' => '0.000001', '/' => '3600'), 'mg/h'),
|
||||
'MILLIGRAM_PER_MINUTE' => array(array('' => '0.000001', '/' => '60'), 'mg/m'),
|
||||
'MILLIGRAM_PER_SECOND' => array('0.000001', 'mg/s'),
|
||||
'OUNCE_PER_DAY' => array(array('' => '0.0283495', '/' => '86400'), 'oz/day'),
|
||||
'OUNCE_PER_HOUR' => array(array('' => '0.0283495', '/' => '3600'), 'oz/h'),
|
||||
'OUNCE_PER_MINUTE' => array(array('' => '0.0283495', '/' => '60'), 'oz/m'),
|
||||
'OUNCE_PER_SECOND' => array('0.0283495', 'oz/s'),
|
||||
'POUND_PER_DAY' => array(array('' => '0.453592', '/' => '86400'), 'lb/day'),
|
||||
'POUND_PER_HOUR' => array(array('' => '0.453592', '/' => '3600'), 'lb/h'),
|
||||
'POUND_PER_MINUTE' => array(array('' => '0.453592', '/' => '60'), 'lb/m'),
|
||||
'POUND_PER_SECOND' => array('0.453592', 'lb/s'),
|
||||
'TON_LONG_PER_DAY' => array(array('' => '1016.04608', '/' => '86400'), 't/day'),
|
||||
'TON_LONG_PER_HOUR' => array(array('' => '1016.04608', '/' => '3600'), 't/h'),
|
||||
'TON_LONG_PER_MINUTE' => array(array('' => '1016.04608', '/' => '60'), 't/m'),
|
||||
'TON_LONG_PER_SECOND' => array('1016.04608', 't/s'),
|
||||
'TON_PER_DAY' => array(array('' => '1000', '/' => '86400'), 't/day'),
|
||||
'TON_PER_HOUR' => array(array('' => '1000', '/' => '3600'), 't/h'),
|
||||
'TON_PER_MINUTE' => array(array('' => '1000', '/' => '60'), 't/m'),
|
||||
'TON_PER_SECOND' => array('1000', 't/s'),
|
||||
'TON_SHORT_PER_DAY' => array(array('' => '907.184', '/' => '86400'), 't/day'),
|
||||
'TON_SHORT_PER_HOUR' => array(array('' => '907.184', '/' => '3600'), 't/h'),
|
||||
'TON_SHORT_PER_MINUTE' => array(array('' => '907.184', '/' => '60'), 't/m'),
|
||||
'TON_SHORT_PER_SECOND' => array('907.184', 't/s'),
|
||||
'STANDARD' => 'KILOGRAM_PER_SECOND'
|
||||
);
|
||||
}
|
91
libs/Zend/Measure/Flow/Mole.php
Normal file
91
libs/Zend/Measure/Flow/Mole.php
Normal file
@ -0,0 +1,91 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Mole.php 9508 2008-05-23 10:56:41Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implement needed classes
|
||||
*/
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
require_once 'Zend/Measure/Abstract.php';
|
||||
require_once 'Zend/Locale.php';
|
||||
|
||||
/**
|
||||
* Class for handling flow mole conversions
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @subpackage Zend_Measure_Flow_Mole
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Measure_Flow_Mole extends Zend_Measure_Abstract
|
||||
{
|
||||
const STANDARD = 'MOLE_PER_SECOND';
|
||||
|
||||
const CENTIMOLE_PER_DAY = 'CENTIMOLE_PER_DAY';
|
||||
const CENTIMOLE_PER_HOUR = 'CENTIMOLE_PER_HOUR';
|
||||
const CENTIMOLE_PER_MINUTE = 'CENTIMOLE_PER_MINUTE';
|
||||
const CENTIMOLE_PER_SECOND = 'CENTIMOLE_PER_SECOND';
|
||||
const MEGAMOLE_PER_DAY = 'MEGAMOLE_PER_DAY';
|
||||
const MEGAMOLE_PER_HOUR = 'MEGAMOLE_PER_HOUR';
|
||||
const MEGAMOLE_PER_MINUTE = 'MEGAMOLE_PER_MINUTE';
|
||||
const MEGAMOLE_PER_SECOND = 'MEGAMOLE_PER_SECOND';
|
||||
const MICROMOLE_PER_DAY = 'MICROMOLE_PER_DAY';
|
||||
const MICROMOLE_PER_HOUR = 'MICROMOLE_PER_HOUR';
|
||||
const MICROMOLE_PER_MINUTE = 'MICROMOLE_PER_MINUTE';
|
||||
const MICROMOLE_PER_SECOND = 'MICROMOLE_PER_SECOND';
|
||||
const MILLIMOLE_PER_DAY = 'MILLIMOLE_PER_DAY';
|
||||
const MILLIMOLE_PER_HOUR = 'MILLIMOLE_PER_HOUR';
|
||||
const MILLIMOLE_PER_MINUTE = 'MILLIMOLE_PER_MINUTE';
|
||||
const MILLIMOLE_PER_SECOND = 'MILLIMOLE_PER_SECOND';
|
||||
const MOLE_PER_DAY = 'MOLE_PER_DAY';
|
||||
const MOLE_PER_HOUR = 'MOLE_PER_HOUR';
|
||||
const MOLE_PER_MINUTE = 'MOLE_PER_MINUTE';
|
||||
const MOLE_PER_SECOND = 'MOLE_PER_SECOND';
|
||||
|
||||
/**
|
||||
* Calculations for all flow mole units
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_units = array(
|
||||
'CENTIMOLE_PER_DAY' => array(array('' => '0.01', '/' => '86400'), 'cmol/day'),
|
||||
'CENTIMOLE_PER_HOUR' => array(array('' => '0.01', '/' => '3600'), 'cmol/h'),
|
||||
'CENTIMOLE_PER_MINUTE' => array(array('' => '0.01', '/' => '60'), 'cmol/m'),
|
||||
'CENTIMOLE_PER_SECOND' => array('0.01', 'cmol/s'),
|
||||
'MEGAMOLE_PER_DAY' => array(array('' => '1000000', '/' => '86400'), 'Mmol/day'),
|
||||
'MEGAMOLE_PER_HOUR' => array(array('' => '1000000', '/' => '3600'), 'Mmol/h'),
|
||||
'MEGAMOLE_PER_MINUTE' => array(array('' => '1000000', '/' => '60'), 'Mmol/m'),
|
||||
'MEGAMOLE_PER_SECOND' => array('1000000', 'Mmol/s'),
|
||||
'MICROMOLE_PER_DAY' => array(array('' => '0.000001', '/' => '86400'), 'µmol/day'),
|
||||
'MICROMOLE_PER_HOUR' => array(array('' => '0.000001', '/' => '3600'), 'µmol/h'),
|
||||
'MICROMOLE_PER_MINUTE' => array(array('' => '0.000001', '/' => '60'), 'µmol/m'),
|
||||
'MICROMOLE_PER_SECOND' => array('0.000001', 'µmol/s'),
|
||||
'MILLIMOLE_PER_DAY' => array(array('' => '0.001', '/' => '86400'), 'mmol/day'),
|
||||
'MILLIMOLE_PER_HOUR' => array(array('' => '0.001', '/' => '3600'), 'mmol/h'),
|
||||
'MILLIMOLE_PER_MINUTE' => array(array('' => '0.001', '/' => '60'), 'mmol/m'),
|
||||
'MILLIMOLE_PER_SECOND' => array('0.001', 'mmol/s'),
|
||||
'MOLE_PER_DAY' => array(array('' => '1', '/' => '86400'), 'mol/day'),
|
||||
'MOLE_PER_HOUR' => array(array('' => '1', '/' => '3600'), 'mol/h'),
|
||||
'MOLE_PER_MINUTE' => array(array('' => '1', '/' => '60'), 'mol/m'),
|
||||
'MOLE_PER_SECOND' => array('1', 'mol/s'),
|
||||
'STANDARD' => 'MOLE_PER_SECOND'
|
||||
);
|
||||
}
|
403
libs/Zend/Measure/Flow/Volume.php
Normal file
403
libs/Zend/Measure/Flow/Volume.php
Normal file
@ -0,0 +1,403 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Volume.php 9508 2008-05-23 10:56:41Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implement needed classes
|
||||
*/
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
require_once 'Zend/Measure/Abstract.php';
|
||||
require_once 'Zend/Locale.php';
|
||||
|
||||
/**
|
||||
* Class for handling flow volume conversions
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @subpackage Zend_Measure_Flow_Volume
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Measure_Flow_Volume extends Zend_Measure_Abstract
|
||||
{
|
||||
const STANDARD = 'CUBIC_METER_PER_SECOND';
|
||||
|
||||
const ACRE_FOOT_PER_DAY = 'ACRE_FOOT_PER_DAY';
|
||||
const ACRE_FOOT_PER_HOUR = 'ACRE_FOOT_PER_HOUR';
|
||||
const ACRE_FOOT_PER_MINUTE = 'ACRE_FOOT_PER_MINUTE';
|
||||
const ACRE_FOOT_PER_SECOND = 'ACRE_FOOT_PER_SECOND';
|
||||
const ACRE_FOOT_SURVEY_PER_DAY = 'ACRE_FOOT_SURVEY_PER_DAY';
|
||||
const ACRE_FOOT_SURVEY_PER_HOUR = 'ACRE_FOOT_SURVEY_PER_HOUR';
|
||||
const ACRE_FOOT_SURVEY_PER_MINUTE = 'ACRE_FOOT_SURVEY_PER_MINUTE';
|
||||
const ACRE_FOOT_SURVEY_PER_SECOND = 'ACRE_FOOT_SURVEY_PER_SECOND';
|
||||
const ACRE_INCH_PER_DAY = 'ACRE_INCH_PER_DAY';
|
||||
const ACRE_INCH_PER_HOUR = 'ACRE_INCH_PER_HOUR';
|
||||
const ACRE_INCH_PER_MINUTE = 'ACRE_INCH_PER_MINUTE';
|
||||
const ACRE_INCH_PER_SECOND = 'ACRE_INCH_PER_SECOND';
|
||||
const ACRE_INCH_SURVEY_PER_DAY = 'ACRE_INCH_SURVEY_PER_DAY';
|
||||
const ACRE_INCH_SURVEY_PER_HOUR = 'ACRE_INCH_SURVEY_PER_HOUR';
|
||||
const ACRE_INCH_SURVEY_PER_MINUTE = 'ACRE_INCH_SURVEY_PER_MINUTE';
|
||||
const ACRE_INCH_SURVEY_PER_SECOND = 'ACRE_INCH_SURVEY_PER_SECOND';
|
||||
const BARREL_PETROLEUM_PER_DAY = 'BARREL_PETROLEUM_PER_DAY';
|
||||
const BARREL_PETROLEUM_PER_HOUR = 'BARREL_PETROLEUM_PER_HOUR';
|
||||
const BARREL_PETROLEUM_PER_MINUTE = 'BARREL_PETROLEUM_PER_MINUTE';
|
||||
const BARREL_PETROLEUM_PER_SECOND = 'BARREL_PETROLEUM_PER_SECOND';
|
||||
const BARREL_PER_DAY = 'BARREL_PER_DAY';
|
||||
const BARREL_PER_HOUR = 'BARREL_PER_HOUR';
|
||||
const BARREL_PER_MINUTE = 'BARREL_PER_MINUTE';
|
||||
const BARREL_PER_SECOND = 'BARREL_PER_SECOND';
|
||||
const BARREL_US_PER_DAY = 'BARREL_US_PER_DAY';
|
||||
const BARREL_US_PER_HOUR = 'BARREL_US_PER_HOUR';
|
||||
const BARREL_US_PER_MINUTE = 'BARREL_US_PER_MINUTE';
|
||||
const BARREL_US_PER_SECOND = 'BARREL_US_PER_SECOND';
|
||||
const BARREL_WINE_PER_DAY = 'BARREL_WINE_PER_DAY';
|
||||
const BARREL_WINE_PER_HOUR = 'BARREL_WINE_PER_HOUR';
|
||||
const BARREL_WINE_PER_MINUTE = 'BARREL_WINE_PER_MINUTE';
|
||||
const BARREL_WINE_PER_SECOND = 'BARREL_WINE_PER_SECOND';
|
||||
const BARREL_BEER_PER_DAY = 'BARREL_BEER_PER_DAY';
|
||||
const BARREL_BEER_PER_HOUR = 'BARREL_BEER_PER_HOUR';
|
||||
const BARREL_BEER_PER_MINUTE = 'BARREL_BEER_PER_MINUTE';
|
||||
const BARREL_BEER_PER_SECOND = 'BARREL_BEER_PER_SECOND';
|
||||
const BILLION_CUBIC_FOOT_PER_DAY = 'BILLION_CUBIC_FOOT_PER_DAY';
|
||||
const BILLION_CUBIC_FOOT_PER_HOUR = 'BILLION_CUBIC_FOOT_PER_HOUR';
|
||||
const BILLION_CUBIC_FOOT_PER_MINUTE = 'BILLION_CUBIC_FOOT_PER_MINUTE';
|
||||
const BILLION_CUBIC_FOOT_PER_SECOND = 'BILLION_CUBIC_FOOT_PER_SECOND';
|
||||
const CENTILITER_PER_DAY = 'CENTILITER_PER_DAY';
|
||||
const CENTILITER_PER_HOUR = 'CENTILITER_PER_HOUR';
|
||||
const CENTILITER_PER_MINUTE = 'CENTILITER_PER_MINUTE';
|
||||
const CENTILITER_PER_SECOND = 'CENTILITER_PER_SECOND';
|
||||
const CUBEM_PER_DAY = 'CUBEM_PER_DAY';
|
||||
const CUBEM_PER_HOUR = 'CUBEM_PER_HOUR';
|
||||
const CUBEM_PER_MINUTE = 'CUBEM_PER_MINUTE';
|
||||
const CUBEM_PER_SECOND = 'CUBEM_PER_SECOND';
|
||||
const CUBIC_CENTIMETER_PER_DAY = 'CUBIC_CENTIMETER_PER_DAY';
|
||||
const CUBIC_CENTIMETER_PER_HOUR = 'CUBIC_CENTIMETER_PER_HOUR';
|
||||
const CUBIC_CENTIMETER_PER_MINUTE = 'CUBIC_CENTIMETER_PER_MINUTE';
|
||||
const CUBIC_CENTIMETER_PER_SECOND = 'CUBIC_CENTIMETER_PER_SECOND';
|
||||
const CUBIC_DECIMETER_PER_DAY = 'CUBIC_DECIMETER_PER_DAY';
|
||||
const CUBIC_DECIMETER_PER_HOUR = 'CUBIC_DECIMETER_PER_HOUR';
|
||||
const CUBIC_DECIMETER_PER_MINUTE = 'CUBIC_DECIMETER_PER_MINUTE';
|
||||
const CUBIC_DECIMETER_PER_SECOND = 'CUBIC_DECIMETER_PER_SECOND';
|
||||
const CUBIC_DEKAMETER_PER_DAY = 'CUBIC_DEKAMETER_PER_DAY';
|
||||
const CUBIC_DEKAMETER_PER_HOUR = 'CUBIC_DEKAMETER_PER_HOUR';
|
||||
const CUBIC_DEKAMETER_PER_MINUTE = 'CUBIC_DEKAMETER_PER_MINUTE';
|
||||
const CUBIC_DEKAMETER_PER_SECOND = 'CUBIC_DEKAMETER_PER_SECOND';
|
||||
const CUBIC_FOOT_PER_DAY = 'CUBIC_FOOT_PER_DAY';
|
||||
const CUBIC_FOOT_PER_HOUR = 'CUBIC_FOOT_PER_HOUR';
|
||||
const CUBIC_FOOT_PER_MINUTE = 'CUBIC_FOOT_PER_MINUTE';
|
||||
const CUBIC_FOOT_PER_SECOND = 'CUBIC_FOOT_PER_SECOND';
|
||||
const CUBIC_INCH_PER_DAY = 'CUBIC_INCH_PER_DAY';
|
||||
const CUBIC_INCH_PER_HOUR = 'CUBIC_INCH_PER_HOUR';
|
||||
const CUBIC_INCH_PER_MINUTE = 'CUBIC_INCH_PER_MINUTE';
|
||||
const CUBIC_INCH_PER_SECOND = 'CUBIC_INCH_PER_SECOND';
|
||||
const CUBIC_KILOMETER_PER_DAY = 'CUBIC_KILOMETER_PER_DAY';
|
||||
const CUBIC_KILOMETER_PER_HOUR = 'CUBIC_KILOMETER_PER_HOUR';
|
||||
const CUBIC_KILOMETER_PER_MINUTE = 'CUBIC_KILOMETER_PER_MINUTE';
|
||||
const CUBIC_KILOMETER_PER_SECOND = 'CUBIC_KILOMETER_PER_SECOND';
|
||||
const CUBIC_METER_PER_DAY = 'CUBIC_METER_PER_DAY';
|
||||
const CUBIC_METER_PER_HOUR = 'CUBIC_METER_PER_HOUR';
|
||||
const CUBIC_METER_PER_MINUTE = 'CUBIC_METER_PER_MINUTE';
|
||||
const CUBIC_METER_PER_SECOND = 'CUBIC_METER_PER_SECOND';
|
||||
const CUBIC_MILE_PER_DAY = 'CUBIC_MILE_PER_DAY';
|
||||
const CUBIC_MILE_PER_HOUR = 'CUBIC_MILE_PER_HOUR';
|
||||
const CUBIC_MILE_PER_MINUTE = 'CUBIC_MILE_PER_MINUTE';
|
||||
const CUBIC_MILE_PER_SECOND = 'CUBIC_MILE_PER_SECOND';
|
||||
const CUBIC_MILLIMETER_PER_DAY = 'CUBIC_MILLIMETER_PER_DAY';
|
||||
const CUBIC_MILLIMETER_PER_HOUR = 'CUBIC_MILLIMETER_PER_HOUR';
|
||||
const CUBIC_MILLIMETER_PER_MINUTE = 'CUBIC_MILLIMETER_PER_MINUTE';
|
||||
const CUBIC_MILLIMETER_PER_SECOND = 'CUBIC_MILLIMETER_PER_SECOND';
|
||||
const CUBIC_YARD_PER_DAY = 'CUBIC_YARD_PER_DAY';
|
||||
const CUBIC_YARD_PER_HOUR = 'CUBIC_YARD_PER_HOUR';
|
||||
const CUBIC_YARD_PER_MINUTE = 'CUBIC_YARD_PER_MINUTE';
|
||||
const CUBIC_YARD_PER_SECOND = 'CUBIC_YARD_PER_SECOND';
|
||||
const CUSEC = 'CUSEC';
|
||||
const DECILITER_PER_DAY = 'DECILITER_PER_DAY';
|
||||
const DECILITER_PER_HOUR = 'DECILITER_PER_HOUR';
|
||||
const DECILITER_PER_MINUTE = 'DECILITER_PER_MINUTE';
|
||||
const DECILITER_PER_SECOND = 'DECILITER_PER_SECOND';
|
||||
const DEKALITER_PER_DAY = 'DEKALITER_PER_DAY';
|
||||
const DEKALITER_PER_HOUR = 'DEKALITER_PER_HOUR';
|
||||
const DEKALITER_PER_MINUTE = 'DEKALITER_PER_MINUTE';
|
||||
const DEKALITER_PER_SECOND = 'DEKALITER_PER_SECOND';
|
||||
const GALLON_PER_DAY = 'GALLON_PER_DAY';
|
||||
const GALLON_PER_HOUR = 'GALLON_PER_HOUR';
|
||||
const GALLON_PER_MINUTE = 'GALLON_PER_MINUTE';
|
||||
const GALLON_PER_SECOND = 'GALLON_PER_SECOND';
|
||||
const GALLON_US_PER_DAY = 'GALLON_US_PER_DAY';
|
||||
const GALLON_US_PER_HOUR = 'GALLON_US_PER_HOUR';
|
||||
const GALLON_US_PER_MINUTE = 'GALLON_US_PER_MINUTE';
|
||||
const GALLON_US_PER_SECOND = 'GALLON_US_PER_SECOND';
|
||||
const HECTARE_METER_PER_DAY = 'HECTARE_METER_PER_DAY';
|
||||
const HECTARE_METER_PER_HOUR = 'HECTARE_METER_PER_HOUR';
|
||||
const HECTARE_METER_PER_MINUTE = 'HECTARE_METER_PER_MINUTE';
|
||||
const HECTARE_METER_PER_SECOND = 'HECTARE_METER_PER_SECOND';
|
||||
const HECTOLITER_PER_DAY = 'HECTOLITER_PER_DAY';
|
||||
const HECTOLITER_PER_HOUR = 'HECTOLITER_PER_HOUR';
|
||||
const HECTOLITER_PER_MINUTE = 'HECTOLITER_PER_MINUTE';
|
||||
const HECTOLITER_PER_SECOND = 'HECTOLITER_PER_SECOND';
|
||||
const KILOLITER_PER_DAY = 'KILOLITER_PER_DAY';
|
||||
const KILOLITER_PER_HOUR = 'KILOLITER_PER_HOUR';
|
||||
const KILOLITER_PER_MINUTE = 'KILOLITER_PER_MINUTE';
|
||||
const KILOLITER_PER_SECOND = 'KILOLITER_PER_SECOND';
|
||||
const LAMBDA_PER_DAY = 'LAMBDA_PER_DAY';
|
||||
const LAMBDA_PER_HOUR = 'LAMBDA_PER_HOUR';
|
||||
const LAMBDA_PER_MINUTE = 'LAMBDA_PER_MINUTE';
|
||||
const LAMBDA_PER_SECOND = 'LAMBDA_PER_SECOND';
|
||||
const LITER_PER_DAY = 'LITER_PER_DAY';
|
||||
const LITER_PER_HOUR = 'LITER_PER_HOUR';
|
||||
const LITER_PER_MINUTE = 'LITER_PER_MINUTE';
|
||||
const LITER_PER_SECOND = 'LITER_PER_SECOND';
|
||||
const MILLILITER_PER_DAY = 'MILLILITER_PER_DAY';
|
||||
const MILLILITER_PER_HOUR = 'MILLILITER_PER_HOUR';
|
||||
const MILLILITER_PER_MINUTE = 'MILLILITER_PER_MINUTE';
|
||||
const MILLILITER_PER_SECOND = 'MILLILITER_PER_SECOND';
|
||||
const MILLION_ACRE_FOOT_PER_DAY = 'MILLION_ACRE_FOOT_PER_DAY';
|
||||
const MILLION_ACRE_FOOT_PER_HOUR = 'MILLION_ACRE_FOOT_PER_HOUR';
|
||||
const MILLION_ACRE_FOOT_PER_MINUTE = 'MILLION_ACRE_FOOT_PER_MINUTE';
|
||||
const MILLION_ACRE_FOOT_PER_SECOND = 'MILLION_ACRE_FOOT_PER_SECOND';
|
||||
const MILLION_CUBIC_FOOT_PER_DAY = 'MILLION_CUBIC_FOOT_PER_DAY';
|
||||
const MILLION_CUBIC_FOOT_PER_HOUR = 'MILLION_CUBIC_FOOT_PER_HOUR';
|
||||
const MILLION_CUBIC_FOOT_PER_MINUTE = 'MILLION_CUBIC_FOOT_PER_MINUTE';
|
||||
const MILLION_CUBIC_FOOT_PER_SECOND = 'MILLION_CUBIC_FOOT_PER_SECOND';
|
||||
const MILLION_GALLON_PER_DAY = 'MILLION_GALLON_PER_DAY';
|
||||
const MILLION_GALLON_PER_HOUR = 'MILLION_GALLON_PER_HOUR';
|
||||
const MILLION_GALLON_PER_MINUTE = 'MILLION_GALLON_PER_MINUTE';
|
||||
const MILLION_GALLON_PER_SECOND = 'MILLION_GALLON_PER_SECOND';
|
||||
const MILLION_GALLON_US_PER_DAY = 'MILLION_GALLON_US_PER_DAY';
|
||||
const MILLION_GALLON_US_PER_HOUR = 'MILLION_GALLON_US_PER_HOUR';
|
||||
const MILLION_GALLON_US_PER_MINUTE = 'MILLION_GALLON_US_PER_MINUTE';
|
||||
const MILLION_GALLON_US_PER_SECOND = 'MILLION_GALLON_US_PER_SECOND';
|
||||
const MINERS_INCH_AZ = 'MINERS_INCH_AZ';
|
||||
const MINERS_INCH_CA = 'MINERS_INCH_CA';
|
||||
const MINERS_INCH_OR = 'MINERS_INCH_OR';
|
||||
const MINERS_INCH_CO = 'MINERS_INCH_CO';
|
||||
const MINERS_INCH_ID = 'MINERS_INCH_ID';
|
||||
const MINERS_INCH_WA = 'MINERS_INCH_WA';
|
||||
const MINERS_INCH_NM = 'MINERS_INCH_NM';
|
||||
const OUNCE_PER_DAY = 'OUNCE_PER_DAY';
|
||||
const OUNCE_PER_HOUR = 'OUNCE_PER_HOUR';
|
||||
const OUNCE_PER_MINUTE = 'OUNCE_PER_MINUTE';
|
||||
const OUNCE_PER_SECOND = 'OUNCE_PER_SECOND';
|
||||
const OUNCE_US_PER_DAY = 'OUNCE_US_PER_DAY';
|
||||
const OUNCE_US_PER_HOUR = 'OUNCE_US_PER_HOUR';
|
||||
const OUNCE_US_PER_MINUTE = 'OUNCE_US_PER_MINUTE';
|
||||
const OUNCE_US_PER_SECOND = 'OUNCE_US_PER_SECOND';
|
||||
const PETROGRAD_STANDARD_PER_DAY = 'PETROGRAD_STANDARD_PER_DAY';
|
||||
const PETROGRAD_STANDARD_PER_HOUR = 'PETROGRAD_STANDARD_PER_HOUR';
|
||||
const PETROGRAD_STANDARD_PER_MINUTE = 'PETROGRAD_STANDARD_PER_MINUTE';
|
||||
const PETROGRAD_STANDARD_PER_SECOND = 'PETROGRAD_STANDARD_PER_SECOND';
|
||||
const STERE_PER_DAY = 'STERE_PER_DAY';
|
||||
const STERE_PER_HOUR = 'STERE_PER_HOUR';
|
||||
const STERE_PER_MINUTE = 'STERE_PER_MINUTE';
|
||||
const STERE_PER_SECOND = 'STERE_PER_SECOND';
|
||||
const THOUSAND_CUBIC_FOOT_PER_DAY = 'THOUSAND_CUBIC_FOOT_PER_DAY';
|
||||
const THOUSAND_CUBIC_FOOT_PER_HOUR = 'THOUSAND_CUBIC_FOOT_PER_HOUR';
|
||||
const THOUSAND_CUBIC_FOOT_PER_MINUTE = 'THOUSAND_CUBIC_FOOT_PER_MINUTE';
|
||||
const THOUSAND_CUBIC_FOOT_PER_SECOND = 'THOUSAND_CUBIC_FOOT_PER_SECOND';
|
||||
const TRILLION_CUBIC_FOOT_PER_DAY = 'TRILLION_CUBIC_FOOT_PER_DAY';
|
||||
const TRILLION_CUBIC_FOOT_PER_HOUR = 'TRILLION_CUBIC_FOOT_PER_HOUR';
|
||||
const TRILLION_CUBIC_FOOT_PER_MINUTE = 'TRILLION_CUBIC_FOOT_PER_MINUTE';
|
||||
const TRILLION_CUBIC_FOOT_PER_SECOND = 'TRILLION_CUBIC_FOOT_PER_';
|
||||
|
||||
/**
|
||||
* Calculations for all flow volume units
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_units = array(
|
||||
'ACRE_FOOT_PER_DAY' => array(array('' => '1233.48184', '/' => '86400'), 'ac ft/day'),
|
||||
'ACRE_FOOT_PER_HOUR' => array(array('' => '1233.48184', '/' => '3600'), 'ac ft/h'),
|
||||
'ACRE_FOOT_PER_MINUTE' => array(array('' => '1233.48184', '/' => '60'), 'ac ft/m'),
|
||||
'ACRE_FOOT_PER_SECOND' => array('1233.48184', 'ac ft/s'),
|
||||
'ACRE_FOOT_SURVEY_PER_DAY' => array(array('' => '1233.48924', '/' => '86400'), 'ac ft/day'),
|
||||
'ACRE_FOOT_SURVEY_PER_HOUR' => array(array('' => '1233.48924', '/' => '3600'), 'ac ft/h'),
|
||||
'ACRE_FOOT_SURVEY_PER_MINUTE' => array(array('' => '1233.48924', '/' => '60'), 'ac ft/m'),
|
||||
'ACRE_FOOT_SURVEY_PER_SECOND' => array('1233.48924', 'ac ft/s'),
|
||||
'ACRE_INCH_PER_DAY' => array(array('' => '1233.48184', '/' => '1036800'), 'ac in/day'),
|
||||
'ACRE_INCH_PER_HOUR' => array(array('' => '1233.48184', '/' => '43200'), 'ac in/h'),
|
||||
'ACRE_INCH_PER_MINUTE' => array(array('' => '1233.48184', '/' => '720'), 'ac in/m'),
|
||||
'ACRE_INCH_PER_SECOND' => array(array('' => '1233.48184', '/' => '12'), 'ac in/s'),
|
||||
'ACRE_INCH_SURVEY_PER_DAY' => array(array('' => '1233.48924', '/' => '1036800'), 'ac in/day'),
|
||||
'ACRE_INCH_SURVEY_PER_HOUR' => array(array('' => '1233.48924', '/' => '43200'), 'ac in/h'),
|
||||
'ACRE_INCH_SURVEY_PER_MINUTE' => array(array('' => '1233.48924', '/' => '720'), 'ac in /m'),
|
||||
'ACRE_INCH_SURVEY_PER_SECOND' => array(array('' => '1233.48924', '/' => '12'), 'ac in/s'),
|
||||
'BARREL_PETROLEUM_PER_DAY' => array(array('' => '0.1589872956', '/' => '86400'), 'bbl/day'),
|
||||
'BARREL_PETROLEUM_PER_HOUR' => array(array('' => '0.1589872956', '/' => '3600'), 'bbl/h'),
|
||||
'BARREL_PETROLEUM_PER_MINUTE' => array(array('' => '0.1589872956', '/' => '60'), 'bbl/m'),
|
||||
'BARREL_PETROLEUM_PER_SECOND' => array('0.1589872956', 'bbl/s'),
|
||||
'BARREL_PER_DAY' => array(array('' => '0.16365924', '/' => '86400'), 'bbl/day'),
|
||||
'BARREL_PER_HOUR' => array(array('' => '0.16365924', '/' => '3600'), 'bbl/h'),
|
||||
'BARREL_PER_MINUTE' => array(array('' => '0.16365924', '/' => '60'), 'bbl/m'),
|
||||
'BARREL_PER_SECOND' => array('0.16365924', 'bbl/s'),
|
||||
'BARREL_US_PER_DAY' => array(array('' => '0.1192404717', '/' => '86400'), 'bbl/day'),
|
||||
'BARREL_US_PER_HOUR' => array(array('' => '0.1192404717', '/' => '3600'), 'bbl/h'),
|
||||
'BARREL_US_PER_MINUTE' => array(array('' => '0.1192404717', '/' => '60'), 'bbl/m'),
|
||||
'BARREL_US_PER_SECOND' => array('0.1192404717', 'bbl/s'),
|
||||
'BARREL_WINE_PER_DAY' => array(array('' => '0.1173477658', '/' => '86400'), 'bbl/day'),
|
||||
'BARREL_WINE_PER_HOUR' => array(array('' => '0.1173477658', '/' => '3600'), 'bbl/h'),
|
||||
'BARREL_WINE_PER_MINUTE' => array(array('' => '0.1173477658', '/' => '60'), 'bbl/m'),
|
||||
'BARREL_WINE_PER_SECOND' => array('0.1173477658', 'bbl/s'),
|
||||
'BARREL_BEER_PER_DAY' => array(array('' => '0.1173477658', '/' => '86400'), 'bbl/day'),
|
||||
'BARREL_BEER_PER_HOUR' => array(array('' => '0.1173477658', '/' => '3600'), 'bbl/h'),
|
||||
'BARREL_BEER_PER_MINUTE' => array(array('' => '0.1173477658', '/' => '60'), 'bbl/m'),
|
||||
'BARREL_BEER_PER_SECOND' => array('0.1173477658', 'bbl/s'),
|
||||
'BILLION_CUBIC_FOOT_PER_DAY' => array(array('' => '28316847', '/' => '86400'), 'bn ft³/day'),
|
||||
'BILLION_CUBIC_FOOT_PER_HOUR' => array(array('' => '28316847', '/' => '3600'), 'bn ft³/h'),
|
||||
'BILLION_CUBIC_FOOT_PER_MINUTE' => array(array('' => '28316847', '/' => '60'), 'bn ft³/m'),
|
||||
'BILLION_CUBIC_FOOT_PER_SECOND' => array('28316847', 'bn ft³/s'),
|
||||
'CENTILITER_PER_DAY' => array(array('' => '0.00001', '/' => '86400'), 'cl/day'),
|
||||
'CENTILITER_PER_HOUR' => array(array('' => '0.00001', '/' => '3600'), 'cl/h'),
|
||||
'CENTILITER_PER_MINUTE' => array(array('' => '0.00001', '/' => '60'), 'cl/m'),
|
||||
'CENTILITER_PER_SECOND' => array('0.00001', 'cl/s'),
|
||||
'CUBEM_PER_DAY' => array(array('' => '4168181830', '/' => '86400'), 'cubem/day'),
|
||||
'CUBEM_PER_HOUR' => array(array('' => '4168181830', '/' => '3600'), 'cubem/h'),
|
||||
'CUBEM_PER_MINUTE' => array(array('' => '4168181830', '/' => '60'), 'cubem/m'),
|
||||
'CUBEM_PER_SECOND' => array('4168181830', 'cubem/s'),
|
||||
'CUBIC_CENTIMETER_PER_DAY' => array(array('' => '0.000001', '/' => '86400'), 'cm³/day'),
|
||||
'CUBIC_CENTIMETER_PER_HOUR' => array(array('' => '0.000001', '/' => '3600'), 'cm³/h'),
|
||||
'CUBIC_CENTIMETER_PER_MINUTE' => array(array('' => '0.000001', '/' => '60'), 'cm³/m'),
|
||||
'CUBIC_CENTIMETER_PER_SECOND' => array('0.000001', 'cm³/s'),
|
||||
'CUBIC_DECIMETER_PER_DAY' => array(array('' => '0.001', '/' => '86400'), 'dm³/day'),
|
||||
'CUBIC_DECIMETER_PER_HOUR' => array(array('' => '0.001', '/' => '3600'), 'dm³/h'),
|
||||
'CUBIC_DECIMETER_PER_MINUTE' => array(array('' => '0.001', '/' => '60'), 'dm³/m'),
|
||||
'CUBIC_DECIMETER_PER_SECOND' => array('0.001', 'dm³/s'),
|
||||
'CUBIC_DEKAMETER_PER_DAY' => array(array('' => '1000', '/' => '86400'), 'dam³/day'),
|
||||
'CUBIC_DEKAMETER_PER_HOUR' => array(array('' => '1000', '/' => '3600'), 'dam³/h'),
|
||||
'CUBIC_DEKAMETER_PER_MINUTE' => array(array('' => '1000', '/' => '60'), 'dam³/m'),
|
||||
'CUBIC_DEKAMETER_PER_SECOND' => array('1000', 'dam³/s'),
|
||||
'CUBIC_FOOT_PER_DAY' => array(array('' => '0.028316847', '/' => '86400'), 'ft³/day'),
|
||||
'CUBIC_FOOT_PER_HOUR' => array(array('' => '0.028316847', '/' => '3600'), 'ft³/h'),
|
||||
'CUBIC_FOOT_PER_MINUTE' => array(array('' => '0.028316847', '/' => '60'), 'ft³/m'),
|
||||
'CUBIC_FOOT_PER_SECOND' => array('0.028316847', 'ft³/s'),
|
||||
'CUBIC_INCH_PER_DAY' => array(array('' => '0.028316847', '/' => '149299200'), 'in³/day'),
|
||||
'CUBIC_INCH_PER_HOUR' => array(array('' => '0.028316847', '/' => '6220800'), 'in³/h'),
|
||||
'CUBIC_INCH_PER_MINUTE' => array(array('' => '0.028316847', '/' => '103680'), 'in³/m'),
|
||||
'CUBIC_INCH_PER_SECOND' => array('0.028316847', 'in³/s'),
|
||||
'CUBIC_KILOMETER_PER_DAY' => array(array('' => '1000000000', '/' => '86400'), 'km³/day'),
|
||||
'CUBIC_KILOMETER_PER_HOUR' => array(array('' => '1000000000', '/' => '3600'), 'km³/h'),
|
||||
'CUBIC_KILOMETER_PER_MINUTE' => array(array('' => '1000000000', '/' => '60'), 'km³/m'),
|
||||
'CUBIC_KILOMETER_PER_SECOND' => array('1000000000', 'km³/s'),
|
||||
'CUBIC_METER_PER_DAY' => array(array('' => '1', '/' => '86400'), 'm³/day'),
|
||||
'CUBIC_METER_PER_HOUR' => array(array('' => '1', '/' => '3600'), 'm³/h'),
|
||||
'CUBIC_METER_PER_MINUTE' => array(array('' => '1', '/' => '60'), 'm³/m'),
|
||||
'CUBIC_METER_PER_SECOND' => array('1', 'm³/s'),
|
||||
'CUBIC_MILE_PER_DAY' => array(array('' => '4168181830', '/' => '86400'), 'mi³/day'),
|
||||
'CUBIC_MILE_PER_HOUR' => array(array('' => '4168181830', '/' => '3600'), 'mi³/h'),
|
||||
'CUBIC_MILE_PER_MINUTE' => array(array('' => '4168181830', '/' => '60'), 'mi³/m'),
|
||||
'CUBIC_MILE_PER_SECOND' => array('4168181830', 'mi³/s'),
|
||||
'CUBIC_MILLIMETER_PER_DAY' => array(array('' => '0.000000001', '/' => '86400'), 'mm³/day'),
|
||||
'CUBIC_MILLIMETER_PER_HOUR' => array(array('' => '0.000000001', '/' => '3600'), 'mm³/h'),
|
||||
'CUBIC_MILLIMETER_PER_MINUTE' => array(array('' => '0.000000001', '/' => '60'), 'mm³/m'),
|
||||
'CUBIC_MILLIMETER_PER_SECOND' => array('0.000000001', 'mm³/s'),
|
||||
'CUBIC_YARD_PER_DAY' => array(array('' => '0.764554869', '/' => '86400'), 'yd³/day'),
|
||||
'CUBIC_YARD_PER_HOUR' => array(array('' => '0.764554869', '/' => '3600'), 'yd³/h'),
|
||||
'CUBIC_YARD_PER_MINUTE' => array(array('' => '0.764554869', '/' => '60'), 'yd³/m'),
|
||||
'CUBIC_YARD_PER_SECOND' => array('0.764554869', 'yd³/s'),
|
||||
'CUSEC' => array('0.028316847', 'cusec'),
|
||||
'DECILITER_PER_DAY' => array(array('' => '0.0001', '/' => '86400'), 'dl/day'),
|
||||
'DECILITER_PER_HOUR' => array(array('' => '0.0001', '/' => '3600'), 'dl/h'),
|
||||
'DECILITER_PER_MINUTE' => array(array('' => '0.0001', '/' => '60'), 'dl/m'),
|
||||
'DECILITER_PER_SECOND' => array('0.0001', 'dl/s'),
|
||||
'DEKALITER_PER_DAY' => array(array('' => '0.01', '/' => '86400'), 'dal/day'),
|
||||
'DEKALITER_PER_HOUR' => array(array('' => '0.01', '/' => '3600'), 'dal/h'),
|
||||
'DEKALITER_PER_MINUTE' => array(array('' => '0.01', '/' => '60'), 'dal/m'),
|
||||
'DEKALITER_PER_SECOND' => array('0.01', 'dal/s'),
|
||||
'GALLON_PER_DAY' => array(array('' => '0.00454609', '/' => '86400'), 'gal/day'),
|
||||
'GALLON_PER_HOUR' => array(array('' => '0.00454609', '/' => '3600'), 'gal/h'),
|
||||
'GALLON_PER_MINUTE' => array(array('' => '0.00454609', '/' => '60'), 'gal/m'),
|
||||
'GALLON_PER_SECOND' => array('0.00454609', 'gal/s'),
|
||||
'GALLON_US_PER_DAY' => array(array('' => '0.0037854118', '/' => '86400'), 'gal/day'),
|
||||
'GALLON_US_PER_HOUR' => array(array('' => '0.0037854118', '/' => '3600'), 'gal/h'),
|
||||
'GALLON_US_PER_MINUTE' => array(array('' => '0.0037854118', '/' => '60'), 'gal/m'),
|
||||
'GALLON_US_PER_SECOND' => array('0.0037854118', 'gal/s'),
|
||||
'HECTARE_METER_PER_DAY' => array(array('' => '10000', '/' => '86400'), 'ha m/day'),
|
||||
'HECTARE_METER_PER_HOUR' => array(array('' => '10000', '/' => '3600'), 'ha m/h'),
|
||||
'HECTARE_METER_PER_MINUTE' => array(array('' => '10000', '/' => '60'), 'ha m/m'),
|
||||
'HECTARE_METER_PER_SECOND' => array('10000', 'ha m/s'),
|
||||
'HECTOLITER_PER_DAY' => array(array('' => '0.1', '/' => '86400'), 'hl/day'),
|
||||
'HECTOLITER_PER_HOUR' => array(array('' => '0.1', '/' => '3600'), 'hl/h'),
|
||||
'HECTOLITER_PER_MINUTE' => array(array('' => '0.1', '/' => '60'), 'hl/m'),
|
||||
'HECTOLITER_PER_SECOND' => array('0.1', 'hl/s'),
|
||||
'KILOLITER_PER_DAY' => array(array('' => '1', '/' => '86400'), 'kl/day'),
|
||||
'KILOLITER_PER_HOUR' => array(array('' => '1', '/' => '3600'), 'kl/h'),
|
||||
'KILOLITER_PER_MINUTE' => array(array('' => '1', '/' => '60'), 'kl/m'),
|
||||
'KILOLITER_PER_SECOND' => array('1', 'kl/s'),
|
||||
'LAMBDA_PER_DAY' => array(array('' => '0.000000001', '/' => '86400'), 'λ/day'),
|
||||
'LAMBDA_PER_HOUR' => array(array('' => '0.000000001', '/' => '3600'), 'λ/h'),
|
||||
'LAMBDA_PER_MINUTE' => array(array('' => '0.000000001', '/' => '60'), 'λ/m'),
|
||||
'LAMBDA_PER_SECOND' => array('0.000000001', 'λ/s'),
|
||||
'LITER_PER_DAY' => array(array('' => '0.001', '/' => '86400'), 'l/day'),
|
||||
'LITER_PER_HOUR' => array(array('' => '0.001', '/' => '3600'), 'l/h'),
|
||||
'LITER_PER_MINUTE' => array(array('' => '0.001', '/' => '60'), 'l/m'),
|
||||
'LITER_PER_SECOND' => array('0.001', 'l/s'),
|
||||
'MILLILITER_PER_DAY' => array(array('' => '0.000001', '/' => '86400'), 'ml/day'),
|
||||
'MILLILITER_PER_HOUR' => array(array('' => '0.000001', '/' => '3600'), 'ml/h'),
|
||||
'MILLILITER_PER_MINUTE' => array(array('' => '0.000001', '/' => '60'), 'ml/m'),
|
||||
'MILLILITER_PER_SECOND' => array('0.000001', 'ml/s'),
|
||||
'MILLION_ACRE_FOOT_PER_DAY' => array(array('' => '1233481840', '/' => '86400'), 'million ac ft/day'),
|
||||
'MILLION_ACRE_FOOT_PER_HOUR' => array(array('' => '1233481840', '/' => '3600'), 'million ac ft/h'),
|
||||
'MILLION_ACRE_FOOT_PER_MINUTE' => array(array('' => '1233481840', '/' => '60'), 'million ac ft/m'),
|
||||
'MILLION_ACRE_FOOT_PER_SECOND' => array('1233481840', 'million ac ft/s'),
|
||||
'MILLION_CUBIC_FOOT_PER_DAY' => array(array('' => '28316.847', '/' => '86400'), 'million ft³/day'),
|
||||
'MILLION_CUBIC_FOOT_PER_HOUR' => array(array('' => '28316.847', '/' => '3600'), 'million ft³/h'),
|
||||
'MILLION_CUBIC_FOOT_PER_MINUTE' => array(array('' => '28316.847', '/' => '60'), 'million ft³/m'),
|
||||
'MILLION_CUBIC_FOOT_PER_SECOND' => array('28316.847', 'million ft³/s'),
|
||||
'MILLION_GALLON_PER_DAY' => array(array('' => '4546.09', '/' => '86400'), 'million gal/day'),
|
||||
'MILLION_GALLON_PER_HOUR' => array(array('' => '4546.09', '/' => '3600'), 'million gal/h'),
|
||||
'MILLION_GALLON_PER_MINUTE' => array(array('' => '4546.09', '/' => '60'), 'million gal/m'),
|
||||
'MILLION_GALLON_PER_SECOND' => array('4546.09', 'million gal/s'),
|
||||
'MILLION_GALLON_US_PER_DAY' => array(array('' => '3785.4118', '/' => '86400'), 'million gal/day'),
|
||||
'MILLION_GALLON_US_PER_HOUR' => array(array('' => '3785.4118', '/' => '3600'), 'million gal/h'),
|
||||
'MILLION_GALLON_US_PER_MINUTE'=> array(array('' => '3785.4118', '/' => '60'), 'million gal/m'),
|
||||
'MILLION_GALLON_US_PER_SECOND'=> array('3785.4118', 'million gal/s'),
|
||||
'MINERS_INCH_AZ' => array(array('' => '0.0424752705', '/' => '60'), "miner's inch"),
|
||||
'MINERS_INCH_CA' => array(array('' => '0.0424752705', '/' => '60'), "miner's inch"),
|
||||
'MINERS_INCH_OR' => array(array('' => '0.0424752705', '/' => '60'), "miner's inch"),
|
||||
'MINERS_INCH_CO' => array(array('' => '0.0442450734375', '/' => '60'), "miner's inch"),
|
||||
'MINERS_INCH_ID' => array(array('' => '0.0340687062', '/' => '60'), "miner's inch"),
|
||||
'MINERS_INCH_WA' => array(array('' => '0.0340687062', '/' => '60'), "miner's inch"),
|
||||
'MINERS_INCH_NM' => array(array('' => '0.0340687062', '/' => '60'), "miner's inch"),
|
||||
'OUNCE_PER_DAY' => array(array('' => '0.00454609', '/' => '13824000'), 'oz/day'),
|
||||
'OUNCE_PER_HOUR' => array(array('' => '0.00454609', '/' => '576000'), 'oz/h'),
|
||||
'OUNCE_PER_MINUTE' => array(array('' => '0.00454609', '/' => '9600'), 'oz/m'),
|
||||
'OUNCE_PER_SECOND' => array(array('' => '0.00454609', '/' => '160'), 'oz/s'),
|
||||
'OUNCE_US_PER_DAY' => array(array('' => '0.0037854118', '/' => '11059200'), 'oz/day'),
|
||||
'OUNCE_US_PER_HOUR' => array(array('' => '0.0037854118', '/' => '460800'), 'oz/h'),
|
||||
'OUNCE_US_PER_MINUTE' => array(array('' => '0.0037854118', '/' => '7680'), 'oz/m'),
|
||||
'OUNCE_US_PER_SECOND' => array(array('' => '0.0037854118', '/' => '128'), 'oz/s'),
|
||||
'PETROGRAD_STANDARD_PER_DAY' => array(array('' => '4.672279755', '/' => '86400'), 'petrograd standard/day'),
|
||||
'PETROGRAD_STANDARD_PER_HOUR' => array(array('' => '4.672279755', '/' => '3600'), 'petrograd standard/h'),
|
||||
'PETROGRAD_STANDARD_PER_MINUTE' => array(array('' => '4.672279755', '/' => '60'), 'petrograd standard/m'),
|
||||
'PETROGRAD_STANDARD_PER_SECOND' => array('4.672279755', 'petrograd standard/s'),
|
||||
'STERE_PER_DAY' => array(array('' => '1', '/' => '86400'), 'st/day'),
|
||||
'STERE_PER_HOUR' => array(array('' => '1', '/' => '3600'), 'st/h'),
|
||||
'STERE_PER_MINUTE' => array(array('' => '1', '/' => '60'), 'st/m'),
|
||||
'STERE_PER_SECOND' => array('1', 'st/s'),
|
||||
'THOUSAND_CUBIC_FOOT_PER_DAY' => array(array('' => '28.316847', '/' => '86400'), 'thousand ft³/day'),
|
||||
'THOUSAND_CUBIC_FOOT_PER_HOUR' => array(array('' => '28.316847', '/' => '3600'), 'thousand ft³/h'),
|
||||
'THOUSAND_CUBIC_FOOT_PER_MINUTE' => array(array('' => '28.316847', '/' => '60'), 'thousand ft³/m'),
|
||||
'THOUSAND_CUBIC_FOOT_PER_SECOND' => array('28.316847', 'thousand ft³/s'),
|
||||
'TRILLION_CUBIC_FOOT_PER_DAY' => array(array('' => '28316847000', '/' => '86400'), 'trillion ft³/day'),
|
||||
'TRILLION_CUBIC_FOOT_PER_HOUR' => array(array('' => '28316847000', '/' => '3600'), 'trillion ft³/h'),
|
||||
'TRILLION_CUBIC_FOOT_PER_MINUTE' => array(array('' => '28316847000', '/' => '60'), 'trillion ft³/m'),
|
||||
'TRILLION_CUBIC_FOOT_PER_' => array('28316847000', 'trillion ft³/s'),
|
||||
'STANDARD' => 'CUBIC_METER_PER_SECOND'
|
||||
);
|
||||
}
|
127
libs/Zend/Measure/Force.php
Normal file
127
libs/Zend/Measure/Force.php
Normal file
@ -0,0 +1,127 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Force.php 9508 2008-05-23 10:56:41Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implement needed classes
|
||||
*/
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
require_once 'Zend/Measure/Abstract.php';
|
||||
require_once 'Zend/Locale.php';
|
||||
|
||||
/**
|
||||
* Class for handling force conversions
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @subpackage Zend_Measure_Force
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Measure_Force extends Zend_Measure_Abstract
|
||||
{
|
||||
const STANDARD = 'NEWTON';
|
||||
|
||||
const ATTONEWTON = 'ATTONEWTON';
|
||||
const CENTINEWTON = 'CENTINEWTON';
|
||||
const DECIGRAM_FORCE = 'DECIGRAM_FORCE';
|
||||
const DECINEWTON = 'DECINEWTON';
|
||||
const DEKAGRAM_FORCE = 'DEKAGRAM_FORCE';
|
||||
const DEKANEWTON = 'DEKANEWTON';
|
||||
const DYNE = 'DYNE';
|
||||
const EXANEWTON = 'EXANEWTON';
|
||||
const FEMTONEWTON = 'FEMTONEWTON';
|
||||
const GIGANEWTON = 'GIGANEWTON';
|
||||
const GRAM_FORCE = 'GRAM_FORCE';
|
||||
const HECTONEWTON = 'HECTONEWTON';
|
||||
const JOULE_PER_METER = 'JOULE_PER_METER';
|
||||
const KILOGRAM_FORCE = 'KILOGRAM_FORCE';
|
||||
const KILONEWTON = 'KILONEWTON';
|
||||
const KILOPOND = 'KILOPOND';
|
||||
const KIP = 'KIP';
|
||||
const MEGANEWTON = 'MEGANEWTON';
|
||||
const MEGAPOND = 'MEGAPOND';
|
||||
const MICRONEWTON = 'MICRONEWTON';
|
||||
const MILLINEWTON = 'MILLINEWTON';
|
||||
const NANONEWTON = 'NANONEWTON';
|
||||
const NEWTON = 'NEWTON';
|
||||
const OUNCE_FORCE = 'OUNCE_FORCE';
|
||||
const PETANEWTON = 'PETANEWTON';
|
||||
const PICONEWTON = 'PICONEWTON';
|
||||
const POND = 'POND';
|
||||
const POUND_FORCE = 'POUND_FORCE';
|
||||
const POUNDAL = 'POUNDAL';
|
||||
const STHENE = 'STHENE';
|
||||
const TERANEWTON = 'TERANEWTON';
|
||||
const TON_FORCE_LONG = 'TON_FORCE_LONG';
|
||||
const TON_FORCE = 'TON_FORCE';
|
||||
const TON_FORCE_SHORT = 'TON_FORCE_SHORT';
|
||||
const YOCTONEWTON = 'YOCTONEWTON';
|
||||
const YOTTANEWTON = 'YOTTANEWTON';
|
||||
const ZEPTONEWTON = 'ZEPTONEWTON';
|
||||
const ZETTANEWTON = 'ZETTANEWTON';
|
||||
|
||||
/**
|
||||
* Calculations for all force units
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_units = array(
|
||||
'ATTONEWTON' => array('1.0e-18', 'aN'),
|
||||
'CENTINEWTON' => array('0.01', 'cN'),
|
||||
'DECIGRAM_FORCE' => array('0.000980665', 'dgf'),
|
||||
'DECINEWTON' => array('0.1', 'dN'),
|
||||
'DEKAGRAM_FORCE' => array('0.0980665', 'dagf'),
|
||||
'DEKANEWTON' => array('10', 'daN'),
|
||||
'DYNE' => array('0.00001', 'dyn'),
|
||||
'EXANEWTON' => array('1.0e+18', 'EN'),
|
||||
'FEMTONEWTON' => array('1.0e-15', 'fN'),
|
||||
'GIGANEWTON' => array('1.0e+9', 'GN'),
|
||||
'GRAM_FORCE' => array('0.00980665', 'gf'),
|
||||
'HECTONEWTON' => array('100', 'hN'),
|
||||
'JOULE_PER_METER' => array('1', 'J/m'),
|
||||
'KILOGRAM_FORCE' => array('9.80665', 'kgf'),
|
||||
'KILONEWTON' => array('1000', 'kN'),
|
||||
'KILOPOND' => array('9.80665', 'kp'),
|
||||
'KIP' => array('4448.2216', 'kip'),
|
||||
'MEGANEWTON' => array('1000000', 'Mp'),
|
||||
'MEGAPOND' => array('9806.65', 'MN'),
|
||||
'MICRONEWTON' => array('0.000001', 'µN'),
|
||||
'MILLINEWTON' => array('0.001', 'mN'),
|
||||
'NANONEWTON' => array('0.000000001', 'nN'),
|
||||
'NEWTON' => array('1', 'N'),
|
||||
'OUNCE_FORCE' => array('0.27801385', 'ozf'),
|
||||
'PETANEWTON' => array('1.0e+15', 'PN'),
|
||||
'PICONEWTON' => array('1.0e-12', 'pN'),
|
||||
'POND' => array('0.00980665', 'pond'),
|
||||
'POUND_FORCE' => array('4.4482216', 'lbf'),
|
||||
'POUNDAL' => array('0.13825495', 'pdl'),
|
||||
'STHENE' => array('1000', 'sn'),
|
||||
'TERANEWTON' => array('1.0e+12', 'TN'),
|
||||
'TON_FORCE_LONG' => array('9964.016384', 'tnf'),
|
||||
'TON_FORCE' => array('9806.65', 'tnf'),
|
||||
'TON_FORCE_SHORT' => array('8896.4432', 'tnf'),
|
||||
'YOCTONEWTON' => array('1.0e-24', 'yN'),
|
||||
'YOTTANEWTON' => array('1.0e+24', 'YN'),
|
||||
'ZEPTONEWTON' => array('1.0e-21', 'zN'),
|
||||
'ZETTANEWTON' => array('1.0e+21', 'ZN'),
|
||||
'STANDARD' => 'NEWTON'
|
||||
);
|
||||
}
|
87
libs/Zend/Measure/Frequency.php
Normal file
87
libs/Zend/Measure/Frequency.php
Normal file
@ -0,0 +1,87 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Frequency.php 9508 2008-05-23 10:56:41Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implement needed classes
|
||||
*/
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
require_once 'Zend/Measure/Abstract.php';
|
||||
require_once 'Zend/Locale.php';
|
||||
|
||||
/**
|
||||
* Class for handling flow volume conversions
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @subpackage Zend_Measure_Frequency
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Measure_Frequency extends Zend_Measure_Abstract
|
||||
{
|
||||
const STANDARD = 'HERTZ';
|
||||
|
||||
const ONE_PER_SECOND = 'ONE_PER_SECOND';
|
||||
const CYCLE_PER_SECOND = 'CYCLE_PER_SECOND';
|
||||
const DEGREE_PER_HOUR = 'DEGREE_PER_HOUR';
|
||||
const DEGREE_PER_MINUTE = 'DEGREE_PER_MINUTE';
|
||||
const DEGREE_PER_SECOND = 'DEGREE_PER_SECOND';
|
||||
const GIGAHERTZ = 'GIGAHERTZ';
|
||||
const HERTZ = 'HERTZ';
|
||||
const KILOHERTZ = 'KILOHERTZ';
|
||||
const MEGAHERTZ = 'MEGAHERTZ';
|
||||
const MILLIHERTZ = 'MILLIHERTZ';
|
||||
const RADIAN_PER_HOUR = 'RADIAN_PER_HOUR';
|
||||
const RADIAN_PER_MINUTE = 'RADIAN_PER_MINUTE';
|
||||
const RADIAN_PER_SECOND = 'RADIAN_PER_SECOND';
|
||||
const REVOLUTION_PER_HOUR = 'REVOLUTION_PER_HOUR';
|
||||
const REVOLUTION_PER_MINUTE = 'REVOLUTION_PER_MINUTE';
|
||||
const REVOLUTION_PER_SECOND = 'REVOLUTION_PER_SECOND';
|
||||
const RPM = 'RPM';
|
||||
const TERRAHERTZ = 'TERRAHERTZ';
|
||||
|
||||
/**
|
||||
* Calculations for all frequency units
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_units = array(
|
||||
'ONE_PER_SECOND' => array('1', '1/s'),
|
||||
'CYCLE_PER_SECOND' => array('1', 'cps'),
|
||||
'DEGREE_PER_HOUR' => array(array('' => '1', '/' => '1296000'), '°/h'),
|
||||
'DEGREE_PER_MINUTE' => array(array('' => '1', '/' => '21600'), '°/m'),
|
||||
'DEGREE_PER_SECOND' => array(array('' => '1', '/' => '360'), '°/s'),
|
||||
'GIGAHERTZ' => array('1000000000', 'GHz'),
|
||||
'HERTZ' => array('1', 'Hz'),
|
||||
'KILOHERTZ' => array('1000', 'kHz'),
|
||||
'MEGAHERTZ' => array('1000000', 'MHz'),
|
||||
'MILLIHERTZ' => array('0.001', 'mHz'),
|
||||
'RADIAN_PER_HOUR' => array(array('' => '1', '/' => '22619.467'), 'rad/h'),
|
||||
'RADIAN_PER_MINUTE' => array(array('' => '1', '/' => '376.99112'), 'rad/m'),
|
||||
'RADIAN_PER_SECOND' => array(array('' => '1', '/' => '6.2831853'), 'rad/s'),
|
||||
'REVOLUTION_PER_HOUR' => array(array('' => '1', '/' => '3600'), 'rph'),
|
||||
'REVOLUTION_PER_MINUTE' => array(array('' => '1', '/' => '60'), 'rpm'),
|
||||
'REVOLUTION_PER_SECOND' => array('1', 'rps'),
|
||||
'RPM' => array(array('' => '1', '/' => '60'), 'rpm'),
|
||||
'TERRAHERTZ' => array('1000000000000', 'THz'),
|
||||
'STANDARD' =>'HERTZ'
|
||||
);
|
||||
}
|
73
libs/Zend/Measure/Illumination.php
Normal file
73
libs/Zend/Measure/Illumination.php
Normal file
@ -0,0 +1,73 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Illumination.php 9508 2008-05-23 10:56:41Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implement needed classes
|
||||
*/
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
require_once 'Zend/Measure/Abstract.php';
|
||||
require_once 'Zend/Locale.php';
|
||||
|
||||
/**
|
||||
* Class for handling illumination conversions
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @subpackage Zend_Measure_Illumination
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Measure_Illumination extends Zend_Measure_Abstract
|
||||
{
|
||||
const STANDARD = 'LUX';
|
||||
|
||||
const FOOTCANDLE = 'FOOTCANDLE';
|
||||
const KILOLUX = 'KILOLUX';
|
||||
const LUMEN_PER_SQUARE_CENTIMETER = 'LUMEN_PER_SQUARE_CENTIMETER';
|
||||
const LUMEN_PER_SQUARE_FOOT = 'LUMEN_PER_SQUARE_FOOT';
|
||||
const LUMEN_PER_SQUARE_INCH = 'LUMEN_PER_SQUARE_INCH';
|
||||
const LUMEN_PER_SQUARE_METER = 'LUMEN_PER_SQUARE_METER';
|
||||
const LUX = 'LUX';
|
||||
const METERCANDLE = 'METERCANDLE';
|
||||
const MILLIPHOT = 'MILLIPHOT';
|
||||
const NOX = 'NOX';
|
||||
const PHOT = 'PHOT';
|
||||
|
||||
/**
|
||||
* Calculations for all illumination units
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_units = array(
|
||||
'FOOTCANDLE' => array('10.7639104', 'fc'),
|
||||
'KILOLUX' => array('1000', 'klx'),
|
||||
'LUMEN_PER_SQUARE_CENTIMETER' => array('10000', 'lm/cm²'),
|
||||
'LUMEN_PER_SQUARE_FOOT' => array('10.7639104', 'lm/ft²'),
|
||||
'LUMEN_PER_SQUARE_INCH' => array('1550.0030976', 'lm/in²'),
|
||||
'LUMEN_PER_SQUARE_METER' => array('1', 'lm/m²'),
|
||||
'LUX' => array('1', 'lx'),
|
||||
'METERCANDLE' => array('1', 'metercandle'),
|
||||
'MILLIPHOT' => array('10', 'mph'),
|
||||
'NOX' => array('0.001', 'nox'),
|
||||
'PHOT' => array('10000', 'ph'),
|
||||
'STANDARD' => 'LUX'
|
||||
);
|
||||
}
|
675
libs/Zend/Measure/Length.php
Normal file
675
libs/Zend/Measure/Length.php
Normal file
@ -0,0 +1,675 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Length.php 9508 2008-05-23 10:56:41Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implement needed classes
|
||||
*/
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
require_once 'Zend/Measure/Abstract.php';
|
||||
require_once 'Zend/Locale.php';
|
||||
|
||||
/**
|
||||
* Class for handling length conversions
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @subpackage Zend_Measure_Length
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Measure_Length extends Zend_Measure_Abstract
|
||||
{
|
||||
const STANDARD = 'METER';
|
||||
|
||||
const AGATE = 'AGATE';
|
||||
const ALEN_DANISH = 'ALEN_DANISH';
|
||||
const ALEN = 'ALEN';
|
||||
const ALEN_SWEDISH = 'ALEN_SWEDISH';
|
||||
const ANGSTROM = 'ANGSTROM';
|
||||
const ARMS = 'ARMS';
|
||||
const ARPENT_CANADIAN = 'ARPENT_CANADIAN';
|
||||
const ARPENT = 'ARPENT';
|
||||
const ARSHEEN = 'ARSHEEN';
|
||||
const ARSHIN = 'ARSHIN';
|
||||
const ARSHIN_IRAQ = 'ARSHIN_IRAQ';
|
||||
const ASTRONOMICAL_UNIT = 'ASTRONOMICAL_UNIT';
|
||||
const ATTOMETER = 'ATTOMETER';
|
||||
const BAMBOO = 'BAMBOO';
|
||||
const BARLEYCORN = 'BARLEYCORN';
|
||||
const BEE_SPACE = 'BEE_SPACE';
|
||||
const BICRON = 'BICRON';
|
||||
const BLOCK_US_EAST = 'BLOCK_US_EAST';
|
||||
const BLOCK_US_WEST = 'BLOCK_US_WEST';
|
||||
const BLOCK_US_SOUTH = 'BLOCK_US_SOUTH';
|
||||
const BOHR = 'BOHR';
|
||||
const BRACCIO = 'BRACCIO';
|
||||
const BRAZA_ARGENTINA = 'BRAZA_ARGENTINA';
|
||||
const BRAZA = 'BRAZA';
|
||||
const BRAZA_US = 'BRAZA_US';
|
||||
const BUTTON = 'BUTTON';
|
||||
const CABLE_US = 'CABLE_US';
|
||||
const CABLE_UK = 'CABLE_UK';
|
||||
const CALIBER = 'CALIBER';
|
||||
const CANA = 'CANA';
|
||||
const CAPE_FOOT = 'CAPE_FOOT';
|
||||
const CAPE_INCH = 'CAPE_INCH';
|
||||
const CAPE_ROOD = 'CAPE_ROOD';
|
||||
const CENTIMETER = 'CENTIMETER';
|
||||
const CHAIN = 'CHAIN';
|
||||
const CHAIN_ENGINEER = 'CHAIN_ENGINEER';
|
||||
const CHIH = 'CHIH';
|
||||
const CHINESE_FOOT = 'CHINESE_FOOT';
|
||||
const CHINESE_INCH = 'CHINESE_INCH';
|
||||
const CHINESE_MILE = 'CHINESE_MILE';
|
||||
const CHINESE_YARD = 'CHINESE_YARD';
|
||||
const CITY_BLOCK_US_EAST = 'CITY_BLOCK_US_EAST';
|
||||
const CITY_BLOCK_US_WEST = 'CITY_BLOCK_US_WEST';
|
||||
const CITY_BLOCK_US_SOUTH = 'CITY_BLOCK_US_SOUTH';
|
||||
const CLICK = 'CLICK';
|
||||
const CUADRA = 'CUADRA';
|
||||
const CUADRA_ARGENTINA = 'CUADRA_ARGENTINA';
|
||||
const CUBIT_EGYPT = 'Length:CUBIT_EGYPT';
|
||||
const CUBIT_ROYAL = 'CUBIT_ROYAL';
|
||||
const CUBIT_UK = 'CUBIT_UK';
|
||||
const CUBIT = 'CUBIT';
|
||||
const CUERDA = 'CUERDA';
|
||||
const DECIMETER = 'DECIMETER';
|
||||
const DEKAMETER = 'DEKAMETER';
|
||||
const DIDOT_POINT = 'DIDOT_POINT';
|
||||
const DIGIT = 'DIGIT';
|
||||
const DIRAA = 'DIRAA';
|
||||
const DONG = 'DONG';
|
||||
const DOUZIEME_WATCH = 'DOUZIEME_WATCH';
|
||||
const DOUZIEME = 'DOUZIEME';
|
||||
const DRA_IRAQ = 'DRA_IRAQ';
|
||||
const DRA = 'DRA';
|
||||
const EL = 'EL';
|
||||
const ELL = 'ELL';
|
||||
const ELL_SCOTTISH = 'ELL_SCOTTISH';
|
||||
const ELLE = 'ELLE';
|
||||
const ELLE_VIENNA = 'ELLE_VIENNA';
|
||||
const EM = 'EM';
|
||||
const ESTADIO_PORTUGAL = 'ESTADIO_PORTUGAL';
|
||||
const ESTADIO = 'ESTADIO';
|
||||
const EXAMETER = 'EXAMETER';
|
||||
const FADEN_AUSTRIA = 'FADEN_AUSTRIA';
|
||||
const FADEN = 'FADEN';
|
||||
const FALL = 'FALL';
|
||||
const FALL_SCOTTISH = 'FALL_SCOTTISH';
|
||||
const FATHOM = 'FATHOM';
|
||||
const FATHOM_ANCIENT = 'FATHOM_ANCIENT';
|
||||
const FAUST = 'FAUST';
|
||||
const FEET_OLD_CANADIAN = 'FEET_OLD_CANADIAN';
|
||||
const FEET_EGYPT = 'FEET_EGYPT';
|
||||
const FEET_FRANCE = 'FEET_FRANCE';
|
||||
const FEET = 'FEET';
|
||||
const FEET_IRAQ = 'FEET_IRAQ';
|
||||
const FEET_NETHERLAND = 'FEET_NETHERLAND';
|
||||
const FEET_ITALIC = 'FEET_ITALIC';
|
||||
const FEET_SURVEY = 'FEET_SURVEY';
|
||||
const FEMTOMETER = 'FEMTOMETER';
|
||||
const FERMI = 'FERMI';
|
||||
const FINGER = 'FINGER';
|
||||
const FINGERBREADTH = 'FINGERBREADTH';
|
||||
const FIST = 'FIST';
|
||||
const FOD = 'FOD';
|
||||
const FOOT_EGYPT = 'FOOT_EGYPT';
|
||||
const FOOT_FRANCE = 'FOOT_FRANCE';
|
||||
const FOOT = 'FOOT';
|
||||
const FOOT_IRAQ = 'FOOT_IRAQ';
|
||||
const FOOT_NETHERLAND = 'FOOT_NETHERLAND';
|
||||
const FOOT_ITALIC = 'FOOT_ITALIC';
|
||||
const FOOT_SURVEY = 'FOOT_SURVEY';
|
||||
const FOOTBALL_FIELD_CANADA = 'FOOTBALL_FIELD_CANADA';
|
||||
const FOOTBALL_FIELD_US = 'FOOTBALL_FIELD_US';
|
||||
const FOOTBALL_FIELD = 'FOOTBALL_FIELD';
|
||||
const FURLONG = 'FURLONG';
|
||||
const FURLONG_SURVEY = 'FURLONG_SURVEY';
|
||||
const FUSS = 'FUSS';
|
||||
const GIGAMETER = 'GIGAMETER';
|
||||
const GIGAPARSEC = 'GIGAPARSEC';
|
||||
const GNATS_EYE = 'GNATS_EYE';
|
||||
const GOAD = 'GOAD';
|
||||
const GRY = 'GRY';
|
||||
const HAIRS_BREADTH = 'HAIRS_BREADTH';
|
||||
const HAND = 'HAND';
|
||||
const HANDBREADTH = 'HANDBREADTH';
|
||||
const HAT = 'HAT';
|
||||
const HECTOMETER = 'HECTOMETER';
|
||||
const HEER = 'HEER';
|
||||
const HIRO = 'HIRO';
|
||||
const HUBBLE = 'HUBBLE';
|
||||
const HVAT = 'HVAT';
|
||||
const INCH = 'INCH';
|
||||
const IRON = 'IRON';
|
||||
const KEN = 'KEN';
|
||||
const KERAT = 'KERAT';
|
||||
const KILOFOOT = 'KILOFOOT';
|
||||
const KILOMETER = 'KILOMETER';
|
||||
const KILOPARSEC = 'KILOPARSEC';
|
||||
const KILOYARD = 'KILOYARD';
|
||||
const KIND = 'KIND';
|
||||
const KLAFTER = 'KLAFTER';
|
||||
const KLAFTER_SWISS = 'KLAFTER_SWISS';
|
||||
const KLICK = 'KLICK';
|
||||
const KYU = 'KYU';
|
||||
const LAP_ANCIENT = 'LAP_ANCIENT';
|
||||
const LAP = 'LAP';
|
||||
const LAP_POOL = 'LAP_POOL';
|
||||
const LEAGUE_ANCIENT = 'LEAGUE_ANCIENT';
|
||||
const LEAGUE_NAUTIC = 'LEAGUE_NAUTIC';
|
||||
const LEAGUE_UK_NAUTIC = 'LEAGUE_UK_NAUTIC';
|
||||
const LEAGUE = 'LEAGUE';
|
||||
const LEAGUE_US = 'LEAGUE_US';
|
||||
const LEAP = 'LEAP';
|
||||
const LEGOA = 'LEGOA';
|
||||
const LEGUA = 'LEGUA';
|
||||
const LEGUA_US = 'LEGUA_US';
|
||||
const LEGUA_SPAIN_OLD = 'LEGUA_SPAIN_OLD';
|
||||
const LEGUA_SPAIN = 'LEGUA_SPAIN';
|
||||
const LI_ANCIENT = 'LI_ANCIENT';
|
||||
const LI_IMPERIAL = 'LI_IMPERIAL';
|
||||
const LI = 'LI';
|
||||
const LIEUE = 'LIEUE';
|
||||
const LIEUE_METRIC = 'LIEUE_METRIC';
|
||||
const LIEUE_NAUTIC = 'LIEUE_NAUTIC';
|
||||
const LIGHT_SECOND = 'LIGHT_SECOND';
|
||||
const LIGHT_MINUTE = 'LIGHT_MINUTE';
|
||||
const LIGHT_HOUR = 'LIGHT_HOUR';
|
||||
const LIGHT_DAY = 'LIGHT_DAY';
|
||||
const LIGHT_YEAR = 'LIGHT_YEAR';
|
||||
const LIGNE = 'LIGNE';
|
||||
const LIGNE_SWISS = 'LIGNE_SWISS';
|
||||
const LINE = 'LINE';
|
||||
const LINE_SMALL = 'LINE_SMALL';
|
||||
const LINK = 'LINK';
|
||||
const LINK_ENGINEER = 'LINK_ENGINEER';
|
||||
const LUG = 'LUG';
|
||||
const LUG_GREAT = 'LUG_GREAT';
|
||||
const MARATHON = 'MARATHON';
|
||||
const MARK_TWAIN = 'MARK_TWAIN';
|
||||
const MEGAMETER = 'MEGAMETER';
|
||||
const MEGAPARSEC = 'MEGAPARSEC';
|
||||
const MEILE_AUSTRIAN = 'MEILE_AUSTRIAN';
|
||||
const MEILE = 'MEILE';
|
||||
const MEILE_GERMAN = 'MEILE_GERMAN';
|
||||
const METER = 'METER';
|
||||
const METRE = 'METRE';
|
||||
const METRIC_MILE = 'METRIC_MILE';
|
||||
const METRIC_MILE_US = 'METRIC_MILE_US';
|
||||
const MICROINCH = 'MICROINCH';
|
||||
const MICROMETER = 'MICROMETER';
|
||||
const MICROMICRON = 'MICROMICRON';
|
||||
const MICRON = 'MICRON';
|
||||
const MIGLIO = 'MIGLIO';
|
||||
const MIIL = 'MIIL';
|
||||
const MIIL_DENMARK = 'MIIL_DENMARK';
|
||||
const MIIL_SWEDISH = 'MIIL_SWEDISH';
|
||||
const MIL = 'MIL';
|
||||
const MIL_SWEDISH = 'MIL_SWEDISH';
|
||||
const MILE_UK = 'MILE_UK';
|
||||
const MILE_IRISH = 'MILE_IRISH';
|
||||
const MILE = 'MILE';
|
||||
const MILE_NAUTIC = 'MILE_NAUTIC';
|
||||
const MILE_NAUTIC_UK = 'MILE_NAUTIC_UK';
|
||||
const MILE_NAUTIC_US = 'MILE_NAUTIC_US';
|
||||
const MILE_ANCIENT = 'MILE_ANCIENT';
|
||||
const MILE_SCOTTISH = 'MILE_SCOTTISH';
|
||||
const MILE_STATUTE = 'MILE_STATUTE';
|
||||
const MILE_US = 'MILE_US';
|
||||
const MILHA = 'MILHA';
|
||||
const MILITARY_PACE = 'MILITARY_PACE';
|
||||
const MILITARY_PACE_DOUBLE = 'MILITARY_PACE_DOUBLE';
|
||||
const MILLA = 'MILLA';
|
||||
const MILLE = 'MILLE';
|
||||
const MILLIARE = 'MILLIARE';
|
||||
const MILLIMETER = 'MILLIMETER';
|
||||
const MILLIMICRON = 'MILLIMICRON';
|
||||
const MKONO = 'MKONO';
|
||||
const MOOT = 'MOOT';
|
||||
const MYRIAMETER = 'MYRIAMETER';
|
||||
const NAIL = 'NAIL';
|
||||
const NANOMETER = 'NANOMETER';
|
||||
const NANON = 'NANON';
|
||||
const PACE = 'PACE';
|
||||
const PACE_ROMAN = 'PACE_ROMAN';
|
||||
const PALM_DUTCH = 'PALM_DUTCH';
|
||||
const PALM_UK = 'PALM_UK';
|
||||
const PALM = 'PALM';
|
||||
const PALMO_PORTUGUESE = 'PALMO_PORTUGUESE';
|
||||
const PALMO = 'PALMO';
|
||||
const PALMO_US = 'PALMO_US';
|
||||
const PARASANG = 'PARASANG';
|
||||
const PARIS_FOOT = 'PARIS_FOOT';
|
||||
const PARSEC = 'PARSEC';
|
||||
const PE = 'PE';
|
||||
const PEARL = 'PEARL';
|
||||
const PERCH = 'PERCH';
|
||||
const PERCH_IRELAND = 'PERCH_IRELAND';
|
||||
const PERTICA = 'PERTICA';
|
||||
const PES = 'PES';
|
||||
const PETAMETER = 'PETAMETER';
|
||||
const PICA = 'PICA';
|
||||
const PICOMETER = 'PICOMETER';
|
||||
const PIE_ARGENTINA = 'PIE_ARGENTINA';
|
||||
const PIE_ITALIC = 'PIE_ITALIC';
|
||||
const PIE = 'PIE';
|
||||
const PIE_US = 'PIE_US';
|
||||
const PIED_DE_ROI = 'PIED_DE_ROI';
|
||||
const PIK = 'PIK';
|
||||
const PIKE = 'PIKE';
|
||||
const POINT_ADOBE = 'POINT_ADOBE';
|
||||
const POINT = 'POINT';
|
||||
const POINT_DIDOT = 'POINT_DIDOT';
|
||||
const POINT_TEX = 'POINT_TEX';
|
||||
const POLE = 'POLE';
|
||||
const POLEGADA = 'POLEGADA';
|
||||
const POUCE = 'POUCE';
|
||||
const PU = 'PU';
|
||||
const PULGADA = 'PULGADA';
|
||||
const PYGME = 'PYGME';
|
||||
const Q = 'Q';
|
||||
const QUADRANT = 'QUADRANT';
|
||||
const QUARTER = 'QUARTER';
|
||||
const QUARTER_CLOTH = 'QUARTER_CLOTH';
|
||||
const QUARTER_PRINT = 'QUARTER_PRINT';
|
||||
const RANGE = 'RANGE';
|
||||
const REED = 'REED';
|
||||
const RI = 'RI';
|
||||
const RIDGE = 'RIDGE';
|
||||
const RIVER = 'RIVER';
|
||||
const ROD = 'ROD';
|
||||
const ROD_SURVEY = 'ROD_SURVEY';
|
||||
const ROEDE = 'ROEDE';
|
||||
const ROOD = 'ROOD';
|
||||
const ROPE = 'ROPE';
|
||||
const ROYAL_FOOT = 'ROYAL_FOOT';
|
||||
const RUTE = 'RUTE';
|
||||
const SADZHEN = 'SADZHEN';
|
||||
const SAGENE = 'SAGENE';
|
||||
const SCOTS_FOOT = 'SCOTS_FOOT';
|
||||
const SCOTS_MILE = 'SCOTS_MILE';
|
||||
const SEEMEILE = 'SEEMEILE';
|
||||
const SHACKLE = 'SHACKLE';
|
||||
const SHAFTMENT = 'SHAFTMENT';
|
||||
const SHAFTMENT_ANCIENT = 'SHAFTMENT_ANCIENT';
|
||||
const SHAKU = 'SHAKU';
|
||||
const SIRIOMETER = 'SIRIOMETER';
|
||||
const SMOOT = 'SMOOT';
|
||||
const SPAN = 'SPAN';
|
||||
const SPAT = 'SPAT';
|
||||
const STADIUM = 'STADIUM';
|
||||
const STEP = 'STEP';
|
||||
const STICK = 'STICK';
|
||||
const STORY = 'STORY';
|
||||
const STRIDE = 'STRIDE';
|
||||
const STRIDE_ROMAN = 'STRIDE_ROMAN';
|
||||
const TENTHMETER = 'TENTHMETER';
|
||||
const TERAMETER = 'TERAMETER';
|
||||
const THOU = 'THOU';
|
||||
const TOISE = 'TOISE';
|
||||
const TOWNSHIP = 'TOWNSHIP';
|
||||
const T_SUN = 'T_SUN';
|
||||
const TU = 'TU';
|
||||
const TWAIN = 'TWAIN';
|
||||
const TWIP = 'TWIP';
|
||||
const U = 'U';
|
||||
const VARA_CALIFORNIA = 'VARA_CALIFORNIA';
|
||||
const VARA_MEXICAN = 'VARA_MEXICAN';
|
||||
const VARA_PORTUGUESE = 'VARA_PORTUGUESE';
|
||||
const VARA_AMERICA = 'VARA_AMERICA';
|
||||
const VARA = 'VARA';
|
||||
const VARA_TEXAS = 'VARA_TEXAS';
|
||||
const VERGE = 'VERGE';
|
||||
const VERSHOK = 'VERSHOK';
|
||||
const VERST = 'VERST';
|
||||
const WAH = 'WAH';
|
||||
const WERST = 'WERST';
|
||||
const X_UNIT = 'X_UNIT';
|
||||
const YARD = 'YARD';
|
||||
const YOCTOMETER = 'YOCTOMETER';
|
||||
const YOTTAMETER = 'YOTTAMETER';
|
||||
const ZEPTOMETER = 'ZEPTOMETER';
|
||||
const ZETTAMETER = 'ZETTAMETER';
|
||||
const ZOLL = 'ZOLL';
|
||||
const ZOLL_SWISS = 'ZOLL_SWISS';
|
||||
|
||||
/**
|
||||
* Calculations for all length units
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_units = array(
|
||||
'AGATE' => array(array('' => '0.0254', '/' => '72'), 'agate'),
|
||||
'ALEN_DANISH' => array('0.6277', 'alen'),
|
||||
'ALEN' => array('0.6', 'alen'),
|
||||
'ALEN_SWEDISH' => array('0.5938', 'alen'),
|
||||
'ANGSTROM' => array('1.0e-10', 'Å'),
|
||||
'ARMS' => array('0.7', 'arms'),
|
||||
'ARPENT_CANADIAN' => array('58.47', 'arpent'),
|
||||
'ARPENT' => array('58.471308', 'arpent'),
|
||||
'ARSHEEN' => array('0.7112', 'arsheen'),
|
||||
'ARSHIN' => array('1.04', 'arshin'),
|
||||
'ARSHIN_IRAQ' => array('74.5', 'arshin'),
|
||||
'ASTRONOMICAL_UNIT' => array('149597870691', 'AU'),
|
||||
'ATTOMETER' => array('1.0e-18', 'am'),
|
||||
'BAMBOO' => array('3.2', 'bamboo'),
|
||||
'BARLEYCORN' => array('0.0085', 'barleycorn'),
|
||||
'BEE_SPACE' => array('0.0065', 'bee space'),
|
||||
'BICRON' => array('1.0e-12', '<27><>'),
|
||||
'BLOCK_US_EAST' => array('80.4672', 'block'),
|
||||
'BLOCK_US_WEST' => array('100.584', 'block'),
|
||||
'BLOCK_US_SOUTH' => array('160.9344', 'block'),
|
||||
'BOHR' => array('52.918e-12', 'a<>'),
|
||||
'BRACCIO' => array('0.7', 'braccio'),
|
||||
'BRAZA_ARGENTINA' => array('1.733', 'braza'),
|
||||
'BRAZA' => array('1.67', 'braza'),
|
||||
'BRAZA_US' => array('1.693', 'braza'),
|
||||
'BUTTON' => array('0.000635', 'button'),
|
||||
'CABLE_US' => array('219.456', 'cable'),
|
||||
'CABLE_UK' => array('185.3184', 'cable'),
|
||||
'CALIBER' => array('0.0254', 'cal'),
|
||||
'CANA' => array('2', 'cana'),
|
||||
'CAPE_FOOT' => array('0.314858', 'cf'),
|
||||
'CAPE_INCH' => array(array('' => '0.314858','/' => '12'), 'ci'),
|
||||
'CAPE_ROOD' => array('3.778296', 'cr'),
|
||||
'CENTIMETER' => array('0.01', 'cm'),
|
||||
'CHAIN' => array(array('' => '79200','/' => '3937'), 'ch'),
|
||||
'CHAIN_ENGINEER' => array('30.48', 'ch'),
|
||||
'CHIH' => array('0.35814', "ch'ih"),
|
||||
'CHINESE_FOOT' => array('0.371475', 'ft'),
|
||||
'CHINESE_INCH' => array('0.0371475', 'in'),
|
||||
'CHINESE_MILE' => array('557.21', 'mi'),
|
||||
'CHINESE_YARD' => array('0.89154', 'yd'),
|
||||
'CITY_BLOCK_US_EAST' => array('80.4672', 'block'),
|
||||
'CITY_BLOCK_US_WEST' => array('100.584', 'block'),
|
||||
'CITY_BLOCK_US_SOUTH' => array('160.9344', 'block'),
|
||||
'CLICK' => array('1000', 'click'),
|
||||
'CUADRA' => array('84', 'cuadra'),
|
||||
'CUADRA_ARGENTINA'=> array('130', 'cuadra'),
|
||||
'Length:CUBIT_EGYPT' => array('0.45', 'cubit'),
|
||||
'CUBIT_ROYAL' => array('0.5235', 'cubit'),
|
||||
'CUBIT_UK' => array('0.4572', 'cubit'),
|
||||
'CUBIT' => array('0.444', 'cubit'),
|
||||
'CUERDA' => array('21', 'cda'),
|
||||
'DECIMETER' => array('0.1', 'dm'),
|
||||
'DEKAMETER' => array('10', 'dam'),
|
||||
'DIDOT_POINT' => array('0.000377', 'didot point'),
|
||||
'DIGIT' => array('0.019', 'digit'),
|
||||
'DIRAA' => array('0.58', ''),
|
||||
'DONG' => array(array('' => '7','/' => '300'), 'dong'),
|
||||
'DOUZIEME_WATCH' => array('0.000188', 'douzi<7A>me'),
|
||||
'DOUZIEME' => array('0.00017638888889', 'douzi<7A>me'),
|
||||
'DRA_IRAQ' => array('0.745', 'dra'),
|
||||
'DRA' => array('0.7112', 'dra'),
|
||||
'EL' => array('0.69', 'el'),
|
||||
'ELL' => array('1.143', 'ell'),
|
||||
'ELL_SCOTTISH' => array('0.945', 'ell'),
|
||||
'ELLE' => array('0.6', 'ellen'),
|
||||
'ELLE_VIENNA' => array('0.7793', 'ellen'),
|
||||
'EM' => array('0.0042175176', 'em'),
|
||||
'ESTADIO_PORTUGAL'=> array('261', 'estadio'),
|
||||
'ESTADIO' => array('174', 'estadio'),
|
||||
'EXAMETER' => array('1.0e+18', 'Em'),
|
||||
'FADEN_AUSTRIA' => array('1.8965', 'faden'),
|
||||
'FADEN' => array('1.8', 'faden'),
|
||||
'FALL' => array('6.858', 'fall'),
|
||||
'FALL_SCOTTISH' => array('5.67', 'fall'),
|
||||
'FATHOM' => array('1.8288', 'fth'),
|
||||
'FATHOM_ANCIENT' => array('1.829', 'fth'),
|
||||
'FAUST' => array('0.10536', 'faust'),
|
||||
'FEET_OLD_CANADIAN' => array('0.325', 'ft'),
|
||||
'FEET_EGYPT' => array('0.36', 'ft'),
|
||||
'FEET_FRANCE' => array('0.3248406', 'ft'),
|
||||
'FEET' => array('0.3048', 'ft'),
|
||||
'FEET_IRAQ' => array('0.316', 'ft'),
|
||||
'FEET_NETHERLAND' => array('0.28313', 'ft'),
|
||||
'FEET_ITALIC' => array('0.296', 'ft'),
|
||||
'FEET_SURVEY' => array(array('' => '1200', '/' => '3937'), 'ft'),
|
||||
'FEMTOMETER' => array('1.0e-15', 'fm'),
|
||||
'FERMI' => array('1.0e-15', 'f'),
|
||||
'FINGER' => array('0.1143', 'finger'),
|
||||
'FINGERBREADTH' => array('0.01905', 'fingerbreadth'),
|
||||
'FIST' => array('0.1', 'fist'),
|
||||
'FOD' => array('0.3141', 'fod'),
|
||||
'FOOT_EGYPT' => array('0.36', 'ft'),
|
||||
'FOOT_FRANCE' => array('0.3248406', 'ft'),
|
||||
'FOOT' => array('0.3048', 'ft'),
|
||||
'FOOT_IRAQ' => array('0.316', 'ft'),
|
||||
'FOOT_NETHERLAND' => array('0.28313', 'ft'),
|
||||
'FOOT_ITALIC' => array('0.296', 'ft'),
|
||||
'FOOT_SURVEY' => array(array('' => '1200', '/' => '3937'), 'ft'),
|
||||
'FOOTBALL_FIELD_CANADA' => array('100.584', 'football field'),
|
||||
'FOOTBALL_FIELD_US' => array('91.44', 'football field'),
|
||||
'FOOTBALL_FIELD' => array('109.728', 'football field'),
|
||||
'FURLONG' => array('201.168', 'fur'),
|
||||
'FURLONG_SURVEY' => array(array('' => '792000', '/' => '3937'), 'fur'),
|
||||
'FUSS' => array('0.31608', 'fuss'),
|
||||
'GIGAMETER' => array('1.0e+9', 'Gm'),
|
||||
'GIGAPARSEC' => array('30.85678e+24', 'Gpc'),
|
||||
'GNATS_EYE' => array('0.000125', "gnat's eye"),
|
||||
'GOAD' => array('1.3716', 'goad'),
|
||||
'GRY' => array('0.000211667', 'gry'),
|
||||
'HAIRS_BREADTH' => array('0.0001', "hair's breadth"),
|
||||
'HAND' => array('0.1016', 'hand'),
|
||||
'HANDBREADTH' => array('0.08', "hand's breadth"),
|
||||
'HAT' => array('0.5', 'hat'),
|
||||
'HECTOMETER' => array('100', 'hm'),
|
||||
'HEER' => array('73.152', 'heer'),
|
||||
'HIRO' => array('1.818', 'hiro'),
|
||||
'HUBBLE' => array('9.4605e+24', 'hubble'),
|
||||
'HVAT' => array('1.8965', 'hvat'),
|
||||
'INCH' => array('0.0254', 'in'),
|
||||
'IRON' => array(array('' => '0.0254', '/' => '48'), 'iron'),
|
||||
'KEN' => array('1.818', 'ken'),
|
||||
'KERAT' => array('0.0286', 'kerat'),
|
||||
'KILOFOOT' => array('304.8', 'kft'),
|
||||
'KILOMETER' => array('1000', 'km'),
|
||||
'KILOPARSEC' => array('3.0856776e+19', 'kpc'),
|
||||
'KILOYARD' => array('914.4', 'kyd'),
|
||||
'KIND' => array('0.5', 'kind'),
|
||||
'KLAFTER' => array('1.8965', 'klafter'),
|
||||
'KLAFTER_SWISS' => array('1.8', 'klafter'),
|
||||
'KLICK' => array('1000', 'klick'),
|
||||
'KYU' => array('0.00025', 'kyu'),
|
||||
'LAP_ANCIENT' => array('402.336', ''),
|
||||
'LAP' => array('400', 'lap'),
|
||||
'LAP_POOL' => array('100', 'lap'),
|
||||
'LEAGUE_ANCIENT' => array('2275', 'league'),
|
||||
'LEAGUE_NAUTIC' => array('5556', 'league'),
|
||||
'LEAGUE_UK_NAUTIC'=> array('5559.552', 'league'),
|
||||
'LEAGUE' => array('4828', 'league'),
|
||||
'LEAGUE_US' => array('4828.0417', 'league'),
|
||||
'LEAP' => array('2.0574', 'leap'),
|
||||
'LEGOA' => array('6174.1', 'legoa'),
|
||||
'LEGUA' => array('4200', 'legua'),
|
||||
'LEGUA_US' => array('4233.4', 'legua'),
|
||||
'LEGUA_SPAIN_OLD' => array('4179.4', 'legua'),
|
||||
'LEGUA_SPAIN' => array('6680', 'legua'),
|
||||
'LI_ANCIENT' => array('500', 'li'),
|
||||
'LI_IMPERIAL' => array('644.65', 'li'),
|
||||
'LI' => array('500', 'li'),
|
||||
'LIEUE' => array('3898', 'lieue'),
|
||||
'LIEUE_METRIC' => array('4000', 'lieue'),
|
||||
'LIEUE_NAUTIC' => array('5556', 'lieue'),
|
||||
'LIGHT_SECOND' => array('299792458', 'light second'),
|
||||
'LIGHT_MINUTE' => array('17987547480', 'light minute'),
|
||||
'LIGHT_HOUR' => array('1079252848800', 'light hour'),
|
||||
'LIGHT_DAY' => array('25902068371200', 'light day'),
|
||||
'LIGHT_YEAR' => array('9460528404879000', 'ly'),
|
||||
'LIGNE' => array('0.0021167', 'ligne'),
|
||||
'LIGNE_SWISS' => array('0.002256', 'ligne'),
|
||||
'LINE' => array('0.0021167', 'li'),
|
||||
'LINE_SMALL' => array('0.000635', 'li'),
|
||||
'LINK' => array(array('' => '792','/' => '3937'), 'link'),
|
||||
'LINK_ENGINEER' => array('0.3048', 'link'),
|
||||
'LUG' => array('5.0292', 'lug'),
|
||||
'LUG_GREAT' => array('6.4008', 'lug'),
|
||||
'MARATHON' => array('42194.988', 'marathon'),
|
||||
'MARK_TWAIN' => array('3.6576074', 'mark twain'),
|
||||
'MEGAMETER' => array('1000000', 'Mm'),
|
||||
'MEGAPARSEC' => array('3.085677e+22', 'Mpc'),
|
||||
'MEILE_AUSTRIAN' => array('7586', 'meile'),
|
||||
'MEILE' => array('7412.7', 'meile'),
|
||||
'MEILE_GERMAN' => array('7532.5', 'meile'),
|
||||
'METER' => array('1', 'm'),
|
||||
'METRE' => array('1', 'm'),
|
||||
'METRIC_MILE' => array('1500', 'metric mile'),
|
||||
'METRIC_MILE_US' => array('1600', 'metric mile'),
|
||||
'MICROINCH' => array('2.54e-08', '<27>in'),
|
||||
'MICROMETER' => array('0.000001', '<27>m'),
|
||||
'MICROMICRON' => array('1.0e-12', '<27><>'),
|
||||
'MICRON' => array('0.000001', '<27>'),
|
||||
'MIGLIO' => array('1488.6', 'miglio'),
|
||||
'MIIL' => array('7500', 'miil'),
|
||||
'MIIL_DENMARK' => array('7532.5', 'miil'),
|
||||
'MIIL_SWEDISH' => array('10687', 'miil'),
|
||||
'MIL' => array('0.0000254', 'mil'),
|
||||
'MIL_SWEDISH' => array('10000', 'mil'),
|
||||
'MILE_UK' => array('1609', 'mi'),
|
||||
'MILE_IRISH' => array('2048', 'mi'),
|
||||
'MILE' => array('1609.344', 'mi'),
|
||||
'MILE_NAUTIC' => array('1852', 'mi'),
|
||||
'MILE_NAUTIC_UK' => array('1853.184', 'mi'),
|
||||
'MILE_NAUTIC_US' => array('1852', 'mi'),
|
||||
'MILE_ANCIENT' => array('1520', 'mi'),
|
||||
'MILE_SCOTTISH' => array('1814', 'mi'),
|
||||
'MILE_STATUTE' => array('1609.344', 'mi'),
|
||||
'MILE_US' => array(array('' => '6336000','/' => '3937'), 'mi'),
|
||||
'MILHA' => array('2087.3', 'milha'),
|
||||
'MILITARY_PACE' => array('0.762', 'mil. pace'),
|
||||
'MILITARY_PACE_DOUBLE' => array('0.9144', 'mil. pace'),
|
||||
'MILLA' => array('1392', 'milla'),
|
||||
'MILLE' => array('1949', 'mille'),
|
||||
'MILLIARE' => array('0.001478', 'milliare'),
|
||||
'MILLIMETER' => array('0.001', 'mm'),
|
||||
'MILLIMICRON' => array('1.0e-9', 'm<>'),
|
||||
'MKONO' => array('0.4572', 'mkono'),
|
||||
'MOOT' => array('0.0762', 'moot'),
|
||||
'MYRIAMETER' => array('10000', 'mym'),
|
||||
'NAIL' => array('0.05715', 'nail'),
|
||||
'NANOMETER' => array('1.0e-9', 'nm'),
|
||||
'NANON' => array('1.0e-9', 'nanon'),
|
||||
'PACE' => array('1.524', 'pace'),
|
||||
'PACE_ROMAN' => array('1.48', 'pace'),
|
||||
'PALM_DUTCH' => array('0.10', 'palm'),
|
||||
'PALM_UK' => array('0.075', 'palm'),
|
||||
'PALM' => array('0.2286', 'palm'),
|
||||
'PALMO_PORTUGUESE'=> array('0.22', 'palmo'),
|
||||
'PALMO' => array('0.20', 'palmo'),
|
||||
'PALMO_US' => array('0.2117', 'palmo'),
|
||||
'PARASANG' => array('6000', 'parasang'),
|
||||
'PARIS_FOOT' => array('0.3248406', 'paris foot'),
|
||||
'PARSEC' => array('3.0856776e+16', 'pc'),
|
||||
'PE' => array('0.33324', 'p<>'),
|
||||
'PEARL' => array('0.001757299', 'pearl'),
|
||||
'PERCH' => array('5.0292', 'perch'),
|
||||
'PERCH_IRELAND' => array('6.4008', 'perch'),
|
||||
'PERTICA' => array('2.96', 'pertica'),
|
||||
'PES' => array('0.2967', 'pes'),
|
||||
'PETAMETER' => array('1.0e+15', 'Pm'),
|
||||
'PICA' => array('0.0042175176', 'pi'),
|
||||
'PICOMETER' => array('1.0e-12', 'pm'),
|
||||
'PIE_ARGENTINA' => array('0.2889', 'pie'),
|
||||
'PIE_ITALIC' => array('0.298', 'pie'),
|
||||
'PIE' => array('0.2786', 'pie'),
|
||||
'PIE_US' => array('0.2822', 'pie'),
|
||||
'PIED_DE_ROI' => array('0.3248406', 'pied de roi'),
|
||||
'PIK' => array('0.71', 'pik'),
|
||||
'PIKE' => array('0.71', 'pike'),
|
||||
'POINT_ADOBE' => array(array('' => '0.3048', '/' => '864'), 'pt'),
|
||||
'POINT' => array('0.00035', 'pt'),
|
||||
'POINT_DIDOT' => array('0.000377', 'pt'),
|
||||
'POINT_TEX' => array('0.0003514598035', 'pt'),
|
||||
'POLE' => array('5.0292', 'pole'),
|
||||
'POLEGADA' => array('0.02777', 'polegada'),
|
||||
'POUCE' => array('0.02707', 'pouce'),
|
||||
'PU' => array('1.7907', 'pu'),
|
||||
'PULGADA' => array('0.02365', 'pulgada'),
|
||||
'PYGME' => array('0.346', 'pygme'),
|
||||
'Q' => array('0.00025', 'q'),
|
||||
'QUADRANT' => array('10001300', 'quad'),
|
||||
'QUARTER' => array('402.336', 'Q'),
|
||||
'QUARTER_CLOTH' => array('0.2286', 'Q'),
|
||||
'QUARTER_PRINT' => array('0.00025', 'Q'),
|
||||
'RANGE' => array(array('' => '38016000','/' => '3937'), 'range'),
|
||||
'REED' => array('2.679', 'reed'),
|
||||
'RI' => array('3927', 'ri'),
|
||||
'RIDGE' => array('6.1722', 'ridge'),
|
||||
'RIVER' => array('2000', 'river'),
|
||||
'ROD' => array('5.0292', 'rd'),
|
||||
'ROD_SURVEY' => array(array('' => '19800', '/' => '3937'), 'rd'),
|
||||
'ROEDE' => array('10', 'roede'),
|
||||
'ROOD' => array('3.7783', 'rood'),
|
||||
'ROPE' => array('3.7783', 'rope'),
|
||||
'ROYAL_FOOT' => array('0.3248406', 'royal foot'),
|
||||
'RUTE' => array('3.75', 'rute'),
|
||||
'SADZHEN' => array('2.1336', 'sadzhen'),
|
||||
'SAGENE' => array('2.1336', 'sagene'),
|
||||
'SCOTS_FOOT' => array('0.30645', 'scots foot'),
|
||||
'SCOTS_MILE' => array('1814.2', 'scots mile'),
|
||||
'SEEMEILE' => array('1852', 'seemeile'),
|
||||
'SHACKLE' => array('27.432', 'shackle'),
|
||||
'SHAFTMENT' => array('0.15124', 'shaftment'),
|
||||
'SHAFTMENT_ANCIENT' => array('0.165', 'shaftment'),
|
||||
'SHAKU' => array('0.303', 'shaku'),
|
||||
'SIRIOMETER' => array('1.4959787e+17', 'siriometer'),
|
||||
'SMOOT' => array('1.7018', 'smoot'),
|
||||
'SPAN' => array('0.2286', 'span'),
|
||||
'SPAT' => array('1.0e+12', 'spat'),
|
||||
'STADIUM' => array('185', 'stadium'),
|
||||
'STEP' => array('0.762', 'step'),
|
||||
'STICK' => array('3.048', 'stk'),
|
||||
'STORY' => array('3.3', 'story'),
|
||||
'STRIDE' => array('1.524', 'stride'),
|
||||
'STRIDE_ROMAN' => array('1.48', 'stride'),
|
||||
'TENTHMETER' => array('1.0e-10', 'tenth-meter'),
|
||||
'TERAMETER' => array('1.0e+12', 'Tm'),
|
||||
'THOU' => array('0.0000254', 'thou'),
|
||||
'TOISE' => array('1.949', 'toise'),
|
||||
'TOWNSHIP' => array(array('' => '38016000','/' => '3937'), 'twp'),
|
||||
'T_SUN' => array('0.0358', "t'sun"),
|
||||
'TU' => array('161130', 'tu'),
|
||||
'TWAIN' => array('3.6576074', 'twain'),
|
||||
'TWIP' => array('0.000017639', 'twip'),
|
||||
'U' => array('0.04445', 'U'),
|
||||
'VARA_CALIFORNIA' => array('0.83820168', 'vara'),
|
||||
'VARA_MEXICAN' => array('0.83802', 'vara'),
|
||||
'VARA_PORTUGUESE' => array('1.10', 'vara'),
|
||||
'VARA_AMERICA' => array('0.864', 'vara'),
|
||||
'VARA' => array('0.83587', 'vara'),
|
||||
'VARA_TEXAS' => array('0.84666836', 'vara'),
|
||||
'VERGE' => array('0.9144', 'verge'),
|
||||
'VERSHOK' => array('0.04445', 'vershok'),
|
||||
'VERST' => array('1066.8', 'verst'),
|
||||
'WAH' => array('2', 'wah'),
|
||||
'WERST' => array('1066.8', 'werst'),
|
||||
'X_UNIT' => array('1.0020722e-13', 'Xu'),
|
||||
'YARD' => array('0.9144', 'yd'),
|
||||
'YOCTOMETER' => array('1.0e-24', 'ym'),
|
||||
'YOTTAMETER' => array('1.0e+24', 'Ym'),
|
||||
'ZEPTOMETER' => array('1.0e-21', 'zm'),
|
||||
'ZETTAMETER' => array('1.0e+21', 'Zm'),
|
||||
'ZOLL' => array('0.02634', 'zoll'),
|
||||
'ZOLL_SWISS' => array('0.03', 'zoll'),
|
||||
'STANDARD' => 'METER'
|
||||
);
|
||||
}
|
81
libs/Zend/Measure/Lightness.php
Normal file
81
libs/Zend/Measure/Lightness.php
Normal file
@ -0,0 +1,81 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Lightness.php 9508 2008-05-23 10:56:41Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implement needed classes
|
||||
*/
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
require_once 'Zend/Measure/Abstract.php';
|
||||
require_once 'Zend/Locale.php';
|
||||
|
||||
/**
|
||||
* Class for handling temperature conversions
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @subpackage Zend_Measure_Lightness
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Measure_Lightness extends Zend_Measure_Abstract
|
||||
{
|
||||
const STANDARD = 'CANDELA_PER_SQUARE_METER';
|
||||
|
||||
const APOSTILB = 'APOSTILB';
|
||||
const BLONDEL = 'BLONDEL';
|
||||
const CANDELA_PER_SQUARE_CENTIMETER = 'CANDELA_PER_SQUARE_CENTIMETER';
|
||||
const CANDELA_PER_SQUARE_FOOT = 'CANDELA_PER_SQUARE_FOOT';
|
||||
const CANDELA_PER_SQUARE_INCH = 'CANDELA_PER_SQUARE_INCH';
|
||||
const CANDELA_PER_SQUARE_METER = 'CANDELA_PER_SQUARE_METER';
|
||||
const FOOTLAMBERT = 'FOOTLAMBERT';
|
||||
const KILOCANDELA_PER_SQUARE_CENTIMETER = 'KILOCANDELA_PER_SQUARE_CENTIMETER';
|
||||
const KILOCANDELA_PER_SQUARE_FOOT = 'KILOCANDELA_PER_SQUARE_FOOT';
|
||||
const KILOCANDELA_PER_SQUARE_INCH = 'KILOCANDELA_PER_SQUARE_INCH';
|
||||
const KILOCANDELA_PER_SQUARE_METER = 'KILOCANDELA_PER_SQUARE_METER';
|
||||
const LAMBERT = 'LAMBERT';
|
||||
const MILLILAMBERT = 'MILLILAMBERT';
|
||||
const NIT = 'NIT';
|
||||
const STILB = 'STILB';
|
||||
|
||||
/**
|
||||
* Calculations for all lightness units
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_units = array(
|
||||
'APOSTILB' => array('0.31830989', 'asb'),
|
||||
'BLONDEL' => array('0.31830989', 'blondel'),
|
||||
'CANDELA_PER_SQUARE_CENTIMETER' => array('10000', 'cd/cm²'),
|
||||
'CANDELA_PER_SQUARE_FOOT' => array('10.76391', 'cd/ft²'),
|
||||
'CANDELA_PER_SQUARE_INCH' => array('1550.00304', 'cd/in²'),
|
||||
'CANDELA_PER_SQUARE_METER' => array('1', 'cd/m²'),
|
||||
'FOOTLAMBERT' => array('3.4262591', 'ftL'),
|
||||
'KILOCANDELA_PER_SQUARE_CENTIMETER' => array('10000000', 'kcd/cm²'),
|
||||
'KILOCANDELA_PER_SQUARE_FOOT' => array('10763.91', 'kcd/ft²'),
|
||||
'KILOCANDELA_PER_SQUARE_INCH' => array('1550003.04', 'kcd/in²'),
|
||||
'KILOCANDELA_PER_SQUARE_METER' => array('1000', 'kcd/m²'),
|
||||
'LAMBERT' => array('3183.0989', 'L'),
|
||||
'MILLILAMBERT' => array('3.1830989', 'mL'),
|
||||
'NIT' => array('1', 'nt'),
|
||||
'STILB' => array('10000', 'sb'),
|
||||
'STANDARD' => 'CANDELA_PER_SQUARE_METER'
|
||||
);
|
||||
}
|
420
libs/Zend/Measure/Number.php
Normal file
420
libs/Zend/Measure/Number.php
Normal file
@ -0,0 +1,420 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Number.php 12514 2008-11-10 16:30:24Z matthew $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implement needed classes
|
||||
*/
|
||||
require_once 'Zend/Measure/Abstract.php';
|
||||
require_once 'Zend/Locale.php';
|
||||
|
||||
/**
|
||||
* Class for handling number conversions
|
||||
*
|
||||
* This class can only handle numbers without precission
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @subpackage Zend_Measure_Number
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Measure_Number extends Zend_Measure_Abstract
|
||||
{
|
||||
const STANDARD = 'DECIMAL';
|
||||
|
||||
const BINARY = 'BINARY';
|
||||
const TERNARY = 'TERNARY';
|
||||
const QUATERNARY = 'QUATERNARY';
|
||||
const QUINARY = 'QUINARY';
|
||||
const SENARY = 'SENARY';
|
||||
const SEPTENARY = 'SEPTENARY';
|
||||
const OCTAL = 'OCTAL';
|
||||
const NONARY = 'NONARY';
|
||||
const DECIMAL = 'DECIMAL';
|
||||
const DUODECIMAL = 'DUODECIMAL';
|
||||
const HEXADECIMAL = 'HEXADECIMAL';
|
||||
const ROMAN = 'ROMAN';
|
||||
|
||||
/**
|
||||
* Calculations for all number units
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_units = array(
|
||||
'BINARY' => array(2, '⑵'),
|
||||
'TERNARY' => array(3, '⑶'),
|
||||
'QUATERNARY' => array(4, '⑷'),
|
||||
'QUINARY' => array(5, '⑸'),
|
||||
'SENARY' => array(6, '⑹'),
|
||||
'SEPTENARY' => array(7, '⑺'),
|
||||
'OCTAL' => array(8, '⑻'),
|
||||
'NONARY' => array(9, '⑼'),
|
||||
'DECIMAL' => array(10, '⑽'),
|
||||
'DUODECIMAL' => array(12, '⑿'),
|
||||
'HEXADECIMAL' => array(16, '⒃'),
|
||||
'ROMAN' => array(99, ''),
|
||||
'STANDARD' => 'DECIMAL'
|
||||
);
|
||||
|
||||
/**
|
||||
* Definition of all roman signs
|
||||
*
|
||||
* @var array $_roman
|
||||
*/
|
||||
private static $_roman = array(
|
||||
'I' => 1,
|
||||
'A' => 4,
|
||||
'V' => 5,
|
||||
'B' => 9,
|
||||
'X' => 10,
|
||||
'E' => 40,
|
||||
'L' => 50,
|
||||
'F' => 90,
|
||||
'C' => 100,
|
||||
'G' => 400,
|
||||
'D' => 500,
|
||||
'H' => 900,
|
||||
'M' => 1000,
|
||||
'J' => 4000,
|
||||
'P' => 5000,
|
||||
'K' => 9000,
|
||||
'Q' => 10000,
|
||||
'N' => 40000,
|
||||
'R' => 50000,
|
||||
'W' => 90000,
|
||||
'S' => 100000,
|
||||
'Y' => 400000,
|
||||
'T' => 500000,
|
||||
'Z' => 900000,
|
||||
'U' => 1000000
|
||||
);
|
||||
|
||||
/**
|
||||
* Convertion table for roman signs
|
||||
*
|
||||
* @var array $_romanconvert
|
||||
*/
|
||||
private static $_romanconvert = array(
|
||||
'/_V/' => '/P/',
|
||||
'/_X/' => '/Q/',
|
||||
'/_L/' => '/R/',
|
||||
'/_C/' => '/S/',
|
||||
'/_D/' => '/T/',
|
||||
'/_M/' => '/U/',
|
||||
'/IV/' => '/A/',
|
||||
'/IX/' => '/B/',
|
||||
'/XL/' => '/E/',
|
||||
'/XC/' => '/F/',
|
||||
'/CD/' => '/G/',
|
||||
'/CM/' => '/H/',
|
||||
'/M_V/'=> '/J/',
|
||||
'/MQ/' => '/K/',
|
||||
'/QR/' => '/N/',
|
||||
'/QS/' => '/W/',
|
||||
'/ST/' => '/Y/',
|
||||
'/SU/' => '/Z/'
|
||||
);
|
||||
|
||||
/**
|
||||
* Zend_Measure_Abstract is an abstract class for the different measurement types
|
||||
*
|
||||
* @param integer $value Value
|
||||
* @param string $type (Optional) A Zend_Measure_Number Type
|
||||
* @param string|Zend_Locale $locale (Optional) A Zend_Locale
|
||||
* @throws Zend_Measure_Exception When language is unknown
|
||||
* @throws Zend_Measure_Exception When type is unknown
|
||||
*/
|
||||
public function __construct($value, $type, $locale = null)
|
||||
{
|
||||
if (($type !== null) and (Zend_Locale::isLocale($type, null, false))) {
|
||||
$locale = $type;
|
||||
$type = null;
|
||||
}
|
||||
|
||||
if ($locale === null) {
|
||||
$locale = new Zend_Locale();
|
||||
}
|
||||
|
||||
if (!Zend_Locale::isLocale($locale, true, false)) {
|
||||
if (!Zend_Locale::isLocale($locale, true, false)) {
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
throw new Zend_Measure_Exception("Language (" . (string) $locale . ") is unknown");
|
||||
}
|
||||
|
||||
$locale = new Zend_Locale($locale);
|
||||
}
|
||||
|
||||
$this->_locale = (string) $locale;
|
||||
|
||||
if ($type === null) {
|
||||
$type = $this->_units['STANDARD'];
|
||||
}
|
||||
|
||||
if (isset($this->_units[$type]) === false) {
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
throw new Zend_Measure_Exception("Type ($type) is unknown");
|
||||
}
|
||||
|
||||
$this->setValue($value, $type, $this->_locale);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a new value
|
||||
*
|
||||
* @param integer $value Value
|
||||
* @param string $type (Optional) A Zend_Measure_Number Type
|
||||
* @param string|Zend_Locale $locale (Optional) A Zend_Locale Type
|
||||
* @throws Zend_Measure_Exception
|
||||
*/
|
||||
public function setValue($value, $type = null, $locale = null)
|
||||
{
|
||||
if (empty($locale)) {
|
||||
$locale = $this->_locale;
|
||||
}
|
||||
|
||||
if (empty($this->_units[$type])) {
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
throw new Zend_Measure_Exception('unknown type of number:' . $type);
|
||||
}
|
||||
|
||||
switch($type) {
|
||||
case 'BINARY':
|
||||
preg_match('/[01]+/', $value, $ergebnis);
|
||||
$value = $ergebnis[0];
|
||||
break;
|
||||
|
||||
case 'TERNARY':
|
||||
preg_match('/[012]+/', $value, $ergebnis);
|
||||
$value = $ergebnis[0];
|
||||
break;
|
||||
|
||||
case 'QUATERNARY':
|
||||
preg_match('/[0123]+/', $value, $ergebnis);
|
||||
$value = $ergebnis[0];
|
||||
break;
|
||||
|
||||
case 'QUINARY':
|
||||
preg_match('/[01234]+/', $value, $ergebnis);
|
||||
$value = $ergebnis[0];
|
||||
break;
|
||||
|
||||
case 'SENARY':
|
||||
preg_match('/[012345]+/', $value, $ergebnis);
|
||||
$value = $ergebnis[0];
|
||||
break;
|
||||
|
||||
case 'SEPTENARY':
|
||||
preg_match('/[0123456]+/', $value, $ergebnis);
|
||||
$value = $ergebnis[0];
|
||||
break;
|
||||
|
||||
case 'OCTAL':
|
||||
preg_match('/[01234567]+/', $value, $ergebnis);
|
||||
$value = $ergebnis[0];
|
||||
break;
|
||||
|
||||
case 'NONARY':
|
||||
preg_match('/[012345678]+/', $value, $ergebnis);
|
||||
$value = $ergebnis[0];
|
||||
break;
|
||||
|
||||
case 'DUODECIMAL':
|
||||
preg_match('/[0123456789AB]+/', strtoupper($value), $ergebnis);
|
||||
$value = $ergebnis[0];
|
||||
break;
|
||||
|
||||
case 'HEXADECIMAL':
|
||||
preg_match('/[0123456789ABCDEF]+/', strtoupper($value), $ergebnis);
|
||||
$value = $ergebnis[0];
|
||||
break;
|
||||
|
||||
case 'ROMAN':
|
||||
preg_match('/[IVXLCDM_]+/', strtoupper($value), $ergebnis);
|
||||
$value = $ergebnis[0];
|
||||
break;
|
||||
|
||||
default:
|
||||
try {
|
||||
$value = Zend_Locale_Format::getInteger($value, array('locale' => $locale));
|
||||
} catch (Exception $e) {
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
throw new Zend_Measure_Exception($e->getMessage());
|
||||
}
|
||||
if (call_user_func(Zend_Locale_Math::$comp, $value, 0) < 0) {
|
||||
$value = call_user_func(Zend_Locale_Math::$sqrt, call_user_func(Zend_Locale_Math::$pow, $value, 2));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
$this->_value = $value;
|
||||
$this->_type = $type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert input to decimal value string
|
||||
*
|
||||
* @param integer $input Input string
|
||||
* @param string $type Type from which to convert to decimal
|
||||
* @return string
|
||||
*/
|
||||
private function _toDecimal($input, $type)
|
||||
{
|
||||
$value = '';
|
||||
// Convert base xx values
|
||||
if ($this->_units[$type][0] <= 16) {
|
||||
$split = str_split($input);
|
||||
$length = strlen($input);
|
||||
for ($x = 0; $x < $length; ++$x) {
|
||||
$split[$x] = hexdec($split[$x]);
|
||||
$value = call_user_func(Zend_Locale_Math::$add, $value,
|
||||
call_user_func(Zend_Locale_Math::$mul, $split[$x],
|
||||
call_user_func(Zend_Locale_Math::$pow, $this->_units[$type][0], ($length - $x - 1))));
|
||||
}
|
||||
}
|
||||
|
||||
// Convert roman numbers
|
||||
if ($type === 'ROMAN') {
|
||||
$input = strtoupper($input);
|
||||
$input = preg_replace(array_keys(self::$_romanconvert), array_values(self::$_romanconvert), $input);
|
||||
|
||||
$split = preg_split('//', strrev($input), -1, PREG_SPLIT_NO_EMPTY);
|
||||
|
||||
for ($x =0; $x < sizeof($split); $x++) {
|
||||
if ($split[$x] == '/') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$num = self::$_roman[$split[$x]];
|
||||
if (($x > 0 and ($split[$x-1] != '/') and ($num < self::$_roman[$split[$x-1]]))) {
|
||||
$num -= $num;
|
||||
}
|
||||
|
||||
$value += $num;
|
||||
}
|
||||
|
||||
str_replace('/', '', $value);
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert input to type value string
|
||||
*
|
||||
* @param integer $value Input string
|
||||
* @param string $type Type to convert to
|
||||
* @return string
|
||||
* @throws Zend_Measure_Exception When more than 200 digits are calculated
|
||||
*/
|
||||
private function _fromDecimal($value, $type)
|
||||
{
|
||||
$tempvalue = $value;
|
||||
if ($this->_units[$type][0] <= 16) {
|
||||
$newvalue = '';
|
||||
$count = 200;
|
||||
$base = $this->_units[$type][0];
|
||||
|
||||
while (call_user_func(Zend_Locale_Math::$comp, $value, 0, 25) <> 0) {
|
||||
$target = call_user_func(Zend_Locale_Math::$mod, $value, $base);
|
||||
|
||||
$newvalue = strtoupper(dechex($target)) . $newvalue;
|
||||
|
||||
$value = call_user_func(Zend_Locale_Math::$sub, $value, $target, 0);
|
||||
$value = call_user_func(Zend_Locale_Math::$div, $value, $base, 0);
|
||||
|
||||
--$count;
|
||||
if ($count === 0) {
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
throw new Zend_Measure_Exception("Your value '$tempvalue' cannot be processed because it extends 200 digits");
|
||||
}
|
||||
}
|
||||
|
||||
if ($newvalue === '') {
|
||||
$newvalue = '0';
|
||||
}
|
||||
}
|
||||
|
||||
if ($type === 'ROMAN') {
|
||||
$i = 0;
|
||||
$newvalue = '';
|
||||
$romanval = array_values(array_reverse(self::$_roman));
|
||||
$romankey = array_keys(array_reverse(self::$_roman));
|
||||
$count = 200;
|
||||
while (call_user_func(Zend_Locale_Math::$comp, $value, 0, 25) <> 0) {
|
||||
while ($value >= $romanval[$i]) {
|
||||
$value -= $romanval[$i];
|
||||
$newvalue .= $romankey[$i];
|
||||
|
||||
if ($value < 1) {
|
||||
break;
|
||||
}
|
||||
|
||||
--$count;
|
||||
if ($count === 0) {
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
throw new Zend_Measure_Exception("Your value '$tempvalue' cannot be processed because it extends 200 digits");
|
||||
}
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
$newvalue = str_replace('/', '', preg_replace(array_values(self::$_romanconvert), array_keys(self::$_romanconvert), $newvalue));
|
||||
}
|
||||
|
||||
return $newvalue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a new type, and convert the value
|
||||
*
|
||||
* @param string $type New type to set
|
||||
* @throws Zend_Measure_Exception When a unknown type is given
|
||||
* @return void
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
if (empty($this->_units[$type]) === true) {
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
throw new Zend_Measure_Exception('Unknown type of number:' . $type);
|
||||
}
|
||||
|
||||
$value = $this->_toDecimal($this->getValue(-1), $this->getType(-1));
|
||||
$value = $this->_fromDecimal($value, $type);
|
||||
|
||||
$this->_value = $value;
|
||||
$this->_type = $type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias function for setType returning the converted unit
|
||||
* Default is 0 as this class only handles numbers without precision
|
||||
*
|
||||
* @param string $type Type to convert to
|
||||
* @param integer $round (Optional) Precision to add, will always be 0
|
||||
* @return string
|
||||
*/
|
||||
public function convertTo($type, $round = 0)
|
||||
{
|
||||
$this->setType($type);
|
||||
return $this->toString($round);
|
||||
}
|
||||
}
|
189
libs/Zend/Measure/Power.php
Normal file
189
libs/Zend/Measure/Power.php
Normal file
@ -0,0 +1,189 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Power.php 9508 2008-05-23 10:56:41Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implement needed classes
|
||||
*/
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
require_once 'Zend/Measure/Abstract.php';
|
||||
require_once 'Zend/Locale.php';
|
||||
|
||||
/**
|
||||
* Class for handling power conversions
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @subpackage Zend_Measure_Power
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Measure_Power extends Zend_Measure_Abstract
|
||||
{
|
||||
const STANDARD = 'WATT';
|
||||
|
||||
const ATTOWATT = 'ATTOWATT';
|
||||
const BTU_PER_HOUR = 'BTU_PER_HOUR';
|
||||
const BTU_PER_MINUTE = 'BTU_PER_MINUTE';
|
||||
const BTU_PER_SECOND = 'BTU_PER_SECOND';
|
||||
const CALORIE_PER_HOUR = 'CALORIE_PER_HOUR';
|
||||
const CALORIE_PER_MINUTE = 'CALORIE_PER_MINUTE';
|
||||
const CALORIE_PER_SECOND = 'CALORIE_PER_SECOND';
|
||||
const CENTIWATT = 'CENTIWATT';
|
||||
const CHEVAL_VAPEUR = 'CHEVAL_VAPEUR';
|
||||
const CLUSEC = 'CLUSEC';
|
||||
const DECIWATT = 'DECIWATT';
|
||||
const DEKAWATT = 'DEKAWATT';
|
||||
const DYNE_CENTIMETER_PER_HOUR = 'DYNE_CENTIMETER_PER_HOUR';
|
||||
const DYNE_CENTIMETER_PER_MINUTE = 'DYNE_CENTIMETER_PER_MINUTE';
|
||||
const DYNE_CENTIMETER_PER_SECOND = 'DYNE_CENTIMETER_PER_SECOND';
|
||||
const ERG_PER_HOUR = 'ERG_PER_HOUR';
|
||||
const ERG_PER_MINUTE = 'ERG_PER_MINUTE';
|
||||
const ERG_PER_SECOND = 'ERG_PER_SECOND';
|
||||
const EXAWATT = 'EXAWATT';
|
||||
const FEMTOWATT = 'FEMTOWATT';
|
||||
const FOOT_POUND_FORCE_PER_HOUR = 'FOOT_POUND_FORCE_PER_HOUR';
|
||||
const FOOT_POUND_FORCE_PER_MINUTE = 'FOOT_POUND_FORCE_PER_MINUTE';
|
||||
const FOOT_POUND_FORCE_PER_SECOND = 'FOOT_POUND_FORCE_PER_SECOND';
|
||||
const FOOT_POUNDAL_PER_HOUR = 'FOOT_POUNDAL_PER_HOUR';
|
||||
const FOOT_POUNDAL_PER_MINUTE = 'FOOT_POUNDAL_PER_MINUTE';
|
||||
const FOOT_POUNDAL_PER_SECOND = 'FOOT_POUNDAL_PER_SECOND';
|
||||
const GIGAWATT = 'GIGAWATT';
|
||||
const GRAM_FORCE_CENTIMETER_PER_HOUR = 'GRAM_FORCE_CENTIMETER_PER_HOUR';
|
||||
const GRAM_FORCE_CENTIMETER_PER_MINUTE = 'GRAM_FORCE_CENTIMETER_PER_MINUTE';
|
||||
const GRAM_FORCE_CENTIMETER_PER_SECOND = 'GRAM_FORCE_CENTIMETER_PER_SECOND';
|
||||
const HECTOWATT = 'HECTOWATT';
|
||||
const HORSEPOWER_INTERNATIONAL = 'HORSEPOWER_INTERNATIONAL';
|
||||
const HORSEPOWER_ELECTRIC = 'HORSEPOWER_ELECTRIC';
|
||||
const HORSEPOWER = 'HORSEPOWER';
|
||||
const HORSEPOWER_WATER = 'HORSEPOWER_WATER';
|
||||
const INCH_OUNCE_FORCE_REVOLUTION_PER_MINUTE = 'INCH_OUNCH_FORCE_REVOLUTION_PER_MINUTE';
|
||||
const JOULE_PER_HOUR = 'JOULE_PER_HOUR';
|
||||
const JOULE_PER_MINUTE = 'JOULE_PER_MINUTE';
|
||||
const JOULE_PER_SECOND = 'JOULE_PER_SECOND';
|
||||
const KILOCALORIE_PER_HOUR = 'KILOCALORIE_PER_HOUR';
|
||||
const KILOCALORIE_PER_MINUTE = 'KILOCALORIE_PER_MINUTE';
|
||||
const KILOCALORIE_PER_SECOND = 'KILOCALORIE_PER_SECOND';
|
||||
const KILOGRAM_FORCE_METER_PER_HOUR = 'KILOGRAM_FORCE_METER_PER_HOUR';
|
||||
const KILOGRAM_FORCE_METER_PER_MINUTE = 'KILOGRAM_FORCE_METER_PER_MINUTE';
|
||||
const KILOGRAM_FORCE_METER_PER_SECOND = 'KILOGRAM_FORCE_METER_PER_SECOND';
|
||||
const KILOPOND_METER_PER_HOUR = 'KILOPOND_METER_PER_HOUR';
|
||||
const KILOPOND_METER_PER_MINUTE = 'KILOPOND_METER_PER_MINUTE';
|
||||
const KILOPOND_METER_PER_SECOND = 'KILOPOND_METER_PER_SECOND';
|
||||
const KILOWATT = 'KILOWATT';
|
||||
const MEGAWATT = 'MEGAWATT';
|
||||
const MICROWATT = 'MICROWATT';
|
||||
const MILLION_BTU_PER_HOUR = 'MILLION_BTU_PER_HOUR';
|
||||
const MILLIWATT = 'MILLIWATT';
|
||||
const NANOWATT = 'NANOWATT';
|
||||
const NEWTON_METER_PER_HOUR = 'NEWTON_METER_PER_HOUR';
|
||||
const NEWTON_METER_PER_MINUTE = 'NEWTON_METER_PER_MINUTE';
|
||||
const NEWTON_METER_PER_SECOND = 'NEWTON_METER_PER_SECOND';
|
||||
const PETAWATT = 'PETAWATT';
|
||||
const PFERDESTAERKE = 'PFERDESTAERKE';
|
||||
const PICOWATT = 'PICOWATT';
|
||||
const PONCELET = 'PONCELET';
|
||||
const POUND_SQUARE_FOOR_PER_CUBIC_SECOND = 'POUND_SQUARE_FOOT_PER_CUBIC_SECOND';
|
||||
const TERAWATT = 'TERAWATT';
|
||||
const TON_OF_REFRIGERATION = 'TON_OF_REFRIGERATION';
|
||||
const WATT = 'WATT';
|
||||
const YOCTOWATT = 'YOCTOWATT';
|
||||
const YOTTAWATT = 'YOTTAWATT';
|
||||
const ZEPTOWATT = 'ZEPTOWATT';
|
||||
const ZETTAWATT = 'ZETTAWATT';
|
||||
|
||||
/**
|
||||
* Calculations for all power units
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_units = array(
|
||||
'ATTOWATT' => array('1.0e-18', 'aW'),
|
||||
'BTU_PER_HOUR' => array('0.29307197', 'BTU/h'),
|
||||
'BTU_PER_MINUTE' => array('17.5843182', 'BTU/m'),
|
||||
'BTU_PER_SECOND' => array('1055.059092', 'BTU/s'),
|
||||
'CALORIE_PER_HOUR' => array(array('' => '11630', '*' => '1.0e-7'), 'cal/h'),
|
||||
'CALORIE_PER_MINUTE' => array(array('' => '697800', '*' => '1.0e-7'), 'cal/m'),
|
||||
'CALORIE_PER_SECOND' => array(array('' => '41868000', '*' => '1.0e-7'), 'cal/s'),
|
||||
'CENTIWATT' => array('0.01', 'cW'),
|
||||
'CHEVAL_VAPEUR' => array('735.49875', 'cv'),
|
||||
'CLUSEC' => array('0.0000013332237', 'clusec'),
|
||||
'DECIWATT' => array('0.1', 'dW'),
|
||||
'DEKAWATT' => array('10', 'daW'),
|
||||
'DYNE_CENTIMETER_PER_HOUR' => array(array('' => '1.0e-7','/' => '3600'), 'dyn cm/h'),
|
||||
'DYNE_CENTIMETER_PER_MINUTE' => array(array('' => '1.0e-7','/' => '60'), 'dyn cm/m'),
|
||||
'DYNE_CENTIMETER_PER_SECOND' => array('1.0e-7', 'dyn cm/s'),
|
||||
'ERG_PER_HOUR' => array(array('' => '1.0e-7','/' => '3600'), 'erg/h'),
|
||||
'ERG_PER_MINUTE' => array(array('' => '1.0e-7','/' => '60'), 'erg/m'),
|
||||
'ERG_PER_SECOND' => array('1.0e-7', 'erg/s'),
|
||||
'EXAWATT' => array('1.0e+18', 'EW'),
|
||||
'FEMTOWATT' => array('1.0e-15', 'fW'),
|
||||
'FOOT_POUND_FORCE_PER_HOUR' => array(array('' => '1.3558179', '/' => '3600'), 'ft lb/h'),
|
||||
'FOOT_POUND_FORCE_PER_MINUTE' => array(array('' => '1.3558179', '/' => '60'), 'ft lb/m'),
|
||||
'FOOT_POUND_FORCE_PER_SECOND' => array('1.3558179', 'ft lb/s'),
|
||||
'FOOT_POUNDAL_PER_HOUR' => array(array('' => '0.04214011','/' => '3600'), 'ft pdl/h'),
|
||||
'FOOT_POUNDAL_PER_MINUTE' => array(array('' => '0.04214011', '/' => '60'), 'ft pdl/m'),
|
||||
'FOOT_POUNDAL_PER_SECOND' => array('0.04214011', 'ft pdl/s'),
|
||||
'GIGAWATT' => array('1.0e+9', 'GW'),
|
||||
'GRAM_FORCE_CENTIMETER_PER_HOUR' => array(array('' => '0.0000980665','/' => '3600'), 'gf cm/h'),
|
||||
'GRAM_FORCE_CENTIMETER_PER_MINUTE' => array(array('' => '0.0000980665','/' => '60'), 'gf cm/m'),
|
||||
'GRAM_FORCE_CENTIMETER_PER_SECOND' => array('0.0000980665', 'gf cm/s'),
|
||||
'HECTOWATT' => array('100', 'hW'),
|
||||
'HORSEPOWER_INTERNATIONAL' => array('745.69987', 'hp'),
|
||||
'HORSEPOWER_ELECTRIC' => array('746', 'hp'),
|
||||
'HORSEPOWER' => array('735.49875', 'hp'),
|
||||
'HORSEPOWER_WATER' => array('746.043', 'hp'),
|
||||
'INCH_OUNCH_FORCE_REVOLUTION_PER_MINUTE' => array('0.00073948398', 'in ocf/m'),
|
||||
'JOULE_PER_HOUR' => array(array('' => '1', '/' => '3600'), 'J/h'),
|
||||
'JOULE_PER_MINUTE' => array(array('' => '1', '/' => '60'), 'J/m'),
|
||||
'JOULE_PER_SECOND' => array('1', 'J/s'),
|
||||
'KILOCALORIE_PER_HOUR' => array('1.163', 'kcal/h'),
|
||||
'KILOCALORIE_PER_MINUTE' => array('69.78', 'kcal/m'),
|
||||
'KILOCALORIE_PER_SECOND' => array('4186.8', 'kcal/s'),
|
||||
'KILOGRAM_FORCE_METER_PER_HOUR' => array(array('' => '9.80665', '/' => '3600'), 'kgf m/h'),
|
||||
'KILOGRAM_FORCE_METER_PER_MINUTE' => array(array('' => '9.80665', '/' => '60'), 'kfg m/m'),
|
||||
'KILOGRAM_FORCE_METER_PER_SECOND' => array('9.80665', 'kfg m/s'),
|
||||
'KILOPOND_METER_PER_HOUR' => array(array('' => '9.80665', '/' => '3600'), 'kp/h'),
|
||||
'KILOPOND_METER_PER_MINUTE' => array(array('' => '9.80665', '/' => '60'), 'kp/m'),
|
||||
'KILOPOND_METER_PER_SECOND' => array('9.80665', 'kp/s'),
|
||||
'KILOWATT' => array('1000', 'kW'),
|
||||
'MEGAWATT' => array('1000000', 'MW'),
|
||||
'MICROWATT' => array('0.000001', 'µW'),
|
||||
'MILLION_BTU_PER_HOUR' => array('293071.07', 'mio BTU/h'),
|
||||
'MILLIWATT' => array('0.001', 'mM'),
|
||||
'NANOWATT' => array('1.0e-9', 'nN'),
|
||||
'NEWTON_METER_PER_HOUR' => array(array('' => '1', '/' => '3600'), 'Nm/h'),
|
||||
'NEWTON_METER_PER_MINUTE' => array(array('' => '1', '/' => '60'), 'Nm/m'),
|
||||
'NEWTON_METER_PER_SECOND' => array('1', 'Nm/s'),
|
||||
'PETAWATT' => array('1.0e+15', 'PW'),
|
||||
'PFERDESTAERKE' => array('735.49875', 'PS'),
|
||||
'PICOWATT' => array('1.0e-12', 'pW'),
|
||||
'PONCELET' => array('980.665', 'p'),
|
||||
'POUND_SQUARE_FOOT_PER_CUBIC_SECOND' => array('0.04214011', 'lb ft²/s³'),
|
||||
'TERAWATT' => array('1.0e+12', 'TW'),
|
||||
'TON_OF_REFRIGERATION' => array('3516.85284', 'RT'),
|
||||
'WATT' => array('1', 'W'),
|
||||
'YOCTOWATT' => array('1.0e-24', 'yW'),
|
||||
'YOTTAWATT' => array('1.0e+24', 'YW'),
|
||||
'ZEPTOWATT' => array('1.0e-21', 'zW'),
|
||||
'ZETTAWATT' => array('1.0e+21', 'ZW'),
|
||||
'STANDARD' => 'WATT'
|
||||
);
|
||||
}
|
251
libs/Zend/Measure/Pressure.php
Normal file
251
libs/Zend/Measure/Pressure.php
Normal file
@ -0,0 +1,251 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Pressure.php 9508 2008-05-23 10:56:41Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implement needed classes
|
||||
*/
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
require_once 'Zend/Measure/Abstract.php';
|
||||
require_once 'Zend/Locale.php';
|
||||
|
||||
/**
|
||||
* Class for handling pressure conversions
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @subpackage Zend_Measure_Pressure
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Measure_Pressure extends Zend_Measure_Abstract
|
||||
{
|
||||
const STANDARD = 'NEWTON_PER_SQUARE_METER';
|
||||
|
||||
const ATMOSPHERE = 'ATMOSPHERE';
|
||||
const ATMOSPHERE_TECHNICAL = 'ATMOSPHERE_TECHNICAL';
|
||||
const ATTOBAR = 'ATTOBAR';
|
||||
const ATTOPASCAL = 'ATTOPASCAL';
|
||||
const BAR = 'BAR';
|
||||
const BARAD = 'BARAD';
|
||||
const BARYE = 'BARYE';
|
||||
const CENTIBAR = 'CENTIBAR';
|
||||
const CENTIHG = 'CENTIHG';
|
||||
const CENTIMETER_MERCURY_0C = 'CENTIMETER_MERCURY_0C';
|
||||
const CENTIMETER_WATER_4C = 'CENTIMETER_WATER_4C';
|
||||
const CENTIPASCAL = 'CENTIPASCAL';
|
||||
const CENTITORR = 'CENTITORR';
|
||||
const DECIBAR = 'DECIBAR';
|
||||
const DECIPASCAL = 'DECIPASCAL';
|
||||
const DECITORR = 'DECITORR';
|
||||
const DEKABAR = 'DEKABAR';
|
||||
const DEKAPASCAL = 'DEKAPASCAL';
|
||||
const DYNE_PER_SQUARE_CENTIMETER = 'DYNE_PER_SQUARE_CENTIMETER';
|
||||
const EXABAR = 'EXABAR';
|
||||
const EXAPASCAL = 'EXAPASCAL';
|
||||
const FEMTOBAR = 'FEMTOBAR';
|
||||
const FEMTOPASCAL = 'FEMTOPASCAL';
|
||||
const FOOT_AIR_0C = 'FOOT_AIR_0C';
|
||||
const FOOT_AIR_15C = 'FOOT_AIR_15C';
|
||||
const FOOT_HEAD = 'FOOT_HEAD';
|
||||
const FOOT_MERCURY_0C = 'FOOT_MERCURY_0C';
|
||||
const FOOT_WATER_4C = 'FOOT_WATER_4C';
|
||||
const GIGABAR = 'GIGABAR';
|
||||
const GIGAPASCAL = 'GIGAPASCAL';
|
||||
const GRAM_FORCE_SQUARE_CENTIMETER = 'GRAM_FORCE_SQUARE_CENTIMETER';
|
||||
const HECTOBAR = 'HECTOBAR';
|
||||
const HECTOPASCAL = 'HECTOPASCAL';
|
||||
const INCH_AIR_0C = 'INCH_AIR_0C';
|
||||
const INCH_AIR_15C = 'INCH_AIR_15C';
|
||||
const INCH_MERCURY_0C = 'INCH_MERCURY_0C';
|
||||
const INCH_WATER_4C = 'INCH_WATER_4C';
|
||||
const KILOBAR = 'KILOBAR';
|
||||
const KILOGRAM_FORCE_PER_SQUARE_CENTIMETER = 'KILOGRAM_FORCE_PER_SQUARE_CENTIMETER';
|
||||
const KILOGRAM_FORCE_PER_SQUARE_METER = 'KILOGRAM_FORCE_PER_SQUARE_METER';
|
||||
const KILOGRAM_FORCE_PER_SQUARE_MILLIMETER = 'KILOGRAM_FORCE_PER_SQUARE_MILLIMETER';
|
||||
const KILONEWTON_PER_SQUARE_METER = 'KILONEWTON_PER_SQUARE_METER';
|
||||
const KILOPASCAL = 'KILOPASCAL';
|
||||
const KILOPOND_PER_SQUARE_CENTIMETER = 'KILOPOND_PER_SQUARE_CENTIMETER';
|
||||
const KILOPOND_PER_SQUARE_METER = 'KILOPOND_PER_SQUARE_METER';
|
||||
const KILOPOND_PER_SQUARE_MILLIMETER = 'KILOPOND_PER_SQUARE_MILLIMETER';
|
||||
const KIP_PER_SQUARE_FOOT = 'KIP_PER_SQUARE_FOOT';
|
||||
const KIP_PER_SQUARE_INCH = 'KIP_PER_SQUARE_INCH';
|
||||
const MEGABAR = 'MEGABAR';
|
||||
const MEGANEWTON_PER_SQUARE_METER = 'MEGANEWTON_PER_SQUARE_METER';
|
||||
const MEGAPASCAL = 'MEGAPASCAL';
|
||||
const METER_AIR_0C = 'METER_AIR_0C';
|
||||
const METER_AIR_15C = 'METER_AIR_15C';
|
||||
const METER_HEAD = 'METER_HEAD';
|
||||
const MICROBAR = 'MICROBAR';
|
||||
const MICROMETER_MERCURY_0C = 'MICROMETER_MERCURY_0C';
|
||||
const MICROMETER_WATER_4C = 'MICROMETER_WATER_4C';
|
||||
const MICRON_MERCURY_0C = 'MICRON_MERCURY_0C';
|
||||
const MICROPASCAL = 'MICROPASCAL';
|
||||
const MILLIBAR = 'MILLIBAR';
|
||||
const MILLIHG = 'MILLIHG';
|
||||
const MILLIMETER_MERCURY_0C = 'MILLIMETER_MERCURY_0C';
|
||||
const MILLIMETER_WATER_4C = 'MILLIMETER_WATER_4C';
|
||||
const MILLIPASCAL = 'MILLIPASCAL';
|
||||
const MILLITORR = 'MILLITORR';
|
||||
const NANOBAR = 'NANOBAR';
|
||||
const NANOPASCAL = 'NANOPASCAL';
|
||||
const NEWTON_PER_SQUARE_METER = 'NEWTON_PER_SQUARE_METER';
|
||||
const NEWTON_PER_SQUARE_MILLIMETER = 'NEWTON_PER_SQUARE_MILLIMETER';
|
||||
const OUNCE_PER_SQUARE_INCH = 'OUNCE_PER_SQUARE_INCH';
|
||||
const PASCAL = 'PASCAL';
|
||||
const PETABAR = 'PETABAR';
|
||||
const PETAPASCAL = 'PETAPASCAL';
|
||||
const PICOBAR = 'PICOBAR';
|
||||
const PICOPASCAL = 'PICOPASCAL';
|
||||
const PIEZE = 'PIEZE';
|
||||
const POUND_PER_SQUARE_FOOT = 'POUND_PER_SQUARE_FOOT';
|
||||
const POUND_PER_SQUARE_INCH = 'POUND_PER_SQUARE_INCH';
|
||||
const POUNDAL_PER_SQUARE_FOOT = 'POUNDAL_PER_SQUARE_FOOT';
|
||||
const STHENE_PER_SQUARE_METER = 'STHENE_PER_SQUARE_METER';
|
||||
const TECHNICAL_ATMOSPHERE = 'TECHNICAL_ATMOSPHERE';
|
||||
const TERABAR = 'TERABAR';
|
||||
const TERAPASCAL = 'TERAPASCAL';
|
||||
const TON_PER_SQUARE_FOOT = 'TON_PER_SQUARE_FOOT';
|
||||
const TON_PER_SQUARE_FOOT_SHORT = 'TON_PER_SQUARE_FOOT_SHORT';
|
||||
const TON_PER_SQUARE_INCH = 'TON_PER_SQUARE_INCH';
|
||||
const TON_PER_SQUARE_INCH_SHORT = 'TON_PER_SQUARE_INCH_SHORT';
|
||||
const TON_PER_SQUARE_METER = 'TON_PER_SQUARE_METER';
|
||||
const TORR = 'TORR';
|
||||
const WATER_COLUMN_CENTIMETER = 'WATER_COLUMN_CENTIMETER';
|
||||
const WATER_COLUMN_INCH = 'WATER_COLUMN_INCH';
|
||||
const WATER_COLUMN_MILLIMETER = 'WATER_COLUMN_MILLIMETER';
|
||||
const YOCTOBAR = 'YOCTOBAR';
|
||||
const YOCTOPASCAL = 'YOCTOPASCAL';
|
||||
const YOTTABAR = 'YOTTABAR';
|
||||
const YOTTAPASCAL = 'YOTTAPASCAL';
|
||||
const ZEPTOBAR = 'ZEPTOBAR';
|
||||
const ZEPTOPASCAL = 'ZEPTOPASCAL';
|
||||
const ZETTABAR = 'ZETTABAR';
|
||||
const ZETTAPASCAL = 'ZETTAPASCAL';
|
||||
|
||||
/**
|
||||
* Calculations for all pressure units
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_units = array(
|
||||
'ATMOSPHERE' => array('101325.01', 'atm'),
|
||||
'ATMOSPHERE_TECHNICAL' => array('98066.5', 'atm'),
|
||||
'ATTOBAR' => array('1.0e-13', 'ab'),
|
||||
'ATTOPASCAL' => array('1.0e-18', 'aPa'),
|
||||
'BAR' => array('100000', 'b'),
|
||||
'BARAD' => array('0.1', 'barad'),
|
||||
'BARYE' => array('0.1', 'ba'),
|
||||
'CENTIBAR' => array('1000', 'cb'),
|
||||
'CENTIHG' => array('1333.2239', 'cHg'),
|
||||
'CENTIMETER_MERCURY_0C' => array('1333.2239', 'cm mercury (0°C)'),
|
||||
'CENTIMETER_WATER_4C' => array('98.0665', 'cm water (4°C)'),
|
||||
'CENTIPASCAL' => array('0.01', 'cPa'),
|
||||
'CENTITORR' => array('1.3332237', 'cTorr'),
|
||||
'DECIBAR' => array('10000', 'db'),
|
||||
'DECIPASCAL' => array('0.1', 'dPa'),
|
||||
'DECITORR' => array('13.332237', 'dTorr'),
|
||||
'DEKABAR' => array('1000000', 'dab'),
|
||||
'DEKAPASCAL' => array('10', 'daPa'),
|
||||
'DYNE_PER_SQUARE_CENTIMETER' => array('0.1', 'dyn/cm²'),
|
||||
'EXABAR' => array('1.0e+23', 'Eb'),
|
||||
'EXAPASCAL' => array('1.0e+18', 'EPa'),
|
||||
'FEMTOBAR' => array('1.0e-10', 'fb'),
|
||||
'FEMTOPASCAL' => array('1.0e-15', 'fPa'),
|
||||
'FOOT_AIR_0C' => array('3.8640888', 'ft air (0°C)'),
|
||||
'FOOT_AIR_15C' => array('3.6622931', 'ft air (15°C)'),
|
||||
'FOOT_HEAD' => array('2989.0669', 'ft head'),
|
||||
'FOOT_MERCURY_0C' => array('40636.664', 'ft mercury (0°C)'),
|
||||
'FOOT_WATER_4C' => array('2989.0669', 'ft water (4°C)'),
|
||||
'GIGABAR' => array('1.0e+14', 'Gb'),
|
||||
'GIGAPASCAL' => array('1.0e+9', 'GPa'),
|
||||
'GRAM_FORCE_SQUARE_CENTIMETER' => array('98.0665', 'gf'),
|
||||
'HECTOBAR' => array('1.0e+7', 'hb'),
|
||||
'HECTOPASCAL' => array('100', 'hPa'),
|
||||
'INCH_AIR_0C' => array(array('' => '3.8640888', '/' => '12'), 'in air (0°C)'),
|
||||
'INCH_AIR_15C' => array(array('' => '3.6622931', '/' => '12'), 'in air (15°C)'),
|
||||
'INCH_MERCURY_0C' => array(array('' => '40636.664', '/' => '12'), 'in mercury (0°C)'),
|
||||
'INCH_WATER_4C' => array(array('' => '2989.0669', '/' => '12'), 'in water (4°C)'),
|
||||
'KILOBAR' => array('1.0e+8', 'kb'),
|
||||
'KILOGRAM_FORCE_PER_SQUARE_CENTIMETER' => array('98066.5', 'kgf/cm²'),
|
||||
'KILOGRAM_FORCE_PER_SQUARE_METER' => array('9.80665', 'kgf/m²'),
|
||||
'KILOGRAM_FORCE_PER_SQUARE_MILLIMETER' => array('9806650', 'kgf/mm²'),
|
||||
'KILONEWTON_PER_SQUARE_METER' => array('1000', 'kN/m²'),
|
||||
'KILOPASCAL' => array('1000', 'kPa'),
|
||||
'KILOPOND_PER_SQUARE_CENTIMETER' => array('98066.5', 'kp/cm²'),
|
||||
'KILOPOND_PER_SQUARE_METER' => array('9.80665', 'kp/m²'),
|
||||
'KILOPOND_PER_SQUARE_MILLIMETER' => array('9806650', 'kp/mm²'),
|
||||
'KIP_PER_SQUARE_FOOT' => array(array('' => '430.92233', '/' => '0.009'), 'kip/ft²'),
|
||||
'KIP_PER_SQUARE_INCH' => array(array('' => '62052.81552', '/' => '0.009'), 'kip/in²'),
|
||||
'MEGABAR' => array('1.0e+11', 'Mb'),
|
||||
'MEGANEWTON_PER_SQUARE_METER' => array('1000000', 'MN/m²'),
|
||||
'MEGAPASCAL' => array('1000000', 'MPa'),
|
||||
'METER_AIR_0C' => array('12.677457', 'm air (0°C)'),
|
||||
'METER_AIR_15C' => array('12.015397', 'm air (15°C)'),
|
||||
'METER_HEAD' => array('9804.139432', 'm head'),
|
||||
'MICROBAR' => array('0.1', 'µb'),
|
||||
'MICROMETER_MERCURY_0C' => array('0.13332239', 'µm mercury (0°C)'),
|
||||
'MICROMETER_WATER_4C' => array('0.00980665', 'µm water (4°C)'),
|
||||
'MICRON_MERCURY_0C' => array('0.13332239', 'µ mercury (0°C)'),
|
||||
'MICROPASCAL' => array('0.000001', 'µPa'),
|
||||
'MILLIBAR' => array('100', 'mb'),
|
||||
'MILLIHG' => array('133.32239', 'mHg'),
|
||||
'MILLIMETER_MERCURY_0C' => array('133.32239', 'mm mercury (0°C)'),
|
||||
'MILLIMETER_WATER_4C' => array('9.80665', 'mm water (0°C)'),
|
||||
'MILLIPASCAL' => array('0.001', 'mPa'),
|
||||
'MILLITORR' => array('0.13332237', 'mTorr'),
|
||||
'NANOBAR' => array('0.0001', 'nb'),
|
||||
'NANOPASCAL' => array('1.0e-9', 'nPa'),
|
||||
'NEWTON_PER_SQUARE_METER' => array('1', 'N/m²'),
|
||||
'NEWTON_PER_SQUARE_MILLIMETER' => array('1000000', 'N/mm²'),
|
||||
'OUNCE_PER_SQUARE_INCH' => array('430.92233', 'oz/in²'),
|
||||
'PASCAL' => array('1', 'Pa'),
|
||||
'PETABAR' => array('1.0e+20', 'Pb'),
|
||||
'PETAPASCAL' => array('1.0e+15', 'PPa'),
|
||||
'PICOBAR' => array('0.0000001', 'pb'),
|
||||
'PICOPASCAL' => array('1.0e-12', 'pPa'),
|
||||
'PIEZE' => array('1000', 'pz'),
|
||||
'POUND_PER_SQUARE_FOOT' => array(array('' => '430.92233', '/' => '9'), 'lb/ft²'),
|
||||
'POUND_PER_SQUARE_INCH' => array('6894.75728', 'lb/in²'),
|
||||
'POUNDAL_PER_SQUARE_FOOT' => array('1.4881639', 'pdl/ft²'),
|
||||
'STHENE_PER_SQUARE_METER' => array('1000', 'sn/m²'),
|
||||
'TECHNICAL_ATMOSPHERE' => array('98066.5', 'at'),
|
||||
'TERABAR' => array('1.0e+17', 'Tb'),
|
||||
'TERAPASCAL' => array('1.0e+12', 'TPa'),
|
||||
'TON_PER_SQUARE_FOOT' => array(array('' => '120658.2524', '/' => '1.125'), 't/ft²'),
|
||||
'TON_PER_SQUARE_FOOT_SHORT' => array(array('' => '430.92233', '/' => '0.0045'), 't/ft²'),
|
||||
'TON_PER_SQUARE_INCH' => array(array('' => '17374788.3456', '/' => '1.125'), 't/in²'),
|
||||
'TON_PER_SQUARE_INCH_SHORT' => array(array('' => '62052.81552', '/' => '0.0045'), 't/in²'),
|
||||
'TON_PER_SQUARE_METER' => array('9806.65', 't/m²'),
|
||||
'TORR' => array('133.32237', 'Torr'),
|
||||
'WATER_COLUMN_CENTIMETER' => array('98.0665', 'WC (cm)'),
|
||||
'WATER_COLUMN_INCH' => array(array('' => '2989.0669', '/' => '12'), 'WC (in)'),
|
||||
'WATER_COLUMN_MILLIMETER' => array('9.80665', 'WC (mm)'),
|
||||
'YOCTOBAR' => array('1.0e-19', 'yb'),
|
||||
'YOCTOPASCAL' => array('1.0e-24', 'yPa'),
|
||||
'YOTTABAR' => array('1.0e+29', 'Yb'),
|
||||
'YOTTAPASCAL' => array('1.0e+24', 'YPa'),
|
||||
'ZEPTOBAR' => array('1.0e-16', 'zb'),
|
||||
'ZEPTOPASCAL' => array('1.0e-21', 'zPa'),
|
||||
'ZETTABAR' => array('1.0e+26', 'Zb'),
|
||||
'ZETTAPASCAL' => array('1.0e+21', 'ZPa'),
|
||||
'STANDARD' => 'NEWTON_PER_SQUARE_METER'
|
||||
);
|
||||
}
|
191
libs/Zend/Measure/Speed.php
Normal file
191
libs/Zend/Measure/Speed.php
Normal file
@ -0,0 +1,191 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Speed.php 9508 2008-05-23 10:56:41Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implement needed classes
|
||||
*/
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
require_once 'Zend/Measure/Abstract.php';
|
||||
require_once 'Zend/Locale.php';
|
||||
|
||||
/**
|
||||
* Class for handling speed conversions
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @subpackage Zend_Measure_Speed
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Measure_Speed extends Zend_Measure_Abstract
|
||||
{
|
||||
const STANDARD = 'METER_PER_SECOND';
|
||||
|
||||
const BENZ = 'BENZ';
|
||||
const CENTIMETER_PER_DAY = 'CENTIMETER_PER_DAY';
|
||||
const CENTIMETER_PER_HOUR = 'CENTIMETER_PER_HOUR';
|
||||
const CENTIMETER_PER_MINUTE = 'CENTIMETER_PER_MINUTE';
|
||||
const CENTIMETER_PER_SECOND = 'CENTIMETER_PER_SECOND';
|
||||
const DEKAMETER_PER_DAY = 'DEKAMETER_PER_DAY';
|
||||
const DEKAMETER_PER_HOUR = 'DEKAMETER_PER_HOUR';
|
||||
const DEKAMETER_PER_MINUTE = 'DEKAMETER_PER_MINUTE';
|
||||
const DEKAMETER_PER_SECOND = 'DEKAMETER_PER_SECOND';
|
||||
const FOOT_PER_DAY = 'FOOT_PER_DAY';
|
||||
const FOOT_PER_HOUR = 'FOOT_PER_HOUR';
|
||||
const FOOT_PER_MINUTE = 'FOOT_PER_MINUTE';
|
||||
const FOOT_PER_SECOND = 'FOOT_PER_SECOND';
|
||||
const FURLONG_PER_DAY = 'FURLONG_PER_DAY';
|
||||
const FURLONG_PER_FORTNIGHT = 'FURLONG_PER_FORTNIGHT';
|
||||
const FURLONG_PER_HOUR = 'FURLONG_PER_HOUR';
|
||||
const FURLONG_PER_MINUTE = 'FURLONG_PER_MINUTE';
|
||||
const FURLONG_PER_SECOND = 'FURLONG_PER_SECOND';
|
||||
const HECTOMETER_PER_DAY = 'HECTOMETER_PER_DAY';
|
||||
const HECTOMETER_PER_HOUR = 'HECTOMETER_PER_HOUR';
|
||||
const HECTOMETER_PER_MINUTE = 'HECTOMETER_PER_MINUTE';
|
||||
const HECTOMETER_PER_SECOND = 'HECTOMETER_PER_SECOND';
|
||||
const INCH_PER_DAY = 'INCH_PER_DAY';
|
||||
const INCH_PER_HOUR = 'INCH_PER_HOUR';
|
||||
const INCH_PER_MINUTE = 'INCH_PER_MINUTE';
|
||||
const INCH_PER_SECOND = 'INCH_PER_SECOND';
|
||||
const KILOMETER_PER_DAY = 'KILOMETER_PER_DAY';
|
||||
const KILOMETER_PER_HOUR = 'KILOMETER_PER_HOUR';
|
||||
const KILOMETER_PER_MINUTE = 'KILOMETER_PER_MINUTE';
|
||||
const KILOMETER_PER_SECOND = 'KILOMETER_PER_SECOND';
|
||||
const KNOT = 'KNOT';
|
||||
const LEAGUE_PER_DAY = 'LEAGUE_PER_DAY';
|
||||
const LEAGUE_PER_HOUR = 'LEAGUE_PER_HOUR';
|
||||
const LEAGUE_PER_MINUTE = 'LEAGUE_PER_MINUTE';
|
||||
const LEAGUE_PER_SECOND = 'LEAGUE_PER_SECOND';
|
||||
const MACH = 'MACH';
|
||||
const MEGAMETER_PER_DAY = 'MEGAMETER_PER_DAY';
|
||||
const MEGAMETER_PER_HOUR = 'MEGAMETER_PER_HOUR';
|
||||
const MEGAMETER_PER_MINUTE = 'MEGAMETER_PER_MINUTE';
|
||||
const MEGAMETER_PER_SECOND = 'MEGAMETER_PER_SECOND';
|
||||
const METER_PER_DAY = 'METER_PER_DAY';
|
||||
const METER_PER_HOUR = 'METER_PER_HOUR';
|
||||
const METER_PER_MINUTE = 'METER_PER_MINUTE';
|
||||
const METER_PER_SECOND = 'METER_PER_SECOND';
|
||||
const MILE_PER_DAY = 'MILE_PER_DAY';
|
||||
const MILE_PER_HOUR = 'MILE_PER_HOUR';
|
||||
const MILE_PER_MINUTE = 'MILE_PER_MINUTE';
|
||||
const MILE_PER_SECOND = 'MILE_PER_SECOND';
|
||||
const MILLIMETER_PER_DAY = 'MILLIMETER_PER_DAY';
|
||||
const MILLIMETER_PER_HOUR = 'MILLIMETER_PER_HOUR';
|
||||
const MILLIMETER_PER_MINUTE = 'MILLIMETER_PER_MINUTE';
|
||||
const MILLIMETER_PER_SECOND = 'MILLIMETER_PER_SECOND';
|
||||
const MILLIMETER_PER_MICROSECOND = 'MILLIMETER_PER_MICROSECOND';
|
||||
const MILLIMETER_PER_100_MICROSECOND = 'MILLIMETER_PER_100_MICROSECOND';
|
||||
const NAUTIC_MILE_PER_DAY = 'NAUTIC_MILE_PER_DAY';
|
||||
const NAUTIC_MILE_PER_HOUR = 'NAUTIC_MILE_PER_HOUR';
|
||||
const NAUTIC_MILE_PER_MINUTE = 'NAUTIC_MILE_PER_MINUTE';
|
||||
const NAUTIC_MILE_PER_SECOND = 'NAUTIC_MILE_PER_SECOND';
|
||||
const LIGHTSPEED_AIR = 'LIGHTSPEED_AIR';
|
||||
const LIGHTSPEED_GLASS = 'LIGHTSPEED_GLASS';
|
||||
const LIGHTSPEED_ICE = 'LIGHTSPEED_ICE';
|
||||
const LIGHTSPEED_VACUUM = 'LIGHTSPEED_VACUUM';
|
||||
const LIGHTSPEED_WATER = 'LIGHTSPEED_WATER';
|
||||
const SOUNDSPEED_AIR = 'SOUNDSPEED_AIT';
|
||||
const SOUNDSPEED_METAL = 'SOUNDSPEED_METAL';
|
||||
const SOUNDSPEED_WATER = 'SOUNDSPEED_WATER';
|
||||
const YARD_PER_DAY = 'YARD_PER_DAY';
|
||||
const YARD_PER_HOUR = 'YARD_PER_HOUR';
|
||||
const YARD_PER_MINUTE = 'YARD_PER_MINUTE';
|
||||
const YARD_PER_SECOND = 'YARD_PER_SECOND';
|
||||
|
||||
/**
|
||||
* Calculations for all speed units
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_units = array(
|
||||
'BENZ' => array('1', 'Bz'),
|
||||
'CENTIMETER_PER_DAY' => array(array('' => '0.01', '/' => '86400'), 'cm/day'),
|
||||
'CENTIMETER_PER_HOUR' => array(array('' => '0.01', '/' => '3600'), 'cm/h'),
|
||||
'CENTIMETER_PER_MINUTE' => array(array('' => '0.01', '/' => '60'), 'cm/m'),
|
||||
'CENTIMETER_PER_SECOND' => array('0.01', 'cd/s'),
|
||||
'DEKAMETER_PER_DAY' => array(array('' => '10', '/' => '86400'), 'dam/day'),
|
||||
'DEKAMETER_PER_HOUR' => array(array('' => '10', '/' => '3600'), 'dam/h'),
|
||||
'DEKAMETER_PER_MINUTE' => array(array('' => '10', '/' => '60'), 'dam/m'),
|
||||
'DEKAMETER_PER_SECOND' => array('10', 'dam/s'),
|
||||
'FOOT_PER_DAY' => array(array('' => '0.3048', '/' => '86400'), 'ft/day'),
|
||||
'FOOT_PER_HOUR' => array(array('' => '0.3048', '/' => '3600'), 'ft/h'),
|
||||
'FOOT_PER_MINUTE' => array(array('' => '0.3048', '/' => '60'), 'ft/m'),
|
||||
'FOOT_PER_SECOND' => array('0.3048', 'ft/s'),
|
||||
'FURLONG_PER_DAY' => array(array('' => '201.1684', '/' => '86400'), 'fur/day'),
|
||||
'FURLONG_PER_FORTNIGHT' => array(array('' => '201.1684', '/' => '1209600'), 'fur/fortnight'),
|
||||
'FURLONG_PER_HOUR' => array(array('' => '201.1684', '/' => '3600'), 'fur/h'),
|
||||
'FURLONG_PER_MINUTE' => array(array('' => '201.1684', '/' => '60'), 'fur/m'),
|
||||
'FURLONG_PER_SECOND' => array('201.1684', 'fur/s'),
|
||||
'HECTOMETER_PER_DAY' => array(array('' => '100', '/' => '86400'), 'hm/day'),
|
||||
'HECTOMETER_PER_HOUR' => array(array('' => '100', '/' => '3600'), 'hm/h'),
|
||||
'HECTOMETER_PER_MINUTE' => array(array('' => '100', '/' => '60'), 'hm/m'),
|
||||
'HECTOMETER_PER_SECOND' => array('100', 'hm/s'),
|
||||
'INCH_PER_DAY' => array(array('' => '0.0254', '/' => '86400'), 'in/day'),
|
||||
'INCH_PER_HOUR' => array(array('' => '0.0254', '/' => '3600'), 'in/h'),
|
||||
'INCH_PER_MINUTE' => array(array('' => '0.0254', '/' => '60'), 'in/m'),
|
||||
'INCH_PER_SECOND' => array('0.0254', 'in/s'),
|
||||
'KILOMETER_PER_DAY' => array(array('' => '1000', '/' => '86400'), 'km/day'),
|
||||
'KILOMETER_PER_HOUR' => array(array('' => '1000', '/' => '3600'), 'km/h'),
|
||||
'KILOMETER_PER_MINUTE' => array(array('' => '1000', '/' => '60'), 'km/m'),
|
||||
'KILOMETER_PER_SECOND' => array('1000', 'km/s'),
|
||||
'KNOT' => array(array('' => '1852', '/' => '3600'), 'kn'),
|
||||
'LEAGUE_PER_DAY' => array(array('' => '4828.0417', '/' => '86400'), 'league/day'),
|
||||
'LEAGUE_PER_HOUR' => array(array('' => '4828.0417', '/' => '3600'), 'league/h'),
|
||||
'LEAGUE_PER_MINUTE' => array(array('' => '4828.0417', '/' => '60'), 'league/m'),
|
||||
'LEAGUE_PER_SECOND' => array('4828.0417', 'league/s'),
|
||||
'MACH' => array('340.29', 'M'),
|
||||
'MEGAMETER_PER_DAY' => array(array('' => '1000000', '/' => '86400'), 'Mm/day'),
|
||||
'MEGAMETER_PER_HOUR' => array(array('' => '1000000', '/' => '3600'), 'Mm/h'),
|
||||
'MEGAMETER_PER_MINUTE' => array(array('' => '1000000', '/' => '60'), 'Mm/m'),
|
||||
'MEGAMETER_PER_SECOND' => array('1000000', 'Mm/s'),
|
||||
'METER_PER_DAY' => array(array('' => '1', '/' => '86400'), 'm/day'),
|
||||
'METER_PER_HOUR' => array(array('' => '1', '/' => '3600'), 'm/h'),
|
||||
'METER_PER_MINUTE' => array(array('' => '1', '/' => '60'), 'm/m'),
|
||||
'METER_PER_SECOND' => array('1', 'm/s'),
|
||||
'MILE_PER_DAY' => array(array('' => '1609.344', '/' => '86400'), 'mi/day'),
|
||||
'MILE_PER_HOUR' => array(array('' => '1609.344', '/' => '3600'), 'mi/h'),
|
||||
'MILE_PER_MINUTE' => array(array('' => '1609.344', '/' => '60'), 'mi/m'),
|
||||
'MILE_PER_SECOND' => array('1609.344', 'mi/s'),
|
||||
'MILLIMETER_PER_DAY' => array(array('' => '0.001', '/' => '86400'), 'mm/day'),
|
||||
'MILLIMETER_PER_HOUR' => array(array('' => '0.001', '/' => '3600'), 'mm/h'),
|
||||
'MILLIMETER_PER_MINUTE' => array(array('' => '0.001', '/' => '60'), 'mm/m'),
|
||||
'MILLIMETER_PER_SECOND' => array('0.001', 'mm/s'),
|
||||
'MILLIMETER_PER_MICROSECOND' => array('1000', 'mm/µs'),
|
||||
'MILLIMETER_PER_100_MICROSECOND' => array('10', 'mm/100µs'),
|
||||
'NAUTIC_MILE_PER_DAY' => array(array('' => '1852', '/' => '86400'), 'nmi/day'),
|
||||
'NAUTIC_MILE_PER_HOUR' => array(array('' => '1852', '/' => '3600'), 'nmi/h'),
|
||||
'NAUTIC_MILE_PER_MINUTE' => array(array('' => '1852', '/' => '60'), 'nmi/m'),
|
||||
'NAUTIC_MILE_PER_SECOND' => array('1852', 'nmi/s'),
|
||||
'LIGHTSPEED_AIR' => array('299702547', 'speed of light (air)'),
|
||||
'LIGHTSPEED_GLASS' => array('199861638', 'speed of light (glass)'),
|
||||
'LIGHTSPEED_ICE' => array('228849204', 'speed of light (ice)'),
|
||||
'LIGHTSPEED_VACUUM' => array('299792458', 'speed of light (vacuum)'),
|
||||
'LIGHTSPEED_WATER' => array('225407863', 'speed of light (water)'),
|
||||
'SOUNDSPEED_AIT' => array('340.29', 'speed of sound (air)'),
|
||||
'SOUNDSPEED_METAL' => array('5000', 'speed of sound (metal)'),
|
||||
'SOUNDSPEED_WATER' => array('1500', 'speed of sound (water)'),
|
||||
'YARD_PER_DAY' => array(array('' => '0.9144', '/' => '86400'), 'yd/day'),
|
||||
'YARD_PER_HOUR' => array(array('' => '0.9144', '/' => '3600'), 'yd/h'),
|
||||
'YARD_PER_MINUTE' => array(array('' => '0.9144', '/' => '60'), 'yd/m'),
|
||||
'YARD_PER_SECOND' => array('0.9144', 'yd/s'),
|
||||
'STANDARD' => 'METER_PER_SECOND'
|
||||
);
|
||||
}
|
61
libs/Zend/Measure/Temperature.php
Normal file
61
libs/Zend/Measure/Temperature.php
Normal file
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Temperature.php 9508 2008-05-23 10:56:41Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implement needed classes
|
||||
*/
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
require_once 'Zend/Measure/Abstract.php';
|
||||
require_once 'Zend/Locale.php';
|
||||
|
||||
/**
|
||||
* Class for handling temperature conversions
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @subpackage Zend_Measure_Temperature
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Measure_Temperature extends Zend_Measure_Abstract
|
||||
{
|
||||
const STANDARD = 'KELVIN';
|
||||
|
||||
const CELSIUS = 'CELSIUS';
|
||||
const FAHRENHEIT = 'FAHRENHEIT';
|
||||
const RANKINE = 'RANKINE';
|
||||
const REAUMUR = 'REAUMUR';
|
||||
const KELVIN = 'KELVIN';
|
||||
|
||||
/**
|
||||
* Calculations for all temperature units
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_units = array(
|
||||
'CELSIUS' => array(array('' => '1', '+' => '273.15'),'°C'),
|
||||
'FAHRENHEIT' => array(array('' => '1', '-' => '32', '/' => '1.8', '+' => '273.15'),'°F'),
|
||||
'RANKINE' => array(array('' => '1', '/' => '1.8'),'°R'),
|
||||
'REAUMUR' => array(array('' => '1', '*' => '1.25', '+' => '273.15'),'°r'),
|
||||
'KELVIN' => array(1,'°K'),
|
||||
'STANDARD' => 'KELVIN'
|
||||
);
|
||||
}
|
118
libs/Zend/Measure/Time.php
Normal file
118
libs/Zend/Measure/Time.php
Normal file
@ -0,0 +1,118 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implement needed classes
|
||||
*/
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
require_once 'Zend/Measure/Abstract.php';
|
||||
require_once 'Zend/Locale.php';
|
||||
|
||||
/**
|
||||
* Class for handling time conversions
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @subpackage Zend_Measure_Time
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Measure_Time extends Zend_Measure_Abstract
|
||||
{
|
||||
const STANDARD = 'SECOND';
|
||||
|
||||
const ANOMALISTIC_YEAR = 'ANOMALISTIC_YEAR';
|
||||
const ATTOSECOND = 'ATTOSECOND';
|
||||
const CENTURY = 'CENTURY';
|
||||
const DAY = 'DAY';
|
||||
const DECADE = 'DECADE';
|
||||
const DRACONIC_YEAR = 'DRACONTIC_YEAR';
|
||||
const EXASECOND = 'EXASECOND';
|
||||
const FEMTOSECOND = 'FEMTOSECOND';
|
||||
const FORTNIGHT = 'FORTNIGHT';
|
||||
const GAUSSIAN_YEAR = 'GAUSSIAN_YEAR';
|
||||
const GIGASECOND = 'GIGASECOND';
|
||||
const GREGORIAN_YEAR = 'GREGORIAN_YEAR';
|
||||
const HOUR = 'HOUR';
|
||||
const JULIAN_YEAR = 'JULIAN_YEAR';
|
||||
const KILOSECOND = 'KILOSECOND';
|
||||
const LEAPYEAR = 'LEAPYEAR';
|
||||
const MEGASECOND = 'MEGASECOND';
|
||||
const MICROSECOND = 'MICROSECOND';
|
||||
const MILLENIUM = 'MILLENIUM';
|
||||
const MILLISECOND = 'MILLISECOND';
|
||||
const MINUTE = 'MINUTE';
|
||||
const MONTH = 'MONTH';
|
||||
const NANOSECOND = 'NANOSECOND';
|
||||
const PETASECOND = 'PETASECOND';
|
||||
const PICOSECOND = 'PICOSECOND';
|
||||
const QUARTER = 'QUARTER';
|
||||
const SECOND = 'SECOND';
|
||||
const SHAKE = 'SHAKE';
|
||||
const SIDEREAL_YEAR = 'SYNODIC_MONTH';
|
||||
const TERASECOND = 'TERASECOND';
|
||||
const TROPICAL_YEAR = 'TROPIC_YEAR';
|
||||
const WEEK = 'WEEK';
|
||||
const YEAR = 'YEAR';
|
||||
|
||||
/**
|
||||
* Calculations for all time units
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_units = array(
|
||||
'ANOMALISTIC_YEAR' => array('31558432', 'anomalistic year'),
|
||||
'ATTOSECOND' => array('1.0e-18', 'as'),
|
||||
'CENTURY' => array('3153600000', 'century'),
|
||||
'DAY' => array('86400', 'day'),
|
||||
'DECADE' => array('315360000', 'decade'),
|
||||
'DRACONIC_YEAR' => array('29947974', 'draconic year'),
|
||||
'EXASECOND' => array('1.0e+18', 'Es'),
|
||||
'FEMTOSECOND' => array('1.0e-15', 'fs'),
|
||||
'FORTNIGHT' => array('1209600', 'fortnight'),
|
||||
'GAUSSIAN_YEAR' => array('31558196', 'gaussian year'),
|
||||
'GIGASECOND' => array('1.0e+9', 'Gs'),
|
||||
'GREAT_YEAR' => array(array('*' => '31536000', '*' => '25700'), 'great year'),
|
||||
'GREGORIAN_YEAR' => array('31536000', 'year'),
|
||||
'HOUR' => array('3600', 'h'),
|
||||
'JULIAN_YEAR' => array('31557600', 'a'),
|
||||
'KILOSECOND' => array('1000', 'ks'),
|
||||
'LEAPYEAR' => array('31622400', 'year'),
|
||||
'MEGASECOND' => array('1000000', 'Ms'),
|
||||
'MICROSECOND' => array('0.000001', 'µs'),
|
||||
'MILLENIUM' => array('31536000000', 'millenium'),
|
||||
'MILLISECOND' => array('0.001', 'ms'),
|
||||
'MINUTE' => array('60', 'min'),
|
||||
'MONTH' => array('2628600', 'month'),
|
||||
'NANOSECOND' => array('1.0e-9', 'ns'),
|
||||
'PETASECOND' => array('1.0e+15', 'Ps'),
|
||||
'PICOSECOND' => array('1.0e-12', 'ps'),
|
||||
'QUARTER' => array('7884000', 'quarter'),
|
||||
'SECOND' => array('1', 's'),
|
||||
'SHAKE' => array('1.0e-9', 'shake'),
|
||||
'SIDEREAL_YEAR' => array('31558149.7676', 'sidereal year'),
|
||||
'TERASECOND' => array('1.0e+12', 'Ts'),
|
||||
'TROPICAL_YEAR' => array('31556925', 'tropical year'),
|
||||
'WEEK' => array('604800', 'week'),
|
||||
'YEAR' => array('31536000', 'year'),
|
||||
'STANDARD' => 'SECOND'
|
||||
);
|
||||
}
|
83
libs/Zend/Measure/Torque.php
Normal file
83
libs/Zend/Measure/Torque.php
Normal file
@ -0,0 +1,83 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Torque.php 9508 2008-05-23 10:56:41Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implement needed classes
|
||||
*/
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
require_once 'Zend/Measure/Abstract.php';
|
||||
require_once 'Zend/Locale.php';
|
||||
|
||||
/**
|
||||
* Class for handling torque conversions
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @subpackage Zend_Measure_Torque
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Measure_Torque extends Zend_Measure_Abstract
|
||||
{
|
||||
const STANDARD = 'NEWTON_METER';
|
||||
|
||||
const DYNE_CENTIMETER = 'DYNE_CENTIMETER';
|
||||
const GRAM_CENTIMETER = 'GRAM_CENTIMETER';
|
||||
const KILOGRAM_CENTIMETER = 'KILOGRAM_CENTIMETER';
|
||||
const KILOGRAM_METER = 'KILOGRAM_METER';
|
||||
const KILONEWTON_METER = 'KILONEWTON_METER';
|
||||
const KILOPOND_METER = 'KILOPOND_METER';
|
||||
const MEGANEWTON_METER = 'MEGANEWTON_METER';
|
||||
const MICRONEWTON_METER = 'MICRONEWTON_METER';
|
||||
const MILLINEWTON_METER = 'MILLINEWTON_METER';
|
||||
const NEWTON_CENTIMETER = 'NEWTON_CENTIMETER';
|
||||
const NEWTON_METER = 'NEWTON_METER';
|
||||
const OUNCE_FOOT = 'OUNCE_FOOT';
|
||||
const OUNCE_INCH = 'OUNCE_INCH';
|
||||
const POUND_FOOT = 'POUND_FOOT';
|
||||
const POUNDAL_FOOT = 'POUNDAL_FOOT';
|
||||
const POUND_INCH = 'POUND_INCH';
|
||||
|
||||
/**
|
||||
* Calculations for all torque units
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_units = array(
|
||||
'DYNE_CENTIMETER' => array('0.0000001', 'dyncm'),
|
||||
'GRAM_CENTIMETER' => array('0.0000980665', 'gcm'),
|
||||
'KILOGRAM_CENTIMETER' => array('0.0980665', 'kgcm'),
|
||||
'KILOGRAM_METER' => array('9.80665', 'kgm'),
|
||||
'KILONEWTON_METER' => array('1000', 'kNm'),
|
||||
'KILOPOND_METER' => array('9.80665', 'kpm'),
|
||||
'MEGANEWTON_METER' => array('1000000', 'MNm'),
|
||||
'MICRONEWTON_METER' => array('0.000001', 'µNm'),
|
||||
'MILLINEWTON_METER' => array('0.001', 'mNm'),
|
||||
'NEWTON_CENTIMETER' => array('0.01', 'Ncm'),
|
||||
'NEWTON_METER' => array('1', 'Nm'),
|
||||
'OUNCE_FOOT' => array('0.084738622', 'ozft'),
|
||||
'OUNCE_INCH' => array(array('' => '0.084738622', '/' => '12'), 'ozin'),
|
||||
'POUND_FOOT' => array(array('' => '0.084738622', '*' => '16'), 'lbft'),
|
||||
'POUNDAL_FOOT' => array('0.0421401099752144', 'plft'),
|
||||
'POUND_INCH' => array(array('' => '0.084738622', '/' => '12', '*' => '16'), 'lbin'),
|
||||
'STANDARD' => 'NEWTON_METER'
|
||||
);
|
||||
}
|
121
libs/Zend/Measure/Viscosity/Dynamic.php
Normal file
121
libs/Zend/Measure/Viscosity/Dynamic.php
Normal file
@ -0,0 +1,121 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Dynamic.php 9508 2008-05-23 10:56:41Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implement needed classes
|
||||
*/
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
require_once 'Zend/Measure/Abstract.php';
|
||||
require_once 'Zend/Locale.php';
|
||||
|
||||
/**
|
||||
* Class for handling acceleration conversions
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @subpackage Zend_Measure_Viscosity_Dynamic
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Measure_Viscosity_Dynamic extends Zend_Measure_Abstract
|
||||
{
|
||||
const STANDARD = 'KILOGRAM_PER_METER_SECOND';
|
||||
|
||||
const CENTIPOISE = 'CENTIPOISE';
|
||||
const DECIPOISE = 'DECIPOISE';
|
||||
const DYNE_SECOND_PER_SQUARE_CENTIMETER = 'DYNE_SECOND_PER_SQUARE_CENTIMETER';
|
||||
const GRAM_FORCE_SECOND_PER_SQUARE_CENTIMETER = 'GRAM_FORCE_SECOND_PER_SQUARE_CENTIMETER';
|
||||
const GRAM_PER_CENTIMETER_SECOND = 'GRAM_PER_CENTIMETER_SECOND';
|
||||
const KILOGRAM_FORCE_SECOND_PER_SQUARE_METER = 'KILOGRAM_FORCE_SECOND_PER_SQUARE_METER';
|
||||
const KILOGRAM_PER_METER_HOUR = 'KILOGRAM_PER_METER_HOUR';
|
||||
const KILOGRAM_PER_METER_SECOND = 'KILOGRAM_PER_METER_SECOND';
|
||||
const MILLIPASCAL_SECOND = 'MILLIPASCAL_SECOND';
|
||||
const MILLIPOISE = 'MILLIPOISE';
|
||||
const NEWTON_SECOND_PER_SQUARE_METER = 'NEWTON_SECOND_PER_SQUARE_METER';
|
||||
const PASCAL_SECOND = 'PASCAL_SECOND';
|
||||
const POISE = 'POISE';
|
||||
const POISEUILLE = 'POISEUILLE';
|
||||
const POUND_FORCE_SECOND_PER_SQUARE_FEET = 'POUND_FORCE_SECOND_PER_SQUARE_FEET';
|
||||
const POUND_FORCE_SECOND_PER_SQUARE_INCH = 'POUND_FORCE_SECOND_PER_SQUARE_INCH';
|
||||
const POUND_PER_FOOT_HOUR = 'POUND_PER_FOOT_HOUR';
|
||||
const POUND_PER_FOOT_SECOND = 'POUND_PER_FOOT_SECOND';
|
||||
const POUNDAL_HOUR_PER_SQUARE_FOOT = 'POUNDAL_HOUR_PER_SQUARE_FOOT';
|
||||
const POUNDAL_SECOND_PER_SQUARE_FOOT = 'POUNDAL_SECOND_PER_SQUARE_FOOT';
|
||||
const REYN = 'REYN';
|
||||
const SLUG_PER_FOOT_SECOND = 'SLUG_PER_FOOT_SECOND';
|
||||
const LBFS_PER_SQUARE_FOOT = 'LBFS_PER_SQUARE_FOOT';
|
||||
const NS_PER_SQUARE_METER = 'NS_PER_SQUARE_METER';
|
||||
const WATER_20C = 'WATER_20C';
|
||||
const WATER_40C = 'WATER_40C';
|
||||
const HEAVY_OIL_20C = 'HEAVY_OIL_20C';
|
||||
const HEAVY_OIL_40C = 'HEAVY_OIL_40C';
|
||||
const GLYCERIN_20C = 'GLYCERIN_20C';
|
||||
const GLYCERIN_40C = 'GLYCERIN_40C';
|
||||
const SAE_5W_MINUS18C = 'SAE_5W_MINUS18C';
|
||||
const SAE_10W_MINUS18C = 'SAE_10W_MINUS18C';
|
||||
const SAE_20W_MINUS18C = 'SAE_20W_MINUS18C';
|
||||
const SAE_5W_99C = 'SAE_5W_99C';
|
||||
const SAE_10W_99C = 'SAE_10W_99C';
|
||||
const SAE_20W_99C = 'SAE_20W_99C';
|
||||
|
||||
/**
|
||||
* Calculations for all dynamic viscosity units
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_units = array(
|
||||
'CENTIPOISE' => array('0.001', 'cP'),
|
||||
'DECIPOISE' => array('0.01', 'dP'),
|
||||
'DYNE_SECOND_PER_SQUARE_CENTIMETER' => array('0.1', 'dyn s/cm²'),
|
||||
'GRAM_FORCE_SECOND_PER_SQUARE_CENTIMETER' => array('98.0665', 'gf s/cm²'),
|
||||
'GRAM_PER_CENTIMETER_SECOND' => array('0.1', 'g/cm s'),
|
||||
'KILOGRAM_FORCE_SECOND_PER_SQUARE_METER' => array('9.80665', 'kgf s/m²'),
|
||||
'KILOGRAM_PER_METER_HOUR' => array(array('' => '1', '/' => '3600'), 'kg/m h'),
|
||||
'KILOGRAM_PER_METER_SECOND' => array('1', 'kg/ms'),
|
||||
'MILLIPASCAL_SECOND' => array('0.001', 'mPa s'),
|
||||
'MILLIPOISE' => array('0.0001', 'mP'),
|
||||
'NEWTON_SECOND_PER_SQUARE_METER' => array('1', 'N s/m²'),
|
||||
'PASCAL_SECOND' => array('1', 'Pa s'),
|
||||
'POISE' => array('0.1', 'P'),
|
||||
'POISEUILLE' => array('1', 'Pl'),
|
||||
'POUND_FORCE_SECOND_PER_SQUARE_FEET' => array('47.880259', 'lbf s/ft²'),
|
||||
'POUND_FORCE_SECOND_PER_SQUARE_INCH' => array('6894.75729', 'lbf s/in²'),
|
||||
'POUND_PER_FOOT_HOUR' => array('0.00041337887', 'lb/ft h'),
|
||||
'POUND_PER_FOOT_SECOND' => array('1.4881639', 'lb/ft s'),
|
||||
'POUNDAL_HOUR_PER_SQUARE_FOOT' => array('0.00041337887', 'pdl h/ft²'),
|
||||
'POUNDAL_SECOND_PER_SQUARE_FOOT' => array('1.4881639', 'pdl s/ft²'),
|
||||
'REYN' => array('6894.75729', 'reyn'),
|
||||
'SLUG_PER_FOOT_SECOND'=> array('47.880259', 'slug/ft s'),
|
||||
'WATER_20C' => array('0.001', 'water (20°)'),
|
||||
'WATER_40C' => array('0.00065', 'water (40°)'),
|
||||
'HEAVY_OIL_20C' => array('0.45', 'oil (20°)'),
|
||||
'HEAVY_OIL_40C' => array('0.11', 'oil (40°)'),
|
||||
'GLYCERIN_20C' => array('1.41', 'glycerin (20°)'),
|
||||
'GLYCERIN_40C' => array('0.284', 'glycerin (40°)'),
|
||||
'SAE_5W_MINUS18C' => array('1.2', 'SAE 5W (-18°)'),
|
||||
'SAE_10W_MINUS18C' => array('2.4', 'SAE 10W (-18°)'),
|
||||
'SAE_20W_MINUS18C' => array('9.6', 'SAE 20W (-18°)'),
|
||||
'SAE_5W_99C' => array('0.0039', 'SAE 5W (99°)'),
|
||||
'SAE_10W_99C' => array('0.0042', 'SAE 10W (99°)'),
|
||||
'SAE_20W_99C' => array('0.0057', 'SAE 20W (99°)'),
|
||||
'STANDARD' => 'KILOGRAM_PER_METER_SECOND'
|
||||
);
|
||||
}
|
107
libs/Zend/Measure/Viscosity/Kinematic.php
Normal file
107
libs/Zend/Measure/Viscosity/Kinematic.php
Normal file
@ -0,0 +1,107 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Kinematic.php 9508 2008-05-23 10:56:41Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implement needed classes
|
||||
*/
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
require_once 'Zend/Measure/Abstract.php';
|
||||
require_once 'Zend/Locale.php';
|
||||
|
||||
/**
|
||||
* Class for handling acceleration conversions
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @subpackage Zend_Measure_Viscosity_Kinematic
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Measure_Viscosity_Kinematic extends Zend_Measure_Abstract
|
||||
{
|
||||
const STANDARD = 'SQUARE_METER_PER_SECOND';
|
||||
|
||||
const CENTISTOKES = 'CENTISTOKES';
|
||||
const LENTOR = 'LENTOR';
|
||||
const LITER_PER_CENTIMETER_DAY = 'LITER_PER_CENTIMETER_DAY';
|
||||
const LITER_PER_CENTIMETER_HOUR = 'LITER_PER_CENTIMETER_HOUR';
|
||||
const LITER_PER_CENTIMETER_MINUTE = 'LITER_PER_CENTIMETER_MINUTE';
|
||||
const LITER_PER_CENTIMETER_SECOND = 'LITER_PER_CENTIMETER_SECOND';
|
||||
const POISE_CUBIC_CENTIMETER_PER_GRAM = 'POISE_CUBIC_CENTIMETER_PER_GRAM';
|
||||
const SQUARE_CENTIMETER_PER_DAY = 'SQUARE_CENTIMETER_PER_DAY';
|
||||
const SQUARE_CENTIMETER_PER_HOUR = 'SQUARE_CENTIMETER_PER_HOUR';
|
||||
const SQUARE_CENTIMETER_PER_MINUTE = 'SQUARE_CENTIMETER_PER_MINUTE';
|
||||
const SQUARE_CENTIMETER_PER_SECOND = 'SQUARE_CENTIMETER_PER_SECOND';
|
||||
const SQUARE_FOOT_PER_DAY = 'SQUARE_FOOT_PER_DAY';
|
||||
const SQUARE_FOOT_PER_HOUR = 'SQUARE_FOOT_PER_HOUR';
|
||||
const SQUARE_FOOT_PER_MINUTE = 'SQUARE_FOOT_PER_MINUTE';
|
||||
const SQUARE_FOOT_PER_SECOND = 'SQUARE_FOOT_PER_SECOND';
|
||||
const SQUARE_INCH_PER_DAY = 'SQUARE_INCH_PER_DAY';
|
||||
const SQUARE_INCH_PER_HOUR = 'SQUARE_INCH_PER_HOUR';
|
||||
const SQUARE_INCH_PER_MINUTE = 'SQUARE_INCH_PER_MINUTE';
|
||||
const SQUARE_INCH_PER_SECOND = 'SQUARE_INCH_PER_SECOND';
|
||||
const SQUARE_METER_PER_DAY = 'SQUARE_METER_PER_DAY';
|
||||
const SQUARE_METER_PER_HOUR = 'SQUARE_METER_PER_HOUR';
|
||||
const SQUARE_METER_PER_MINUTE = 'SQUARE_METER_PER_MINUTE';
|
||||
const SQUARE_METER_PER_SECOND = 'SQUARE_METER_PER_SECOND';
|
||||
const SQUARE_MILLIMETER_PER_DAY = 'SQUARE_MILLIMETER_PER_DAY';
|
||||
const SQUARE_MILLIMETER_PER_HOUR = 'SQUARE_MILLIMETER_PER_HOUR';
|
||||
const SQUARE_MILLIMETER_PER_MINUTE = 'SQUARE_MILLIMETER_PER_MINUTE';
|
||||
const SQUARE_MILLIMETER_PER_SECOND = 'SQUARE_MILLIMETER_PER_SECOND';
|
||||
const STOKES = 'STOKES';
|
||||
|
||||
/**
|
||||
* Calculations for all kinematic viscosity units
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_units = array(
|
||||
'CENTISTOKES' => array('0.000001', 'cSt'),
|
||||
'LENTOR' => array('0.0001', 'lentor'),
|
||||
'LITER_PER_CENTIMETER_DAY' => array(array('' => '1', '/' => '864000'), 'l/cm day'),
|
||||
'LITER_PER_CENTIMETER_HOUR' => array(array('' => '1', '/' => '36000'), 'l/cm h'),
|
||||
'LITER_PER_CENTIMETER_MINUTE' => array(array('' => '1', '/' => '600'), 'l/cm m'),
|
||||
'LITER_PER_CENTIMETER_SECOND' => array('0.1', 'l/cm s'),
|
||||
'POISE_CUBIC_CENTIMETER_PER_GRAM' => array('0.0001', 'P cm³/g'),
|
||||
'SQUARE_CENTIMETER_PER_DAY' => array(array('' => '1', '/' => '864000000'),'cm²/day'),
|
||||
'SQUARE_CENTIMETER_PER_HOUR' => array(array('' => '1', '/' => '36000000'),'cm²/h'),
|
||||
'SQUARE_CENTIMETER_PER_MINUTE' => array(array('' => '1', '/' => '600000'),'cm²/m'),
|
||||
'SQUARE_CENTIMETER_PER_SECOND' => array('0.0001', 'cm²/s'),
|
||||
'SQUARE_FOOT_PER_DAY' => array('0.0000010752667', 'ft²/day'),
|
||||
'SQUARE_FOOT_PER_HOUR' => array('0.0000258064', 'ft²/h'),
|
||||
'SQUARE_FOOT_PER_MINUTE' => array('0.001548384048', 'ft²/m'),
|
||||
'SQUARE_FOOT_PER_SECOND' => array('0.09290304', 'ft²/s'),
|
||||
'SQUARE_INCH_PER_DAY' => array('7.4671296e-9', 'in²/day'),
|
||||
'SQUARE_INCH_PER_HOUR' => array('0.00000017921111', 'in²/h'),
|
||||
'SQUARE_INCH_PER_MINUTE' => array('0.000010752667', 'in²/m'),
|
||||
'SQUARE_INCH_PER_SECOND' => array('0.00064516', 'in²/s'),
|
||||
'SQUARE_METER_PER_DAY' => array(array('' => '1', '/' => '86400'), 'm²/day'),
|
||||
'SQUARE_METER_PER_HOUR' => array(array('' => '1', '/' => '3600'), 'm²/h'),
|
||||
'SQUARE_METER_PER_MINUTE' => array(array('' => '1', '/' => '60'), 'm²/m'),
|
||||
'SQUARE_METER_PER_SECOND' => array('1', 'm²/s'),
|
||||
'SQUARE_MILLIMETER_PER_DAY' => array(array('' => '1', '/' => '86400000000'), 'mm²/day'),
|
||||
'SQUARE_MILLIMETER_PER_HOUR' => array(array('' => '1', '/' => '3600000000'), 'mm²/h'),
|
||||
'SQUARE_MILLIMETER_PER_MINUTE' => array(array('' => '1', '/' => '60000000'), 'mm²/m'),
|
||||
'SQUARE_MILLIMETER_PER_SECOND' => array('0.000001', 'mm²/s'),
|
||||
'STOKES' => array('0.0001', 'St'),
|
||||
'STANDARD' => 'SQUARE_METER_PER_SECOND'
|
||||
);
|
||||
}
|
214
libs/Zend/Measure/Volume.php
Normal file
214
libs/Zend/Measure/Volume.php
Normal file
@ -0,0 +1,214 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Volume.php 9508 2008-05-23 10:56:41Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implement needed classes
|
||||
*/
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
require_once 'Zend/Measure/Abstract.php';
|
||||
require_once 'Zend/Locale.php';
|
||||
|
||||
/**
|
||||
* Class for handling acceleration conversions
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @subpackage Zend_Measure_Volume
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Measure_Volume extends Zend_Measure_Abstract
|
||||
{
|
||||
const STANDARD = 'CUBIC_METER';
|
||||
|
||||
const ACRE_FOOT = 'ACRE_FOOT';
|
||||
const ACRE_FOOT_SURVEY = 'ACRE_FOOT_SURVEY';
|
||||
const ACRE_INCH = 'ACRE_INCH';
|
||||
const BARREL_WINE = 'BARREL_WINE';
|
||||
const BARREL = 'BARREL';
|
||||
const BARREL_US_DRY = 'BARREL_US_DRY';
|
||||
const BARREL_US_FEDERAL = 'BARREL_US_FEDERAL';
|
||||
const BARREL_US = 'BARREL_US';
|
||||
const BARREL_US_PETROLEUM = 'BARREL_US_PETROLEUM';
|
||||
const BOARD_FOOT = 'BOARD_FOOT';
|
||||
const BUCKET = 'BUCKET';
|
||||
const BUCKET_US = 'BUCKET_US';
|
||||
const BUSHEL = 'BUSHEL';
|
||||
const BUSHEL_US = 'BUSHEL_US';
|
||||
const CENTILTER = 'CENTILITER';
|
||||
const CORD = 'CORD';
|
||||
const CORD_FOOT = 'CORD_FOOT';
|
||||
const CUBIC_CENTIMETER = 'CUBIC_CENTIMETER';
|
||||
const CUBIC_CUBIT = 'CUBIC_CUBIT';
|
||||
const CUBIC_DECIMETER = 'CUBIC_DECIMETER';
|
||||
const CUBIC_DEKAMETER = 'CUBIC_DEKAMETER';
|
||||
const CUBIC_FOOT = 'CUBIC_FOOT';
|
||||
const CUBIC_INCH = 'CUBIC_INCH';
|
||||
const CUBIC_KILOMETER = 'CUBIC_KILOMETER';
|
||||
const CUBIC_METER = 'CUBIC_METER';
|
||||
const CUBIC_MILE = 'CUBIC_MILE';
|
||||
const CUBIC_MICROMETER = 'CUBIC_MICROMETER';
|
||||
const CUBIC_MILLIMETER = 'CUBIC_MILLIMETER';
|
||||
const CUBIC_YARD = 'CUBIC_YARD';
|
||||
const CUP_CANADA = 'CUP_CANADA';
|
||||
const CUP = 'CUP';
|
||||
const CUP_US = 'CUP_US';
|
||||
const DECILITER = 'DECILITER';
|
||||
const DEKALITER = 'DEKALITER';
|
||||
const DRAM = 'DRAM';
|
||||
const DRUM_US = 'DRUM_US';
|
||||
const DRUM = 'DRUM';
|
||||
const FIFTH = 'FIFTH';
|
||||
const GALLON = 'GALLON';
|
||||
const GALLON_US_DRY = 'GALLON_US_DRY';
|
||||
const GALLON_US = 'GALLON_US';
|
||||
const GILL = 'GILL';
|
||||
const GILL_US = 'GILL_US';
|
||||
const HECTARE_METER = 'HECTARE_METER';
|
||||
const HECTOLITER = 'HECTOLITER';
|
||||
const HOGSHEAD = 'HOGSHEAD';
|
||||
const HOGSHEAD_US = 'HOGSHEAD_US';
|
||||
const JIGGER = 'JIGGER';
|
||||
const KILOLITER = 'KILOLITER';
|
||||
const LITER = 'LITER';
|
||||
const MEASURE = 'MEASURE';
|
||||
const MEGALITER = 'MEGALITER';
|
||||
const MICROLITER = 'MICROLITER';
|
||||
const MILLILITER = 'MILLILITER';
|
||||
const MINIM = 'MINIM';
|
||||
const MINIM_US = 'MINIM_US';
|
||||
const OUNCE = 'OUNCE';
|
||||
const OUNCE_US = 'OUNCE_US';
|
||||
const PECK = 'PECK';
|
||||
const PECK_US = 'PECK_US';
|
||||
const PINT = 'PINT';
|
||||
const PINT_US_DRY = 'PINT_US_DRY';
|
||||
const PINT_US = 'PINT_US';
|
||||
const PIPE = 'PIPE';
|
||||
const PIPE_US = 'PIPE_US';
|
||||
const PONY = 'PONY';
|
||||
const QUART_GERMANY = 'QUART_GERMANY';
|
||||
const QUART_ANCIENT = 'QUART_ANCIENT';
|
||||
const QUART = 'QUART';
|
||||
const QUART_US_DRY = 'QUART_US_DRY';
|
||||
const QUART_US = 'QUART_US';
|
||||
const QUART_UK = 'QUART_UK';
|
||||
const SHOT = 'SHOT';
|
||||
const STERE = 'STERE';
|
||||
const TABLESPOON = 'TABLESPOON';
|
||||
const TABLESPOON_UK = 'TABLESPOON_UK';
|
||||
const TABLESPOON_US = 'TABLESPOON_US';
|
||||
const TEASPOON = 'TEASPOON';
|
||||
const TEASPOON_UK = 'TEASPOON_UK';
|
||||
const TEASPOON_US = 'TEASPOON_US';
|
||||
const YARD = 'YARD';
|
||||
|
||||
/**
|
||||
* Calculations for all volume units
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_units = array(
|
||||
'ACRE_FOOT' => array('1233.48185532', 'ac ft'),
|
||||
'ACRE_FOOT_SURVEY' => array('1233.489', 'ac ft'),
|
||||
'ACRE_INCH' => array('102.79015461', 'ac in'),
|
||||
'BARREL_WINE' => array('0.143201835', 'bbl'),
|
||||
'BARREL' => array('0.16365924', 'bbl'),
|
||||
'BARREL_US_DRY' => array(array('' => '26.7098656608', '/' => '231'), 'bbl'),
|
||||
'BARREL_US_FEDERAL' => array('0.1173477658', 'bbl'),
|
||||
'BARREL_US' => array('0.1192404717', 'bbl'),
|
||||
'BARREL_US_PETROLEUM' => array('0.1589872956', 'bbl'),
|
||||
'BOARD_FOOT' => array(array('' => '6.5411915904', '/' => '2772'), 'board foot'),
|
||||
'BUCKET' => array('0.01818436', 'bucket'),
|
||||
'BUCKET_US' => array('0.018927059', 'bucket'),
|
||||
'BUSHEL' => array('0.03636872', 'bu'),
|
||||
'BUSHEL_US' => array('0.03523907', 'bu'),
|
||||
'CENTILITER' => array('0.00001', 'cl'),
|
||||
'CORD' => array('3.624556416', 'cd'),
|
||||
'CORD_FOOT' => array('0.453069552', 'cd ft'),
|
||||
'CUBIC_CENTIMETER' => array('0.000001', 'cm³'),
|
||||
'CUBIC_CUBIT' => array('0.144', 'cubit³'),
|
||||
'CUBIC_DECIMETER' => array('0.001', 'dm³'),
|
||||
'CUBIC_DEKAMETER' => array('1000', 'dam³'),
|
||||
'CUBIC_FOOT' => array(array('' => '6.54119159', '/' => '231'), 'ft³'),
|
||||
'CUBIC_INCH' => array(array('' => '0.0037854118', '/' => '231'), 'in³'),
|
||||
'CUBIC_KILOMETER' => array('1.0e+9', 'km³'),
|
||||
'CUBIC_METER' => array('1', 'm³'),
|
||||
'CUBIC_MILE' => array(array('' => '0.0037854118', '/' => '231', '*' => '75271680', '*' => '3379200'),
|
||||
'mi³'),
|
||||
'CUBIC_MICROMETER' => array('1.0e-18', 'µm³'),
|
||||
'CUBIC_MILLIMETER' => array('1.0e-9', 'mm³'),
|
||||
'CUBIC_YARD' => array(array('' => '0.0037854118', '/' => '231', '*' => '46656'), 'yd³'),
|
||||
'CUP_CANADA' => array('0.0002273045', 'c'),
|
||||
'CUP' => array('0.00025', 'c'),
|
||||
'CUP_US' => array(array('' => '0.0037854118', '/' => '16'), 'c'),
|
||||
'DECILITER' => array('0.0001', 'dl'),
|
||||
'DEKALITER' => array('0.001', 'dal'),
|
||||
'DRAM' => array(array('' => '0.0037854118', '/' => '1024'), 'dr'),
|
||||
'DRUM_US' => array('0.208197649', 'drum'),
|
||||
'DRUM' => array('0.2', 'drum'),
|
||||
'FIFTH' => array('0.00075708236', 'fifth'),
|
||||
'GALLON' => array('0.00454609', 'gal'),
|
||||
'GALLON_US_DRY' => array('0.0044048838', 'gal'),
|
||||
'GALLON_US' => array('0.0037854118', 'gal'),
|
||||
'GILL' => array(array('' => '0.00454609', '/' => '32'), 'gi'),
|
||||
'GILL_US' => array(array('' => '0.0037854118', '/' => '32'), 'gi'),
|
||||
'HECTARE_METER' => array('10000', 'ha m'),
|
||||
'HECTOLITER' => array('0.1', 'hl'),
|
||||
'HOGSHEAD' => array('0.28640367', 'hhd'),
|
||||
'HOGSHEAD_US' => array('0.2384809434', 'hhd'),
|
||||
'JIGGER' => array(array('' => '0.0037854118', '/' => '128', '*' => '1.5'), 'jigger'),
|
||||
'KILOLITER' => array('1', 'kl'),
|
||||
'LITER' => array('0.001', 'l'),
|
||||
'MEASURE' => array('0.0077', 'measure'),
|
||||
'MEGALITER' => array('1000', 'Ml'),
|
||||
'MICROLITER' => array('1.0e-9', 'µl'),
|
||||
'MILLILITER' => array('0.000001', 'ml'),
|
||||
'MINIM' => array(array('' => '0.00454609', '/' => '76800'), 'min'),
|
||||
'MINIM_US' => array(array('' => '0.0037854118','/' => '61440'), 'min'),
|
||||
'OUNCE' => array(array('' => '0.00454609', '/' => '160'), 'oz'),
|
||||
'OUNCE_US' => array(array('' => '0.0037854118', '/' => '128'), 'oz'),
|
||||
'PECK' => array('0.00909218', 'pk'),
|
||||
'PECK_US' => array('0.0088097676', 'pk'),
|
||||
'PINT' => array(array('' => '0.00454609', '/' => '8'), 'pt'),
|
||||
'PINT_US_DRY' => array(array('' => '0.0044048838', '/' => '8'), 'pt'),
|
||||
'PINT_US' => array(array('' => '0.0037854118', '/' => '8'), 'pt'),
|
||||
'PIPE' => array('0.49097772', 'pipe'),
|
||||
'PIPE_US' => array('0.4769618868', 'pipe'),
|
||||
'PONY' => array(array('' => '0.0037854118', '/' => '128'), 'pony'),
|
||||
'QUART_GERMANY' => array('0.00114504', 'qt'),
|
||||
'QUART_ANCIENT' => array('0.00108', 'qt'),
|
||||
'QUART' => array(array('' => '0.00454609', '/' => '4'), 'qt'),
|
||||
'QUART_US_DRY' => array(array('' => '0.0044048838', '/' => '4'), 'qt'),
|
||||
'QUART_US' => array(array('' => '0.0037854118', '/' => '4'), 'qt'),
|
||||
'QUART_UK' => array('0.29094976', 'qt'),
|
||||
'SHOT' => array(array('' => '0.0037854118', '/' => '128'), 'shot'),
|
||||
'STERE' => array('1', 'st'),
|
||||
'TABLESPOON' => array('0.000015', 'tbsp'),
|
||||
'TABLESPOON_UK' => array(array('' => '0.00454609', '/' => '320'), 'tbsp'),
|
||||
'TABLESPOON_US' => array(array('' => '0.0037854118', '/' => '256'), 'tbsp'),
|
||||
'TEASPOON' => array('0.000005', 'tsp'),
|
||||
'TEASPOON_UK' => array(array('' => '0.00454609', '/' => '1280'), 'tsp'),
|
||||
'TEASPOON_US' => array(array('' => '0.0037854118', '/' => '768'), 'tsp'),
|
||||
'YARD' => array(array('' => '176.6121729408', '/' => '231'), 'yd'),
|
||||
'STANDARD' => 'CUBIC_METER'
|
||||
);
|
||||
}
|
481
libs/Zend/Measure/Weight.php
Normal file
481
libs/Zend/Measure/Weight.php
Normal file
@ -0,0 +1,481 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Weight.php 9508 2008-05-23 10:56:41Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implement needed classes
|
||||
*/
|
||||
require_once 'Zend/Measure/Exception.php';
|
||||
require_once 'Zend/Measure/Abstract.php';
|
||||
require_once 'Zend/Locale.php';
|
||||
|
||||
/**
|
||||
* Class for handling weight conversions
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Measure
|
||||
* @subpackage Zend_Measure_Weigth
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Measure_Weight extends Zend_Measure_Abstract
|
||||
{
|
||||
const STANDARD = 'KILOGRAM';
|
||||
|
||||
const ARRATEL = 'ARRATEL';
|
||||
const ARTEL = 'ARTEL';
|
||||
const ARROBA_PORTUGUESE = 'ARROBA_PORTUGUESE';
|
||||
const ARROBA = 'ARROBA';
|
||||
const AS_ = 'AS_';
|
||||
const ASS = 'ASS';
|
||||
const ATOMIC_MASS_UNIT_1960 = 'ATOMIC_MASS_UNIT_1960';
|
||||
const ATOMIC_MASS_UNIT_1973 = 'ATOMIC_MASS_UNIT_1973';
|
||||
const ATOMIC_MASS_UNIT_1986 = 'ATOMIC_MASS_UNIT_1986';
|
||||
const ATOMIC_MASS_UNIT = 'ATOMIC_MASS_UNIT';
|
||||
const AVOGRAM = 'AVOGRAM';
|
||||
const BAG = 'BAG';
|
||||
const BAHT = 'BAHT';
|
||||
const BALE = 'BALE';
|
||||
const BALE_US = 'BALE_US';
|
||||
const BISMAR_POUND = 'BISMAR_POUND';
|
||||
const CANDY = 'CANDY';
|
||||
const CARAT_INTERNATIONAL = 'CARAT_INTERNATIONAL';
|
||||
const CARAT = 'CARAT';
|
||||
const CARAT_UK = 'CARAT_UK';
|
||||
const CARAT_US_1913 = 'CARAT_US_1913';
|
||||
const CARGA = 'CARGA';
|
||||
const CATTI = 'CATTI';
|
||||
const CATTI_JAPANESE = 'CATTI_JAPANESE';
|
||||
const CATTY = 'CATTY';
|
||||
const CATTY_JAPANESE = 'CATTY_JAPANESE';
|
||||
const CATTY_THAI = 'CATTY_THAI';
|
||||
const CENTAL = 'CENTAL';
|
||||
const CENTIGRAM = 'CENTIGRAM';
|
||||
const CENTNER = 'CENTNER';
|
||||
const CENTNER_RUSSIAN = 'CENTNER_RUSSIAN';
|
||||
const CHALDER = 'CHALDER';
|
||||
const CHALDRON = 'CHALDRON';
|
||||
const CHIN = 'CHIN';
|
||||
const CHIN_JAPANESE = 'CHIN_JAPANESE';
|
||||
const CLOVE = 'CLOVE';
|
||||
const CRITH = 'CRITH';
|
||||
const DALTON = 'DALTON';
|
||||
const DAN = 'DAN';
|
||||
const DAN_JAPANESE = 'DAN_JAPANESE';
|
||||
const DECIGRAM = 'DECIGRAM';
|
||||
const DECITONNE = 'DECITONNE';
|
||||
const DEKAGRAM = 'DEKAGRAM';
|
||||
const DEKATONNE = 'DEKATONNE';
|
||||
const DENARO = 'DENARO';
|
||||
const DENIER = 'DENIER';
|
||||
const DRACHME = 'DRACHME';
|
||||
const DRAM = 'DRAM';
|
||||
const DRAM_APOTHECARIES = 'DRAM_APOTHECARIES';
|
||||
const DYNE = 'DYNE';
|
||||
const ELECTRON = 'ELECTRON';
|
||||
const ELECTRONVOLT = 'ELECTRONVOLT';
|
||||
const ETTO = 'ETTO';
|
||||
const EXAGRAM = 'EXAGRAM';
|
||||
const FEMTOGRAM = 'FEMTOGRAM';
|
||||
const FIRKIN = 'FIRKIN';
|
||||
const FLASK = 'FLASK';
|
||||
const FOTHER = 'FOTHER';
|
||||
const FOTMAL = 'FOTMAL';
|
||||
const FUNT = 'FUNT';
|
||||
const FUNTE = 'FUNTE';
|
||||
const GAMMA = 'GAMMA';
|
||||
const GIGAELECTRONVOLT = 'GIGAELECTRONVOLT';
|
||||
const GIGAGRAM = 'GIGAGRAM';
|
||||
const GIGATONNE = 'GIGATONNE';
|
||||
const GIN = 'GIN';
|
||||
const GIN_JAPANESE = 'GIN_JAPANESE';
|
||||
const GRAIN = 'GRAIN';
|
||||
const GRAM = 'GRAM';
|
||||
const GRAN = 'GRAN';
|
||||
const GRANO = 'GRANO';
|
||||
const GRANI = 'GRANI';
|
||||
const GROS = 'GROS';
|
||||
const HECTOGRAM = 'HECTOGRAM';
|
||||
const HUNDRETWEIGHT = 'HUNDRETWEIGHT';
|
||||
const HUNDRETWEIGHT_US = 'HUNDRETWEIGHT_US';
|
||||
const HYL = 'HYL';
|
||||
const JIN = 'JIN';
|
||||
const JUPITER = 'JUPITER';
|
||||
const KATI = 'KATI';
|
||||
const KATI_JAPANESE = 'KATI_JAPANESE';
|
||||
const KEEL = 'KEEL';
|
||||
const KEG = 'KEG';
|
||||
const KILODALTON = 'KILODALTON';
|
||||
const KILOGRAM = 'KILOGRAM';
|
||||
const KILOGRAM_FORCE = 'KILOGRAM_FORCE';
|
||||
const KILOTON = 'KILOTON';
|
||||
const KILOTON_US = 'KILOTON_US';
|
||||
const KILOTONNE = 'KILOTONNE';
|
||||
const KIN = 'KIN';
|
||||
const KIP = 'KIP';
|
||||
const KOYAN = 'KOYAN';
|
||||
const KWAN = 'KWAN';
|
||||
const LAST_GERMANY = 'LAST_GERMANY';
|
||||
const LAST = 'LAST';
|
||||
const LAST_WOOL = 'LAST_WOOL';
|
||||
const LB = 'LB';
|
||||
const LBS = 'LBS';
|
||||
const LIANG = 'LIANG';
|
||||
const LIBRA_ITALIAN = 'LIBRE_ITALIAN';
|
||||
const LIBRA_SPANISH = 'LIBRA_SPANISH';
|
||||
const LIBRA_PORTUGUESE = 'LIBRA_PORTUGUESE';
|
||||
const LIBRA_ANCIENT = 'LIBRA_ANCIENT';
|
||||
const LIBRA = 'LIBRA';
|
||||
const LIVRE = 'LIVRE';
|
||||
const LONG_TON = 'LONG_TON';
|
||||
const LOT = 'LOT';
|
||||
const MACE = 'MACE';
|
||||
const MAHND = 'MAHND';
|
||||
const MARC = 'MARC';
|
||||
const MARCO = 'MARCO';
|
||||
const MARK = 'MARK';
|
||||
const MARK_GERMAN = 'MARK_GERMANY';
|
||||
const MAUND = 'MAUND';
|
||||
const MAUND_PAKISTAN = 'MAUND_PAKISTAN';
|
||||
const MEGADALTON = 'MEGADALTON';
|
||||
const MEGAGRAM = 'MEGAGRAM';
|
||||
const MEGATONNE = 'MEGATONNE';
|
||||
const MERCANTILE_POUND = 'MERCANTILE_POUND';
|
||||
const METRIC_TON = 'METRIC_TON';
|
||||
const MIC = 'MIC';
|
||||
const MICROGRAM = 'MICROGRAM';
|
||||
const MILLIDALTON = 'MILLIDALTON';
|
||||
const MILLIER = 'MILLIER';
|
||||
const MILLIGRAM = 'MILLIGRAM';
|
||||
const MILLIMASS_UNIT = 'MILLIMASS_UNIT';
|
||||
const MINA = 'MINA';
|
||||
const MOMME = 'MOMME';
|
||||
const MYRIAGRAM = 'MYRIAGRAM';
|
||||
const NANOGRAM = 'NANOGRAM';
|
||||
const NEWTON = 'NEWTON';
|
||||
const OBOL = 'OBOL';
|
||||
const OBOLOS = 'OBOLOS';
|
||||
const OBOLUS = 'OBOLUS';
|
||||
const OBOLOS_ANCIENT = 'OBOLOS_ANCIENT';
|
||||
const OBOLUS_ANCIENT = 'OBOLUS_ANCIENT';
|
||||
const OKA = 'OKA';
|
||||
const ONCA = 'ONCA';
|
||||
const ONCE = 'ONCE';
|
||||
const ONCIA = 'ONCIA';
|
||||
const ONZA = 'ONZA';
|
||||
const ONS = 'ONS';
|
||||
const OUNCE = 'OUNCE';
|
||||
const OUNCE_FORCE = 'OUNCE_FORCE';
|
||||
const OUNCE_TROY = 'OUNCE_TROY';
|
||||
const PACKEN = 'PACKEN';
|
||||
const PENNYWEIGHT = 'PENNYWEIGHT';
|
||||
const PETAGRAM = 'PETAGRAM';
|
||||
const PFUND = 'PFUND';
|
||||
const PICOGRAM = 'PICOGRAM';
|
||||
const POINT = 'POINT';
|
||||
const POND = 'POND';
|
||||
const POUND = 'POUND';
|
||||
const POUND_FORCE = 'POUND_FORCE';
|
||||
const POUND_METRIC = 'POUND_METRIC';
|
||||
const POUND_TROY = 'POUND_TROY';
|
||||
const PUD = 'PUD';
|
||||
const POOD = 'POOD';
|
||||
const PUND = 'PUND';
|
||||
const QIAN = 'QIAN';
|
||||
const QINTAR = 'QINTAR';
|
||||
const QUARTER = 'QUARTER';
|
||||
const QUARTER_US = 'QUARTER_US';
|
||||
const QUARTER_TON = 'QUARTER_TON';
|
||||
const QUARTERN = 'QUARTERN';
|
||||
const QUARTERN_LOAF = 'QUARTERN_LOAF';
|
||||
const QUINTAL_FRENCH = 'QUINTAL_FRENCH';
|
||||
const QUINTAL = 'QUINTAL';
|
||||
const QUINTAL_PORTUGUESE = 'QUINTAL_PORTUGUESE';
|
||||
const QUINTAL_SPAIN = 'QUINTAL_SPAIN';
|
||||
const REBAH = 'REBAH';
|
||||
const ROTL = 'ROTL';
|
||||
const ROTEL = 'ROTEL';
|
||||
const ROTTLE = 'ROTTLE';
|
||||
const RATEL = 'RATEL';
|
||||
const SACK = 'SACK';
|
||||
const SCRUPLE = 'SCRUPLE';
|
||||
const SEER = 'SEER';
|
||||
const SEER_PAKISTAN = 'SEER_PAKISTAN';
|
||||
const SHEKEL = 'SHEKEL';
|
||||
const SHORT_TON = 'SHORT_TON';
|
||||
const SLINCH = 'SLINCH';
|
||||
const SLUG = 'SLUG';
|
||||
const STONE = 'STONE';
|
||||
const TAEL = 'TAEL';
|
||||
const TAHIL_JAPANESE = 'TAHIL_JAPANESE';
|
||||
const TAHIL = 'TAHIL';
|
||||
const TALENT = 'TALENT';
|
||||
const TAN = 'TAN';
|
||||
const TECHNISCHE_MASS_EINHEIT = 'TECHNISCHE_MASS_EINHEIT';
|
||||
const TERAGRAM = 'TERAGRAM';
|
||||
const TETRADRACHM = 'TETRADRACHM';
|
||||
const TICAL = 'TICAL';
|
||||
const TOD = 'TOD';
|
||||
const TOLA = 'TOLA';
|
||||
const TOLA_PAKISTAN = 'TOLA_PAKISTAN';
|
||||
const TON_UK = 'TON_UK';
|
||||
const TON = 'TON';
|
||||
const TON_US = 'TON_US';
|
||||
const TONELADA_PORTUGUESE = 'TONELADA_PORTUGUESE';
|
||||
const TONELADA = 'TONELADA';
|
||||
const TONNE = 'TONNE';
|
||||
const TONNEAU = 'TONNEAU';
|
||||
const TOVAR = 'TOVAR';
|
||||
const TROY_OUNCE = 'TROY_OUNCE';
|
||||
const TROY_POUND = 'TROY_POUND';
|
||||
const TRUSS = 'TRUSS';
|
||||
const UNCIA = 'UNCIA';
|
||||
const UNZE = 'UNZE';
|
||||
const VAGON = 'VAGON';
|
||||
const YOCTOGRAM = 'YOCTOGRAM';
|
||||
const YOTTAGRAM = 'YOTTAGRAM';
|
||||
const ZENTNER = 'ZENTNER';
|
||||
const ZEPTOGRAM = 'ZEPTOGRAM';
|
||||
const ZETTAGRAM = 'ZETTAGRAM';
|
||||
|
||||
/**
|
||||
* Calculations for all weight units
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_units = array(
|
||||
'ARRATEL' => array('0.5', 'arratel'),
|
||||
'ARTEL' => array('0.5', 'artel'),
|
||||
'ARROBA_PORTUGUESE' => array('14.69', 'arroba'),
|
||||
'ARROBA' => array('11.502', '@'),
|
||||
'AS_' => array('0.000052', 'as'),
|
||||
'ASS' => array('0.000052', 'ass'),
|
||||
'ATOMIC_MASS_UNIT_1960' => array('1.6603145e-27', 'amu'),
|
||||
'ATOMIC_MASS_UNIT_1973' => array('1.6605655e-27', 'amu'),
|
||||
'ATOMIC_MASS_UNIT_1986' => array('1.6605402e-27', 'amu'),
|
||||
'ATOMIC_MASS_UNIT' => array('1.66053873e-27', 'amu'),
|
||||
'AVOGRAM' => array('1.6605402e-27', 'avogram'),
|
||||
'BAG' => array('42.63768278', 'bag'),
|
||||
'BAHT' => array('0.015', 'baht'),
|
||||
'BALE' => array('326.5865064', 'bl'),
|
||||
'BALE_US' => array('217.7243376', 'bl'),
|
||||
'BISMAR_POUND' => array('5.993', 'bismar pound'),
|
||||
'CANDY' => array('254', 'candy'),
|
||||
'CARAT_INTERNATIONAL' => array('0.0002', 'ct'),
|
||||
'CARAT' => array('0.0002', 'ct'),
|
||||
'CARAT_UK' => array('0.00025919564', 'ct'),
|
||||
'CARAT_US_1913' => array('0.0002053', 'ct'),
|
||||
'CARGA' => array('140', 'carga'),
|
||||
'CATTI' => array('0.604875', 'catti'),
|
||||
'CATTI_JAPANESE' => array('0.594', 'catti'),
|
||||
'CATTY' => array('0.5', 'catty'),
|
||||
'CATTY_JAPANESE' => array('0.6', 'catty'),
|
||||
'CATTY_THAI' => array('0.6', 'catty'),
|
||||
'CENTAL' => array('45.359237', 'cH'),
|
||||
'CENTIGRAM' => array('0.00001', 'cg'),
|
||||
'CENTNER' => array('50', 'centner'),
|
||||
'CENTNER_RUSSIAN' => array('100', 'centner'),
|
||||
'CHALDER' => array('2692.52', 'chd'),
|
||||
'CHALDRON' => array('2692.52', 'chd'),
|
||||
'CHIN' => array('0.5', 'chin'),
|
||||
'CHIN_JAPANESE' => array('0.6', 'chin'),
|
||||
'CLOVE' => array('3.175', 'clove'),
|
||||
'CRITH' => array('0.000089885', 'crith'),
|
||||
'DALTON' => array('1.6605402e-27', 'D'),
|
||||
'DAN' => array('50', 'dan'),
|
||||
'DAN_JAPANESE' => array('60', 'dan'),
|
||||
'DECIGRAM' => array('0.0001', 'dg'),
|
||||
'DECITONNE' => array('100', 'dt'),
|
||||
'DEKAGRAM' => array('0.01', 'dag'),
|
||||
'DEKATONNE' => array('10000', 'dat'),
|
||||
'DENARO' => array('0.0011', 'denaro'),
|
||||
'DENIER' => array('0.001275', 'denier'),
|
||||
'DRACHME' => array('0.0038', 'drachme'),
|
||||
'DRAM' => array(array('' => '0.45359237', '/' => '256'), 'dr'),
|
||||
'DRAM_APOTHECARIES' => array('0.0038879346', 'dr'),
|
||||
'DYNE' => array('1.0197162e-6', 'dyn'),
|
||||
'ELECTRON' => array('9.109382e-31', 'e−'),
|
||||
'ELECTRONVOLT' => array('1.782662e-36', 'eV'),
|
||||
'ETTO' => array('0.1', 'hg'),
|
||||
'EXAGRAM' => array('1.0e+15', 'Eg'),
|
||||
'FEMTOGRAM' => array('1.0e-18', 'fg'),
|
||||
'FIRKIN' => array('25.40117272', 'fir'),
|
||||
'FLASK' => array('34.7', 'flask'),
|
||||
'FOTHER' => array('979.7595192', 'fother'),
|
||||
'FOTMAL' => array('32.65865064', 'fotmal'),
|
||||
'FUNT' => array('0.4095', 'funt'),
|
||||
'FUNTE' => array('0.4095', 'funte'),
|
||||
'GAMMA' => array('0.000000001', 'gamma'),
|
||||
'GIGAELECTRONVOLT' => array('1.782662e-27', 'GeV'),
|
||||
'GIGAGRAM' => array('1000000', 'Gg'),
|
||||
'GIGATONNE' => array('1.0e+12', 'Gt'),
|
||||
'GIN' => array('0.6', 'gin'),
|
||||
'GIN_JAPANESE' => array('0.594', 'gin'),
|
||||
'GRAIN' => array('0.00006479891', 'gr'),
|
||||
'GRAM' => array('0.001', 'g'),
|
||||
'GRAN' => array('0.00082', 'gran'),
|
||||
'GRANO' => array('0.00004905', 'grano'),
|
||||
'GRANI' => array('0.00004905', 'grani'),
|
||||
'GROS' => array('0.003824', 'gros'),
|
||||
'HECTOGRAM' => array('0.1', 'hg'),
|
||||
'HUNDRETWEIGHT' => array('50.80234544', 'cwt'),
|
||||
'HUNDRETWEIGHT_US' => array('45.359237', 'cwt'),
|
||||
'HYL' => array('9.80665', 'hyl'),
|
||||
'JIN' => array('0.5', 'jin'),
|
||||
'JUPITER' => array('1.899e+27', 'jupiter'),
|
||||
'KATI' => array('0.5', 'kati'),
|
||||
'KATI_JAPANESE' => array('0.6', 'kati'),
|
||||
'KEEL' => array('21540.19446656', 'keel'),
|
||||
'KEG' => array('45.359237', 'keg'),
|
||||
'KILODALTON' => array('1.6605402e-24', 'kD'),
|
||||
'KILOGRAM' => array('1', 'kg'),
|
||||
'KILOGRAM_FORCE' => array('1', 'kgf'),
|
||||
'KILOTON' => array('1016046.9088', 'kt'),
|
||||
'KILOTON_US' => array('907184.74', 'kt'),
|
||||
'KILOTONNE' => array('1000000', 'kt'),
|
||||
'KIN' => array('0.6', 'kin'),
|
||||
'KIP' => array('453.59237', 'kip'),
|
||||
'KOYAN' => array('2419', 'koyan'),
|
||||
'KWAN' => array('3.75', 'kwan'),
|
||||
'LAST_GERMANY' => array('2000', 'last'),
|
||||
'LAST' => array('1814.36948', 'last'),
|
||||
'LAST_WOOL' => array('1981.29147216', 'last'),
|
||||
'LB' => array('0.45359237', 'lb'),
|
||||
'LBS' => array('0.45359237', 'lbs'),
|
||||
'LIANG' => array('0.05', 'liang'),
|
||||
'LIBRE_ITALIAN' => array('0.339', 'lb'),
|
||||
'LIBRA_SPANISH' => array('0.459', 'lb'),
|
||||
'LIBRA_PORTUGUESE' => array('0.459', 'lb'),
|
||||
'LIBRA_ANCIENT' => array('0.323', 'lb'),
|
||||
'LIBRA' => array('1', 'lb'),
|
||||
'LIVRE' => array('0.4895', 'livre'),
|
||||
'LONG_TON' => array('1016.0469088', 't'),
|
||||
'LOT' => array('0.015', 'lot'),
|
||||
'MACE' => array('0.003778', 'mace'),
|
||||
'MAHND' => array('0.9253284348', 'mahnd'),
|
||||
'MARC' => array('0.24475', 'marc'),
|
||||
'MARCO' => array('0.23', 'marco'),
|
||||
'MARK' => array('0.2268', 'mark'),
|
||||
'MARK_GERMANY' => array('0.2805', 'mark'),
|
||||
'MAUND' => array('37.3242', 'maund'),
|
||||
'MAUND_PAKISTAN' => array('40', 'maund'),
|
||||
'MEGADALTON' => array('1.6605402e-21', 'MD'),
|
||||
'MEGAGRAM' => array('1000', 'Mg'),
|
||||
'MEGATONNE' => array('1.0e+9', 'Mt'),
|
||||
'MERCANTILE_POUND' => array('0.46655', 'lb merc'),
|
||||
'METRIC_TON' => array('1000', 't'),
|
||||
'MIC' => array('1.0e-9', 'mic'),
|
||||
'MICROGRAM' => array('1.0e-9', '<27>g'),
|
||||
'MILLIDALTON' => array('1.6605402e-30', 'mD'),
|
||||
'MILLIER' => array('1000', 'millier'),
|
||||
'MILLIGRAM' => array('0.000001', 'mg'),
|
||||
'MILLIMASS_UNIT' => array('1.6605402e-30', 'mmu'),
|
||||
'MINA' => array('0.499', 'mina'),
|
||||
'MOMME' => array('0.00375', 'momme'),
|
||||
'MYRIAGRAM' => array('10', 'myg'),
|
||||
'NANOGRAM' => array('1.0e-12', 'ng'),
|
||||
'NEWTON' => array('0.101971621', 'N'),
|
||||
'OBOL' => array('0.0001', 'obol'),
|
||||
'OBOLOS' => array('0.0001', 'obolos'),
|
||||
'OBOLUS' => array('0.0001', 'obolus'),
|
||||
'OBOLOS_ANCIENT' => array('0.0005', 'obolos'),
|
||||
'OBOLUS_ANCIENT' => array('0.00057', 'obolos'),
|
||||
'OKA' => array('1.28', 'oka'),
|
||||
'ONCA' => array('0.02869', 'onca'),
|
||||
'ONCE' => array('0.03059', 'once'),
|
||||
'ONCIA' => array('0.0273', 'oncia'),
|
||||
'ONZA' => array('0.02869', 'onza'),
|
||||
'ONS' => array('0.1', 'ons'),
|
||||
'OUNCE' => array(array('' => '0.45359237', '/' => '16'), 'oz'),
|
||||
'OUNCE_FORCE' => array(array('' => '0.45359237', '/' => '16'), 'ozf'),
|
||||
'OUNCE_TROY' => array(array('' => '65.31730128', '/' => '2100'), 'oz'),
|
||||
'PACKEN' => array('490.79', 'packen'),
|
||||
'PENNYWEIGHT' => array(array('' => '65.31730128', '/' => '42000'), 'dwt'),
|
||||
'PETAGRAM' => array('1.0e+12', 'Pg'),
|
||||
'PFUND' => array('0.5', 'pfd'),
|
||||
'PICOGRAM' => array('1.0e-15', 'pg'),
|
||||
'POINT' => array('0.000002', 'pt'),
|
||||
'POND' => array('0.5', 'pond'),
|
||||
'POUND' => array('0.45359237', 'lb'),
|
||||
'POUND_FORCE' => array('0.4535237', 'lbf'),
|
||||
'POUND_METRIC' => array('0.5', 'lb'),
|
||||
'POUND_TROY' => array(array('' => '65.31730128', '/' => '175'), 'lb'),
|
||||
'PUD' => array('16.3', 'pud'),
|
||||
'POOD' => array('16.3', 'pood'),
|
||||
'PUND' => array('0.5', 'pund'),
|
||||
'QIAN' => array('0.005', 'qian'),
|
||||
'QINTAR' => array('50', 'qintar'),
|
||||
'QUARTER' => array('12.70058636', 'qtr'),
|
||||
'QUARTER_US' => array('11.33980925', 'qtr'),
|
||||
'QUARTER_TON' => array('226.796185', 'qtr'),
|
||||
'QUARTERN' => array('1.587573295', 'quartern'),
|
||||
'QUARTERN_LOAF' => array('1.81436948', 'quartern-loaf'),
|
||||
'QUINTAL_FRENCH' => array('48.95', 'q'),
|
||||
'QUINTAL' => array('100', 'q'),
|
||||
'QUINTAL_PORTUGUESE' => array('58.752', 'q'),
|
||||
'QUINTAL_SPAIN' => array('45.9', 'q'),
|
||||
'REBAH' => array('0.2855', 'rebah'),
|
||||
'ROTL' => array('0.5', 'rotl'),
|
||||
'ROTEL' => array('0.5', 'rotel'),
|
||||
'ROTTLE' => array('0.5', 'rottle'),
|
||||
'RATEL' => array('0.5', 'ratel'),
|
||||
'SACK' => array('165.10762268', 'sack'),
|
||||
'SCRUPLE' => array(array('' => '65.31730128', '/' => '50400'), 's'),
|
||||
'SEER' => array('0.933105', 'seer'),
|
||||
'SEER_PAKISTAN' => array('1', 'seer'),
|
||||
'SHEKEL' => array('0.01142', 'shekel'),
|
||||
'SHORT_TON' => array('907.18474', 'st'),
|
||||
'SLINCH' => array('175.126908', 'slinch'),
|
||||
'SLUG' => array('14.593903', 'slug'),
|
||||
'STONE' => array('6.35029318', 'st'),
|
||||
'TAEL' => array('0.03751', 'tael'),
|
||||
'TAHIL_JAPANESE' => array('0.03751', 'tahil'),
|
||||
'TAHIL' => array('0.05', 'tahil'),
|
||||
'TALENT' => array('30', 'talent'),
|
||||
'TAN' => array('50', 'tan'),
|
||||
'TECHNISCHE_MASS_EINHEIT' => array('9.80665', 'TME'),
|
||||
'TERAGRAM' => array('1.0e+9', 'Tg'),
|
||||
'TETRADRACHM' => array('0.014', 'tetradrachm'),
|
||||
'TICAL' => array('0.0164', 'tical'),
|
||||
'TOD' => array('12.70058636', 'tod'),
|
||||
'TOLA' => array('0.0116638125', 'tola'),
|
||||
'TOLA_PAKISTAN' => array('0.0125', 'tola'),
|
||||
'TON_UK' => array('1016.0469088', 't'),
|
||||
'TON' => array('1000', 't'),
|
||||
'TON_US' => array('907.18474', 't'),
|
||||
'TONELADA_PORTUGUESE' => array('793.15', 'tonelada'),
|
||||
'TONELADA' => array('919.9', 'tonelada'),
|
||||
'TONNE' => array('1000', 't'),
|
||||
'TONNEAU' => array('979', 'tonneau'),
|
||||
'TOVAR' => array('128.8', 'tovar'),
|
||||
'TROY_OUNCE' => array(array('' => '65.31730128', '/' => '2100'), 'troy oz'),
|
||||
'TROY_POUND' => array(array('' => '65.31730128', '/' => '175'), 'troy lb'),
|
||||
'TRUSS' => array('25.40117272', 'truss'),
|
||||
'UNCIA' => array('0.0272875', 'uncia'),
|
||||
'UNZE' => array('0.03125', 'unze'),
|
||||
'VAGON' => array('10000', 'vagon'),
|
||||
'YOCTOGRAM' => array('1.0e-27', 'yg'),
|
||||
'YOTTAGRAM' => array('1.0e+21', 'Yg'),
|
||||
'ZENTNER' => array('50', 'Ztr'),
|
||||
'ZEPTOGRAM' => array('1.0e-24', 'zg'),
|
||||
'ZETTAGRAM' => array('1.0e+18', 'Zg'),
|
||||
'STANDARD' => 'KILOGRAM'
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user