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 4019) - 03 April 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

Yet Another Dayfile Reader (PHP)

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

Phil23
Posts: 884
Joined: Sat 16 Jul 2016 11:59 pm
Weather Station: Davis VP2+ & GW1000 (Standalone)
Operating System: Win10 Pro / rPi Buster
Location: Australia

Re: Yet Another Dayfile Reader (PHP)

Post by Phil23 »

Hi All,

Really struggling to understand how the php code builds these tables.
My php & html knowledge is near zilch. (Other programming like PIC32 Basic Ok).

Trying to see where they yearly figures are generated so I can change some averages to totals.

Rainfall in particular, Id' like monthly totals not daily averages and probably do the same thing with EVT as it's sort of relevant to rain.
Capture.JPG
I sort of get that the yearly summaries are generated with the 879-1028 line mark in betel_readDayfile.php, but that's about as close as I can get.

Code: Select all

// START year avg table
    $tablelayout .= "                <table id='avgTable' style = 'display:".($show_year_averages ? "table" : "none").";'>\n";
    $tablelayout .= "<tr>\n";
    $tablelayout .= '<th style="width: 80px;">'.($dataSet == 'winddir' ? $translit[$dayfileLang]['dom'] : $translit[$dayfileLang]['avg']).'</th>';
    $tablelayout .= '<th>'.$translit[$dayfileLang]['mn'][0].'</th><th>'.$translit[$dayfileLang]['mn'][1].'</th><th>'.$translit[$dayfileLang]['mn'][2].'</th><th>'.$translit[$dayfileLang]['mn'][3].'</th><th>'.$translit[$dayfileLang]['mn'][4].'</th><th>'.$translit[$dayfileLang]['mn'][5].'</th><th>'.$translit[$dayfileLang]['mn'][6].'</th><th>'.$translit[$dayfileLang]['mn'][7].'</th><th>'.$translit[$dayfileLang]['mn'][8].'</th><th>'.$translit[$dayfileLang]['mn'][9].'</th><th>'.$translit[$dayfileLang]['mn'][10].'</th><th>'.$translit[$dayfileLang]['mn'][11].'</th>';
    $tablelayout .= "</tr>\n";

    $bert = count($type_year) -1;
    $alltime = array(1 => array(), 2 => array(), 3 => array(), 4 => array(), 5 => array(), 6 => array(), 7 => array(), 8 => array(), 9 => array(), 10 => array(), 11 => array(), 12 => array());

    $bg_alltime = array(1 => array(), 2 => array(), 3 => array(), 4 => array(), 5 => array(), 6 => array(), 7 => array(), 8 => array(), 9 => array(), 10 => array(), 11 => array(), 12 => array());

    if($dataSet == 'winddir') {
        for($zz = 1; $zz <= 12; $zz++){
            $alltime[$zz] = array( 0 => 0, 1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => 0, 8 => 0);
        }
    }
    $shortMon = array();
    for ($d = $bert; $d >= 0; $d--) { // latest year first
        $shortMon[$d] = array();
        $tablelayout .= '<tr>';
        $tablelayout .=  '<th>'.$type_year[$d].'</th>';

        for ($m = 1; $m <= 12; $m++) {
            $shortMon[$d][$m] = false;
            $windd = array(0 => 0, 1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => 0, 8 => 0); // twitch fix
            $tablelayout .=  '<td';
            $thisValue = '';
            $part2 = '';

            if(isset($type_data[$type_year[$d]]) && array_key_exists($m, $type_data[$type_year[$d]])) {
                $turd = array();

                $bg_turd = array(); // hmm ... it's not going to be that simple !!!



               foreach($type_data[$type_year[$d]][$m] as $k => $v){

                    if($v <> ''){ // only take account of non null entries
                       if($dataSet == 'winddir'){
                           if($v[0] >0 && $v[1] >0) $windd[round($v[0] / 45)]++ ; // increment wind dir count
                           $v = '';
                        }

                       if(is_array($v)){ // we are dealing with something that needs calculating
                           $thisValue = $v;
                           formatOP(); // only want to use 'native' result
                           $thisValue = ''; // reset
                           $part2 = ''; // reset
                           $turd[] = $native;
                        } else { // 'normal' single piece of data
                           $turd[] = $v; // a 'normal' single data entry

                            if($dataSet == "HoursSun" && $run_sun) {
                                $bg_y = $type_year[$d];
                                $bg_when = mktime(0,0,0, $m, $k, $bg_y);
                                $bg_turd[] = maxsunhours($bg_when);
                            }

                        }
                    }
                }
                if($turd){
                    if($dataSet == 'winddir'){
                        $workMax = max($windd); // find highest occurrence
                        $found = false;
                        foreach($windd as $k => $v){
                            $alltime[$m][$k] += $v;
                            if($found !== true && $v == $workMax){ // see if number of occurrences = max
                                $thisValue = ($k == 0 ? 44 : $k * 45); // sort of put back into a degree range
                                $found = true; // only looking for first (clockwise) event
                            }
                        }
                    } else { // everything that really needs averages
                        $thisValue = array_sum($turd) / count($turd);
                        $thatvalue = "";
                        if($dataSet == 'HoursSun' && $run_sun){
                            $bg_value = round(array_sum($bg_turd) / count($bg_turd), 1);
                            $sunAvailable = $bg_value;
                        }
                    }
                }
                if($thisValue || $thisValue == 0){
                    if($dataSet != 'winddir') $alltime[$m][] = $thisValue;
                    if($dataSet == 'HoursSun' && $run_sun) $bg_alltime[$m][] = $bg_value; // ### NEW bargraph stuff
                    formatOP();
                    $short =  (count($turd) < cal_days_in_month(CAL_GREGORIAN, $m, $type_year[$d]) ? "* " : "");
                    if(count($turd) < cal_days_in_month(CAL_GREGORIAN, $m, $type_year[$d])) $shortMon[$d][$m] = true ;
                    $tablelayout .=  " class=\"datacell2\"".$part2.">".($dataSet != 'HoursSun' ? $short : '').$thisValue."</td>";
                }else {
                    $tablelayout .=  ' class="nondate">&nbsp;</td>';
                }
            }else{
                $tablelayout .=  ' class="nondate">&nbsp;</td>';
            }
        } // END month walk
        $tablelayout .= "</tr>\n";
    } // END year walk
