Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4019) - 03 April 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

Yet Another Dayfile Reader (PHP)

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

Moderator: daj

BCJKiwi
Posts: 1256
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by BCJKiwi »

This was my 'fix' for southern hemisphere seasons (have not yet worked out how to do this automatically standard stuff didn't work and have not had a chance to dig deper);

Code: Select all

// Northern Hemisphere
/*
    $tablelayout .= '<th colspan="3" style="border-right: 2px solid black; text-align: center; font-size: 180%;">'.$translit[$lang]['season_1'].'</th>';
    $tablelayout .= '<th colspan="3" style="border-right: 2px solid black; text-align: center; font-size: 180%;">'.$translit[$lang]['season_2'].'</th>';
    $tablelayout .= '<th colspan="3" style="border-right: 2px solid black; text-align: center; font-size: 180%;">'.$translit[$lang]['season_3'].'</th>';
    $tablelayout .= '<th colspan="3" style="text-align: center; font-size: 180%;">'.$translit[$lang]['season_4'].'</th>';
*/
// Southern Hemisphere

    $tablelayout .= '<th colspan="3" style="border-right: 2px solid black; text-align: center; font-size: 180%;">'.$translit[$lang]['season_3'].'</th>';
    $tablelayout .= '<th colspan="3" style="border-right: 2px solid black; text-align: center; font-size: 180%;">'.$translit[$lang]['season_4'].'</th>';
    $tablelayout .= '<th colspan="3" style="border-right: 2px solid black; text-align: center; font-size: 180%;">'.$translit[$lang]['season_1'].'</th>';
    $tablelayout .= '<th colspan="3" style="text-align: center; font-size: 180%;">'.$translit[$lang]['season_2'].'</th>';

    $tablelayout .= "\n</tr>";
and I also added a space between;
height="22px" />
and
Winter
(and the other seasons of course) to 'improve' the presentation of the icon relative to the text.
Also here is a .png version of leaf just so they are all the same file type ;)
You do not have the required permissions to view the files attached to this post.
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
Final experiment
HoursSun: It is valid for this to be zero for the day so I think it should not be in the $zero_as_null array
winddir: I have changed my wind speed and direction values to null for Oct 2013 and only the first two days of Nov. These are correctly displayed as blanks. However, as expected, the winddir for 3rd to 12th Nov are shown as N because of the Cumulus bug. Perhaps you could put a note in the programme about having to change winddir to null for dates before build 1087.
See http://poundstockpacket.org.uk/weather/basic700.php
Incomplete data note: Would it be possible to only have this displayed if there is incomplete date on tha page?

This really is an excellent programme, I am learning a lot - thanks
nossis
Posts: 89
Joined: Wed 28 Nov 2012 6:12 am
Weather Station: Davis Vantage Pro 2
Operating System: Win 10
Location: Perth AU
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by nossis »

The "Try adding 'evt' to the $zero_as_null array and see if it works as expected." sorts it out.
I have been saved from hours of trial and error learning.
Thanks :D
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Post by beteljuice »

@ jdc

Line 717/1143: the 'Incomplete Data' bar is #DDD. (plus text formatting - I'll work on it)
Line 870: there is a cell 'zerovalue' . December, on the Seasonal view. - for a reason, 'dims' Dec to illustrate part of previous year ;)
Line 860: the 2px borders for Seasonal are 'black' (plus text formatting - I'll work on it)

@ BCJKiwi

I decided against 'auto hemisphere' - $season_1 etc. wouldn't make sense.

@Graham64

"HoursSun: It is valid for this to be zero for the day so I think it should not be in the $zero_as_null array"
As stated - It is a personal choice whether to use $SANITIZE and it's options dependent upon your local situation. It's a best guess workaround.
"winddir: ...." - incomplete logic from the beteljuice, I can fix it ..
"Incomplete data note: ..." That's the way I started it, but it's just too awkward to keep a 'flag' on when you get to the year averages and summaries.

@ ALL

Bug in Summaries for showing * for incomplete data.
Going to to a tricky one to fix - might just give up :roll:

Seems I still have a "To Do" list .....
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
laulau
Posts: 678
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 »

French "tranlit" section

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', 'Zéro traité comme nul !'),
                    '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'),
                    'evt' => array('EVT', 'Evapotranspiration'),
                    'heatday' => array('DJU+', 'Excédent degrés-jours'),
                    'coolday' => array('DJU-', 'Déficit degrés-jours')
                ),
