Author Topic: Wind Rose  (Read 1552 times)

0 Members and 1 Guest are viewing this topic.

Offline griffo42

  • Contributor
  • ***
  • Posts: 101
    • Carina Weather
Wind Rose
« on: May 19, 2020, 09:02:29 PM »
 I am running Saratoga/Cumulus.

When the wind is calm the windrose is not shown on my site as evidenced in the screenshot below.
 [ You are not allowed to view attachments ]

The relevant part of code in my  ajax-dashboard.php script is:

<?php // Wind section coding ?>
          <td valign="middle" align="center">
          <table width="225" border="0" cellpadding="2" cellspacing="0">
         <tr>
                <td class="data1" valign="middle" align="center" style="border: none">
              <img src="<?php echo $imagesDir; ?>spacer.gif" width="1"
                height="<?php echo $wrHeight; ?>" alt=" " align="left"/>
              <span class="ajax" id="ajaxwindiconwr">
              <?php $wr = $imagesDir . $wrName . $dirlabel . $wrType; // normal wind rose
                    $wrtext = langtransstr('Wind from') ." " . langtransstr($dirlabel);
                  if ( ((float)strip_units($avgspd) + strip_units($gstspd) < 0.1 ) and
                       ($wrCalm <> '') ) { // use calm instead
                    $wr = $imagesDir . $wrCalm;
                    $wrtext = $bftspeedtext;
                   }
              ?>
                <img src="<?php echo $wr; ?>"
               height="<?php echo $wrHeight; ?>" width="<?php echo $wrWidth; ?>"
               title="<?php echo $wrtext; ?>"
               alt="<?php echo $wrtext; ?>"  style="text-align:center" />
               </span>
             </td>

which seems to me to be the same as is in the latest version of that script.

Can someone throw some light on a fix for me please so that the rose is shown irrespective of the wind speed?

Keith
Brisbane, Australia
https://www.kstwx.net/index.php
Davis Vantage Pro2 Model #6152AU
Cumulus latest version
Saratoga Weather World template Cumulus plugin
Carina Weather, Brisbane.

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 949
    • LexMAWeather
Re: Wind Rose
« Reply #1 on: May 19, 2020, 09:30:14 PM »
You are missing wr-calm.png in your ajax-images directory.

E.g.
   https://www.kstwx.net/ajax-images/wr-SE.png

is there but

   https://www.kstwx.net/ajax-images/wr-calm.png

is not.
https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

Offline griffo42

  • Contributor
  • ***
  • Posts: 101
    • Carina Weather
Re: Wind Rose
« Reply #2 on: May 20, 2020, 03:31:28 AM »
Hi Jasiu

Thanks for your reply.  The wr-calm.png file is in the folder that you suggested.  The problem still exists as can be seen from the screenshot taken some 10 mins ago:

 [ You are not allowed to view attachments ]

Any other advice, please?

Keith
https://www.kstwx.net/index.php
Davis Vantage Pro2 Model #6152AU
Cumulus latest version
Saratoga Weather World template Cumulus plugin
Carina Weather, Brisbane.

Offline griffo42

  • Contributor
  • ***
  • Posts: 101
    • Carina Weather
Re: Wind Rose
« Reply #3 on: May 20, 2020, 07:35:57 AM »
Here is the latest example of what is going on!  The only difference that I can see is that gust and wind speed are both zero.

 [ You are not allowed to view attachments ]

Hope this is of assistance in providing advice as to how to fix it.

Keith
https://www.kstwx.net/index.php
Davis Vantage Pro2 Model #6152AU
Cumulus latest version
Saratoga Weather World template Cumulus plugin
Carina Weather, Brisbane.

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 949
    • LexMAWeather
Re: Wind Rose
« Reply #4 on: May 20, 2020, 08:37:56 AM »
When this happens, do a "view-source" so you can see what image file name is being created.

  view-source:https://www.kstwx.net/index.php

This is the code you want to look for (and post), around line 770:

Code: [Select]
                <td class="data1" valign="middle" align="center" style="border: none">
  <img src="./ajax-images/spacer.gif" width="1"
    height="58" alt=" " align="left"/>
  <span class="ajax" id="ajaxwindiconwr">
      <img src="./ajax-images/wr-calm.png"
height="58" width="58"
title="Calm"
alt="Calm"  style="text-align:center" />
   </span>
</td>
                <td valign="middle" class="data1" style="text-align: center; border: none;" >
<span class="ajax" id="ajaxwinddir">-</span><br/>
<span class="ajax" id="ajaxwind">
0  km/h</span><br/>
<span class="meas">Gust:<br/></span>
<span class="ajax" id="ajaxgust">
  0  km/h </span>
