Sandaysoft

Support forum for Cumulus weather station software
It is currently Mon May 20, 2013 2:06 am
Please click here before posting. Help me to help you!
Useful Links: Cumulus FAQ • Enhancement requests • Wiki (documentation)
Please put your approximate location into your profile
Add your web site to the Cumulus user map
Vantage Pro2 users with firmware 3.00 should upgrade to fw 3.12 and Cumulus 1.9.4

All times are UTC




Post new topic Reply to topic  [ 66 posts ]  Go to page 1, 2, 3, 4, 5  Next
Author Message
 Post subject: Yearly Data Summary--Adding new fields
PostPosted: Mon Mar 14, 2011 12:20 am 
Offline

Joined: Fri Jan 01, 2010 9:40 pm
Posts: 60
Location: Calgary, Alberta, Canada
Weather Station: Davis VP2
Operating System: Windows 7
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/annualdata/datasummary.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,

_________________
Chris

http://the-vermin.ca/silversprings


Top
 Profile  
 
 Post subject: Re: Yearly Data Summary--Adding new fields
PostPosted: Mon Mar 14, 2011 7:38 am 
Offline
User avatar

Joined: Wed Mar 03, 2010 10:20 am
Posts: 299
Location: Brisbane, Australia
Weather Station: Vantage Pro2 w/ daytime FARS
Operating System: Windows Vista SP2
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.


Top
 Profile  
 
 Post subject: Re: Yearly Data Summary--Adding new fields
PostPosted: Mon Mar 14, 2011 11:22 am 
Offline
User avatar

Joined: Tue Jul 29, 2008 8:00 pm
Posts: 2001
Location: Thornhill, Dumfries, UK
Weather Station: WH1081
Operating System: Mac OSx & Win 7
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
Contact Me


Top
 Profile  
 
 Post subject: Re: Yearly Data Summary--Adding new fields
PostPosted: Mon Mar 14, 2011 3:10 pm 
Offline

Joined: Fri Jan 01, 2010 9:40 pm
Posts: 60
Location: Calgary, Alberta, Canada
Weather Station: Davis VP2
Operating System: Windows 7
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.

_________________
Chris

http://the-vermin.ca/silversprings


Top
 Profile  
 
 Post subject: Re: Yearly Data Summary--Adding new fields
PostPosted: Mon Mar 14, 2011 7:53 pm 
Offline
User avatar

Joined: Wed Mar 03, 2010 10:20 am
Posts: 299
Location: Brisbane, Australia
Weather Station: Vantage Pro2 w/ daytime FARS
Operating System: Windows Vista SP2
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.


Top
 Profile  
 
 Post subject: Re: Yearly Data Summary--Adding new fields
PostPosted: Mon Mar 14, 2011 8:44 pm 
Offline
User avatar

Joined: Tue Jul 29, 2008 8:00 pm
Posts: 2001
Location: Thornhill, Dumfries, UK
Weather Station: WH1081
Operating System: Mac OSx & Win 7
captzero wrote:
The js version was quick and dirty .....

:lol: :lol: :lol:

_________________
David
Contact Me


Top
 Profile  
 
 Post subject: Re: Yearly Data Summary--Adding new fields
PostPosted: Wed Jul 06, 2011 6:45 pm 
Offline

Joined: Tue Jun 24, 2008 9:43 pm
Posts: 182
Location: Maghull, nr Liverpool, UK
Weather Station: MyDEL WX2008 Mk2 Fine Offset
Operating System: XP and W7
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


Top
 Profile  
 
 Post subject: Re: Yearly Data Summary--Adding new fields
PostPosted: Mon Jul 11, 2011 7:28 pm 
Offline
User avatar

Joined: Tue Jul 29, 2008 8:00 pm
Posts: 2001
Location: Thornhill, Dumfries, UK
Weather Station: WH1081
Operating System: Mac OSx & Win 7
Phil

I'll update with pressure and get back to you

_________________
David
Contact Me


Top
 Profile  
 
 Post subject: Re: Yearly Data Summary--Adding new fields
PostPosted: Mon Jul 11, 2011 7:57 pm 
Offline
User avatar

Joined: Tue Jul 29, 2008 8:00 pm
Posts: 2001
Location: Thornhill, Dumfries, UK
Weather Station: WH1081
Operating System: Mac OSx & Win 7
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
Contact Me


Top
 Profile  
 
 Post subject: Re: Yearly Data Summary--Adding new fields
PostPosted: Tue Jul 19, 2011 9:08 am 
Online
User avatar

Joined: Wed Dec 16, 2009 2:32 am
Posts: 150
Location: Wairoa, Hawkes Bay. New Zealand.
Weather Station: La Crosse WS1081
Operating System: Windows XP, XP Pro & Win 7
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
Image


Top
 Profile  
 
 Post subject: Re: Yearly Data Summary--Adding new fields
PostPosted: Tue Jul 19, 2011 10:25 am 
Offline
User avatar

Joined: Tue Dec 09, 2008 1:37 pm
Posts: 1846
Location: Dudley, West Midlands, UK
Weather Station: None !
Operating System: XP SP3
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 !


Top
 Profile  
 
 Post subject: Re: Yearly Data Summary--Adding new fields
PostPosted: Tue Jul 19, 2011 10:30 am 
Online
User avatar

Joined: Wed Dec 16, 2009 2:32 am
Posts: 150
Location: Wairoa, Hawkes Bay. New Zealand.
Weather Station: La Crosse WS1081
Operating System: Windows XP, XP Pro & Win 7
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
Image


Top
 Profile  
 
 Post subject: Re: Yearly Data Summary--Adding new fields
PostPosted: Tue Jul 19, 2011 11:33 am 
Offline

Joined: Mon Aug 10, 2009 10:16 pm
Posts: 1797
Location: World...
Weather Station: No weather station
Operating System: No operating system
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 Oct 08, 2011 1:08 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Yearly Data Summary--Adding new fields
PostPosted: Tue Jul 19, 2011 11:55 am 
Online
User avatar

Joined: Wed Dec 16, 2009 2:32 am
Posts: 150
Location: Wairoa, Hawkes Bay. New Zealand.
Weather Station: La Crosse WS1081
Operating System: Windows XP, XP Pro & Win 7
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
Image


Top
 Profile  
 
 Post subject: Re: Yearly Data Summary--Adding new fields
PostPosted: Tue Jul 19, 2011 11:25 pm 
Offline
User avatar

Joined: Tue Dec 09, 2008 1:37 pm
Posts: 1846
Location: Dudley, West Midlands, UK
Weather Station: None !
Operating System: XP SP3
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:
$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:
   for ($i = 0; $i < count($label_items); $i++)  {
      if ($label_items[$i][3] == true) {
         $tablelayout .= '<li><a href="' . $_SERVER['PHP_SELF'] .'?year='.$tableYear .'&amp;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

_________________
Image
......................Imagine, what you will KNOW tomorrow !


Last edited by beteljuice on Wed Jul 20, 2011 2:12 pm, edited 1 time in total.

Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 66 posts ]  Go to page 1, 2, 3, 4, 5  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group