cloudy cloudy

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

0 Members and 1 Guest are viewing this topic.

Offline weatherc

  • Posts: 1,977
  • Salo, Finland
  • OS/Browser:
  • Win NT 10.0
  • Firefox 51.0
    • Weatherstation Salo,FI
WXSIM "EWN-style"
« on: February 12, 2017, 07:22:38 PM »
Based on requests did i made a version of the new EWN-forecast-style also for WXSIM.   :wink:
The script is fully responsive.

Live demo: https://www.nordicweather.net/ennuste.php?en
Download: https://www.nordicweather.net/downloads/wxsim.zip

 :)

Henkka

Bashy

  • Guest
Re: WXSIM "EWN-style"
« Reply #1 on: February 12, 2017, 08:05:16 PM »
WOW Henkka, that looks brill, love it and will have a look at it tomorrow, thank you

Offline i_fiorentino

  • Alessandro Bardi
  • Posts: 1,682
  • 150 mls Candeglia (Pt), Tuscany, Italy
    • Meteopistoia.it
Re: WXSIM "EWN-style"
« Reply #2 on: February 12, 2017, 09:19:29 PM »
Up and running without any problem.
Thanks Henrik
Regards,


Alessandro

Offline SteveFitz1

  • Posts: 141
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Firefox 51.0
    • Tyler Texas Weather
Re: WXSIM "EWN-style"
« Reply #3 on: February 12, 2017, 11:16:47 PM »
Great job, Henkka! Got it going but have a issues.

One issue I still have is when I first display forecast.php, the temperatures are in Centigrade and the Units in m/s and rain totals are in mm. I have changed the units array on line 46 of config.php to use the second array. Do I need to change something else so that is uses the correct settings when I first run forecast?

The second issue I noticed after I changed the Units and the forecast page is displayed, the temperature and wind changed. However, rain measurements were still in mm instead of inches. I was hoping everything would be in US units ('F','in','mph','in','in','mi').

The third issue is that the Hi and Low temperature forecasts in the bar across the top do not match the forecasts for the same day listed below. For example, my forecast at the top has a low of 46 for Tuesday morning and 53 for Tuesday's high. However, in the forecast section below, the low for Tuesday morning is 47 and the Tuesday high is 52. Shouldn't the top and bottom forecasts agree?

Thanks very much.

Steve
« Last Edit: February 13, 2017, 02:58:00 AM by SteveFitz1 »

Offline hrvistaweather

  • Posts: 223
  • Franklin, Huon Valley Southern Tasmania
  • OS/Browser:
  • Win NT 6.3
  • Chrome 57.0.2987.37
    • Huon River Vista Weather - South Franklin - Tasmania
Re: WXSIM "EWN-style"
« Reply #4 on: February 13, 2017, 08:34:05 PM »
WOW Henkka,
Absolutely Brilliant, Thank you so much greatly appreciated.
I no longer have a web presence to show a link, though attached a pic from my internal network wamp site. Displays my 9 Day forecast brilliantly and love the Daily Summary Slide Bar and that in Table and Graph it displays the selected Day. The iPads love it too.
Only one issue I have is with the Moon Phase and how to adjust it for Southern Hemisphere (The Moon Icons also in Northern).
Kind Regards,
« Last Edit: February 13, 2017, 08:39:02 PM by hrvistaweather »
Tony

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

Offline weatherc

  • Posts: 1,977
  • Salo, Finland
  • OS/Browser:
  • Win NT 10.0
  • Firefox 51.0
    • Weatherstation Salo,FI
Re: WXSIM "EWN-style"
« Reply #5 on: February 13, 2017, 10:11:19 PM »
Hi guys,

Quote
One issue I still have is when I first display forecast.php, the temperatures are in Centigrade and the Units in m/s and rain totals are in mm. I have changed the units array on line 46 of config.php to use the second array. Do I need to change something else so that is uses the correct settings when I first run forecast?

The script use c,m/s,mm as internal units. The scripts gives the choise to the user who can choose the units from the gear-icon and the script remember the choises.

