IMPORTANT! The server may go down soon - possibly permanently. Please read the latest post in Announcements and News

I strongly advise all users using my server for their web site to make alternative arrangements.

Outgoing mail is disabled because of the malware on the server. No new forum registrations are currently possible, and mail to the forum administrator will not work.

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

SQL dayfile data Viewer

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

Moderators: daj, TNETWeather

User avatar
PaulMy
Posts: 1680
Joined: Sun Sep 28, 2008 11:54 pm
Weather Station: Davis Vantage Pro 2 w/Envoy USB
Operating System: Windows-8
Location: Komoka, ON Canada
Contact:

Re: SQL dayfile data Viewer

Postby PaulMy » Tue Dec 19, 2017 10:22 pm

Hi Kocher,
I changed my webserver at GoDaddy to cPanel a couple weeks ago and that included changing my MySQL database. Everything seemed to have worked eventually, except that http://www.komokaweather.com/mysql/dayf ... le-sql.php only goes back to Dec 10. The previous database Dayfile table has data up to Dec 10. The new database Dayfile table is populated to current (Dec 18) so it appears the script is looking in the old database Dayfile table. I've looked in the various files that make up dayfile-sql but have not found where I might need to edit. Any suggestion?

Thanks,
Paul

sfws
Posts: 448
Joined: Fri Jul 27, 2012 11:29 am
Weather Station: Customised mix of Fine Offset
Operating System: Tempermental Win. 10 PC
Location: UK

Re: SQL dayfile data Viewer

Postby sfws » Wed Dec 20, 2017 7:48 am

Paul
In server_processing.php, presumably you have changed the database reference in this code found near the end of that file?

Code: Select all

// SQL server connection information
$sql_details = array(
   'user' => $dbuser,
   'pass' => $dbpassword,
   'db'   => theDatabase,
   'host' => $dbhost
);


I'm busy doing a massive rewrite of my METAR decoder to try to speed it up at the moment, so I have not looked through other scripts making up dayfile-sql but I think this is what you were unable to find. I did notice on your page that a couple of entries in the summary line are not showing figures, I solved that when I implemented the dayfile-sql script on my PC, I think it was something to do with whether units are added or not, but I can't recall exactly. Maybe I will have a look later.

I note that the download in the first post of this thread is no longer available, but fortuently I use the script so have it on my PC.
This is my 350th post, I hope that means I have made a small but significant contribution to the community on this forum!

User avatar
PaulMy
Posts: 1680
Joined: Sun Sep 28, 2008 11:54 pm
Weather Station: Davis Vantage Pro 2 w/Envoy USB
Operating System: Windows-8
Location: Komoka, ON Canada
Contact:

Re: SQL dayfile data Viewer

Postby PaulMy » Wed Dec 20, 2017 2:17 pm

Paul
In server_processing.php, presumably you have changed the database reference in this code found near the end of that file?

Thanks sfws, I had not gone in that folder or file. After editing now the table shows to current http://www.komokaweather.com/mysql/dayf ... le-sql.php.

Enjoy,
Paul

sfws
Posts: 448
Joined: Fri Jul 27, 2012 11:29 am
Weather Station: Customised mix of Fine Offset
Operating System: Tempermental Win. 10 PC
Location: UK

Re: SQL dayfile data Viewer

Postby sfws » Wed Dec 20, 2017 7:36 pm

Paul
I have now checked, and find I amended "dayfile-sql.???" file where the original had