</td>
https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 949
    • LexMAWeather
Re: Wind Rose
« Reply #5 on: May 20, 2020, 09:31:03 AM »
Also, Ken, can you move this to the PHP / AJAX scripting board?
https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 949
    • LexMAWeather
Re: Wind Rose
« Reply #6 on: May 20, 2020, 10:18:23 AM »
I caught it at the right time.

Code: [Select]
                <td class="data1" valign="middle" align="center" style="border: none">
  <img src="./ajax-images/spacer.gif" width="1"
    height="58" alt=" " align="left"/>
  <span class="ajax" id="ajaxwindiconwr">
      <img src="./ajax-images/wr--.png"
height="58" width="58"
title="Wind from -"
alt="Wind from -"  style="text-align:center" />
   </span>
</td>
                <td valign="middle" class="data1" style="text-align: center; border: none;" >
<span class="ajax" id="ajaxwinddir">-</span><br/>
<span class="ajax" id="ajaxwind">
0  km/h</span><br/>
<span class="meas">Gust:<br/></span>
<span class="ajax" id="ajaxgust">
  2  km/h </span>
</td>

I'd need to see your ajax-dashboard script in entirety to figure this out. If I try to do a sce=view on it, I get the Settings-language file instead (Ken, is there a workaround, or for the future can the self downloader code be moved up in ajax-dashboard?).
https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

Offline ConligWX

  • Forecaster
  • *****
  • Posts: 843
  • #conligwx
    • conligwx.org
Re: Wind Rose
« Reply #7 on: May 20, 2020, 10:26:08 AM »
worth checking both ajaxdashboard.php AND ajaxCUwx.js for any anomalies.
Regards Simon
Davis Vantage Pro2 Plus (6162UK) • Daytime FARS • WeatherLink Live • AirLink • PurpleAir PA-II-SD • CumulusMX •


Offline the beteljuice

  • the beteljuice
  • Forecaster
  • *****
  • Posts: 316
    • test site
Re: Wind Rose
« Reply #8 on: May 20, 2020, 10:44:24 AM »
Your site is rather 'broken' !

You have multiple <head> , <doctype= >, <body> statements.
There also problems with some of your commenting.

dashboard ajax doesn't seem to cope with windbearing 0, but it should get 'repaired' by ajaxCUwx.js

I don't believe ajaxCUwx.js is running properly, your page data is NOT updating from ajax but from the nasty meta-refresh you have.


