Welcome to the Cumulus Support forum.

Latest Cumulus MX release 3.6.10 (build 3086) - 24 June 2020 (please see important announcement regarding releases since 3.5.0)
Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of the NOAA report and Snow Index drop-down menus to 2030)

See the Wiki to download the software or click on the Downloads link in the Forum Banner.

Yet Another Dayfile Reader (PHP)

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

Post Reply
User avatar
laulau
Posts: 637
Joined: Tue 13 Oct 2009 10:52 pm
Weather Station: WeatherDuino Pro2
Operating System: Win 7
Location: Meyenheim, Alsace, FR
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post 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
Laurent

Image

User avatar
mcrossley
Posts: 6587
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Buster Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post 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, ---

Graham64
Posts: 74
Joined: Mon 23 Aug 2010 5:04 pm
Weather Station: Davis Vantage Pro 2
Operating System: Windows XP
Location: Cornwall, England
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post 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

Graham64
Posts: 74
Joined: Mon 23 Aug 2010 5:04 pm
Weather Station: Davis Vantage Pro 2
Operating System: Windows XP
Location: Cornwall, England
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post 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.

mikkimii
Posts: 42
Joined: Fri 23 Mar 2012 3:17 pm
Weather Station: Davis VP2
Operating System: Windows 7 x64 Pro
Location: Vilppula, Finland

Re: Yet Another Dayfile Reader (PHP)

Post 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')
                ),
Br,
Mika
Image

User avatar
nitrx
Posts: 1297
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post 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')
                ),

User avatar
laulau
Posts: 637
Joined: Tue 13 Oct 2009 10:52 pm
Weather Station: WeatherDuino Pro2
Operating System: Win 7
Location: Meyenheim, Alsace, FR
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post 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')
                ),
Laurent

Image

JTS
Posts: 22
Joined: Mon 23 Jan 2012 9:14 am
Weather Station: Davis Vantage Vue
Operating System: Windows 7
Location: High Wych, Herts
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by JTS »

Thank you, Beteljuice and others for their contribution. Excellent bit of work.

Neil

nossis
Posts: 68
Joined: Wed 28 Nov 2012 6:12 am
Weather Station: Station closed
Operating System: none at present
Location: No fixed Address

Re: Yet Another Dayfile Reader (PHP)

Post 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
Barry
Station Closed (Travelling around Australia)

nossis
Posts: 68
Joined: Wed 28 Nov 2012 6:12 am
Weather Station: Station closed
Operating System: none at present
Location: No fixed Address

Re: Yet Another Dayfile Reader (PHP)

Post 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
Barry
Station Closed (Travelling around Australia)

User avatar
beteljuice
Posts: 2950
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: ex XP SP3 - now W10 laptop grr
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Post 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.
Image
......................Imagine, what you will KNOW tomorrow !

Graham64
Posts: 74
Joined: Mon 23 Aug 2010 5:04 pm
Weather Station: Davis Vantage Pro 2
Operating System: Windows XP
Location: Cornwall, England
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post 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

User avatar
joewith
Posts: 29
Joined: Fri 18 May 2012 4:33 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 10 Pro
Location: Aurora, Colorado, USA
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post 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.

water01
Posts: 1913
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: WH1081
Operating System: Windows 10 64bit
Location: Burnham-on-Sea
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by water01 »

Upgraded to Beta 1.1.

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

nossis
Posts: 68
Joined: Wed 28 Nov 2012 6:12 am
Weather Station: Station closed
Operating System: none at present
Location: No fixed Address

Re: Yet Another Dayfile Reader (PHP)

Post 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
Barry
Station Closed (Travelling around Australia)

Post Reply