// now do overall month averages
    $tablelayout .= '<tr>';
    $tablelayout .=  '<th class="topborder">'.($dataSet == 'winddir' ? $translit[$dayfileLang]['dom'] : $translit[$dayfileLang]['avg']).'</th>';
    for ($m = 1; $m <= 12; $m++) {
        $tablelayout .=  '<td';
        $thisValue = '';
        $part2 = '';

        if(isset($alltime[$m])) {
            if($dataSet == 'winddir'){
                $workMax = max($alltime[$m]);
                foreach($alltime[$m] as $k => $v){
                    if($v == $workMax){ // see if number of occurences = max
                        $thisValue = ($k == 0 ? 44 : $k * 45); // sort of put back into a degree range
                        break; // only looking for first (clockwise) event
                    }
                }
            } else {
                if(is_array($alltime[$m])) {
                    if(count($alltime[$m]) != 0) $thisValue = array_sum($alltime[$m]) / count($alltime[$m]);
                }
            }
            if($thisValue){

                if($dataSet == 'HoursSun' && $run_sun){
                    if(is_array($bg_alltime[$m])) {
                        if(count($bg_alltime[$m]) != 0) $bg_value = round(array_sum($bg_alltime[$m]) / count($bg_alltime[$m]), 1);
                        $sunAvailable = $bg_value;
                    }
                }

                formatOP();
                $short = "";
                for ($d = $bert; $d >= 0; $d--) { // latest year first (not important)
                    if($shortMon[$d][$m]){
                       $short = "* ";
                       break;
                    }
                }
                $tablelayout .=  " class=\"datacell2 topborder\"".$part2.">".($dataSet != 'HoursSun' ? $short : '').$thisValue."</td>";
            }else {
                $tablelayout .=  ' class="nondate topborder">&nbsp;</td>';
            }
        }else{
            $tablelayout .=  ' class="nondate topborder">&nbsp;</td>';
        }
    } // END month walk
    $tablelayout .= "</tr>\n";
    // END overall year averages
    $tablelayout .= "                </table>\n            </div>\n";
// END year averages table

