Current Block (v24) - Showing incorrect Alternate Values
- MonyMony
- Forecaster
- Posts: 187
- Joined: Sun Aug 20, 2017 12:54 pm
- Location: Elkton, Maryland, US
- Station model: Davis Pro 2
- Software: WeatherCat/Meteobridge
- Contact:
Current Block (v24) - Showing incorrect Alternate Values
I installed the new version and activated the option to show Alternate Values.
Unfortunately the Alternate Pressure and Wind Speed units are getting ignored.
I looked at the code and the values appear to be hard coded so guessing something got missed in the update.
$alternativeW = "mph";
$alternativeP = "inhg";
Nice update and BTW, congrats on the new job Jachym!
Unfortunately the Alternate Pressure and Wind Speed units are getting ignored.
I looked at the code and the values appear to be hard coded so guessing something got missed in the update.
$alternativeW = "mph";
$alternativeP = "inhg";
Nice update and BTW, congrats on the new job Jachym!
- MonyMony
- Forecaster
- Posts: 187
- Joined: Sun Aug 20, 2017 12:54 pm
- Location: Elkton, Maryland, US
- Station model: Davis Pro 2
- Software: WeatherCat/Meteobridge
- Contact:
Re: Current Block (v24) - Showing incorrect Alternate Values
Additionally, if I update the code to set:
$alternativeP = "hpa";
or
$alternativeP = "mmhg";
Then the block completely breaks:
Manually updating $alternateW works as expected.
$alternativeP = "hpa";
or
$alternativeP = "mmhg";
Then the block completely breaks:
Manually updating $alternateW works as expected.
- magical46
- Observer
- Posts: 49
- Joined: Mon Aug 21, 2017 2:19 pm
- Location: Farnham, Surrey, UK
- Contact:
Re: Current Block (v24) - Showing incorrect Alternate Values
Getting the same issue here.
www.philsweather.co.uk
Temp's and precipitation show alternates but wind and pressure show same value twice.
Phil
www.philsweather.co.uk
Temp's and precipitation show alternates but wind and pressure show same value twice.
Phil
- Jachym
- Site Admin
- Posts: 1686
- Joined: Fri Aug 18, 2017 10:12 pm
- Location: Brno, Czech Republic
- Station model: WH1080
- Software: Meteobridge
- Contact:
Re: Current Block (v24) - Showing incorrect Alternate Values
Interesting, I will have a look
- Jachym
- Site Admin
- Posts: 1686
- Joined: Fri Aug 18, 2017 10:12 pm
- Location: Brno, Czech Republic
- Station model: WH1080
- Software: Meteobridge
- Contact:
Re: Current Block (v24) - Showing incorrect Alternate Values
I think I know...
try opening currentBlock.php
lines 198 and 199
$alternativeW = "mph";
$alternativeP = "inhg";
Delete them. These were for testing purposes and looks like I forgot to delete them.
Please let me know if that solved the problem
try opening currentBlock.php
lines 198 and 199
$alternativeW = "mph";
$alternativeP = "inhg";
Delete them. These were for testing purposes and looks like I forgot to delete them.
Please let me know if that solved the problem
- MonyMony
- Forecaster
- Posts: 187
- Joined: Sun Aug 20, 2017 12:54 pm
- Location: Elkton, Maryland, US
- Station model: Davis Pro 2
- Software: WeatherCat/Meteobridge
- Contact:
Re: Current Block (v24) - Showing incorrect Alternate Values
Hi Jachym,
No joy.... If I remove them then the block is blank.
- MonyMony
- Forecaster
- Posts: 187
- Joined: Sun Aug 20, 2017 12:54 pm
- Location: Elkton, Maryland, US
- Station model: Davis Pro 2
- Software: WeatherCat/Meteobridge
- Contact:
Re: Current Block (v24) - Showing incorrect Alternate Values
Figured out the problem...
In lines 1694 thru 1764 the Eval function is missing the closing parenthesis. Once I add that then everything works. I changed it to this:
In lines 1694 thru 1764 the Eval function is missing the closing parenthesis. Once I add that then everything works. I changed it to this:
Code: Select all
if(json['P']!=$("#currentPValue").text()){
changeP = true;
}
else{
changeP = false;
}
$("#currentPValue").text(json['P']);
<?php
if($dualUnits){
?>
if(json['P']!="--"){
<?php
if($displayPressUnits=="hpa" && $alternativeP == "inhg"){
?>
altP = eval(json['P']) * 0.02952);
altP = altP.toFixed(2);
<?php
}
?>
<?php
if($displayPressUnits=="inhg" && $alternativeP == "hpa"){
?>
altP = (eval(json['P']) * 33.8638);
altP = altP.toFixed(1);
<?php
}
?>
<?php
if($displayPressUnits=="hpa" && $alternativeP == "mmhg"){
?>
altP = (eval(json['P']) * 0.75006);
altP = altP.toFixed(1);
<?php
}
?>
<?php
if($displayPressUnits=="mmhg" && $alternativeP == "hpa"){
?>
altP = (eval(json['P']) * 1.3332);
altP = altP.toFixed(1);
<?php
}
?>
<?php
if($displayPressUnits=="inhg" && $alternativeP == "mmhg"){
?>
altP = (eval(json['P']) * 25.3999);
altP = altP.toFixed(1);
<?php
}
?>
<?php
if($displayPressUnits=="mmhg" && $alternativeP == "inhg"){
?>
altP = (eval(json['P']) * 0.03937);
altP = altP.toFixed(2);
<?php
}
?>
<?php
if($displayPressUnits==$alternativeP){
?>
altP = json['P'];
<?php
}
?>
}
$("#currentPValueAlt").text(altP);
<?php
}
?>
- MonyMony
- Forecaster
- Posts: 187
- Joined: Sun Aug 20, 2017 12:54 pm
- Location: Elkton, Maryland, US
- Station model: Davis Pro 2
- Software: WeatherCat/Meteobridge
- Contact:
Re: Current Block (v24) - Showing incorrect Alternate Values
One very minor issue though...
If I change my site to Metric (normally Imperial Units), then those alternate values do not change back to their normally default units. Honestly I don't mind if this left this way as it is a low possibility that anyone would notice, but figured I would point it out just so you are aware.
Site changed to Metric: Site set to Default Units (Imperial) Thanks again for adding the Alternate Values to the CURRENT module. This is something I have been hoping to see for some time.
If I change my site to Metric (normally Imperial Units), then those alternate values do not change back to their normally default units. Honestly I don't mind if this left this way as it is a low possibility that anyone would notice, but figured I would point it out just so you are aware.
Site changed to Metric: Site set to Default Units (Imperial) Thanks again for adding the Alternate Values to the CURRENT module. This is something I have been hoping to see for some time.
- magical46
- Observer
- Posts: 49
- Joined: Mon Aug 21, 2017 2:19 pm
- Location: Farnham, Surrey, UK
- Contact:
Re: Current Block (v24) - Showing incorrect Alternate Values
Just installed the updated version (24.1) but with "Show alternate values" selected its not showing any values at all.
www.philsweather.co.uk
Phil
www.philsweather.co.uk
Phil
- Fraggboy
- Forecaster
- Posts: 193
- Joined: Wed Sep 27, 2017 2:45 pm
- Location: Sunny California
- Station model: Bloomsky II + Storm
- Software: Bloomsky
- Contact:
Re: Current Block (v24) - Showing incorrect Alternate Values
Mine was showing blank also after downloading the latest update.
Once I followed MonyMony's post above, I modified the currentBlock.php file and it's working great. Instead of adding the ending parenthesis, I removed the beginning parenthesis which worked for me.
Once I followed MonyMony's post above, I modified the currentBlock.php file and it's working great. Instead of adding the ending parenthesis, I removed the beginning parenthesis which worked for me.