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

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

Comparing with one year ago

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

Moderators: daj, TNETWeather

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

Re: Comparing with one year ago

Postby sfws » Thu Oct 04, 2018 4:23 pm

I am pleased to see that you now have the test page almost working in that figures appear in all parts of the table although you are showing figures relating to a different month depending on what the time is when anybody loads the web page, whilst you should be showing statistics for 3 October 2018 and 3 October 2017.

The problem was previously it was looking for a date in 2020! Your field delimiter and date delimiter suggestion was irrelevant as although I don't use MX, I believe Cumulus 1 and Cumulus 3 (MX) use same format for dates in dayfile.txt (although dates in other Cumulus log files are different between the two versions). You (dazza123) have solved that year problem, as presumably you were previously feeding in the first two figures of the year as the last two digits, now you are feeding in the correct 4 digit year. Perhaps, for the benefit of others, you can share what you had wrong and have now corrected, because I can't read your mind to know how you corrected the year.

Mapantz wrote:Anything to do with Cumulus V1 vs Cumulus V3?

Mapantz has spotted (well done) why that you still have a problem with the dates, as my Cumulus template file line 188 contains

Code: Select all

<script>var metDate=['<#metdate format="dd">','<#metdate format="mm">','<#metdate format="yyyy">',(parseInt("0"+"<#rollovertime>",10)),"<#rollovertime>"];</script><!-- Pass current Meteorological date and rollover time to script to search dayfile.txt, so knows what day to start search from -->

so it is using web tag <#metdate> and using format parameters that work in Cumulus 1, but not Cumulus MX, for generating the HTML file that was designed (in 2012) for the default format in Cumulus 1. In Cumulus MX '<#metdate format="mm">' returns minutes (which do vary depending on when during the day you generate the web page), in Cumulus 1 it returns month number.

The solution is simple, the month format selector in template line 188 needs to be in capitals to work with both Cumulus 1 and Cumulus MX:

Code: Select all

<script>var metDate=['<#metdate format="dd">','<#metdate format="MM">','<#metdate format="yyyy">',(parseInt("0"+"<#rollovertime>",10)),"<#rollovertime>"];</script><!-- Pass current Meteorological date and rollover time to script to search dayfile.txt, so knows what day to start search from -->]

User avatar
dazza1223
Posts: 393
Joined: Sun Jan 25, 2015 8:41 pm
Weather Station: Davis Vantage Vue
Operating System: raspberry pi 3 +
Location: worthing
Contact:

Re: Comparing with one year ago

Postby dazza1223 » Thu Oct 04, 2018 4:44 pm

hey sfws thank for that and what i did was thay was a bug in the day file that the js was not understanding and jucking out any this it was so i recreated the the day file and bingo all working mate thanks


buti just need to sort Temperature Range / Dominant Direction /Wind Run out as it not showing up ?
have fun and keep learning

dazza :D

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

Re: Comparing with one year ago

Postby sfws » Thu Oct 04, 2018 7:49 pm

dazza1223 wrote:just need to sort Temperature Range / Dominant Direction /Wind Run out as it not showing up ?

It would need me to do a lot of studying to check how the script does these calculations, because on my own test (not online) site I have totally revised how I calculate these.
For temperature range, the script should be subtracting the figure it displays for low temperature from the figure it displays for high temperature, therefore the calculation (and therefore the output) should occur immediently after it has found the second of those two from the various fields in the dayfile.txt line for one year ago.
The dominant direction uses a beteljuice routine to convert the bearing stored in field 39 (where date is field 0) into a compass direction. So the number should be passed to his function and the function will return a string that my script will output immediently afterwards.
The wind run appears in your screen shot, so are you suggesting the wrong figure is shown? Some days are far more windy than others, my figures vary between 0 and about 320 but I am sure my station does not capture fully actual speeds on windy days.

User avatar
dazza1223
Posts: 393
Joined: Sun Jan 25, 2015 8:41 pm
Weather Station: Davis Vantage Vue
Operating System: raspberry pi 3 +
Location: worthing
Contact:

Re: Comparing with one year ago

Postby dazza1223 » Thu Oct 04, 2018 8:32 pm

hey i was just to about to post to say ive fixed it now i was missing a tag in the js file thank u so much sfws :D :D :lol: :lol:
have fun and keep learning

dazza :D

User avatar
Mapantz
Posts: 493
Joined: Sat Dec 17, 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 10 x64 - A beast.
Location: Wareham, Dorset - UK
Contact:

