Please read the posts in the Announcements section about the current status of Cumulus development now that I have retired

Please read this post before posting

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3043 Jan 20 2017. See this post for download

Yearly Data Summary--Adding new fields

Discussion and support for 3rd-party (non-Sandaysoft) tools for Cumulus
hdmax
Posts: 38
Joined: Fri Jul 15, 2011 5:15 pm
Weather Station: Davis Vantage Pro 2
Operating System: Windows Vista
Location: Ohio

Re: Yearly Data Summary--Adding new fields

Postby hdmax » Mon Aug 22, 2011 6:57 pm

Thank you Ray;
I am using godaddy, and e-rice for my website. Not sure what I have as far as PHP, or Java. I do know that I need/want help in making my weather site look good.

On a side note, my home page I have a link to radar, and forecast, (At least they were links) For some reason the forecast link quit working with a mouse click, but still works on my droid phone touch screen. I just added my web address to my sig, but just in case it doen't work, here it is. http://www.sixmileturn-weather.com/

gemini06720 wrote:Mike, my version of the 'Annual Weather Data Summary' page, although based on David's PHP code, is now a 'highly modified' version of the original PHP script - I did not and will not adapted (update) David's JavaScript, not only because I am not as familiar with JavaScript as I am with PHP, but because I do not believe that JavaScript (code running on a user's computer) should be used for a script that should be run directly from the host server through the use of a PHP scripts... :roll:

With that said/written, I would be interested in helping you getting the data summary page installed and running ... as long as your host server makes PHP available - I could not check as you do not provide a link to your web pages in your profile... :evil:

User avatar
MackerelSky
Posts: 139
Joined: Fri Apr 01, 2011 8:14 pm
Weather Station: Davis VP2 w/FARS
Operating System: Toshiba Laptop Windows 7 x64
Location: Smethport, Pa.
Contact:

Re: Yearly Data Summary--Adding new fields

Postby MackerelSky » Tue Aug 23, 2011 12:07 am

hdmax wrote: On a side note, my home page I have a link to radar, and forecast, (At least they were links) For some reason the forecast link quit working with a mouse click, but still works on my droid phone touch screen. I just added my web address to my sig, but just in case it doen't work, here it is. http://www.sixmileturn-weather.com/

Looks like your call to *style="#temp* is broken at the end of the image, after the closing href tag...happens to me too many times...

Code: Select all

<p style="#temp {
   float: left;
   width: 100px;
}"><a href="http://www.wunderground.com/radar/mixedcomposite.asp?region=b4&size=2x&type=loop">
              <img src="http://maps.wunderground.com/data/640x480/mw_sf_anim.gif" alt="" border="0"/></a></p#temp {
   float: right;
   width: 400px;
}

A fix would look like

Code: Select all

</a></p>
<p style="#temp {
   float: right;
   width: 400px;
}


Your link should work fine after fixing that. If not, we'll try again...

Brad
Davis VP2/FARS
Cumulus 1.9.4(1092)

McKean Weather
'cause not everyone lives at the airport

Image

gemini06720
Posts: 1700
Joined: Mon Aug 10, 2009 10:16 pm
Weather Station: No weather station
Operating System: No operating system
Location: World...

Re: Yearly Data Summary--Adding new fields

Postby gemini06720 » Tue Aug 23, 2011 10:25 am

hdmax wrote:I am using godaddy, and e-rice for my website. Not sure what I have as far as PHP, or Java.
Mike, I am attaching (download) a small PHP script that you can upload to your host server and test through your browser - the script will let you know if, indeed, PHP is available on your host server.

hdmax wrote:I do know that I need/want help in making my weather site look good.
Then, you could start by correcting some the coding errors you have made to your main 'index.htm' page... 8-)

Looking at the source code for your main page, I see this:

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head><link href="weatherstyle.css" rel="stylesheet" type="text/css" />

<style type="text/css" media="all">
 body   { color: blue;
      font-family: "arial","times new roman","courier";
          }
 h1   { color: crimson;
          font-weight: bold; }
 </style>