Quote
The second issue I noticed after I changed the Units and the forecast page is displayed, the temperature and wind changed. However, rain measurements were still in mm instead of inches. I was hoping everything would be in US units ('F','in','mph','in','in','mi').

At the moment are only temp and wind-units user-selectable but i can add also rain to it.

Quote
The third issue is that the Hi and Low temperature forecasts in the bar across the top do not match the forecasts for the same day listed below. For example, my forecast at the top has a low of 46 for Tuesday morning and 53 for Tuesday's high. However, in the forecast section below, the low for Tuesday morning is 47 and the Tuesday high is 52. Shouldn't the top and bottom forecasts agree?

Max/min values in the carousel use (rounded) maxtemp/mintemp-values from lastret.txt (idea is to get the real max/min). Theese seems to be a few tenths higher/lower than the "normal" temperature.

Quote
Only one issue I have is with the Moon Phase and how to adjust it for Southern Hemisphere (The Moon Icons also in Northern).

Hmmm...The moon-stuffs comes from the 2 php-scripts (MoonPhase.php and moon-rise-set.php) what i found on the net and they works based on the coordinates. I have no idea else than have you tryed to fiddle with the $latitude in config.php?

Offline SteveFitz1

  • Posts: 141
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Firefox 51.0
    • Tyler Texas Weather
Re: WXSIM "EWN-style"
« Reply #6 on: February 13, 2017, 11:03:10 PM »
Hennka,

Thanks very much for your response. I still have a couple of questions.

Regarding the units, since $uoms is a configurable option, I was just wondering why it isn't used to display temp, wind, rain, etc. instead of having to manually change these values with the gear icon.

Also, in the carousel temps, you mentioned these are rounded values. Wouldn't it make more sense to be consistent between the carousel and the table by either rounding in both places or not at all? It just doesn't look correct to show 2 different forecasted temps for the same day and night.

Thanks very much.

Steve

Offline weatherc

  • Posts: 1,977
  • Salo, Finland
  • OS/Browser:
  • Win NT 10.0
  • Firefox 51.0
    • Weatherstation Salo,FI
Re: WXSIM "EWN-style"
« Reply #7 on: February 14, 2017, 09:23:48 AM »
Quote
Regarding the units, since $uoms is a configurable option, I was just wondering why it isn't used to display temp, wind, rain, etc. instead of having to manually change these values with the gear icon.

As the orginal script was made for Europe (EWN) and this script are just a quick port of it do it have the European units as "default". But yes, i can give it a think if there are a easy way to change those default units.

Quote
Also, in the carousel temps, you mentioned these are rounded values. Wouldn't it make more sense to be consistent between the carousel and the table by either rounding in both places or not at all? It just doesn't look correct to show 2 different forecasted temps for the same day and night.

You maybe not understood how it works, lets clarify. Both table- and carousel-values are rounded when displayed as they do not show any decimals. Values in the table are just "shots" of the conditions at top of the hours, and do not show what happen the rest 59 minutes of that hour. Except the rain + some of its realted variables whats hourly values.  The values in the carousel again are daily values and therefore do it use the lowest/highest values found in the data. Theese may differ with even just 0.1 but due to the way they are shown (rounded) may they show different numbers.

Offline meteosa

  • Posts: 39
  • Italy
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Firefox 51.0
    • MeteoSantAngelo.it
Re: WXSIM "EWN-style"
« Reply #8 on: February 14, 2017, 01:05:28 PM »
One question: you can configure the "config.php" file and set the wind by default in "km/h"? I tried in every way but in "forecast.php" files always results in "m/s".
Thank you

Offline weatherc

  • Posts: 1,977
  • Salo, Finland
  • OS/Browser:
  • Win NT 10.0
  • Firefox 51.0
    • Weatherstation Salo,FI
Re: WXSIM "EWN-style"
« Reply #9 on: February 14, 2017, 02:21:07 PM »
One question: you can configure the "config.php" file and set the wind by default in "km/h"? I tried in every way but in "forecast.php" files always results in "m/s".
Thank you

It displays m/s as default, yes. You can set your own units for temperature and wind from the unit-gear in top-right corner. The browser should remember the settings.

