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 4018) - 28 March 2024

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 drop-down menus to 2030)

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

AnnualDataSummary PHP

Discussion and support for 3rd-party (non-Sandaysoft) tools for Cumulus
KevinF
Posts: 71
Joined: Sat 14 Apr 2012 5:01 pm
Weather Station: WMR200
Operating System: XP SP3
Location: Lancashire

Re: AnnualDataSummary PHP

Post by KevinF »

Kiwi? That's good shoe polish! :lol:
BCJKiwi
Posts: 1255
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: AnnualDataSummary PHP

Post by BCJKiwi »

KevinF wrote:Kiwi? That's good shoe polish! :lol:
Just like most things from New Zealand!
gemini06720
Posts: 1700
Joined: Mon 10 Aug 2009 10:16 pm
Weather Station: No weather station
Operating System: No operating system
Location: World...

Re: AnnualDataSummary PHP

Post by gemini06720 »

BCJKiwi wrote:Ray, you know who I am as we have exchanged emails. Those are my real initials plus an indication of where in the world I am. I trust you know what a Kiwi is and where it comes from...
Indeed, Mr. B - I found the exchanges we had ... association now completes... ;)

The only thing I know about kiwis is that I have stopped eating them (for the same reason mentioned below)... :mrgreen:
BCJKiwi wrote:Just like most things from New Zealand!
I used to enjoy the New Zealand lamb but now find it tasteless ... that is why I pay a bit more money and get my lamb from an island producer (ie: Vancouver Island, British Columbia, Canada)... :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: AnnualDataSummary PHP

Post by beteljuice »

Maintaining legibility especially in the vertical (column) plane for a 'twinned' data entry has proved interesting.

Although I think temperatures in F would be tight, and comparing say high / low pressure would break the cell formating.

The beteljuice attempt using BCJkiwi 'buttons' and Ron's (nitrix) data.
Edit: Out of date link removed
Last edited by beteljuice on Thu 31 Jan 2019 1:14 am, edited 2 times in total.
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
mcrossley
Posts: 12694
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: AnnualDataSummary PHP

Post by mcrossley »

Hmm, personally I find these double entries too hard to read, I don't think the slash makes it any easier, a space/double space may be better.
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: AnnualDataSummary PHP

Post by beteljuice »

Nice idea, but somehow it feels 'uncomfortable' .. Edit: old link removed

... and again with eg. deg, F would become even more confusing - I think any kind of 'double-entry' would have to be judiciously considered upon it's unique output.
Last edited by beteljuice on Thu 31 Jan 2019 4:07 pm, edited 3 times in total.
Image
......................Imagine, what you will KNOW tomorrow !
BCJKiwi
Posts: 1255
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: AnnualDataSummary PHP

Post by BCJKiwi »

Well perhaps you can see why I decided to concatenate the double columns into one.

12.3/23.4
12.3/23.4
12.3/23.4
12.3/23.4

12.3 / 23.4
12.3 / 23.4
12.3 / 23.4
12.3 / 23.4

12.3 23.4
12.3 23.4
12.3 23.4
12.3 23.4

| 12.3 | 23.4 |
| 12.3 | 23.4 |
| 12.3 | 23.4 |
| 12.3 | 23.4 | - if you have a table with borders.

Layout does not really work here as the BBS strips out extra spaces but I guess you get the idea.

"you pays your money and you takes your choice"
gemini06720
Posts: 1700
Joined: Mon 10 Aug 2009 10:16 pm
Weather Station: No weather station
Operating System: No operating system
Location: World...

Re: AnnualDataSummary PHP

Post by gemini06720 »

Indeed Mark, the double entries are very difficult to read for most people - I had some double entries months ago when I first installed the original script - then I got some comments from my users/visitors as the double entries, because the font size had to be reduced (to fit within the same space) were quite difficult to read (many of my users are 50+) - thus, I re-wrote the original script, added all the tags available from Cumulus, and deactivated all double entries. I have not received any comments from my 'audience'... ;)
BCJKiwi
Posts: 1255
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: AnnualDataSummary PHP

