cloudy cloudy

Author Topic: WXSIM "EWN-style"  (Read 16622 times)

0 Members and 1 Guest are viewing this topic.

Offline wvdkuil

  • Wim van der Kuil
  • Posts: 765
  • Amsterdam / Netherlands
  • OS/Browser:
  • Mac OS X 10.13.3
  • Chrome 64.0.3282.119
    • My private weatherstation
Re: WXSIM "EWN-style"
« Reply #150 on: January 29, 2018, 08:41:13 PM »
Quote from: hila private message
. . . shortened . . .
Now I have made the modification in the data.php file and it works !!!
Now I only need one thing, the graphic ..
I think I have some problem with the Highcharts-custom ...
. . . shortened . . .
Thanks for you pm
It works now almost, but there is a problem with the translations. Highcharts needs those. I tested with the standard languages.

For now, check the generated  source of your script: http://meteohila2.esy.es/wxsim1/forecast.php nearly at the bottom
Code: [Select]
<script>
 name="Xert, Valenciana",lang="en",tzabb = "Europe/Madrid",version=2017.03,ewnpath="./wxsim/",latitude=40.52;
  var days = null,months = null;
  var temptxt="TEMP",barotxt="BARO",prectxt="PRECIP",windtxt="WIND",dewtxt="DEWP",snowtxt="SNOB",feeltxt="FEELS",tstxt="TSPROB",humtxt="HUMIDITY",gusttxt="GUST",rratetxt="RRATE",txtgust="GUST",txtmidnightsun="MIDNIGHTSUN",txtpolarnight="POLARNIGHT";
  var snowset="cm",baroset="hPa",wiset="kmh",piset="mm",tiset="c";
</script>
it is missing essential translated texts, this is how it should look
Code: [Select]
<script>
name="Xert, Valenciana",lang="en",tzabb = "Europe/Madrid",version=2017.03,ewnpath="./wxsim/",latitude=40.52;
  var days = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],months = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
  var temptxt="Temperature",barotxt="Pressure",prectxt="Precipitation",windtxt="Wind",dewtxt="Dewpoint",snowtxt="SNOB",feeltxt="Feels like",tstxt="TS-prob.",humtxt="Humidity",gusttxt="Gust",rratetxt="RRATE",txtgust="Gust",txtmidnightsun="Midnight Sun",txtpolarnight="Polar Night";
  var snowset="cm",baroset="hPa",wiset="kmh",piset="mm",tiset="c";
</script>
Highcharts can not draw the graphs as the array for day-names is empty. These are the errors on the inspect console
Code: [Select]
ncaught TypeError: Cannot read property '2' of null
    at qa (highcharts-custom-4.2.0.js:29)
    at ra (highcharts-custom-4.2.0.js:18)
    at Object.defaultLabelFormatter (highcharts-custom-4.2.0.js:111)
    at Xa.addLabel (highcharts-custom-4.2.0.js:96)
    at new Xa (highcharts-custom-4.2.0.js:21)
    at highcharts-custom-4.2.0.js:136
    at Array.forEach (<anonymous>)
    at t (highcharts-custom-4.2.0.js:32)
    at L.Axis.getOffset (highcharts-custom-4.2.0.js:136)
    at highcharts-custom-4.2.0.js:209