Offline i_fiorentino

  • Alessandro Bardi
  • Posts: 1,682
  • 150 mls Candeglia (Pt), Tuscany, Italy
  • OS/Browser:
  • Win NT 10.0
  • Chrome 56.0.2924.87
    • Meteopistoia.it
Re: WXSIM "EWN-style"
« Reply #10 on: February 14, 2017, 02:53:05 PM »
One question: you can configure the "config.php" file and set the wind by default in "km/h"? I tried in every way but in "forecast.php" files always results in "m/s".
Thank you

Hi!

Set line 45 in config.php like this:

Code: [Select]
$uoms = array('C','mm','km/h','hPa','cm','km');  # IMPORTANT! Units in use, temperature, precip, wind, pressure, snowdepth, visibility
After that, do as Henrik told.
Cheers,



Alessandro
« Last Edit: February 14, 2017, 02:55:04 PM by i_fiorentino »

Offline hcorrin

  • Posts: 1,180
  • Ballaugh Isle of Man GB
  • OS/Browser:
  • Win NT 10.0
  • Mozilla compatible
    • Ballaugh Weather
Re: WXSIM "EWN-style"
« Reply #11 on: February 14, 2017, 04:52:07 PM »
Hi
I tried setting this up on my local server to test but all I get is the correct time for the lastret.txt and the white circle on the right
http://ballaugh.no-ip.biz:2082/wxsim/forecast.php

not sure what I have missed

Harold

Offline i_fiorentino

  • Alessandro Bardi
  • Posts: 1,682
  • 150 mls Candeglia (Pt), Tuscany, Italy
    • Meteopistoia.it
Re: WXSIM "EWN-style"
« Reply #12 on: February 14, 2017, 06:06:03 PM »
Hi
I tried setting this up on my local server to test but all I get is the correct time for the lastret.txt and the white circle on the right
http://ballaugh.no-ip.biz:2082/wxsim/forecast.php

not sure what I have missed

Harold
It seems an incorrect path of plaintext. txt... please could you post all path in config.php here?

Offline hcorrin

  • Posts: 1,180
  • Ballaugh Isle of Man GB
  • OS/Browser:
  • Win NT 10.0
  • Mozilla compatible
    • Ballaugh Weather
Re: WXSIM "EWN-style"
« Reply #13 on: February 14, 2017, 07:56:57 PM »
Hi

$wxsimlocation     = "Ballaugh, Isle of Man";                 # Your location
$latitude = 54.31;
$longitude = -4.54;
$tzabb        = "Europe/Isle_of_Man";
$datestyle    = "d.m.Y";
$timeFormat = "d.m.Y H:i";          # Timeformat
$updatehrs = array(6,11,15,21);  # Hours when wxsim runs
$updateminute = 20;                  # minutes past full hour for upload time
$jqueryload   = true;                             # Should we load JQuery? (Set to false if your site loads it by default)
$bootstrapload = true;                             # Should we load Bootstrap? (Set to false if your site loads it by default)
$mainwidth    = "100%";                           // Use 100% for responsivity

$path_to_langfiles = "/lang/";                   This is the only option that allowed the button options to work
#$path_to_lastret = "/home/web3/subdomains/data/wd/lastret.txt";
$path_to_lastret = "../lastret.txt";          This points to my root web folder where the wxsim folder is
$path_to_js = "js/";
$path_to_css = "css/";

if($wxsimtype=="forecast"){
  include __DIR__.'/frc.php';
}

These are all the paths I could find in the config file

Found these in plaintext.php
$pathtodata=str_replace("lastret.txt","",$path_to_lastret);
$pt = file($pathtodata."../../plaintext.txt");


not sure what I have missed

Harold





Offline meteosa

  • Posts: 39
  • Italy
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Firefox 51.0
    • MeteoSantAngelo.it
Re: WXSIM "EWN-style"
« Reply #14 on: February 14, 2017, 08:03:46 PM »
It displays m/s as default, yes. You can set your own units for temperature and wind from the unit-gear in top-right corner. The browser should remember the settings.

Okay, but if I close the browser and reopen it returns me to m/s, you could not configure it directly with km/h as you can do with the "short.php" file?
Thank you

 

cumulus