Can anyone enlighten me a bit on the block of code where I can change these averages to totals?
And how I'd make it apply to only the Rainfall & EVT pages.


Thanks

Phil
You do not have the required permissions to view the files attached to this post.
:Now: :Today/Yesterday:

Image

Main Station Davis VP2+ Running Via Win10 Pro.
Secondary Stations, Ecowitt HP2551/GW1000 Via rPi 3 & 4 Running Buster GUI.
:Local Inverell Ecowitt Station: :Remote Ashford Ecowitt Station:
Mapantz
Posts: 1807
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 x64
Location: Dorset - UK
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by Mapantz »

But then what would be the point in having a drop down to select a year? You can also view the monthly totals by looking at the seasonal data.
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: Yet Another Dayfile Reader (PHP)

Post by beteljuice »

No guarantees - the beteljuice is still a bit 'loopy' after being done over in the vets ...

I think I've got the vars right (original code is on my dead XP machine - awaiting new PC and organ donation)

Edit: No
i didn't - rain should be rainfall - fixed.

Edit: No
i didn't - $dataset should be $dataSet - fixed.

Edit:No, No No
$translit[$dayfileLang]['sum'] should be $translit[$dayfileLang]['total'] - fixed


Code has been done 'long-hand' with comments so you have an idea what's been done.

Code changed for rain / evt totals in year table with averages at bottom

Code: Select all


// START year avg table *** MODIFIED FOR RAIN TOTALS ***
    $tablelayout .= "                <table id='avgTable' style = 'display:".($show_year_averages ? "table" : "none").";'>\n";
    $tablelayout .= "<tr>\n";
//    $tablelayout .= '<th style="width: 80px;">'.($dataSet == 'winddir' ? $translit[$dayfileLang]['dom'] : $translit[$dayfileLang]['avg']).'</th>';