Code: Select all

 "footerCallback": function ( row, data, start, end, display ) {
            var api = this.api(), data;
            // Remove the formatting to get integer data for summation
            var intVal = function ( i ) {
                return typeof i === 'string' ?
                    i.replace(/[\mm,\Km,\hPa,]/g, '')*1 :
                    typeof i === 'number' ?
                        i : 0;
            };

My amendment was to add to the list of units in line 255 so it also included the units for the columns where the max/min/average/total was not appearing. From a very quick inspection, it appears that is all I changed to add the missing figures to my footer, the equivalent of your
Date -19.5 °C 34.0 °C 12.2 °C 263.0 mm Bmin Bmax Wgust 5827 Km

Put as simply as I can that is a pattern replacement instruction within the demiiters, it looks for any one of the expressions separated by a comma in the square brackets and replaces it by an empty string (delimited by the pair of single quotes). I'm very new to pattern specifying and had to look up the significance of the 'g' flag for javascript, apparently it gives the expression a global applicability.
If I am correct, then you are missing the \hPa and \km/H units (or for you latter is Km/h apparently). You may have problems with '/' as it appears that character is used as start and end delimiter outside the square brackets. I believe you also need to escape the '/' i.e. '//'. As I said, I am a novice with these expressions, and just starting to learn the PERL ones used with PHP, and the javascript ones might be different.

It is possible I also amended the code snippet dealing with reading from the database and adding the figures to the table but I can't at a quick glance see any other relevant changes.

User avatar
kocher
Posts: 67
Joined: Sat Apr 19, 2014 7:57 pm
Weather Station: Davis Vantage Pro2+
Operating System: Windows 10
Location: San Sebastian - Spain
Contact:

Re: SQL dayfile data Viewer

Postby kocher » Sat Dec 23, 2017 7:36 pm

Greetings to all.

The download link for this script is already working again:

    http://kocher.es/cajon/DataTables-cumulus-dayfile.rar

You can see the installation instructions at:

          http://sandaysoft.com/forum/viewtopic.php?f=14&t=15983#p122552


Saludos desde San Sebastian :D
Image

User avatar
vpokroglo
Posts: 55
Joined: Thu Feb 24, 2011 7:45 pm
Weather Station: WS-2350
Operating System: Raspberry Pi 2
Location: Slovenija

Re: SQL dayfile data Viewer

Postby vpokroglo » Thu Dec 28, 2017 2:04 pm

Great script!
Do anyone know some script to show data from monthly files- monthly mysql?
Image

User avatar
vpokroglo
Posts: 55
Joined: Thu Feb 24, 2011 7:45 pm
Weather Station: WS-2350
Operating System: Raspberry Pi 2
Location: Slovenija

Re: SQL dayfile data Viewer

Postby vpokroglo » Fri Jan 19, 2018 7:55 am

What does the bottom line (circled-red color) show?
Image
Image

sfws
Posts: 448
Joined: Fri Jul 27, 2012 11:29 am
Weather Station: Customised mix of Fine Offset
Operating System: Tempermental Win. 10 PC
Location: UK

Re: SQL dayfile data Viewer

Postby sfws » Fri Jan 19, 2018 4:11 pm

sfws wrote:where the max/min/average/total was

What you ringed in red is supposed to show summary for column. I have just quoted an extract from my earlier post where I mention for my own version I tried to sort out that output line. I will leave it to the author of the script to add any further comment.

User avatar
kocher
Posts: 67
Joined: Sat Apr 19, 2014 7:57 pm
Weather Station: Davis Vantage Pro2+
Operating System: Windows 10
Location: San Sebastian - Spain
Contact:

Re: SQL dayfile data Viewer

Postby kocher » Wed Feb 14, 2018 7:35 pm

Effectively

The foot of the table, contains the summary of each column after conducting a search;

1): Get the minimum temperature of all filtered dates
2): Get the maximum temperature all of the filtered dates.
3): Get the mean value of the average temperature of all the filtered dates.
4): Obtain the sum of the precipitation of the filtered dates.

And so on: Minimum pressure, Maximum pressure, Maximum windgust and the Total kilometers traveled by the wind:


http://kocher.es/central.php

Saludos desde San Sebastian, Spain
Image

User avatar
vpokroglo
Posts: 55
Joined: Thu Feb 24, 2011 7:45 pm
Weather Station: WS-2350
Operating System: Raspberry Pi 2
Location: Slovenija

Re: SQL dayfile data Viewer

Postby vpokroglo » Sun Feb 18, 2018 8:20 am

kocher wrote:Effectively

The foot of the table, contains the summary of each column after conducting a search;

1): Get the minimum temperature of all filtered dates
2): Get the maximum temperature all of the filtered dates.
3): Get the mean value of the average temperature of all the filtered dates.
4): Obtain the sum of the precipitation of the filtered dates.

And so on: Minimum pressure, Maximum pressure, Maximum windgust and the Total kilometers traveled by the wind:


http://kocher.es/central.php

Saludos desde San Sebastian, Spain



I am not sure if this is correct,

If I set filter to 2017 (year only), I get different values when scrolling down, so data shown in the bottom row is unusable in this way.
If I set year and month, it is OK.
Image

User avatar
Toxic17
Posts: 698
Joined: Mon May 19, 2014 10:45 pm
Weather Station: Davis VPro2 Plus
Operating System: Debian 9.5 Stretch
Location: Bangor, NI
Contact:

Re: SQL dayfile data Viewer

Postby Toxic17 » Tue Jul 31, 2018 9:55 am

Does anyone have the full archive handy to download? links provided are dead.
Regards Simon

https://www.conligwx.org
https://www.conligwx.org/pws/
https://twitter.com/conligwx
Davis Vantage Pro2+ - CumulusMX v3.0.0 (build 3043) + Saratoga/PWS
Image

User avatar
kocher
Posts: 67
Joined: Sat Apr 19, 2014 7:57 pm
Weather Station: Davis Vantage Pro2+
Operating System: Windows 10
Location: San Sebastian - Spain
Contact:

Re: SQL dayfile data Viewer

Postby kocher » Wed Sep 26, 2018 5:19 pm

I am sorry

The link is now active again:

http://kocher.es/cajon/DataTables-cumulus-dayfile.rar
Image


Return to “Web site - General”

Who is online

Users browsing this forum: No registered users and 8 guests