Sandaysoft

Support forum for Cumulus weather station software
It is currently Fri May 24, 2013 6:08 pm
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  [ 59 posts ]  Go to page Previous  1, 2, 3, 4
Author Message
 Post subject: Re: Consecutive Dry/Wet Days
PostPosted: Tue Aug 30, 2011 12:45 pm 
Offline
User avatar

Joined: Mon Dec 20, 2010 12:12 pm
Posts: 446
Location: Palmerston, NT, Australia
Weather Station: WS-1081 with rain gauge mod
Operating System: Windows 7 & 1.9.3 b1059
steve wrote:
n9mfk wrote:
Hi Steve
why not put the value in dayfile so if it rained in the middle of the day
you wood not have to wait all day for Consecutive Dry days to rest
Beau

I don't understand how putting the values in dayfile.txt would make any difference, the counts are updated at the end of the day.

I would suggest that anyone who doesn't like the way I've implemented this facility should write some javascript (or whatever) to modify the figures to suit themselves (e.g. based on whether it's rained so far today or not).

Hey Steve, I think it's great what you've done. Good work. I have taken you're advice though, and added "Consecutive dry days (excl. today)", "Consecutive Wet Days (excl. today)" and "Consecutive Wet Days (incl. today)" if it has rained during the day. I used Javascript to make this:
Code:
<tr class="td_rainfall_data">

<script type="text/javascript">
<!--
//Michael Holliday's code to display either consecutive rain or dry days, which ever is more than 0.
//If it has rained, the rain days WILL include today! :) 
var ConsecutiveRainDays=<#ConsecutiveRainDays>;
var ConsecutiveDryDays=<#ConsecutiveDryDays>;
var rained=<#rfall>;  //rain fall for today
if (rained>0){
ConsecutiveRainDays=<#ConsecutiveRainDays>+1;
document.write("<td>Consecutive Rain Days \(incl. today\)</td><td>" + ConsecutiveRainDays + "</td>");
}else if (ConsecutiveRainDays>0){
document.write("<td>Consecutive Rain Days \(excl. today\)</td><td><#ConsecutiveRainDays></td>");
}else {
document.write("<td>Consecutive Dry Days \(excl. today\)</td><td><#ConsecutiveDryDays></td>");
}
//-->
</script>
</td>


Can't wait to see if you implement a webtag to display rainfall duration. :clap:
EDIT - PS. Love the records editors, soooooo much easier :!: And if I use it with a rainfall duration webtag, my data has me aiming for 55hrs + ;) . Thanks in advance Steve.

_________________
Michael, Palmerston, NT Australia www.Palmerston-WeatherImageNo image? I'm offline!
ImageImageImage


Top
 Profile  
 
 Post subject: Re: Consecutive Dry/Wet Days
PostPosted: Tue Aug 30, 2011 1:01 pm 
Offline
User avatar

Joined: Thu Jan 07, 2010 9:44 pm
Posts: 2521
Location: Wilmslow, Cheshire, UK
Weather Station: Davis VP2
Operating System: XP SP3, Win 7
Michael

Just a slight adjustment, you should change:

if (rained>0){
and
}else if (ConsecutiveRainDays>0){

to...

//use default 0.2mm, or 0.01in threshold
if (rained>=0.2){
and
}else if (ConsecutiveRainDays>=0.2){

_________________
Mark
Wilmslow Astro Weather


Top
 Profile  
 
 Post subject: Re: Consecutive Dry/Wet Days
PostPosted: Tue Aug 30, 2011 1:19 pm 
Offline
User avatar

Joined: Mon Dec 20, 2010 12:12 pm
Posts: 446
Location: Palmerston, NT, Australia
Weather Station: WS-1081 with rain gauge mod
Operating System: Windows 7 & 1.9.3 b1059
mcrossley wrote:
Michael

Just a slight adjustment, you should change:

if (rained>0){
and
}else if (ConsecutiveRainDays>0){

to...

//use default 0.2mm, or 0.01in threshold
if (rained>=0.2){
and
}else if (ConsecutiveRainDays>=0.2){

Changing the rain value will do little for me as after 0 the next value it displays is .2mm anyway. As for ConsecutiveRainDays, how do you get 0.2 of a day? :lol: After 0 it will read 1 (and will skip .2, .3, etc.). It will get the same end result, so I see no point changing it. ConsecutiveRainDays will not advance unless it breaks the rain threshold which is preset at 0.2mm.
But thanks for the concern anyway.

_________________
Michael, Palmerston, NT Australia www.Palmerston-WeatherImageNo image? I'm offline!
ImageImageImage


Top
 Profile  
 
 Post subject: Re: Consecutive Dry/Wet Days
PostPosted: Tue Aug 30, 2011 1:34 pm 
Offline
User avatar

Joined: Thu Jan 07, 2010 9:44 pm
Posts: 2521
Location: Wilmslow, Cheshire, UK
Weather Station: Davis VP2
Operating System: XP SP3, Win 7
Opps, a slip up there, you're right the second bit is nonsense :oops:
Still to make your code generic across all users you should change the initial compare from zero to whatever threshold value you are using - my station counts in 0.1mm 'steps'.

_________________
Mark
Wilmslow Astro Weather


Top
 Profile  
 
 Post subject: Re: Consecutive Dry/Wet Days
PostPosted: Tue Aug 30, 2011 2:08 pm 
Offline

Joined: Mon Aug 10, 2009 10:16 pm
Posts: 1772
Location: World...
Weather Station: No weather station
Operating System: No operating system
Mark, it really does not matter how much rain is needed to move the tipping spoon (be it 0.01 in or 0.1 mm or 0.2 mm) - as soon as Cumulus sense that it is raining, the '<#rfall>' value (which Michael is using) will change from '0.0' to something else - thus the value will not be zero anymore - thus the 'rained' variable will not be zero anymore... :mrgreen:


Top
 Profile  
 
 Post subject: Re: Consecutive Dry/Wet Days
PostPosted: Tue Aug 30, 2011 2:12 pm 
Offline
User avatar

Joined: Thu Jan 07, 2010 9:44 pm
Posts: 2521
Location: Wilmslow, Cheshire, UK
Weather Station: Davis VP2
Operating System: XP SP3, Win 7
Ray

I beg to differ, in my case a single tip would be 0.1mm, which is below the default threshold Cumulus uses to 'register' a rain day (default is 0.2mm). If I get a single tip today, and you use >0 then the code will register today as a rain day, but tomorrow Cumulus will not.

_________________
Mark
Wilmslow Astro Weather


Top
 Profile  
 
 Post subject: Re: Consecutive Dry/Wet Days
PostPosted: Wed Aug 31, 2011 3:56 am 
Offline
User avatar

Joined: Mon Dec 20, 2010 12:12 pm
Posts: 446
Location: Palmerston, NT, Australia
Weather Station: WS-1081 with rain gauge mod
Operating System: Windows 7 & 1.9.3 b1059
Yes, I guess you'd want the values to be equal. Thus the #rfall >= value should equal the threshold value. Whether you use .1 or .2. or whatever. For my unit, it makes bugger all difference. :lol:

_________________
Michael, Palmerston, NT Australia www.Palmerston-WeatherImageNo image? I'm offline!
ImageImageImage


Top
 Profile  
 
 Post subject: Re: Consecutive Dry/Wet Days
PostPosted: Wed Apr 11, 2012 1:19 am 
Offline

Joined: Wed Mar 23, 2011 11:58 am
Posts: 16
Location: Brisbane, Australia
Weather Station: WH2081
Operating System: Windows XP SP3
Just thought I'd post my solution to the problem:

Code:
  <tr class="td_rainfall_data">
    <td>Rainfall&nbsp;Last Hour</td>
    <td>0.0&nbsp;mm</td>
    <td>
        <?php
        require_once("cumuluswebtags.php");
        if ($rfall>0)
       echo "Days of Rain";
        else
       echo "Days of Sunshine";
        ?>
    </td>
    <td>
        <?php
        require_once("cumuluswebtags.php");
        if ($rfall>0)
       echo $ConsecutiveRainDays+1;
        else
       echo $ConsecutiveDryDays+1;
        ?>
    </td>
  </tr>


Top
 Profile  
 
 Post subject: Re: Consecutive Dry/Wet Days
PostPosted: Fri Apr 13, 2012 1:04 pm 
Offline

Joined: Mon Aug 10, 2009 10:16 pm
Posts: 1772
Location: World...
Weather Station: No weather station
Operating System: No operating system
Krumlov, one little suggestion: You do not have to repeat the 'require_once()' statement more than once (unless the name of the file is different) - the 'require_once()' statement can even be placed way at the top of the page... ;)


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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