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 4017) - 17 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

Yearly Data Summary--Adding new fields

Discussion and support for 3rd-party (non-Sandaysoft) tools for Cumulus
silverview
Posts: 61
Joined: Fri 01 Jan 2010 9:40 pm
Weather Station: Davis VP2
Operating System: Windows 10
Location: Calgary, Alberta, Canada
Contact:

Yearly Data Summary--Adding new fields

Post by silverview »

I have been playing around with the annual data summary. I would like to add summaries for windrun, windchill, and sunshine hours. I have tried to edit both the readDayfile.php and readDayfile.js using the following: ['sunhours','Sunshine','Hours of Sunshine',true],

I'm having the following problems:

I'm not sure what to put in the first element for the system variable . I'm just guessing when I use sunhours, windchill and windrun. Is there a list of the variables which correspond to each entry in the dayfile.txt?

Using what I have shown above, when I check the resulting web page, there is a button labeled Sunshine, a question mark above the table instead of Hours of Sunshine, and the values in the table are those from Max Temp. http://www.the-vermin.ca/silversprings/ ... mmary.html

Apparently there is more to it than just adding one line to the readDayfile script. I know other users have been able to customize the information that is being displayed, but I'm not able to figure it out. Any help would be appreciated.

Thanks,
captzero
Posts: 363
Joined: Wed 03 Mar 2010 10:20 am
Weather Station: Vantage Pro2 w/ daytime FARS
Operating System: Windows 10
Location: Brisbane, Australia
Contact:

Re: Yearly Data Summary--Adding new fields

Post by captzero »

Hi Chris,

I modified mine to display wind run, hi / lo pressure but deleted avg temp and min/max as displayed here: http://www.brisbaneliveweather.com/annual.php

I'm using the javascript version so I edited my readDayfile.js file with notepad ++ to look like this:
http://www.brisbaneliveweather.com/readDayfile.js

To add Rain Rate for example....
add this
['rainrate','Rain Rate','Daily Rain Rate (mm/hr)',true],

'rainrate' names the variable, 'Rain Rate' labels the button, and 'Daily Rain Rate (mm/hr)' is what is displayed above the table.

Then I had to add this line:
break;case'rainrate':tablelayout+=label_items[3][2];dayfilecol=12;

dayfilecol=12 points to the column number in the dayfile.txt file. (The first column in the dayfile.txt file is the 'date' column and is number 0, so Rain Rate in the dayfile.txt file is column 13, but 12 in the readDayfile.js )

To display a 'zero value' for the Rain Rate, I also modified this line and added:

if((parseFloat(wd_data[dayfilecol])==0)&&(dayfilecol==14||dayfilecol==1||dayfilecol==12)){$(data_cell).addClass('zerovalue');}}

Have a look at my readDayfile.js and have a play around and experiment. You should be able to add Sunshine Hours easy enough. Don't forget to make a back up of any files you are modifying, just in case.

I hope this helps.
Dan

http://www.brisbaneliveweather.com




A man with a thermometer always knows the temperature. A man with two thermometers, not so sure.
User avatar
daj
Posts: 2041
Joined: Tue 29 Jul 2008 8:00 pm
Weather Station: WH1081
Operating System: Pi & MX
Location: SW Scotland
Contact:

Re: Yearly Data Summary--Adding new fields

Post by daj »

I actually just realised that the scripts I included in the pack are slightly 'minified' so all the whitespace is removed making it very difficult to read and modify. I should upload full versions :oops:
David
kippfordweather.uk
Cumulus MX & Raspberry Pi
silverview
Posts: 61
Joined: Fri 01 Jan 2010 9:40 pm
Weather Station: Davis VP2
Operating System: Windows 10
Location: Calgary, Alberta, Canada
Contact:

Re: Yearly Data Summary--Adding new fields

Post by silverview »

Thanks Dan and David,

Dan, I had looked at your readDayfile previously when I was trying to figure this out. It was considerably different than the readDayfile I was attempting to edit, so I assumed that it had something to do with having a .js table in a .php page. That should give you an idea of the knowledge level I am dealing with here.

