Page 6 of 55

Re: Yet Another Dayfile Reader (PHP)

Posted: Wed 05 Feb 2014 11:45 am
by laulau
Hi,
Beta release tested quickly this morning.
For some new items like "DP" i had the same warning message(Warning: number_format() expects parameter 1 to be double, string given in.... ) that i have had with "Windspeed" at some point.
In the code i had to replace

Code: Select all

number_format($thisValue,---
by

Code: Select all

number_format($thisValue * 1],----
(as you did in DoWind() line 638) in line 388,396,413,579 .
I guess that some values without decimal part are considered as string by number_format() function :idea:
I'll try to check it this evening.
It's strange that i'm the only one with this problem :o

Re: Yet Another Dayfile Reader (PHP)

Posted: Wed 05 Feb 2014 11:54 am
by mcrossley
Wouldn't it be better to re-cast the strings explicitly rather than relying on implicit conversion then multiplication by one?

Code: Select all

number_format((int) $thisValue, ---
or
number_format((float) $thisValue, ---

Re: Yet Another Dayfile Reader (PHP)

Posted: Wed 05 Feb 2014 12:22 pm
by Graham64
Laurent

You aren't the only one, I found the same error on the new items such as apparent temp and DP but couldn't see the solution.

I have tried Mark's suggestion and that has solved the problem.

Thanks

Re: Yet Another Dayfile Reader (PHP)

Posted: Wed 05 Feb 2014 1:09 pm
by Graham64
Beteljuice

Colour gradient - solar energy
My highest value for solar energy is approx 1160 and so most of the readings are white.
I have changed the 500 you used to 1300 and the gradients look better.

These values are difficult to believe in the current weather conditions, but don't forget that Bude (5 miles down the road) is officially the sunniest place in the UK.

Re: Yet Another Dayfile Reader (PHP)

Posted: Wed 05 Feb 2014 2:35 pm
by mikkimii
beteljuice wrote: To those who have graciously translated, there are a few more options now I'm afraid :shock:
Here is the Finnish (fi) translation module:

Code: Select all

                'fi' => array(
                    'daily' => 'Päivittäin', // drop-down table selector
                    'seasonal' => 'Vuodenajoittain', // drop-down table selector
                    'note' => array('Huom!','Keskeneräinen datatiedosto'),
                    'loading' => 'Hakee tiedostoa ...',
                    'fail' => 'DATAVIRHE !!!',
                    'total' => 'Σ',
                    'avg' => 'Keskim.',
                    'hi' => 'Korkein',
                    'lo' => 'Alin',
                    'dom' => 'Hallitseva', // short for dominant (wind direction)
                    'season_1' => '<img src="snowflake.png" height="22px" />Talvi', // previous Dec, Jan, Feb
                    'season_2' => '<img src="daffodil.png" height="22px" />Kevät', // Mar, Apr, May
                    'season_3' => '<img src="sun.png" height="22px" />Kesä', // Jun, Jul, Aug
                    'season_4' => '<img src="leaf.gif" height="22px" />Syksy', // Sep, Oct, Nov
                    'mn' => array('Tam', 'Hel', 'Maa', 'Huh', 'Tou', 'Kes', 'Hei', 'Elo', 'Syy', 'Lok', 'Mar', 'Jou'),
                    'dy' => array('Su','Ma','Ti','Ke','To','Pe','La'),
                    'compass_headings' => array('POH&nbsp;&#x2193;','KOI&nbsp;&#x2199;','IT&Auml;&nbsp;&#x2190;','KAA&nbsp;&#x2196;','ETE&nbsp;&#x2191;','LOU&nbsp;&#x2197;','L&Auml;N&nbsp;&#x2192;','LUO&nbsp;&#x2198;','POH&nbsp;&#x2193;'),
                    'maxtemp' => array('Korkein lämpö', 'Korkein lämpötila'),
                    'mintemp' => array('Alin lämpö', 'Alin lämpötila'),
                    'tdiff' => array('Lämpötilaero &deg', 'Lämpötilan vaihtelu &deg'),
                    'avgtemp' => array('Keskim. lämpö', 'Keskimääräinen lämpötila'),
                    'tappmax' => array('Korkein "tuntuu kuin"', 'Korkein "tuntuu kuin" lämpötila'),
                    'tappmin' => array('Alin "tuntuu kuin"', 'Alin "tuntuu kuin" lämpötila'),
                    'dpmax' => array('Korkein kastep.', 'Korkein kastepistelämpötila'),
                    'dpmin' => array('Alin kastep.', 'Alin kastepistelämpötila'),
                    'rhmax' => array('Korkein kosteus', 'Korkein kosteus %'),
                    'rhmin' => array('Alin kosteus', 'Alin kosteus %'),
                    'rainfall' => array('Sade', 'Sademäärä'),
                    'windspd' => array('Tuulen nopeus', 'Korkein keskituulen nopeus '),
                    'windgust' => array('Puuska', 'Korkein tuulenpuuska'),
                    'windrun' => array('Tuulen matka', 'Tuulen matka'),
                    'winddir' => array('Tuulen suunta', 'Hallitseva tuulen suunta'),
                    'baromax' => array('Korkein ilmanpaine', 'Korkein Ilmanpaine'),
                    'baromin' => array('Alin ilmanpaine', 'Alin Ilmanpaine'),
                    'HoursSun' => array('Auringonpaiste', 'Auringonpaistetunnit'),
                    'Solar' => array('Aurinkoenergia', 'Korkein aurinkoenergia W/m&sup2;'),
                    'HighUV' => array('UV Index', 'Korkein UV indeksi')
                ),

Re: Yet Another Dayfile Reader (PHP)

Posted: Wed 05 Feb 2014 6:28 pm
by nitrx
Latest (version 1.0 beta) Dutch translation (nl)

Code: Select all

 'nl' => array(
                    'daily' => 'Dagelijks', // drop-down table selector
                    'seasonal' => 'Seizoenen', // drop-down table selector
                    'note' => array('Let op','dataset is niet compleet.'),
                    'loading' => 'Ophalen van data ...',
                    'fail' => 'Data FOUT !!!',
                    'total' => '&#931;',
                    'avg' => 'Gem',
                    'hi' => 'Max',
                    'lo' => 'Min',
                    'dom' => 'Dom', // 'short' for dominant (wind direction)
                    'season_1' => '<img src="snowflake.png" height="22px" />Winter', // previous Dec, Jan, Feb
                    'season_2' => '<img src="daffodil.png" height="22px" />Lente', // Mar, Apr, May
                    'season_3' => '<img src="sun.png" height="22px" />Zomer', // Jun, Jul, Aug
                    'season_4' => '<img src="leaf.gif" height="22px" />Herfst', // Sep, Oct, Nov
                    'mn' => array('Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dec'),
                    'dy' => array('Zon','Maa','Din','Woe','Don','Vrij','Zat'),
                    'compass_headings' => array('N&nbsp;&#x2193;','NO&nbsp;&#x2199;','O&nbsp;&#x2190;','ZO&nbsp;&#x2196;','Z&nbsp;&#x2191;','ZW&nbsp;&#x2197;','W&nbsp;&#x2192;','NW&nbsp;&#x2198;','N&nbsp;&#x2193;'),
                    'maxtemp' => array('Max Temp', 'Maximum Temperatuur'),
                    'mintemp' => array('Min Temp', 'Minimum Temperatuur'),
                    'tdiff' => array('T&deg; Verschil', 'T&deg; Verschil'),
                    'avgtemp' => array('Gem Temp', 'Gemiddelde Temperatuur'),
                    'tappmax' => array('Max T&deg; App', 'Maximum Apparent Temperature'),
                    'tappmin' => array('Min T&deg; App', 'Minimum Apparent Temperature'),
                    'dpmax' => array('Max DP', 'Max Dauwpunt temperatuur'),
                    'dpmin' => array('Min DP', 'Min Dauwpunt temperatuur'),
                    'rhmax' => array('Max RV', 'Max Relatieve vochtigheid %'),
                    'rhmin' => array('Min RV', 'Min Relatieve vochtigheid %'),
                    'rainfall' => array('Neerslag', 'Neerslag'),
                    'windspd' => array('Windsnelheid', 'Hoogste Windsnelheid'),
                    'windgust' => array('Windvlaag', 'Hoogste Windvlaag'),
                    'windrun' => array('Wind Run', 'Wind Run'),
                    'winddir' => array('Windrichting', 'Dominante Windrichting'),
                    'baromax' => array('Baro Max', 'Luchtdruk - Max'),
                    'baromin' => array('Baro Min', 'Luchtdruk - Min'),
                    'HoursSun' => array('Zonneschijn', 'Zonuren'),
                    'Solar' => array('Zonne-energie', 'Zonne-energie W/m&sup2;'),
                    'HighUV' => array('UV Index', 'UV index')
                ),

Re: Yet Another Dayfile Reader (PHP)

Posted: Wed 05 Feb 2014 7:01 pm
by laulau
And the french one:

Code: Select all

                'fr' => array(
                    'daily' => 'Journalier', // drop-down table selector
                    'seasonal' => 'Saisonnier', // drop-down table selector
                    'note' => array('Note','Ensemble de donnée incomplet'),
                    'loading' => 'Lecture des données ...',
                    'fail' => 'Erreur donnée !!!',
                    'total' => '&#931;',
                    'avg' => 'Moy',
                    'hi' => 'Max',
                    'lo' => 'Min',
                    'dom' => 'Dom', // 'short' for dominant (wind direction)
                    'season_1' => '<img src="snowflake.png" height="22px" />Hiver', // previous Dec, Jan, Feb
                    'season_2' => '<img src="daffodil.png" height="22px" />Printemps', // Mar, Apr, May
                    'season_3' => '<img src="sun.png" height="22px" />Eté', // Jun, Jul, Aug
                    'season_4' => '<img src="leaf.gif" height="22px" />Automne', // Sep, Oct, Nov
                    'mn' => array('Jan', 'Fév', 'Mar', 'Avr', 'Mai', 'Juin', 'Juil', 'Août', 'Sept', 'Oct', 'Nov', 'Déc'),
                    'dy' => array('Dim','Lun','Mar','Mer','Jeu','Ven','Sam'),
                    'compass_headings' => array('N&nbsp;&#x2193;','NE&nbsp;&#x2199;','E&nbsp;&#x2190;','SE&nbsp;&#x2196;','S&nbsp;&#x2191;','SW&nbsp;&#x2197;','W&nbsp;&#x2192;','NW&nbsp;&#x2198;','N&nbsp;&#x2193;'),
                    'maxtemp' => array('Temp max', 'Température maximum'),
                    'mintemp' => array('Temp min', 'Température minimum'),
                    'tdiff' => array('T&deg; Diff', 'T&deg; Différence'),
                    'avgtemp' => array('Temp moy', 'Température moyenne'),
                    'tappmax' => array('T&deg; App max', 'Température apparente maximum'),
                    'tappmin' => array('T&deg; App min', 'Température apparente minimum'),
                    'dpmax' => array('Td max', 'Point de rosée maximum'),
                    'dpmin' => array('Td min', 'Point de rosée minimum'),
                    'rhmax' => array('HR max', 'Humidité relative maximum %'),
                    'rhmin' => array('HR min', 'Humidité relative minimum %'),
                    'rainfall' => array('Pluie', 'Pluie'),
                    'windspd' => array('Vent', 'Vitesse du vent maximum'),
                    'windgust' => array('Rafale', 'Rafale maximum'),
                    'windrun' => array('Distance', 'Distance parcourue journalière'),
                    'winddir' => array('Direction', 'Direction vent dominant'),
                    'baromax' => array('Baro Max', 'Pression atmosphérique maximum'),
                    'baromin' => array('Baro Min', 'Pression atmosphérique minimum'),
                    'HoursSun' => array('Ensoleillement', 'Durée ensoleillement'),
                    'Solar' => array('Solaire', 'Energie solaire W/m&sup2;'),
                    'HighUV' => array('Index UV', 'Index UV')
                ),

Re: Yet Another Dayfile Reader (PHP)

Posted: Wed 05 Feb 2014 10:56 pm
by JTS
Thank you, Beteljuice and others for their contribution. Excellent bit of work.

Neil

Re: Yet Another Dayfile Reader (PHP)

Posted: Wed 05 Feb 2014 11:04 pm
by nossis
Graham64 wrote:Beteljuice

Colour gradient - solar energy
My highest value for solar energy is approx 1160 and so most of the readings are white.
I have changed the 500 you used to 1300 and the gradients look better.

These values are difficult to believe in the current weather conditions, but don't forget that Bude (5 miles down the road) is officially the sunniest place in the UK.
Thanks for that... I changed mine to 1500. Being a novice at coding I was wondering where that setting was.

Barry

Re: Yet Another Dayfile Reader (PHP)

Posted: Wed 05 Feb 2014 11:17 pm
by nossis
UV gradient to match Australian conditions

Code: Select all

                gradient('96CC00','FFFF00',14), // 1.6 - 3.0
                gradient('FFFF00','FF9928',30), // 3.0 - 6.0
                gradient('FF9928','FF0000',20), // 6.0 - 8.0
                gradient('FF0000','BF00BF',30), // 8.0 - 11.0
					gradient('BF00BF','7D76AD',50)  // 11.0 - 16.0
When it hits the top colors would be good I think to have the text white. Since I am not that clever haven't figured that one out yet..
Yep we get plenty of sun http://members.iinet.net.au/~nossis/weather/basic.php

Barry

Re: Yet Another Dayfile Reader (PHP)

Posted: Wed 05 Feb 2014 11:55 pm
by beteljuice
Update including ALL of the above now available (beta v1.1)

Many thanks to all the 'translators' (mikkimii your 'posted' characters are corrupt, I've lifted from your site)

@ ALL
Please remember I don't have my own database to look at, nor do I know how sanitized yours may be.
If there is a displayed or computed problem, or you have done a mod you want to share, PLEASE give a link so that everyone else can see the problem / result(s) - thank you.

Re: Yet Another Dayfile Reader (PHP)

Posted: Thu 06 Feb 2014 12:21 pm
by Graham64
Beteljuice

beta 1.1
The solar colour gradient isn't working correctly. You'll need to change the values in line 1600 to 1300.

Code: Select all

    if ($val > 1300) $val = 1300;
See http://poundstockpacket.org.uk/weather/basic700.php 2013 shows the Solar range.

Although I'm not sure that 1300 is enough for some parts of the world.

Thanks for the lurking CSS file - very useful

Re: Yet Another Dayfile Reader (PHP)

Posted: Thu 06 Feb 2014 1:16 pm
by joewith
Thanks Graham64 for steering me in the right direction on this fix. :clap: :clap: :clap:
Although I'm not sure that 1300 is enough for some parts of the world.
Yes, for my website I had to change 1300 to 1500.
See mine at http://www.tigerdenweb.com/tigerdenwx/d ... sic750.php or http://www.tigerdenweb.com/tigerdenwx/d ... /basic.php

The only problem so far that I have encountered on my page so far is that I have no color on my BaroMax and BaroMin pages and haven't been able to figure out the reason as of yet :( .

Thanks BeetleJuice :clap: :clap: :clap: for a great implementation.

Re: Yet Another Dayfile Reader (PHP)

Posted: Thu 06 Feb 2014 1:23 pm
by water01
Upgraded to Beta 1.1.

All working here http://www.dmjsystems.co.uk/weather/basic.php

Re: Yet Another Dayfile Reader (PHP)

Posted: Thu 06 Feb 2014 2:22 pm
by nossis
Hi joewith

I believe your chasing line 47

Code: Select all

'baro' => (isset($SITE['uomBaro']) ? substr($SITE['uomBaro'], 1) : 'hPa')
change the 'hPa' to whatever your day file data is in, I suspect inhg maybe? Then the colors should work out.
Although I am no coder so I could be off.
Although that area sorted me out for wind as I was getting odd values until I changed it to suit what data format my wind was in... knots.

Barry