<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type" />
<meta name="description" content="My backyard weather data" />
<meta name="keywords" content="Cumulus, My backyard weather data, weather, data, weather station" />
<title>My backyard weather</title>
<link href="weatherstyle.css" rel="stylesheet" type="text/css" />
</head>
The code at the top of the page should be rewritten to look like this:

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type" />
<meta name="description" content="My backyard weather data" />
<meta name="keywords" content="Cumulus, My backyard weather data, weather, data, weather station" />
<title>My backyard weather</title>
<link href="weatherstyle.css" rel="stylesheet" type="text/css" />
<style type="text/css">
body  {
  color: blue;
  font-family: arial, times new roman , courier";
}
h1  {
  color: crimson;
  font-weight: bold;
}
</style>
</head>
And that is just the start... About a dozen more lines need some corrections, such as the one proposed by Brad... :twisted:

Mike you have to understand that cleanly written code (be it HTML, PHP, JavaScript, C++, Perl, etc.) make it easier to follow and understand what the code does - it also allows for the code to run better.

I am quite picky about the way code is written - this date back to my years in college and an excellent (and very demanding) teacher I had then... :)

It might be time to start a new message thread where code modifications and proper code writing is being demonstrated (taught) and practiced... :geek:

philcdav
Posts: 240
Joined: Tue Jun 24, 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

Postby philcdav » Sun Sep 11, 2011 9:02 am

Hi David. sorry mate, been away.

I would have liked both max/min pressure and actually managed it using another helper but thanks anyway.

One thing i am having problems with is the auto upload of dayfile.txt.

i cant get it to work. Am home now so will have another go.

thanks for all your input.
Phil - G0DOR

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

Re: Yearly Data Summary--Adding new fields

Postby mcrossley » Thu Oct 27, 2011 2:26 pm

An old thread but I just played around with this again. I've added the following to David's original PHP script...

  • Added low/high value highlighting like lots of other people - mine is transparent
  • Added row/column hover highlighting to both cells on the min/max table, in the original version it only works on the low value
  • Added extra data sets, and in particular handled Dominant Wind Direction in a summary manner rather than raw numbers

http://weather.wilmslowastro.com/datasummary.php

bnwrx
Posts: 448
Joined: Wed Feb 25, 2009 12:01 am
Weather Station: Ambient WS2095 (Fine/Offset)
Operating System: Windows 10 64bit
Location: Woodland Park, Colorado USA
Contact:

Re: Yearly Data Summary--Adding new fields

Postby bnwrx » Thu Oct 27, 2011 3:14 pm

mcrossley wrote:An old thread but I just played around with this again. I've added the following to David's original PHP script...

.....
[*]Added extra data sets, and in particular handled Dominant Wind Direction in a summary manner rather than raw numbers[/list]

http://weather.wilmslowastro.com/datasummary.php


Looks nice. How did you convert the dayfile text from #s?

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

Re: Yearly Data Summary--Adding new fields

Postby mcrossley » Thu Oct 27, 2011 3:35 pm