// *** NEW for rain / evt totals
if($dataSet == 'winddir') {
	$tablelayout .= '<th style="width: 80px;">'.$translit[$dayfileLang]['dom'].'</th>';
} else {
	if($dataSet == 'rainfall' || $dataSet == 'evt') {
	    $tablelayout .= '<th style="width: 80px;">'.$translit[$dayfileLang]['total'].'</th>';
	} else {
	    $tablelayout .= '<th style="width: 80px;">'.$translit[$dayfileLang]['avg'].'</th>';
	}
}	
//		

    $tablelayout .= '<th>'.$translit[$dayfileLang]['mn'][0].'</th><th>'.$translit[$dayfileLang]['mn'][1].'</th><th>'.$translit[$dayfileLang]['mn'][2].'</th><th>'.$translit[$dayfileLang]['mn'][3].'</th><th>'.$translit[$dayfileLang]['mn'][4].'</th><th>'.$translit[$dayfileLang]['mn'][5].'</th><th>'.$translit[$dayfileLang]['mn'][6].'</th><th>'.$translit[$dayfileLang]['mn'][7].'</th><th>'.$translit[$dayfileLang]['mn'][8].'</th><th>'.$translit[$dayfileLang]['mn'][9].'</th><th>'.$translit[$dayfileLang]['mn'][10].'</th><th>'.$translit[$dayfileLang]['mn'][11].'</th>';
    $tablelayout .= "</tr>\n";

    $bert = count($type_year) -1;
    $alltime = array(1 => array(), 2 => array(), 3 => array(), 4 => array(), 5 => array(), 6 => array(), 7 => array(), 8 => array(), 9 => array(), 10 => array(), 11 => array(), 12 => array());

    $bg_alltime = array(1 => array(), 2 => array(), 3 => array(), 4 => array(), 5 => array(), 6 => array(), 7 => array(), 8 => array(), 9 => array(), 10 => array(), 11 => array(), 12 => array());

    if($dataSet == 'winddir') {
        for($zz = 1; $zz <= 12; $zz++){
            $alltime[$zz] = array( 0 => 0, 1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => 0, 8 => 0);
        }
    }
    $shortMon = array();
    for ($d = $bert; $d >= 0; $d--) { // latest year first
        $shortMon[$d] = array();
        $tablelayout .= '<tr>';
        $tablelayout .=  '<th>'.$type_year[$d].'</th>';

        for ($m = 1; $m <= 12; $m++) {
            $shortMon[$d][$m] = false;
            $windd = array(0 => 0, 1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => 0, 8 => 0); // twitch fix
            $tablelayout .=  '<td';
            $thisValue = '';
            $part2 = '';

            if(isset($type_data[$type_year[$d]]) && array_key_exists($m, $type_data[$type_year[$d]])) {
                $turd = array();

                $bg_turd = array(); // hmm ... it's not going to be that simple !!!



               foreach($type_data[$type_year[$d]][$m] as $k => $v){

                    if($v <> ''){ // only take account of non null entries
                       if($dataSet == 'winddir'){
                           if($v[0] >0 && $v[1] >0) $windd[round($v[0] / 45)]++ ; // increment wind dir count
                           $v = '';
                        }

                       if(is_array($v)){ // we are dealing with something that needs calculating
                           $thisValue = $v;
                           formatOP(); // only want to use 'native' result
                           $thisValue = ''; // reset
                           $part2 = ''; // reset
                           $turd[] = $native;
                        } else { // 'normal' single piece of data
                           $turd[] = $v; // a 'normal' single data entry

                            if($dataSet == "HoursSun" && $run_sun) {
                                $bg_y = $type_year[$d];
                                $bg_when = mktime(0,0,0, $m, $k, $bg_y);
                                $bg_turd[] = maxsunhours($bg_when);
                            }

                        }
                    }
                }
                if($turd){
                    if($dataSet == 'winddir'){
                        $workMax = max($windd); // find highest occurrence
                        $found = false;
                        foreach($windd as $k => $v){
                            $alltime[$m][$k] += $v;
                            if($found !== true && $v == $workMax){ // see if number of occurrences = max
                                $thisValue = ($k == 0 ? 44 : $k * 45); // sort of put back into a degree range
                                $found = true; // only looking for first (clockwise) event
                            }
                        }
                    } else { // everything that really needs averages
					
// *** NEW FOR RAIN / EVT TOTALS **
if($dataSet == 'rainfall' || $dataSet == 'evt') {
	$thisValue = array_sum($turd);
} else {
	$thisValue = array_sum($turd) / count($turd);
}
//

//                        $thisValue = array_sum($turd) / count($turd);
                        $thatvalue = "";
                        if($dataSet == 'HoursSun' && $run_sun){
                            $bg_value = round(array_sum($bg_turd) / count($bg_turd), 1);
                            $sunAvailable = $bg_value;
                        }
                    }
                }
                if($thisValue || $thisValue == 0){
                    if($dataSet != 'winddir') $alltime[$m][] = $thisValue;
                    if($dataSet == 'HoursSun' && $run_sun) $bg_alltime[$m][] = $bg_value; // ### NEW bargraph stuff
                    formatOP();
                    $short =  (count($turd) < cal_days_in_month(CAL_GREGORIAN, $m, $type_year[$d]) ? "* " : "");
                    if(count($turd) < cal_days_in_month(CAL_GREGORIAN, $m, $type_year[$d])) $shortMon[$d][$m] = true ;
                    $tablelayout .=  " class=\"datacell2\"".$part2.">".($dataSet != 'HoursSun' ? $short : '').$thisValue."</td>";
                }else {
                    $tablelayout .=  ' class="nondate">&nbsp;</td>';
                }
            }else{
                $tablelayout .=  ' class="nondate">&nbsp;</td>';
            }
        } // END month walk
        $tablelayout .= "</tr>\n";
    } // END year walk
