WXforum.net

Web Weather => Weather Website PHP/AJAX scripting => Custom Website Templates => Topic started by: hcorrin on April 14, 2022, 09:18:40 AM

Title: ajax-dashboard6.php version 95e last hour dew too high
Post by: hcorrin on April 14, 2022, 09:18:40 AM
i notice since putting the 95e version on of the alternate dashboard the the last hour dew value is wrong https://www.hc-iom.co.uk/WD-AJAX1/index.php
the 95c version gives this https://www.hc-iom.co.uk/WD-AJAX3/index.php
not sure what i need to change to get it right
Title: Re: ajax-dashboard6.php version 95e last hour dew too high
Post by: saratogaWX on April 14, 2022, 03:29:19 PM
In 695e the line
Code: [Select]
<span class="convDdif"><?php echo strip_units(abs($dewchangelasthour)) . $uomTemp?></span>  was used to reflect it was a difference.  695c had that coded as
Code: [Select]
<span class="convTemp"><?php echo strip_units(abs($dewchangelasthour)) . $uomTemp?></span> for a temperature.  With testtags.php having
Code: [Select]
$dewchangelasthour =  '-0.2';    // Dew point change last hour
the convertDdif function of
Code: [Select]
Number.prototype.convertDdif = function() { // °C
switch (uom.Temp) {
case "°F"    :
case "&deg;F": return((this * 1.8) + 32.0);
default      : return((this * 1.0) + 17.8);
}
};
in ajaxWDwx3.js was in error.  It should read as
Code: [Select]
Number.prototype.convertDdif = function() { // °C
switch (uom.Temp) {
case "°F"    :
case "&deg;F": return((this * 1.8));
default      : return((this * 1.0));
}
};
to reflect the differences in degree scales from C to F without the offset.
Title: Re: ajax-dashboard6.php version 95e last hour dew too high
Post by: hcorrin on April 14, 2022, 05:09:40 PM
ok have corrected the ajaxWDwx3.js and the value looks ok now
Thanks Ken