Laurent

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 »

Expirement translation in Dutch (nl)

'nl' => array(
'daily' => 'Dagelijks', // drop-down table selector
'seasonal' => 'Seizoenen', // drop-down table selector
'note' => array('Let op','dataset is niet compleet.', 'Zeros treated as null !'),
'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; gevoel', 'Max gevoelsmatige temperatuur'),
'tappmin' => array('Min T&deg; gevoel', 'Min gevoelsmatige temperatuur'),
'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'),
'evt' => array('EVT', 'Evapotranspiratie'),
'Graaddag' => array('Graaddag', 'Graaddag'),
'Koeldag' => array('Koeldag', 'Koeldag')
),
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Post by beteljuice »

@ Ron

'note' => array('Let op','dataset is niet compleet.', 'Zeros treated as null !'),

'Graaddag' => array('Graaddag', 'Graaddag'),
'Koeldag' => array('Koeldag', 'Koeldag')

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

'Zeros treated as Null' hmm zero isn't equal null ?? LauLau hasn't translated this sentence too

I will correct it sorry just awake ;)
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 »

@Betel do you mean every 0 value is treated as a blank ??

edit hmm I do this

invalid, null, non valid Dutch ongeldig

correct translation in Dutch (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.', '0 waarde behandeld als ongeldig !'),
                    '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; gevoel', 'Max gevoelsmatige temperatuur'),
                    'tappmin' => array('Min T&deg; gevoel', 'Min gevoelsmatige temperatuur'),
                    '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'),
                    'evt' => array('EVT', 'Evapotranspiratie'),
                    'heatday' => array('Graaddag', 'Graaddag'),
                    'coolday' => array('Koeldag', 'Koeldag')
                ),
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Post by beteljuice »

@ Ron
@Betel do you mean every 0 value is treated as a blank ??
Yes ... for that particular dataset.

Consider eg.

the average of 5, 0, 10 = (15 / 3) = 5
the minimum = 0

but ..

the average of 5, 10 = (15 / 2) = 7.5
the minimum = 5

Does your head in :bash:
Image
......................Imagine, what you will KNOW tomorrow !
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 »

beteljuice wrote:@ Ron
@Betel do you mean every 0 value is treated as a blank ??
Yes ... for that particular dataset.

Consider eg.

the average of 5, 0, 10 = (15 / 3) = 5
the minimum = 0

but ..

the average of 5, 10 = (15 / 2) = 7.5
the minimum = 5

Does your head in :bash:
Nice mathematics :geek:
User avatar
laulau
Posts: 678
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 »

@ Ron

Did you really read my post from this morning ??
'note' => array('Note','Ensemble de donnée incomplet', 'Zéro traité comme nul !'),
:o
Perhaps 'Zéro traité comme invalide' is more comprehensible when you're just awake :lol:
Laurent

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 »

@laulau
I looked in the source of an old file on my PC :shock: sorry need more coffee :mrgreen:
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Post by beteljuice »

Please Release me, let me go :lol:

Release .... Release .... Release ....

Yup - It's finally all yours !

ALL files have updated / cleaned up / tweaked.

Download on first page ..... https://cumulus.hosiene.co.uk/viewtopic.php?f=14&t=11397

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

@Betel I think there is an error in line 214 of readfile

Code: Select all

 '<span class="meterTxt">' . round($thisValue, $decimals) . '</span></div><b></b';
should be

Code: Select all

 '<span class="meterTxt">' . round($thisValue, $decimals) . '</span></div><b></b'>;
or am I sleeping again.. :?
Post Reply