However, with the help of your explanation, I will have another look.
captzero
Posts: 363
Joined: Wed 03 Mar 2010 10:20 am
Weather Station: Vantage Pro2 w/ daytime FARS
Operating System: Windows 10
Location: Brisbane, Australia
Contact:

Re: Yearly Data Summary--Adding new fields

Post by captzero »

silverview wrote:something to do with having a .js table in a .php page
Thats true. David hadn't released his php version when I tried this but I am slowly converting my site to php. The js version was quick and dirty and works well so I left it as it was.
Dan

http://www.brisbaneliveweather.com




A man with a thermometer always knows the temperature. A man with two thermometers, not so sure.
User avatar
daj
Posts: 2041
Joined: Tue 29 Jul 2008 8:00 pm
Weather Station: WH1081
Operating System: Pi & MX
Location: SW Scotland
Contact:

Re: Yearly Data Summary--Adding new fields

Post by daj »

captzero wrote:The js version was quick and dirty .....
:lol: :lol: :lol:
David
kippfordweather.uk
Cumulus MX & Raspberry Pi
philcdav
Posts: 244
Joined: Tue 24 Jun 2008 9:43 pm
Weather Station: MyDEL WX2008 Mk2 Fine Offset
Operating System: XP and W7
Location: Maghull, nr Liverpool, UK
Contact:

Re: Yearly Data Summary--Adding new fields

Post by philcdav »

Hi guys.

have been trialling the summary and it works great on my site using the js. script ..

http://www.philcdav.webspace.virginmedi ... mmary.html

What i hoped to do was use the modified script to include pressure.

I replaced the script with Dans mod. but it failed to work at all, just gave blank fields.

Help please
Phil - G0DOR
User avatar
daj
Posts: 2041
Joined: Tue 29 Jul 2008 8:00 pm
Weather Station: WH1081
Operating System: Pi & MX
Location: SW Scotland
Contact:

Re: Yearly Data Summary--Adding new fields

Post by daj »

Phil

I'll update with pressure and get back to you
David
kippfordweather.uk
Cumulus MX & Raspberry Pi
User avatar
daj
Posts: 2041
Joined: Tue 29 Jul 2008 8:00 pm
Weather Station: WH1081
Operating System: Pi & MX
Location: SW Scotland
Contact:

Re: Yearly Data Summary--Adding new fields

Post by daj »

Phil

Question -- you wanting Max or Min pressure for each day? Also, the pressure stored in the dayfile is Sea Level (just so you know!)
David
kippfordweather.uk
Cumulus MX & Raspberry Pi
User avatar
JennyLeez
Posts: 314
Joined: Wed 16 Dec 2009 2:32 am
Weather Station: La Crosse WS3083
Operating System: Windows XP, Win7 & Win 10
Location: Wairoa, Hawkes Bay. New Zealand.
Contact:

Re: Yearly Data Summary--Adding new fields

Post by JennyLeez »

Hi David,

Well I have mucked around until blue in face but I aint smart enough.
Please how can I add another row to add more labels.
I have this so far. But as you see they over lap :(
http://wairoa.net/weather/datasummary.php
Many thanks for your help
Jenny
Wairoa, Hawkes Bay, New Zealand Weather Station:
http://wairoa.net/weather/index.htm
Cumulus Topsites:
http://cumulussites.net/
Image
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: Yearly Data Summary--Adding new fields

Post by beteljuice »

You have two different css files to edit ;)

weathermain.css - shadowed-border - width: 850px (increase to suit)

datasummary.css - table_container - width: 840px (increase to suit)
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
JennyLeez
Posts: 314
Joined: Wed 16 Dec 2009 2:32 am
Weather Station: La Crosse WS3083
Operating System: Windows XP, Win7 & Win 10
Location: Wairoa, Hawkes Bay. New Zealand.
Contact:

Re: Yearly Data Summary--Adding new fields

Post by JennyLeez »

beteljuice wrote:You have two different css files to edit ;)

