diff options
author | Marcin Zelent <zelent.marcin@gmail.com> | 2018-03-16 17:53:32 +0100 |
---|---|---|
committer | Marcin Zelent <zelent.marcin@gmail.com> | 2018-03-16 17:53:32 +0100 |
commit | 1ab2b90b02705e206680b5428bf1fbaec6438132 (patch) | |
tree | 8ee964fdf84ff49c22ac6449a178da9d1e67eeb0 /src/AppBundle/Utils/Aqi.php | |
parent | ed01011dfb563e7d8ab13b6a0718eed7bf857880 (diff) |
Removed old files.
Diffstat (limited to 'src/AppBundle/Utils/Aqi.php')
-rw-r--r-- | src/AppBundle/Utils/Aqi.php | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/src/AppBundle/Utils/Aqi.php b/src/AppBundle/Utils/Aqi.php deleted file mode 100644 index 1b324a8..0000000 --- a/src/AppBundle/Utils/Aqi.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php -/** - * Created by PhpStorm. - * User: andy - * Date: 11/30/17 - * Time: 11:27 AM - * - * - */ - -Namespace AppBundle\Utils; - -class Aqi { - public function calculateAQI($gasName, $concentration, $table) { - $bpLow = 1; - $bpHi = 2; - $bpLowIndex = 1; - $bpHiIndex = 1; - - $arr = $table ->{$gasName} ->{'breakpoints'}; - foreach ($arr as $index => $value) { - if ($value <= $concentration && $table->{$gasName}->{'breakpoints'}[$index + 1] >= $concentration) { - $bpLow = $value; - $bpLowIndex = $index; - } - - if ($value >= $concentration && $table->{$gasName}->{'breakpoints'}[$index - 1] <= $concentration) { - $bpHi = $value; - $bpHiIndex = $index; - } - - }; - - - - $airQualityIndex = (($table->{$gasName}->{'aq'}[$bpHiIndex] - $table->{$gasName}->{'aq'}[$bpLowIndex]) / ($bpHi - $bpLow)) * ($concentration - $bpLow) + $table->{$gasName}->{'aq'}[$bpLowIndex]; - - return $airQualityIndex; - - } -} - -?>
\ No newline at end of file |