Post by BCJKiwi »

Back to the new year rollover - Oh dear not yet quite right.
We do need to -1 day.
Have looked in detail at what is on the hoster.
It is the 23/11/2012 here in NZ
The current file shows a last modified time stamp of of 23/11/2012 12:00:00 a.m.
Cumulus (well, Windows 7) shows the exact same time stamp.
The data is for the 22nd.

The best solution I could come up with that should work regardless of the rollover time is :-

Code: Select all

// was a year passed in the URL?  If not use meterological date year from time stamp of dayfile.txt
	if (isset($_GET['year'])) {
		$tableYear=$_GET['year'];
	} else {
		if(date("m", filemtime($dayfile)) == 1 && date("d", filemtime($dayfile)) ==1) {
			$tableYear = date("Y", filemtime($dayfile)) -1 ;
			} else {
			$tableYear = date("Y", filemtime($dayfile)) ;
			}
		}
i.e. if the mod date of the file is the first day of the year use the previous year.
User avatar
mcrossley
Posts: 12694
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: AnnualDataSummary PHP

Post by mcrossley »

I have tried adding some column banding to my page, I think this helps particularly with the 'double column format?
http://weather.wilmslowastro.com/datasummary.php
BCJKiwi
Posts: 1255
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: AnnualDataSummary PHP

Post by BCJKiwi »

Agreed, a significant improvement.

The issue for me with the original script was that all the columns are the same width and with the data centred there is no way to intuitively know which columns are a pair. The column headers being right aligned did not help either.
This became more annoying once most pages had double columns.

Your solution resolves this. However I would like to have the paired columns' data closer together than the non-paired columns and am not sure how complicated that would be to do. If it was relatively simple to identify and style differently alternate columns in the double column setup, then a number of options arise,
A vertical border either side of the pair.
More padding on the left of the right column and on the right of the left column.

Much food for thought.
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: AnnualDataSummary PHP

Post by beteljuice »

However I would like to have the paired columns' data closer together than the non-paired columns and am not sure how complicated that would be to do. If it was relatively simple to identify and style differently alternate columns in the double column setup
It is relatively straightforward to either overide or declare a (new) class / style so that eg. the 2nd (right) column of the pair was left justified. The existing cell padding would leave a differential gap.

In the tests I posted you will notice that this technique was used to center justify the headers over 'dual entry' columns.
Image
......................Imagine, what you will KNOW tomorrow !
sfws
Posts: 1183
Joined: Fri 27 Jul 2012 11:29 am
Weather Station: Chas O, Maplin N96FY, N25FR
Operating System: rPi 3B+ with Buster (full)

Re: AnnualDataSummary PHP

Post by sfws »

BCJKiwi wrote:Back to the new year rollover - Oh dear not yet quite right.
I've posted in https://cumulus.hosiene.co.uk/viewtopic.php?f=18&t=6640 an update on year rollover - including a comparison of the PHP version you developed in this thread and the PHP version you've linked to from the Wiki. Could be a difference in our time zones issue or an error on my part, but one seemed on your 1 January to try to display 2013 before it was available, but all is right now its 2 January for you.

I edited the Wiki yesterday, and moved the bit I inserted to directly after your subsequent insert, trying to complement your style. I have put some explanation of my changes in https://cumulus.hosiene.co.uk/viewtopic.php?f=18&t=8690 following on from the experiences noted there of someone trying to implement the JavaScript version.
BCJKiwi
Posts: 1255
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: AnnualDataSummary PHP

Post by BCJKiwi »

This year rollover date fix (Posted 5 posts above this) survived the new Year and worked as expected.
BCJKiwi wrote:Back to the new year rollover - Oh dear not yet quite right.
We do need to -1 day.
Have looked in detail at what is on the hoster.
It is the 23/11/2012 here in NZ
The current file shows a last modified time stamp of of 23/11/2012 12:00:00 a.m.
Cumulus (well, Windows 7) shows the exact same time stamp.
The data is for the 22nd.