Hi Bob
My PHP code is below (bear in mind I'm no PHP expert!)...

Code: Select all

//add winddir to $label_items
...
//define a global array of compass headings and arrow characters
$compass_headings = array('N&nbsp;↓','NE&nbsp;↙','E&nbsp;←','SE&nbsp;↖','S&nbsp;↑','SW&nbsp;↗','W&nbsp;→','NW&nbsp;↘','N&nbsp;↓');

//define a function to decode a 0-360 value to a heading
function getHeading($deg) {
   global $compass_headings;
   return $compass_headings[round($deg / 45)];;
}

//in the main 'drawCalendar()' for loop substitute the heading string for the value
...
            if (array_key_exists($id, $data)) {
               $data_arr = explode('|', $data[$id]);
...
               if ($whatdata == 'winddir' && intval($data_arr[0]) > 0) {
                  $data_arr[0] = getHeading(intval($data_arr[0]));
               }
...

bnwrx
Posts: 448
Joined: Wed Feb 25, 2009 12:01 am
Weather Station: Ambient WS2095 (Fine/Offset)
Operating System: Windows 10 64bit
Location: Woodland Park, Colorado USA
Contact:

Re: Yearly Data Summary--Adding new fields

Postby bnwrx » Thu Oct 27, 2011 4:02 pm

Thanks, but.... I use htm. don't know if it would work?

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

Re: Yearly Data Summary--Adding new fields

Postby mcrossley » Thu Oct 27, 2011 4:07 pm

I haven't looked at the JavaScript version, but the PHP code will only need minor tweaking to convert to JavaScript

bnwrx
Posts: 448
Joined: Wed Feb 25, 2009 12:01 am
Weather Station: Ambient WS2095 (Fine/Offset)
Operating System: Windows 10 64bit
Location: Woodland Park, Colorado USA
Contact:

Re: Yearly Data Summary--Adding new fields

Postby bnwrx » Thu Oct 27, 2011 4:32 pm

mcrossley wrote:I haven't looked at the JavaScript version, but the PHP code will only need minor tweaking to convert to JavaScript


Maybe, but still a bit beyond my capabilities I'm afraid... ;)

User avatar
captzero
Posts: 363
Joined: Wed Mar 03, 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

Postby captzero » Thu Oct 27, 2011 11:04 pm

It would be even easier if today's dominant/average wind direction in the dayfile.txt file was included as a compass point as well as degrees. I'll submit an enhancement request (providing Steve can get the Rover back from Glasgow in one piece).
Dan

http://www.brisbaneliveweather.com




A man with a thermometer always knows the temperature. A man with two thermometers, not so sure.

bnwrx
Posts: 448
Joined: Wed Feb 25, 2009 12:01 am
Weather Station: Ambient WS2095 (Fine/Offset)
Operating System: Windows 10 64bit
Location: Woodland Park, Colorado USA
Contact:

Re: Yearly Data Summary--Adding new fields

Postby bnwrx » Fri Oct 28, 2011 12:40 am

I've played with my javascript and can get the page to display, but there is no data:
http://woodlandweather.org/datasummary.html

I am using dayfile col #39 for the dominate wind direction but it does not display any data. When I insert another data field # in the javascript it will show that data. Is field #39 the correct one for dominate wind bearing?

Thanks...

User avatar
beteljuice
Posts: 2463
Joined: Tue Dec 09, 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

Re: Yearly Data Summary--Adding new fields

Postby beteljuice » Fri Oct 28, 2011 1:29 am

... It would be even easier if today's dominant/average wind direction in the dayfile.txt file was included as a compass point as well as degrees...
Non-English users would still need a routine to translate.
I am using dayfile col #39 for the dominate wind direction but it does not display any data. When I insert another data field # in the javascript it will show that data. Is field #39 the correct one for dominate wind bearing?
I'm not sure, but I think it's complaining because at the start of the year that (and several other) values did not exist.
Image
......................Imagine, what you will KNOW tomorrow !

User avatar
steve
Cumulus Author
Posts: 26467
Joined: Mon Jun 02, 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Yearly Data Summary--Adding new fields

Postby steve » Fri Oct 28, 2011 6:59 am

beteljuice wrote:
... It would be even easier if today's dominant/average wind direction in the dayfile.txt file was included as a compass point as well as degrees...
Non-English users would still need a routine to translate.

It's a possibility for a future version of Cumulus. It could perhaps use strings.ini so that the translated equivalent was always logged.
Steve
-----
Hosting available for Cumulus web sites. See http://sandaysoft.com/forum/viewtopic.php?f=2&t=11876

Please read the posts in the Announcements section about the current status of Cumulus development since I have retired from my day job

gemini06720
Posts: 1700
Joined: Mon Aug 10, 2009 10:16 pm
Weather Station: No weather station
Operating System: No operating system
Location: World...

Re: Yearly Data Summary--Adding new fields

Postby gemini06720 » Fri Oct 28, 2011 11:06 am

mcrossley wrote:Added low/high value highlighting like lots of other people - mine is transparent
Mark, a while back, I also added transparency to the hi/lo temperature colours but used a different coding:

Code: Select all

  background-color: #000000;
  background: transparent;
Produces similar results but more inline with the W3C standards...


Return to “3rd Party Tools”

Who is online

Users browsing this forum: No registered users and 5 guests