More progress to report:
The VWS plugin set is complete (with AJAX)
The WeatherLink PHP is complete .. need to test the AJAX (thanks to Curly for the initial AJAX script)
The Cumulus PHP is complete .. need to finish the AJAX (Based on Beteljuice's script)
By going through all three packages, I've been able to make the ajax-dashboard dynamically adjust to display what it has available in tags from the various software. WeatherLink is the most sparse (fewest available tags). Cumulus has more tags, but not a lot of historical info. VWS has a plethora of tags, but not all are really useful for display.
Where key tags are missing, but can be derived by using other tags, I've added that to the -defs.php file for that software.
Examples:
VWS has these computed values:
$tempnodp = round($WX['vxv007'],0); // calculated value
$dayswithnorain = intval((time()-strtotime($WX['vyd009']))/86400); // from yrly rain high date // calculated value
$yesterdayrain = sprintf('%01.2f', round($WX['vzh009']-$WX['vzl009'],2)); // calculated value
$mrecordhighgustday = date('j',strtotime($WX['vmd003'])); // calculated value
#-------------------------------------------------------------------------------------
# function processed WD variables
#-------------------------------------------------------------------------------------
$Currentsolardescription = $WX['climate_cconds1']; // Current Conditions
$iconnumber = VWS_icons($WX['climate_icon1'],$WX['vst143'],$WX['vst144'],$WX['vst145']);
if(isset($SITE['conditionsMETAR'])) { // override with METAR conditions for text and icon if requested.
global $SITE;
include_once("get-metar-conditions-inc.php");
list($Currentsolardescription,$iconnumber) = mtr_conditions($SITE['conditionsMETAR'], $time, $sunrise, $sunset);
}
# generate the separate date/time variables by dissection of input date/time and format
list($date_year,$date_month,$date_day,$time_hour,$time_minute,$monthname,$dayname)
= VWS_setDateTimes($WX['vst142'],$WX['vst143'],$SITE['WDdateMDY']);
Likewise, WeatherLink has
$tempnodp = round($WX['outsideTemp'],0); // calculated value
#-------------------------------------------------------------------------------------
# function processed WD variables
#-------------------------------------------------------------------------------------
if(isset($SITE['conditionsMETAR'])) { // override with METAR conditions for text and icon if requested.
global $SITE;
include_once("get-metar-conditions-inc.php");
list($Currentsolardescription,$iconnumber) = mtr_conditions($SITE['conditionsMETAR'], $time, $sunrise, $sunset);
}
# generate the separate date/time variables by dissection of input date/time and format
list($date_year,$date_month,$date_day,$time_hour,$time_minute,$monthname,$dayname)
= WL_setDateTimes($date,$time,$SITE['WDdateMDY']);
$beaufortnum = WL_beaufortNumber($WX['windSpeed'],$WX['unitWind']);
$bftspeedtext = WL_beaufortText($beaufortnum);
if(!isset($wdversion) and isset($SITE['WXsoftwareVersion'])) {$wdversion = $SITE['WXsoftwareVersion']; }
list($feelslike,$heatcolourword) = WL_setFeelslike ($temperature,$windch,$heati,$uomtemp);
and Cumulus has:
$time = substr($WX['time'],0,5); // calculated value
$wdversion = $WX['version'].'-b'.$WX['build']; // calculated value
$timeofnextupdate = date('H:i',strtotime($date.' '.$time)+intval($WX['interval']*60)); // calculated value
$tempnodp = round($WX['temp'],0); // calculated value
#-------------------------------------------------------------------------------------
# function processed WD variables
#-------------------------------------------------------------------------------------
if(isset($SITE['conditionsMETAR'])) { // override with METAR conditions for text and icon if requested.
global $SITE;
include_once("get-metar-conditions-inc.php");
list($Currentsolardescription,$iconnumber) = mtr_conditions($SITE['conditionsMETAR'], $time, $sunrise, $sunset);
}
# generate the separate date/time variables by dissection of input date/time and format
list($date_year,$date_month,$date_day,$time_hour,$time_minute,$monthname,$dayname)
= CU_setDateTimes($date,$time,$SITE['WDdateMDY']);
$beaufortnum = CU_beaufortNumber($avgspd,$winduom);
$bftspeedtext = CU_beaufortText($beaufortnum);
if(!isset($wdversion) and isset($SITE['WXsoftwareVersion'])) {$wdversion = $SITE['WXsoftwareVersion']; }
list($feelslike,$heatcolourword) = CU_setFeelslike ($temperature,$windch,$heati,$uomtemp);
if(substr($WX['LastRainTipISO'],0,4) <> '0000') { // got a last rain valid date
$dateoflastrainalways = $WX['LastRainTipISO'];
$dayswithnorain = intval((time()-strtotime(substr($dateoflastrainalways,0,10)))/86400);
}
Just thought you'd like to see some of the behind-the-scenes progress
I've you've not already voted, please do so .. it does help to guage your interest in specific station plugins.
Best regards,
Ken
Currently on the test site is the Cumulus set.