// now do overall month averages
    $tablelayout .= '<tr>';

    $tablelayout .=  '<th class="topborder">'.($dataSet == 'winddir' ? $translit[$dayfileLang]['dom'] : $translit[$dayfileLang]['avg']).'</th>';
    for ($m = 1; $m <= 12; $m++) {
        $tablelayout .=  '<td';
        $thisValue = '';
        $part2 = '';

        if(isset($alltime[$m])) {
            if($dataSet == 'winddir'){
                $workMax = max($alltime[$m]);
                foreach($alltime[$m] as $k => $v){
                    if($v == $workMax){ // see if number of occurences = max
                        $thisValue = ($k == 0 ? 44 : $k * 45); // sort of put back into a degree range
                        break; // only looking for first (clockwise) event
                    }
                }
            } else {
                if(is_array($alltime[$m])) {
	            if(count($alltime[$m]) != 0) $thisValue = array_sum($alltime[$m]) / count($alltime[$m]);
                }
            }
            if($thisValue){

                if($dataSet == 'HoursSun' && $run_sun){
                    if(is_array($bg_alltime[$m])) {
                        if(count($bg_alltime[$m]) != 0) $bg_value = round(array_sum($bg_alltime[$m]) / count($bg_alltime[$m]), 1);
                        $sunAvailable = $bg_value;
                    }
                }

                formatOP();
                $short = "";
                for ($d = $bert; $d >= 0; $d--) { // latest year first (not important)
                    if($shortMon[$d][$m]){
                       $short = "* ";
                       break;
                    }
                }
                $tablelayout .=  " class=\"datacell2 topborder\"".$part2.">".($dataSet != 'HoursSun' ? $short : '').$thisValue."</td>";
            }else {
                $tablelayout .=  ' class="nondate topborder">&nbsp;</td>';
            }
        }else{
            $tablelayout .=  ' class="nondate topborder">&nbsp;</td>';
        }
    } // END month walk
    $tablelayout .= "</tr>\n";
    // END overall year averages
    $tablelayout .= "                </table>\n            </div>\n";
// END year averages table

******************** MAKE SURE YOU BACK-UP YOUR CURRENT VERSION BEFORE MODDING ******************


Edit: Oops .... noticed a missing ) - fixed.

Edit: Oops ....rain should have been )rainfall - fixed.

{b]Edit:[/b] Ooops .... $dataset should be $dataSetl - fixed.

{b]Edit:[/b] Ooops .... $translit[$dayfileLang]['sum'] should be $translit[$dayfileLang]['total'] - fixed

Code changed for rain / evt totals in year table with averages at bottom
Last edited by beteljuice on Mon 22 Jul 2019 10:27 pm, edited 6 times in total.
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
Super-T
Posts: 890
Joined: Tue 09 Sep 2008 3:37 am
Weather Station: wh-1081
Operating System: Weather Laptop - Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by Super-T »

Gotta watch those Vets mate....might cut the wrong bit off :-)
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: Yet Another Dayfile Reader (PHP)

Post by beteljuice »

Worst of it is ..... It's in a place I can't see (but it feels like everyone else in the world has :shock:
Image
......................Imagine, what you will KNOW tomorrow !
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: Yet Another Dayfile Reader (PHP)

Post by beteljuice »

Oops .... noticed a missing ) - fixed. :oops:
Image
......................Imagine, what you will KNOW tomorrow !
sutne
Posts: 376
Joined: Sun 14 Oct 2012 4:23 pm
Weather Station: HP2553 (WS80) and HP2564 (WS90)
Operating System: Raspbian Bullseye and Bookworm
Location: Rjoanddalen and Kronstad, Norway
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by sutne »

I tried your new code, corrected the missing ), but it still shows Average for the monthly summary of Rain (Nedbør):
http://www.rjoandveret.no/datasummary.php
Phil23
Posts: 884
Joined: Sat 16 Jul 2016 11:59 pm
Weather Station: Davis VP2+ & GW1000 (Standalone)
Operating System: Win10 Pro / rPi Buster
Location: Australia

Re: Yet Another Dayfile Reader (PHP)

Post by Phil23 »

Mapantz wrote: Wed 17 Jul 2019 10:54 pm You can also view the monthly totals by looking at the seasonal data.
Yes, I'm aware of that, but my personal preference for rainfall would be to see monthly totals at the bottom, followed by an average of those.

Average daily rain is not really a meaningly figure to me simply because it's not a value that's readable each day.
:Now: :Today/Yesterday:

Image

Main Station Davis VP2+ Running Via Win10 Pro.
Secondary Stations, Ecowitt HP2551/GW1000 Via rPi 3 & 4 Running Buster GUI.
:Local Inverell Ecowitt Station: :Remote Ashford Ecowitt Station:
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: Yet Another Dayfile Reader (PHP)

Post by beteljuice »

Oops ....rain should have been rainfall - fixed. :groan:

Thank you Sutne
Image
......................Imagine, what you will KNOW tomorrow !
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: Yet Another Dayfile Reader (PHP)