The best solution I could come up with that should work regardless of the rollover time is :-

Code: Select all

// was a year passed in the URL?  If not use meterological date year from time stamp of dayfile.txt
	if (isset($_GET['year'])) {
		$tableYear=$_GET['year'];
	} else {
		if(date("m", filemtime($dayfile)) == 1 && date("d", filemtime($dayfile)) ==1) {
			$tableYear = date("Y", filemtime($dayfile)) -1 ;
			} else {
			$tableYear = date("Y", filemtime($dayfile)) ;
			}
		}
i.e. if the mod date of the file is the first day of the year use the previous year.
User avatar
dazza1223
Posts: 860
Joined: Sun 25 Jan 2015 8:41 pm
Weather Station: Davis Vantage Pro 2 plus
Operating System: Raspberry pi 4 (4gb)
Location: Worthing
Contact:

Re: AnnualDataSummary PHP

Post by dazza1223 »

sorry but i got the sql one ive tryed setting this up but all im geting is this

http://www.davisworthing.co.uk/datasummary.php



--------------------------------------------------------


in the php log it dumping a lote off erros

[Wed Jan 30 20:52:24.337677 2019] [:error] [pid 11360] [client 92.27.85.131:62392] PHP Notice: Undefined index: maxRainRate in /home/pi/usb/website/datasummary.php on line 223, referer: http://www.davisworthing.co.uk/index.php
[Wed Jan 30 20:52:24.337725 2019] [:error] [pid 11360] [client 92.27.85.131:62392] PHP Notice: Undefined index: maxRainRate in /home/pi/usb/website/datasummary.php on line 223, referer: http://www.davisworthing.co.uk/index.php
[Wed Jan 30 20:52:24.337918 2019] [:error] [pid 11360] [client 92.27.85.131:62392] PHP Notice: Undefined index: highAvgWspeed in /home/pi/usb/website/datasummary.php on line 224, referer: http://www.davisworthing.co.uk/index.php
[Wed Jan 30 20:52:24.338089 2019] [:error] [pid 11360] [client 92.27.85.131:62392] PHP Notice: Undefined index: highAvgWspeed in /home/pi/usb/website/datasummary.php on line 224, referer: http://www.davisworthing.co.uk/index.php
[Wed Jan 30 20:52:24.338145 2019] [:error] [pid 11360] [client 92.27.85.131:62392] PHP Notice: Undefined index: highWindGust in /home/pi/usb/website/datasummary.php on line 225, referer: http://www.davisworthing.co.uk/index.php
[Wed Jan 30 20:52:24.338174 2019] [:error] [pid 11360] [client 92.27.85.131:62392] PHP Notice: Undefined index: highWindGust in /home/pi/usb/website/datasummary.php on line 225, referer: http://www.davisworthing.co.uk/index.php
[Wed Jan 30 20:52:24.339662 2019] [:error] [pid 11360] [client 92.27.85.131:62392] PHP Notice: Undefined index: totWindRun in /home/pi/usb/website/datasummary.php on line 226, referer: http://www.davisworthing.co.uk/index.php
[Wed Jan 30 20:52:24.340554 2019] [:error] [pid 11360] [client 92.27.85.131:62392] PHP Notice: Undefined index: totWindRun in /home/pi/usb/website/datasummary.php on line 226, referer: http://www.davisworthing.co.uk/index.php
[Wed Jan 30 20:52:24.340821 2019] [:error] [pid 11360] [client 92.27.85.131:62392] PHP Notice: Undefined index: domWindDir in /home/pi/usb/website/datasummary.php on line 227, referer: http://www.davisworthing.co.uk/index.php
[Wed Jan 30 20:52:24.341032 2019] [:error] [pid 11360] [client 92.27.85.131:62392] PHP Notice: Undefined index: domWindDir in /home/pi/usb/website/datasummary.php on line 227, referer: http://www.davisworthing.co.uk/index.php
[Wed Jan 30 20:52:24.341096 2019] [:error] [pid 11360] [client 92.27.85.131:62392] PHP Notice: Undefined index: maxPress in /home/pi/usb/website/datasummary.php on line 228, referer: http://www.davisworthing.co.uk/index.php
[Wed Jan 30 20:52:24.342065 2019] [:error] [pid 11360] [client 92.27.85.131:62392] PHP Notice: Undefined index: maxPress in /home/pi/usb/website/datasummary.php on line 228, referer: http://www.davisworthing.co.uk/index.php
[Wed Jan 30 20:52:24.342356 2019] [:error] [pid 11360] [client 92.27.85.131:62392] PHP Notice: Undefined index: minPress in /home/pi/usb/website/datasummary.php on line 229, referer: http://www.davisworthing.co.uk/index.php
[Wed Jan 30 20:52:24.342971 2019] [:error] [pid 11360] [client 92.27.85.131:62392] PHP Notice: Undefined index: minPress in /home/pi/usb/website/datasummary.php on line 229, referer: http://www.davisworthing.co.uk/index.php
[Wed Jan 30 20:52:24.343132 2019] [:error] [pid 11360] [client 92.27.85.131:62392] PHP Notice: Undefined index: HighSolarRad in /home/pi/usb/website/datasummary.php on line 231, referer: http://www.davisworthing.co.uk/index.php
[Wed Jan 30 20:52:24.343172 2019] [:error] [pid 11360] [client 92.27.85.131:62392] PHP Notice: Undefined index: HighSolarRad in /home/pi/usb/website/datasummary.php on line 231, referer: http://www.davisworthing.co.uk/index.php
[Wed Jan 30 20:52:24.343949 2019] [:error] [pid 11360] [client 92.27.85.131:62392] PHP Notice: Undefined index: totalEvap in /home/pi/usb/website/datasummary.php on line 233, referer: http://www.davisworthing.co.uk/index.php
[Wed Jan 30 20:52:24.344079 2019] [:error] [pid 11360] [client 92.27.85.131:62392] PHP Notice: Undefined index: totalEvap in /home/pi/usb/website/datasummary.php on line 233, referer: http://www.davisworthing.co.uk/index.php
[Wed Jan 30 20:52:24.344120 2019] [:error] [pid 11360] [client 92.27.85.131:62392] PHP Notice: Undefined index: HeatDegDays in /home/pi/usb/website/datasummary.php on line 234, referer: http://www.davisworthing.co.uk/index.php
[Wed Jan 30 20:52:24.344184 2019] [:error] [pid 11360] [client 92.27.85.131:62392] PHP Notice: Undefined index: HeatDegDays in /home/pi/usb/website/datasummary.php on line 234, referer: http://www.davisworthing.co.uk/index.php
[Wed Jan 30 20:52:24.344218 2019] [:error] [pid 11360] [client 92.27.85.131:62392] PHP Notice: Undefined index: CoolDegDays in /home/pi/usb/website/datasummary.php on line 235, referer: http://www.davisworthing.co.uk/index.php
[Wed Jan 30 20:52:24.344249 2019] [:error] [pid 11360] [client 92.27.85.131:62392] PHP Notice: Undefined index: CoolDegDays in /home/pi/usb/website/datasummary.php on line 235, referer: http://www.davisworthing.co.uk/index.php
[Wed Jan 30 20:52:24.484430 2019] [:error] [pid 11360] [client 92.27.85.131:62392] PHP Notice: Undefined variable: dataset in /home/pi/usb/website/datasummary.php on line 1072, referer: http://www.davisworthing.co.uk/index.php
:bash:
Have fun and keep learning

dazza :D

https://www.davisworthing.co.uk

Image
Post Reply