weathermain.css - shadowed-border - width: 850px (increase to suit)

datasummary.css - table_container - width: 840px (increase to suit)
Correct but this will only fit them across in one row. I want to add more labels so I need two rows please.
Thanks for help so far :)
Wairoa, Hawkes Bay, New Zealand Weather Station:
http://wairoa.net/weather/index.htm
Cumulus Topsites:
http://cumulussites.net/
Image
gemini06720
Posts: 1700
Joined: Mon 10 Aug 2009 10:16 pm
Weather Station: No weather station
Operating System: No operating system
Location: World...

Re: Yearly Data Summary--Adding new fields

Post by gemini06720 »

JennyLeez wrote:Please how can I add another row to add more labels.
Jenny, is this what you are looking for: Annual Weather Data Summary - I also have this stand-alone PHP script: Annual Weather Data Summary
Last edited by gemini06720 on Sat 08 Oct 2011 1:08 pm, edited 1 time in total.
User avatar
JennyLeez
Posts: 314
Joined: Wed 16 Dec 2009 2:32 am
Weather Station: La Crosse WS3083
Operating System: Windows XP, Win7 & Win 10
Location: Wairoa, Hawkes Bay. New Zealand.
Contact:

Re: Yearly Data Summary--Adding new fields

Post by JennyLeez »

gemini06720 wrote:
JennyLeez wrote:Please how can I add another row to add more labels.
Jenny, is this what you are looking for: Annual Weather Data Summary - I also have this stand-alone PHP script: Annual Weather Data Summary
Yes thats it. Lots of labels on more than 1 row.
Can Davids readDayfile.php be written so I may do this please.
I will attach it.
many thanks for your help :)
You do not have the required permissions to view the files attached to this post.
Wairoa, Hawkes Bay, New Zealand Weather Station:
http://wairoa.net/weather/index.htm
Cumulus Topsites:
http://cumulussites.net/
Image
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: Yearly Data Summary--Adding new fields

Post by beteljuice »

The beteljuice suggests ...

Where the humble <br /> is inserted is a cosmetic rather than logical decision ie. some button 'labels' will be long - some short, so doing a simple count (say 6 labels / line) won't necessarily look good.

You already have a "data available" array which contains field names, label names and a flag to create the button.

Why not create an additional flag to create 'a new line' following that button ?
Example: (Edit: a REMark in the middle of an array won't work :oops: )

Code: Select all

$label_items = array(
		array('maxtemp','Max Temp','Maximum Temperature',true, false),
		array('mintemp','Min Temp','Minimum Temperature',true, false),
		array('avgtemp','Avg Temp','Average Temperature',true, false),
		array('minmaxt','Min/Max Temp','Min / Max Temperature',true, false),
		array('rainfall','Rainfall','Daily Rainfall',true, false),
		array('rainrate','Rain Rate','Daily Rain Rate (mm/hr)',true, true),
		array('maxpres','Max Pressure','Maximum Sea Level Pressure',true, false),
		array('minpres','Min Pressure','Minimum Sea Level Pressure',true, false),		
		array('windgust','Wind Gust','Highest Wind Gust',true, false),
		array('windspeed','Wind Speed','Highest Average Wind Speed',true, false),
		array('windrun','Wind Run','Daily Wind Run',true, false) );
Then add a line of code to make the menu construct look like this:

Code: Select all

	for ($i = 0; $i < count($label_items); $i++)  {
		if ($label_items[$i][3] == true) {
			$tablelayout .= '<li><a href="' . $_SERVER['PHP_SELF'] .'?year='.$tableYear .'&data=' . $label_items[$i][0] . '">' . $label_items[$i][1] . '</a></li>';
         if($label_items[$i][4] == true) {$tablelayout .= '<br />';}  // Line break check
		}
	}
Should work, but I've got a few things wrong lately :o
Last edited by beteljuice on Wed 20 Jul 2011 2:12 pm, edited 1 time in total.
Image
......................Imagine, what you will KNOW tomorrow !
Post Reply