There is an error in ajaxCUwx.js @ line #910
Code: [Select]
        if(!showDateMDY) { ajaxdateformat = tdate[0]+"/"+tdate[1]+"/"+tdate[2]";  }
// should be
        if(!showDateMDY) { ajaxdateformat = tdate[0]+"/"+tdate[1]+"/"+tdate[2];  }

... but it's unclear if that is the problem ...

In your page you have:
Code: [Select]
<!-- <span class="ajax" id="ajaxtime"></span> -->
<!--     <span class="ajax" id="ajaxdate">
        </span>&nbsp;<span class="ajax" id="ajaxtime"></span>
                        <script type="text/javascript">
<!--
document.write('<b> -  <span id="ajaxcounter"></span>&nbsp;</b>');
//-->
  <!--          </script>  -->
<script> is opened, but NOT closed, this is a mess and needs to be sorted out as to what you actually want to do !!
Imagine what you will KNOW tomorrow !

Offline griffo42

  • Contributor
  • ***
  • Posts: 101
    • Carina Weather
Re: Wind Rose
« Reply #9 on: May 20, 2020, 09:37:20 PM »
The attachment is the view-source:https://www.kstwx.net/index.php converted to a txt file.  Hope this is some assistance in sorting this matter out.  Generally, I have taken the published Saratoga template set as provided by Ken True and made alterations to them to include extra data.  I have not made any changes in the area of the windrose.

Thanks for everybody's effort.

Best wishes

Keith
https://www.kstwx.net/index.php
Davis Vantage Pro2 Model #6152AU
Cumulus latest version
Saratoga Weather World template Cumulus plugin
Carina Weather, Brisbane.

Offline the beteljuice

  • the beteljuice
  • Forecaster
  • *****
  • Posts: 316
    • test site
Re: Wind Rose
« Reply #10 on: May 20, 2020, 11:34:38 PM »
Quote
I have not made any changes in the area of the windrose.
You're missing the point.
Something is making the javascript 'break' - hence no updating via ajaxCUwx.js

Quite possibly the clock you have added, and moved stuff around.

BTW - You do realise that clock shows the visitors local time, not site time ?
Imagine what you will KNOW tomorrow !

Offline griffo42

  • Contributor
  • ***
  • Posts: 101
    • Carina Weather
Re: Wind Rose
« Reply #11 on: May 21, 2020, 02:19:46 AM »
Quote
I have not made any changes in the area of the windrose.
You're missing the point.
Something is making the javascript 'break' - hence no updating via ajaxCUwx.js

Quite possibly the clock you have added, and moved stuff around.

BTW - You do realise that clock shows the visitors local time, not site time ?

I have now downloaded the latest version of all Saratoga scripts plus the Cumulus plugin from Ken True's website.  I then compared the code in that version of ajaxCUwx.js with the one that I was using and this came up with some differences.  I then replaced the version in use with that recently downloaded and this seems to have fixed the problem.

As for the clock time, I have made a change with the aim of having it show Brisbane local time anywhere in the world.  Would you please check (as I am unable to do so) that I have achieved my aim.

Thanks for your help beteljuice

Best wishes
Keith
https://www.kstwx.net/index.php
Davis Vantage Pro2 Model #6152AU
Cumulus latest version
Saratoga Weather World template Cumulus plugin
Carina Weather, Brisbane.

Online wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Wind Rose
« Reply #12 on: May 21, 2020, 02:50:01 AM »
. . .
As for the clock time, I have made a change with the aim of having it show Brisbane local time anywhere in the world.  Would you please check (as I am unable to do so) that I have achieved my aim.
. . .
It is now 08:41:00 in Brussel, the analog clock shows that time.

According to my estimate it is 16:51:00 in Brisbane.
The  first line of the "digital" clock shows Brisbane date / time.
Another line with current time = Brussels time[/quote]

===
There are still error mesages for missing windrose
Code: [Select]
GET https://www.kstwx.net/ajax-images/wr--.png 404 (Not Found)You could copy the calm windrose and name it wr--.png for the time being.

Wim
« Last Edit: May 21, 2020, 03:08:25 AM by wvdkuil »

Offline griffo42

  • Contributor
  • ***
  • Posts: 101
    • Carina Weather
Re: Wind Rose
« Reply #13 on: May 21, 2020, 03:47:14 AM »
Thanks Wim

That means that I haven't fixed it to show Brisbane time on my website irrespective of where it is viewed in the world.  A work in progress!  I am learning all the time.  Everyone is so helpful and patient with absolute novices like me - appreciate it.

best wishes

Keith
https://www.kstwx.net/index.php
Davis Vantage Pro2 Model #6152AU
Cumulus latest version
Saratoga Weather World template Cumulus plugin
Carina Weather, Brisbane.

Online wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Wind Rose
« Reply #14 on: May 21, 2020, 07:28:52 AM »
Thanks Wim
That means that I haven't fixed it to show Brisbane time on my website irrespective of where it is viewed in the world.  A work in progress!  I am learning all the time.  Everyone is so helpful and patient with absolute novices like me - appreciate it.
best wishes
Keith
Ok it is showing my time after your latest update:
But the words "Currenttime" should better be replaced with "Your local time"  ??
Wim

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 949
    • LexMAWeather
Re: Wind Rose
« Reply #15 on: May 21, 2020, 08:50:52 AM »
The other big issue with the clock, as noted above, is that the code is for a stand-alone web page, repeating the html, head, body tags. Either that needs to be fixed or it has to go within an iframe if you want to keep the same code.
https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 949
    • LexMAWeather
Re: Wind Rose
« Reply #16 on: May 21, 2020, 08:51:46 AM »
I'll also note again that we need to see the raw PHP code for ajax-dashboard.php to figure out anything as to why the wrong file name is being generated.
https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

Offline the beteljuice

  • the beteljuice
  • Forecaster
  • *****
  • Posts: 316
    • test site
Re: Wind Rose
« Reply #17 on: May 21, 2020, 09:48:53 AM »
Everything ajaxCUwx.js is still broken I'm afraid (No updates taking place, you would see green flashes on changed data)

Try the 'standard' page just to prove that the problem IS with the mods / extras.
Clean up your html / extras in the page

In coding little things mean a lot  :shock: although it must be said modern browsers are very forgiving compared with say ten years ago.

The other side of the coin is when things do go t*ts up it can be difficult to find all the straws that broke the camels back  #-o
Imagine what you will KNOW tomorrow !

Offline zmarfak

  • Contributor
  • ***
  • Posts: 135
    • Matar
Re: Wind Rose
« Reply #18 on: May 21, 2020, 10:02:20 AM »
When I did my search correctly you have to change this rule for a correct time :

Code: [Select]
<canvas id="clockid" class="CoolClock:GMTOffset +10" >

it must be more eg :
Code: [Select]
<canvas id="clockid" class="CoolClock:swissrail:85:Seconds:+10">
When I read some info on http://randomibis.com/coolclock/
Patrick
Davis Vantage Pro2 with a Meteobridge NANO SD and WL (6.04) on a Intel NUC 
https://www.matar.be

Offline griffo42

  • Contributor
  • ***
  • Posts: 101
    • Carina Weather
Re: Wind Rose
« Reply #19 on: May 22, 2020, 01:02:22 AM »
I'll also note again that we need to see the raw PHP code for ajax-dashboard.php to figure out anything as to why the wrong file name is being generated.


Thanks for your offer of help.  A zipped copy of my ajax-dashboard.php file is attached/

Keith
https://www.kstwx.net/index.php
Davis Vantage Pro2 Model #6152AU
Cumulus latest version
Saratoga Weather World template Cumulus plugin
Carina Weather, Brisbane.

Offline griffo42

  • Contributor
  • ***
  • Posts: 101
    • Carina Weather
Re: Wind Rose
« Reply #20 on: May 22, 2020, 01:17:20 AM »
Everything ajaxCUwx.js is still broken I'm afraid (No updates taking place, you would see green flashes on changed data)

Try the 'standard' page just to prove that the problem IS with the mods / extras.
Clean up your html / extras in the page

In coding little things mean a lot  :shock: although it must be said modern browsers are very forgiving compared with say ten years ago.

The other side of the coin is when things do go t*ts up it can be difficult to find all the straws that broke the camels back  #-o

I have replied to Jasiu with a zipped copy of my ajax-dashboard.php file.  My ajaxCUwx.js is the same as that in a download of the entire Saratoga package yesterday (maxupdates altered to zero).  I have noticed that some other things do not flash green everytime when the word "Updated" does so.

The analogue clock in the head is now shown by using iframe to insert an html file.  This and the digital "Current Local Time" should always now show Brisbane time irrespective of from where the page is viewed.  I would appreciate a check of this.

Thanks again
Keith

Thanks for your help

Keith
https://www.kstwx.net/index.php
Davis Vantage Pro2 Model #6152AU
Cumulus latest version
Saratoga Weather World template Cumulus plugin
Carina Weather, Brisbane.

Online wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Wind Rose
« Reply #21 on: May 22, 2020, 03:50:36 AM »
. . .
The analogue clock in the head is now shown by using iframe to insert an html file.  This and the digital "Current Local Time" should always now show Brisbane time irrespective of from where the page is viewed.  I would appreciate a check of this.
. . .
See attached screenshot

The clock shows my Brussels time
The two lines in the header show Brisbane time

Wim

Offline zmarfak

  • Contributor
  • ***
  • Posts: 135
    • Matar
Re: Wind Rose
« Reply #22 on: May 22, 2020, 03:59:39 AM »
Hi,
Like Wim said still showing my local time,
please check my former answer and try in your html code :

Code: [Select]
<canvas id="clockid" class="CoolClock:swissrail:85:Seconds:+10">
and not
Code: [Select]
<canvas id="clockid" class="CoolClock:GMTOffset +10" >Thanks
Patrick
Davis Vantage Pro2 with a Meteobridge NANO SD and WL (6.04) on a Intel NUC 
https://www.matar.be

Offline griffo42

  • Contributor
  • ***
  • Posts: 101
    • Carina Weather
Re: Wind Rose
« Reply #23 on: May 22, 2020, 07:39:25 AM »
. . .
The analogue clock in the head is now shown by using iframe to insert an html file.  This and the digital "Current Local Time" should always now show Brisbane time irrespective of from where the page is viewed.  I would appreciate a check of this.
. . .
See attached screenshot

The clock shows my Brussels time
The two lines in the header show Brisbane time

Wim

How is that now for showing Brisbane time on the analogue clock at your place?  Position not right but bed calls!

Keith
https://www.kstwx.net/index.php
Davis Vantage Pro2 Model #6152AU
Cumulus latest version
Saratoga Weather World template Cumulus plugin
Carina Weather, Brisbane.

Offline zmarfak

  • Contributor
  • ***
  • Posts: 135
    • Matar
Re: Wind Rose
« Reply #24 on: May 22, 2020, 08:54:47 AM »
Keith,
seems ok now
Patrick
Davis Vantage Pro2 with a Meteobridge NANO SD and WL (6.04) on a Intel NUC 
https://www.matar.be

 

anything