Re: Comparing with one year ago

Postby Mapantz » Sat Oct 06, 2018 3:04 pm

As it's a wet & windy day, I decided to do some website stuff and thought i'd add the MySQL version of this to my site.

I've got 99.99% of it working - added a few extra's too. However, that 0.01% is the Beaufort number/description not showing up.

I get this error:

Code: Select all

PHP Notice:  Undefined variable: beaufort in /home/wareham1/public_html/yesterday_lastYear.php on line 63


https://warehamwx.co.uk/yesterday_lastYear.php
https://warehamwx.co.uk/yesterday_lastYear.txt
Image
Image

User avatar
dazza1223
Posts: 393
Joined: Sun Jan 25, 2015 8:41 pm
Weather Station: Davis Vantage Vue
Operating System: raspberry pi 3 +
Location: worthing
Contact:

Re: Comparing with one year ago

Postby dazza1223 » Sat Oct 06, 2018 3:09 pm

where did u get the MySQL version from as i was looking for it
have fun and keep learning

dazza :D

User avatar
Mapantz
Posts: 493
Joined: Sat Dec 17, 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 10 x64 - A beast.
Location: Wareham, Dorset - UK
Contact:

Re: Comparing with one year ago

Postby Mapantz » Sat Oct 06, 2018 3:16 pm

The download link is in the same post with all of the other download links on page 1.
Image
Image

User avatar
dazza1223
Posts: 393
Joined: Sun Jan 25, 2015 8:41 pm
Weather Station: Davis Vantage Vue
Operating System: raspberry pi 3 +
Location: worthing
Contact:

Re: Comparing with one year ago

Postby dazza1223 » Sat Oct 06, 2018 3:17 pm

o ok thank you did u here about this maybe shuting down in 4 day?
have fun and keep learning

dazza :D

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

Re: Comparing with one year ago

Postby sfws » Sat Oct 06, 2018 3:33 pm

Mapantz wrote: However, that 0.01% is the Beaufort number/description not showing up.

I get this error:

Code: Select all
PHP Notice: Undefined variable: beaufort in /home/wareham1/public_html/yesterday_lastYear.php on line 63

Line 329 has error in second parameter of call, you have:

Code: Select all

'<span class="lowerfont">&nbsp;mph</span>&nbsp;'

It is supposed to be passing a parameter to a function, not defining a font
Replace that section of the line with 'mph', as the only allowed values for that second parameter are as given in line 38

Code: Select all

$unitChoice=['km/h','mph','kts','m/s'];


======================

dazza1223 wrote:where did u get the MySQL version from as i was looking for it

Mapantz wrote:The download link is in the same post with all of the other download links on page 1.

I told you that ...
sfws wrote:If you want to use PHP and MySQL, 'yesterday_lastYearT.php' includes everything (just beware column names, as I did not follow DAJ's originals (loosely based on the dayfile.txt), but invented a more rule based naming standard, as mentioned in some of my postings earlier this year). Anyway 35 downloads suggests that several people took an interest. I cannot promise that script works with latest PHP version and latest MySQL, it worked well with versions available in 2012.

User avatar
Mapantz
Posts: 493
Joined: Sat Dec 17, 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 10 x64 - A beast.
Location: Wareham, Dorset - UK
Contact:

Re: Comparing with one year ago

Postby Mapantz » Sat Oct 06, 2018 4:00 pm

sfws wrote:Line 329 has error in second parameter of call, you have:

Code: Select all

'<span class="lowerfont">&nbsp;mph</span>&nbsp;'

It is supposed to be passing a parameter to a function, not defining a font
Replace that section of the line with 'mph', as the only allowed values for that second parameter are as given in line 38

Code: Select all

$unitChoice=['km/h','mph','kts','m/s'];



Doh! :oops:

Thanks sfws!

Thank you for sharing the script too. :)
Image
Image

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

Re: Comparing with one year ago

Postby sfws » Sat Oct 06, 2018 4:19 pm

Mapantz wrote:Thanks sfws!

Thank you for sharing the script too.

Thank you for using it, your web page has a very neat look.
I am pleased implementing a 6 year old script apparently did not involve too much effort from you. If the forum does manage to stay up after Monday, seeing my script being used by you might make others want to use it too.


Return to “Web site - General”

Who is online

Users browsing this forum: No registered users and 3 guests