Thread: CVS: phpweather/output pw_text.php,1.9,1.10 pw_text_da.php,1.3,1.4 pw...
Brought to you by:
iridium
From: Max H. <ir...@us...> - 2002-05-12 15:08:27
|
Update of /cvsroot/phpweather/phpweather/output In directory usw-pr-cvs1:/tmp/cvs-serv31482 Modified Files: pw_text.php pw_text_da.php pw_text_en.php pw_text_hu.php pw_text_no.php Log Message: Added heat index, thanks to David Kjellquist Index: pw_text.php =================================================================== RCS file: /cvsroot/phpweather/phpweather/output/pw_text.php,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- pw_text.php 29 Mar 2002 00:38:19 -0000 1.9 +++ pw_text.php 12 May 2002 15:08:24 -0000 1.10 @@ -16,7 +16,7 @@ * @version $Id$ */ class pw_text extends base_object { - + /** * The strings used in the translation are stored here. * @@ -34,7 +34,7 @@ * @var phpweather $weather */ var $weather = null; - + /** * Constructor. * @@ -795,7 +795,15 @@ $this->properties['mark_end'] . ' °F') . '.'; return $output; } - + function print_pretty_heatindex($heatindex) { + extract($heatindex); + $output = $this->strings['heatindex'] . + $this->pref_units($this->properties['mark_begin'] . $heatindex_c . + $this->properties['mark_end'] . ' °C', + $this->properties['mark_begin'] . $heatindex_f . + $this->properties['mark_end'] . ' °F') . '.'; + return $output; + } function print_pretty_clouds($clouds) { if (empty($clouds[0]) || $clouds[0]['condition'] == 'CLR' || @@ -1043,13 +1051,21 @@ } /**************************** + * Heatindex * + ****************************/ + if (!in_array('heatindex', $this->properties['exclude']) && + !empty($heatindex)) { + $output['heatindex'] = $this->print_pretty_heatindex($heatindex); + } + + /**************************** * Altimeter (pressure) * ****************************/ if (!in_array('altimeter', $this->properties['exclude']) && !empty($altimeter)) { $output['altimeter'] = $this->print_pretty_altimeter($altimeter); } - + /************************** * Relative humidity * **************************/ @@ -1057,14 +1073,14 @@ !empty($rel_humidity)) { $output['rel_humidity'] = $this->print_pretty_rel_humidity($rel_humidity); } - + /******************* * Cloudgroups * *******************/ if (!in_array('clouds', $this->properties['exclude'])) { $output['clouds'] = $this->print_pretty_clouds($clouds); } - + /****************** * Visibility * ******************/ @@ -1072,7 +1088,7 @@ !empty($visibility)) { $output['visibility'] = $this->print_pretty_visibility($visibility); } - + /********************* * Precipitation * *********************/ @@ -1080,7 +1096,7 @@ !empty($precipitation)) { $output['precip'] = $this->print_pretty_precipitation($precipitation); } - + /******************************** * Min and max temperatures * ********************************/ @@ -1088,8 +1104,8 @@ !empty($temp_min_max)) { $output['temp_min_max'] = $this->print_pretty_temp_min_max($temp_min_max); } - - + + /************************** * Runway information * **************************/ @@ -1097,7 +1113,7 @@ !empty($runway)) { $output['runway'] = $this->print_pretty_runway($runway); } - + /*********************** * Present weather * ***********************/ @@ -1105,15 +1121,15 @@ !empty($weather)) { $output['weather'] = $this->print_pretty_weather($weather); } - + /* * This is where we make the HTML output. */ return '<!-- Generated by PHP Weather ' . $this->version . " -->\n" . implode("\n", $output); } - - + + /** * Just get the time of the last report. * @@ -1125,7 +1141,7 @@ $data = $this->weather->decode_metar(); return gmdate('H:i \U\T\C', $data['time']); } - + /** * Extract some value from the metar. * @@ -1143,8 +1159,8 @@ return $data[$index]; } } - - + + /** * Makes a short weather-report in a table. * @@ -1154,7 +1170,7 @@ function print_table() { // We use our own weather-object. $data = $this->weather->decode_metar(); - + /* This doesn't work yet... $location = $data['location']; @@ -1162,17 +1178,17 @@ $date = $this->print_pretty_time($data['time']); $wind = $this->print_pretty_wind($data['wind']); - + $temperature = $this->print_pretty_temperature($data['temperature']); $pressure = $this->print_pretty_altimeter($data['altimeter']); $humidity = $this->print_pretty_rel_humidity($data['rel_humidity']); - + if ($this->properties['orientation'] == 'vertical') { - + } else { - + echo '<table border="1">'; echo "\n <tr>\n"; echo ' <th>' . $this->strings['location'] . "</th>\n"; Index: pw_text_da.php =================================================================== RCS file: /cvsroot/phpweather/phpweather/output/pw_text_da.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- pw_text_da.php 24 Mar 2002 19:18:16 -0000 1.3 +++ pw_text_da.php 12 May 2002 15:08:24 -0000 1.4 @@ -97,6 +97,7 @@ $this->strings['inHg'] = ' inHg'; $this->strings['rel_humidity'] = 'Den relative luftfugtigheden var '; $this->strings['windchill'] = 'Temperaturen, inklusiv afkølingsfaktoren, var '; + $this->strings['heatindex'] = 'The heat index was '; $this->strings['cloud_group_beg'] = 'Der var '; $this->strings['cloud_group_end'] = '.'; $this->strings['cloud_clear'] = 'Himlen var %sskyfri%s.'; Index: pw_text_en.php =================================================================== RCS file: /cvsroot/phpweather/phpweather/output/pw_text_en.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- pw_text_en.php 24 Mar 2002 17:25:48 -0000 1.3 +++ pw_text_en.php 12 May 2002 15:08:24 -0000 1.4 @@ -99,6 +99,7 @@ $this->strings['inHg'] = ' inHg'; $this->strings['rel_humidity'] = 'The relative humidity was '; $this->strings['windchill'] = 'The temperature including windchill was '; + $this->strings['heatindex'] = 'The heat index was '; $this->strings['cloud_group_beg'] = 'There were '; $this->strings['cloud_group_end'] = '.'; $this->strings['cloud_clear'] = 'The sky was %sclear%s.'; Index: pw_text_hu.php =================================================================== RCS file: /cvsroot/phpweather/phpweather/output/pw_text_hu.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- pw_text_hu.php 28 Mar 2002 15:50:14 -0000 1.7 +++ pw_text_hu.php 12 May 2002 15:08:24 -0000 1.8 @@ -107,6 +107,7 @@ $this->strings['inHg'] = ' inHg'; $this->strings['rel_humidity'] = 'A relatív páratartalom '; $this->strings['windchill'] = 'A hõérzet '; + $this->strings['heatindex'] = 'The heat index was '; $this->strings['cloud_group_beg'] = 'Az égbolton'; $this->strings['cloud_group_end'] = ' magasságban.'; $this->strings['cloud_clear'] = 'Az égbolt %sfelhõtlen%s volt.'; Index: pw_text_no.php =================================================================== RCS file: /cvsroot/phpweather/phpweather/output/pw_text_no.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- pw_text_no.php 26 Mar 2002 18:44:18 -0000 1.3 +++ pw_text_no.php 12 May 2002 15:08:24 -0000 1.4 @@ -98,6 +98,7 @@ $this->strings['inHg'] = ' inHg'; $this->strings['rel_humidity'] = 'Den relative fuktigheten var '; $this->strings['windchill'] = 'Temperaturen, med vindfaktor, var '; + $this->strings['heatindex'] = 'The heat index was '; $this->strings['cloud_group_beg'] = 'Det var '; $this->strings['cloud_group_end'] = '.'; $this->strings['cloud_clear'] = 'Himmelen var %sclear%s.'; |