Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 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

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

This Month's rain when none has fallen

Discussion and questions about Cumulus weather station software version 1. This section is the main place to get help with Cumulus 1 software developed by Steve Loft that ceased development in November 2014.
Post Reply
RayProudfoot
Posts: 3602
Joined: Wed 06 May 2009 6:29 pm
Weather Station: Davis VP2 with Daytime FARS
Operating System: Windows XP SP3
Location: Cheadle Hulme, Cheshire, England
Contact:

This Month's rain when none has fallen

Post by RayProudfoot »

Hi Steve,

Looking at the data for rain for This Month it doesn't look quite right when no rain has fallen.
Cumulus_Rain.jpg
Is there any way the tags could be made invisible until there is some rain data to display?
You do not have the required permissions to view the files attached to this post.
Cheers,
Ray, Cheshire.

Image
serowe
Posts: 484
Joined: Tue 03 Aug 2010 6:23 am
Weather Station: WM918
Operating System: Win Server 2008 R2
Location: Ferntree Gully, VIC, Oz
Contact:

Re: This Month's rain when none has fallen

Post by serowe »

As long as you are exporting your file(s) as PHP, the followig will work:

Code: Select all

if ( $rfallmH > 0 ){
    
    // Put your display in here - if the monthly rainfall is zero, nothing will display
}
Change the tag to suit whatever section you want (daily, hourly, monthly, yearly falls etc.

You can also use the if()... statements to also provide a display if nothing has fallen eg

Code: Select all

if ( $rfallmH > 0 ){    
    // Put your display in here - if the monthly rainfall is zero, nothing will display
    echo $rfallmH . " recorded so far this month.";
}
else
{
    // Now display a message saying no rain has been recorded
    echo "Nil rain recorded so far this month";
}
Punctuation is the difference between 'Let's eat, grandma' and 'Let's eat grandma'
serowe
Posts: 484
Joined: Tue 03 Aug 2010 6:23 am
Weather Station: WM918
Operating System: Win Server 2008 R2
Location: Ferntree Gully, VIC, Oz
Contact:

Re: This Month's rain when none has fallen

Post by serowe »

Whoops just realised - the above code assumes you are creating a single webtags file and then doing the tanspositions in the PHP files when you display them instead of creating lots of individual files that Cumulus processes (if that makes sense).

If you are processing the files through Cumulus replace the $rfallmH PHP variable with the Cumulus tag - it will still work that way.
Punctuation is the difference between 'Let's eat, grandma' and 'Let's eat grandma'
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: This Month's rain when none has fallen

Post by steve »

RayProudfoot wrote:Is there any way the tags could be made invisible until there is some rain data to display?
You could put some javascript in your HTML to display something else when you've had no rain.
Steve
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: This Month's rain when none has fallen

Post by steve »

As an example of how to do this using javascript, I've modified my todayT.htm template. The code for the time of today's max rain rate is currently:

Code: Select all

<td>at&nbsp;<#TrrateTM>"</td>
which displays as:
Sanday weather - Mozilla Firefox_2011-05-05_09-45-01.png
I added some javascript so that the time is only displayed if the max rain rate isn't zero:

Code: Select all

<td><script type="text/javascript">if (<#rrateTM> != "0.0") {document.write("at&nbsp;<#TrrateTM>")}</script></td>
and it now looks like this:
Sanday weather - Mozilla Firefox_2011-05-05_09-43-56.png
Note that I'm not a javascript expert and there may be better ways of writing the code!
You do not have the required permissions to view the files attached to this post.
Steve
RayProudfoot
Posts: 3602
Joined: Wed 06 May 2009 6:29 pm
Weather Station: Davis VP2 with Daytime FARS
Operating System: Windows XP SP3
Location: Cheadle Hulme, Cheshire, England
Contact:

Re: This Month's rain when none has fallen

Post by RayProudfoot »

Thanks Steve and serowe. I think I have enough information from your examples to change my HTML template files.

BUT!!! Sod's Law strikes again. It started raining this afternoon after 23 days without rain. Quite a rarity in this part of the world.
Cheers,
Ray, Cheshire.

Image
serowe
Posts: 484
Joined: Tue 03 Aug 2010 6:23 am
Weather Station: WM918
Operating System: Win Server 2008 R2
Location: Ferntree Gully, VIC, Oz
Contact:

Re: This Month's rain when none has fallen

Post by serowe »

Which is the rarity? The fact is hasn't ben raining or that it is raining? :)
Punctuation is the difference between 'Let's eat, grandma' and 'Let's eat grandma'
RayProudfoot
Posts: 3602
Joined: Wed 06 May 2009 6:29 pm
Weather Station: Davis VP2 with Daytime FARS
Operating System: Windows XP SP3
Location: Cheadle Hulme, Cheshire, England
Contact:

Re: This Month's rain when none has fallen

Post by RayProudfoot »

serowe wrote:Which is the rarity? The fact is hasn't ben raining or that it is raining? :)
The former. Manchester has a reputation for damp weather so to go 23 days without any measurable precipitation is quite unusual.
Cheers,
Ray, Cheshire.

Image
Post Reply