Post by beteljuice »

@phil23 :bash:
Yes, I'm aware of that, but my personal preference for rainfall would be to see monthly totals at the bottom, followed by an average of those.
The modified code gives overall totals, so just remove the mods in the last section. :roll:
Image
......................Imagine, what you will KNOW tomorrow !
sutne
Posts: 376
Joined: Sun 14 Oct 2012 4:23 pm
Weather Station: HP2553 (WS80) and HP2564 (WS90)
Operating System: Raspbian Bullseye and Bookworm
Location: Rjoanddalen and Kronstad, Norway
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by sutne »

I changed rain to rainfall where I thought it should be, but still it does not give total, just average.
http://www.rjoandveret.no/datasummary.php
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: Yet Another Dayfile Reader (PHP)

Post by beteljuice »

Thank You once again Sutne ...

Told you I was a bit 'loopy' , that and my workhorse HDD not connected ATM = :bash: :bash:

Couple of places - $dataset should be $dataSet - fixed in code block above (I hope !)
Image
......................Imagine, what you will KNOW tomorrow !
Phil23
Posts: 884
Joined: Sat 16 Jul 2016 11:59 pm
Weather Station: Davis VP2+ & GW1000 (Standalone)
Operating System: Win10 Pro / rPi Buster
Location: Australia

Re: Yet Another Dayfile Reader (PHP)

Post by Phil23 »

Super-T wrote: Thu 18 Jul 2019 2:08 am Gotta watch those Vets mate....might cut the wrong bit off :-)
That bit would be you bum cheek & wallet?

Up to Vet visit number 3 for the past 2 weeks.
:Now: :Today/Yesterday:

Image

Main Station Davis VP2+ Running Via Win10 Pro.
Secondary Stations, Ecowitt HP2551/GW1000 Via rPi 3 & 4 Running Buster GUI.
:Local Inverell Ecowitt Station: :Remote Ashford Ecowitt Station:
Phil23
Posts: 884
Joined: Sat 16 Jul 2016 11:59 pm
Weather Station: Davis VP2+ & GW1000 (Standalone)
Operating System: Win10 Pro / rPi Buster
Location: Australia

Re: Yet Another Dayfile Reader (PHP)

Post by Phil23 »

Thanks,

Not sure I'm game to try it yet, given it's still only 7am here in Aus & my brain has the morning fog.
Just browsing to see where that block of code belongs.
:Now: :Today/Yesterday:

Image

Main Station Davis VP2+ Running Via Win10 Pro.
Secondary Stations, Ecowitt HP2551/GW1000 Via rPi 3 & 4 Running Buster GUI.
:Local Inverell Ecowitt Station: :Remote Ashford Ecowitt Station:
Phil23
Posts: 884
Joined: Sat 16 Jul 2016 11:59 pm
Weather Station: Davis VP2+ & GW1000 (Standalone)
Operating System: Win10 Pro / rPi Buster
Location: Australia

Re: Yet Another Dayfile Reader (PHP)

Post by Phil23 »

beteljuice wrote: Thu 18 Jul 2019 12:54 am ******************** MAKE SURE YOU BACK-UP YOUR CURRENT VERSION BEFORE MODDING ******************
Hmmm, been saying that to clients for 30 years. They prefer not to go thru the hassle;
Then request I "Fix It".

Rain totals now done & working just fine.

Have it running on two dayfiles,
my old Fine Offset station that ran from 2011 to 2016, - http://weather.inverellit.com/historic/datasummary.php
and my current live VP/2 data that's carried from 2016 forward - http://weather.inverellit.com/datasummary.php
If you wanted to handle EVT the same way, then ALL lines

if($dataSet == 'rainfall') { ...

become:

if($dataSet == 'rainfall' || $dataSet == 'evt') { ...
With regards to the above comment,

When you say "ALL lines",
do you mean All lines within the New code block,
or All lines within the entire code.

Cheers & thanks for the update.
:Now: :Today/Yesterday:

Image

Main Station Davis VP2+ Running Via Win10 Pro.
Secondary Stations, Ecowitt HP2551/GW1000 Via rPi 3 & 4 Running Buster GUI.
:Local Inverell Ecowitt Station: :Remote Ashford Ecowitt Station:
Post Reply