This  is related to the empty names arrays.
Code: [Select]
{a:q[g].substr(0,3),A:q[g],d:Ta(h),e:h,w:g,b:m.shortMonths[k],B:m.months[k],m:Ta(k+1),y:l.toString().substr(2,2),YIt is getting late so i will check tomorrow. Somewhere the link tothe correct langs is lost, need a clear head to find it.

SUCCES: I think I found it.
Your webserver is set to probably Es as language.
The script detects that and set the language to whatever the server has  in config.php
Code: [Select]
$query=$_SERVER["QUERY_STRING"];
$q=explode("|",$query);
if(preg_match("|\||",$query)){
  $lang=$q[0];
}
But that language is not supported in the rest of the script lines 71-280, so the arrays are not filled with the month-names as they are for fi, sv,se,da,dk,de,nl,it and en.

So add  the following text at the empty line 70 and test for the next problem, if there is any.
Code: [Select]
$lang= "en" ;  

Wim
« Last Edit: January 29, 2018, 09:16:14 PM by wvdkuil »
Vantage VUE with a WLIP used for https://weer.sluispark.be/
Vantage VP2 with a USB logger/Meteobridge for https://www.weerstation-herent.be/

Offline hila

  • Posts: 5
  • OS/Browser:
  • Win XP
  • Chrome 49.0.2623.112
Re: WXSIM "EWN-style"
« Reply #151 on: January 29, 2018, 09:46:08 PM »
Perfect, working !!!

Thank you very much Wim !!! For all your patience and explanations, it has been of great help to me, if it had not been for you I would not have achieved it ..  =D&gt;

http://meteohila2.esy.es/wxsim1/forecast.php


Offline blainec

  • Global Moderator
  • Posts: 357
  • Calgary, Ab.
  • OS/Browser:
  • Win NT 10.0
  • Firefox 57.0
    • Calgary Alberta
Re: WXSIM "EWN-style"
« Reply #152 on: January 31, 2018, 04:44:35 AM »
Same type of problem as above,  but with warnings this time, check http://wxcalgary.com/meteotemplate/wxsim/wxsim/data.php?wunit=kmh&lang=en
Use Chrome => right click => choose inspect => tab console => check for errors.
You can use another browser, it will take different steps to get at the errors. After you solved the problem below, set error reporting to false.

In your case the data.php script is not returning data, at the bottom there should be a large chunk of JSON data.
This is the message: 
Warning: file(../wdUpload/plaintext.txt): failed to open stream:
No such file or directory in /home/wxcalg5/public_html/meteotemplate/wxsim/wxsim/plaintext.php on line 86

It tells us that good old plaintext.php could not load the plaintext.txt file.
Check the link to your plaintext.txt file, it probably is now ../wdUpload/plaintext.txt  => "one step back from the executing script" / "folder wdUpload"

You have to add another ../ to that setting as the file is not  one step back from
http://wxcalgary.com/meteotemplate/wxsim/wxsim/plaintext.php in
http://wxcalgary.com/meteotemplate/wxsim/wdUpload/plaintext.txt but two steps back in
http://wxcalgary.com/meteotemplate/wdUpload/plaintext.txt

Hang in for a while more, it will work as with others,
Wim

Thank you, I have it all working now.

Offline blainec

  • Global Moderator
  • Posts: 357
  • Calgary, Ab.
  • OS/Browser:
  • Win NT 10.0
  • Firefox 58.0
    • Calgary Alberta
Re: WXSIM "EWN-style"
« Reply #153 on: February 04, 2018, 07:03:20 PM »
Just curious.   Has anyone actually put the short.php in a Meteotemplate block?   I have been trying for a while now but can't seem to get it to work.

Offline i_fiorentino

  • Alessandro Bardi
  • Posts: 1,692
  • 150 mls Candeglia (Pt), Tuscany, Italy
  • OS/Browser:
  • Android 7.0
  • Chrome 64.0.3282.137
    • Meteopistoia.it
Re: WXSIM "EWN-style"
« Reply #154 on: February 10, 2018, 08:57:03 AM »
Just curious.   Has anyone actually put the short.php in a Meteotemplate block?   I have been trying for a while now but can't seem to get it to work.

Yes sure!
Take a look here: http://www.meteopistoia.it

Just put an iframe on default block page like this:

Quote
<iframe src="http://www.meteopistoia.it/short.php" frameBorder="0" style="border: none; overflow: hidden; width:100%; height:221px;"></iframe>

Offline blainec

  • Global Moderator
  • Posts: 357
  • Calgary, Ab.
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Firefox 58.0
    • Calgary Alberta
Re: WXSIM "EWN-style"
« Reply #155 on: February 12, 2018, 06:35:29 AM »
Thanks for the tip, works great

Offline i_fiorentino

  • Alessandro Bardi
  • Posts: 1,692
  • 150 mls Candeglia (Pt), Tuscany, Italy
  • OS/Browser:
  • Android 5.0.2
  • Chrome 64.0.3282.137
    • Meteopistoia.it
Re: WXSIM "EWN-style"
« Reply #156 on: February 13, 2018, 12:04:59 AM »
Thanks for the tip, works great

You're welcome  :)

Offline hrvistaweather

  • Posts: 244
  • Franklin, Huon Valley Southern Tasmania
  • OS/Browser:
  • Win NT 6.3
  • Chrome 66.0.3359.139
    • Huon River Vista Weather - South Franklin - Tasmania
Re: WXSIM "EWN-style"
« Reply #157 on: May 09, 2018, 11:57:14 PM »
Hi Henkka,

Hope you are well.
I have had a NaN issue displaying Precip an the Overview page this week, rainfall forecast has changed daily per run from over 200 mm to now over 60 mm.
However Overview page continues to show NaN mm. https://southfranklinweather.com/wxsim/forecast.php

I've search the files for a culprit, though can't find the cause. Would you have any ideas. ?

Below screenshots of old 3 in 1 workin fine and EWN-Style in NaN mm.
Also below is excerpt of same period in plaintext.txt
Quote
Tonight: Dense overcast. Rain likely. Breezy. Low 7, but temperatures rising
 after midnight. Wind south-southeast around 23 kph, gusting to 35 kph. Chance of
 precipitation 80 percent. Precipitation mostly over 60 mm. Minimum snow level
 150 meters above sea level.

I feel it maybe something to do with the "over 60 mm".

Kind regards,
Tony
« Last Edit: May 10, 2018, 12:40:21 AM by hrvistaweather »
Tony

Davis Vantage Pro 2 Plus - FARS, Cumulus MX, 2 Soil Temp/Moist Solar/Rad.
Back Online : 2017-11-01

Offline i_fiorentino

  • Alessandro Bardi
  • Posts: 1,692
  • 150 mls Candeglia (Pt), Tuscany, Italy
  • OS/Browser:
  • Win NT 10.0
  • Chrome 66.0.3359.181
    • Meteopistoia.it
Re: WXSIM "EWN-style"
« Reply #158 on: May 21, 2018, 08:52:22 PM »
Hi Henkka,

Hope you are well.
I have had a NaN issue displaying Precip an the Overview page this week, rainfall forecast has changed daily per run from over 200 mm to now over 60 mm.
However Overview page continues to show NaN mm. https://southfranklinweather.com/wxsim/forecast.php

I've search the files for a culprit, though can't find the cause. Would you have any ideas. ?

Below screenshots of old 3 in 1 workin fine and EWN-Style in NaN mm.
Also below is excerpt of same period in plaintext.txt
I feel it maybe something to do with the "over 60 mm".

Kind regards,
Tony

Same thing here Tony.
I've sent an email to Henrik about this issue but without lucky :(