<?php
/*
 File: CUtags.txt

 Purpose: load Cumulus variables into a $WX[] array for use with the Canada/World/USA template sets

 Instructions:  
 Save this page as CUtags.txt and place in your cumulus\webfiles directory
 
 Use the Cumulus, Configuration, Internet, Files panel select an unused entry.

 In the Local Filenames, press Browse and select the CUtags.txt file as the local filename.
 In the Remote Filenames box, enter the directory and CUtags.php as the Remote Filename to use. 
 Leave the Binary? box unchecked,
 Check the Process? box.
 Leave the Realtime? box unchecked.
 Check the FTP? box.
 
 Press OK on the Internet Settings dialog to close it and save the settings.


 Author: Ken True - webmaster@saratoga-weather.org

 (created by gen-CUtags.php - V1.06 - 29-Aug-2011)

 These tags generated on 2012-01-22 21:01:31 GMT
   From tags.txt updated 2012-01-22 21:01:29 GMT

*/
// --------------------------------------------------------------------------

// allow viewing of generated source

if (isset($_REQUEST["sce"]) and strtolower($_REQUEST["sce"]) == "view" ) {
//--self downloader --
   $filenameReal = __FILE__;
   $download_size = filesize($filenameReal);
   header("Pragma: public");
   header("Cache-Control: private");
   header("Cache-Control: no-cache, must-revalidate");
   header("Content-type: text/plain");
   header("Accept-Ranges: bytes");
   header("Content-Length: $download_size");
   header("Connection: close");
   
   readfile($filenameReal);
   exit;
}
$WXsoftware = 'CU';  
$defsFile = 'CU-defs.php';  // filename with $varnames = $WX['CU-varnames']; equivalents
 
$rawdatalines = <<<END_OF_RAW_DATA_LINES
tempunit|&deg;F:|:
tempunitnodeg|F:|:
pressunit|in:|:
rainunit|in:|:
windunit|mph:|:
windrununit|miles:|:
cloudbaseunit|ft:|:
date|5/14/2023:|:
time|19:14 on 14 May 2023:|:
timehhmmss|19:14:25:|:
timeUTC|01:14 on 15 May 2023:|:
day|14:|:
dayname|Sunday:|:
shortdayname|Sun:|:
month|05:|:
monthname|May:|:
shortmonthname|May:|:
year|2023:|:
shortyear|23:|:
hour|19:|:
minute|14:|:
apptemp|66.6:|:
avgtemp|57.9:|:
temp|67.1:|:
intemp|71.4:|:
temptrend|-1.0:|:
temptrendtext|Falling:|:
temptrendenglish|Falling:|:
heatindex|67.1:|:
humidex|68.4:|:
hum|50:|:
inhum|45:|:
dew|47.8:|:
wchill|67.1:|:
wetbulb|56.8:|:
rfall|0.31:|:
rrate|0.00:|:
rhour|0.00:|:
rmidnight|0.31:|:
r24hour|0.31:|:
LastRainTipISO|2023-05-06 22:59:|:
press|30.086:|:
presstrend|Steady:|:
presstrendval|0.008:|:
presstrendenglish|Rising:|:
altimeterpressure|30.234:|:
wlatest|0.0:|:
bearing|215:|:
currentwdir|SW:|:
wspeed|0.0:|:
avgbearing|0:|:
wdir|---:|:
wgust|0.0:|:
nextwindindex|3494:|:
beaufort|F0:|:
beaufortnumber|0:|:
beaudesc|Calm:|:
cloudbase|4386 ft:|:
cloudbasevalue|4386:|:
UV|0.0:|:
SolarRad|0:|:
forecast| Increasing clouds with little temperature change. Precipitation possible within 24 to 48 hours :|:
forecastnumber|-26:|:
cumulusforecast|Exceptional Weather, Stormy, much precipitation:|:
wsforecast| Increasing clouds with little temperature change. Precipitation possible within 24 to 48 hours :|:
tempTH|74.6:|:
TtempTH|17:32:|:
tempTL|55.5:|:
TtempTL|00:00:|:
temprange|19.1:|:
apptempTH|74.5:|:
TapptempTH|17:32:|:
apptempTL|52.2:|:
TapptempTL|00:00:|:
heatindexTH|74.6:|:
TheatindexTH|17:32:|:
wchillTL|55.5:|:
TwchillTL|00:00:|:
dewpointTH|51.8:|:
TdewpointTH|16:53:|:
dewpointTL|37.1:|:
TdewpointTL|00:00:|:
humTH|50:|:
ThumTH|00:00:|:
humTL|39:|:
ThumTL|17:29:|:
rrateTM|0.00:|:
TrrateTM|00:00:|:
hourlyrainTH|0.31:|:
ThourlyrainTH|16:19:|:
pressTH|30.086:|:
TpressTH|19:13:|:
pressTL|30.038:|:
TpressTL|00:00:|:
windTM|2.0:|:
TwindTM|16:20:|:
wgustTM|7.0:|:
TwgustTM|13:27:|:
bearingTM|0:|:
TwgustTM|13:27:|:
Tbeaufort|F1:|:
TwindTM|16:20:|:
Tbeaufortnumber|1:|:
TwindTM|16:20:|:
windrun|20.0:|:
domwindbearing|231:|:
domwinddir|SW:|:
BearingRangeFrom|0:|:
BearingRangeTo|0:|:
BearingRangeFrom10|000:|:
BearingRangeTo10|000:|:
ET|0.000:|:
heatdegdays|6.4:|:
cooldegdays|0.8:|:
tempYH|55.5:|:
TtempYH|00:00:|:
tempYL|55.5:|:
TtempYL|00:00:|:
temprangeY|0.0:|:
apptempYH|52.2:|:
TapptempYH|00:00:|:
apptempYL|52.2:|:
TapptempYL|00:00:|:
heatindexYH|55.5:|:
TheatindexYH|00:00:|:
wchillYL|55.5:|:
TwchillYL|00:00:|:
dewpointYL|37.1:|:
TdewpointYL|00:00:|:
dewpointYH|37.1:|:
TdewpointYH|00:00:|:
humYH|50:|:
ThumYH|00:00:|:
humYL|50:|:
ThumYL|00:00:|:
rfallY|0.00:|:
rrateYM|0.00:|:
TrrateYM|00:00:|:
hourlyrainYH|0.00:|:
ThourlyrainYH|00:00:|:
pressYH|30.038:|:
TpressYH|00:00:|:
pressYL|30.038:|:
TpressYL|00:00:|:
windYM|1.0:|:
TwindYM|00:00:|:
wgustYM|1.0:|:
TwgustYM|00:00:|:
bearingYM|221:|:
TwgustYM|00:00:|:
Ybeaufort|F1:|:
TwindYM|00:00:|:
Ybeaufortnumber|1:|:
TwindYM|00:00:|:
domwindbearingY|231:|:
domwinddirY|SW:|:
windrunY|24.0:|:
heatdegdaysY|9.5:|:
cooldegdaysY|0.0:|:
MonthTempH|83.7:|:
MonthTempHT|5:28 PM:|:
MonthTempHD|01 May:|:
MonthTempL|38.5:|:
MonthTempLT|2:33 AM:|:
MonthTempLD|07 May:|:
MonthMinTempH|55.5:|:
MonthMinTempHD|13 May:|:
MonthMaxTempL|55.5:|:
MonthMaxTempLD|12 May:|:
MonthHighDailyTempRange|35.5:|:
MonthHighDailyTempRangeD|03 May:|:
MonthLowDailyTempRange|0.0:|:
MonthLowDailyTempRangeD|13 May:|:
MonthHeatIndexH|80.9:|:
MonthHeatIndexHT|5:28 PM:|:
MonthHeatIndexHD|01 May:|:
MonthWChillL|38.5:|:
MonthWChillLT|2:33 AM:|:
MonthWChillLD|07 May:|:
MonthAppTempH|80.3:|:
MonthAppTempHT|5:23 PM:|:
MonthAppTempHD|01 May:|:
MonthAppTempL|35.4:|:
MonthAppTempLT|2:33 AM:|:
MonthAppTempLD|07 May:|:
MonthDewPointH|51.8:|:
MonthDewPointHT|4:53 PM:|:
MonthDewPointHD|14 May:|:
MonthDewPointL|18.4:|:
MonthDewPointLT|10:23 PM:|:
MonthDewPointLD|02 May:|:
MonthHumH|90:|:
MonthHumHT|6:26 AM:|:
MonthHumHD|11 May:|:
MonthHumL|12:|:
MonthHumLT|5:09 PM:|:
MonthHumLD|02 May:|:
MonthPressH|30.086:|:
MonthPressHT|7:13 PM:|:
MonthPressHD|14 May:|:
MonthPressL|29.352:|:
MonthPressLT|8:07 PM:|:
MonthPressLD|01 May:|:
MonthGustH|22.0:|:
MonthGustHT|2:58 PM:|:
MonthGustHD|04 May:|:
MonthWindH|8.0:|:
MonthWindHT|4:08 PM:|:
MonthWindHD|10 May:|:
MonthWindRunH|36.4:|:
MonthWindRunHD|01 May:|:
rmonth|0.58:|:
MonthRainRateH|0.73:|:
MonthRainRateHT|7:11 PM:|:
MonthRainRateHD|06 May:|:
MonthHourlyRainH|0.31:|:
MonthHourlyRainHT|4:19 PM:|:
MonthHourlyRainHD|14 May:|:
MonthDailyRainH|0.31:|:
MonthDailyRainHD|14 May:|:
MonthLongestDryPeriod|7:|:
MonthLongestDryPeriodD|02 May:|:
MonthLongestWetPeriod|4:|:
MonthLongestWetPeriodD|06 May:|:
YearTempH|84.9:|:
YearTempHT|5:47 PM:|:
YearTempHD|30 April:|:
YearTempL|0.9:|:
YearTempLT|7:23 AM:|:
YearTempLD|31 January:|:
YearHighDailyTempRange|39.7:|:
YearHighDailyTempRangeD|30 April:|:
YearLowDailyTempRange|0.0:|:
YearLowDailyTempRangeD|16 March:|:
YearHeatIndexH|81.8:|:
YearHeatIndexHT|5:47 PM:|:
YearHeatIndexHD|30 April:|:
YearWChillL|-2.1:|:
YearWChillLT|5:05 AM:|:
YearWChillLD|31 January:|:
YearAppTempH|81.2:|:
YearAppTempHT|5:28 PM:|:
YearAppTempHD|30 April:|:
YearAppTempL|-5.5:|:
YearAppTempLT|7:23 AM:|:
YearAppTempLD|31 January:|:
YearDewPointH|51.8:|:
YearDewPointHT|4:53 PM:|:
YearDewPointHD|14 May:|:
YearDewPointL|-4.2:|:
YearDewPointLT|4:05 PM:|:
YearDewPointLD|19 April:|:
YearMinTempH|59.1:|:
YearMinTempHD|12 April:|:
YearMaxTempL|20.9:|:
YearMaxTempLD|31 January:|:
YearHumH|97:|:
YearHumHT|12:00 AM:|:
YearHumHD|01 January:|:
YearHumL|12:|:
YearHumLT|5:09 PM:|:
YearHumLD|02 May:|:
YearPressH|30.796:|:
YearPressHT|10:27 AM:|:
YearPressHD|02 February:|:
YearPressL|29.075:|:
YearPressLT|3:56 AM:|:
YearPressLD|22 February:|:
YearGustH|30.0:|:
YearGustHT|1:24 AM:|:
YearGustHD|14 February:|:
YearWindH|12.0:|:
YearWindHT|2:41 PM:|:
YearWindHD|18 April:|:
YearWindRunH|82.7:|:
YearWindRunHD|19 April:|:
ryear|12.43:|:
YearRainRateH|1.35:|:
YearRainRateHT|7:11 PM:|:
YearRainRateHD|10 January:|:
YearHourlyRainH|0.31:|:
YearHourlyRainHT|4:19 PM:|:
YearHourlyRainHD|14 May:|:
YearDailyRainH|0.98:|:
YearDailyRainHD|10 January:|:
YearMonthlyRainH|5.99:|:
YearMonthlyRainHD|January:|:
YearLongestDryPeriod|14:|:
YearLongestDryPeriodD|20 April:|:
YearLongestWetPeriod|9:|:
YearLongestWetPeriodD|01 January:|:
tempH|103.4:|:
TtempH|at 6:54 PM on 02 August 2020:|:
tempL|-2.7:|:
TtempL|at 6:06 AM on 14 January 2013:|:
mintempH|78.6:|:
TmintempH|at 8:30 AM on 09 July 2022:|:
maxtempL|10.7:|:
TmaxtempL|at 3:20 PM on 14 January 2013:|:
LowDailyTempRange|0.0:|:
TLowDailyTempRange|on 23 March 2014:|:
HighDailyTempRange|76.7:|:
THighDailyTempRange|on 15 June 2022:|:
apptempH|100.9:|:
TapptempH|at 4:13 PM on 07 September 2022:|:
apptempL|-9.2:|:
TapptempL|at 6:06 AM on 14 January 2013:|:
heatindexH|98.4:|:
TheatindexH|at 4:38 PM on 29 June 2015:|:
dewpointH|66.7:|:
TdewpointH|at 11:09 AM on 02 August 2022:|:
dewpointL|-36.6:|:
TdewpointL|at 4:54 PM on 03 April 2018:|:
humH|97:|:
ThumH|at 3:45 PM on 25 January 2020:|:
humL|2:|:
ThumL|at 5:20 PM on 17 June 2013:|:
wchillH|-6.6:|:
TwchillH|at 8:28 AM on 14 January 2013:|:
rrateM|9.00:|:
TrrateM|at 10:00 PM on 02 October 2018:|:
rfallH|2.02:|:
TrfallH|on 21 December 2014:|:
rfallhH|0.76:|:
TrfallhH|at 2:03 AM on 30 July 2021:|:
rfallmH|5.99:|:
TrfallmH|January 2023:|:
LongestDryPeriod|48:|:
TLongestDryPeriod|to 06 November 2020:|:
LongestWetPeriod|10:|:
TLongestWetPeriod|to 10 March 2019:|:
pressH|31.110:|:
TpressH|at 10:20 AM on 28 January 2017:|:
pressL|28.990:|:
TpressL|at 6:31 PM on 28 June 2020:|:
gustM|51.0:|:
TgustM|at 3:24 PM on 06 May 2017:|:
wspeedH|20.0:|:
TwspeedH|at 12:39 PM on 17 March 2014:|:
windrunH|159.8:|:
TwindrunH|on 17 March 2014:|:
LatestError|:|:
LatestErrorDate|------:|:
LatestErrorTime|----:|:
ErrorLight|0:|:
version|1.9.4:|:
build|1099:|:
realtimeinterval|5:|:
interval|5:|:
rollovertime|midnight:|:
update|5/14/2023 7:14:25 PM:|:
stationtype|Davis Vantage Pro2:|:
latitude|N&nbsp;40&deg;&nbsp;21&#39;&nbsp;05&quot;:|:
longitude|W&nbsp;111&deg;&nbsp;42&#39;&nbsp;12&quot;:|:
altitude|4851&nbsp;ft:|:
location|N7BAN:|:
longlocation|the weather station at N7BAN:|:
forum|:<a href="http://sandaysoft.com/forum/">forum</a>::|:
webcam|:|:
graphperiod|12:|:
battery|4.56v:|:
txbattery|TX Battery Status: 1-ok   2-ok   3-ok   4-ok   5-ok   6-ok   7-ok   8-ok   :|:
SensorContactLost|0:|:
snowdepth|0:|:
currcond|:|:
chillhours|3964.8:|:
ConsecutiveRainDays|0:|:
ConsecutiveDryDays|7:|:
WindRoseData|42.0,18.0,0.0,0.0,0.0,0.0,21.0,8.0,12.0,226.0,319.0,116.0,17.0,0.0,38.0,24.0:|:
WindRosePoints|16:|:
WindSampleCount|3600:|:
LatestNOAAMonthlyReport|:|:
LatestNOAAYearlyReport|:|:
sunrise|06:12:|:
sunset|20:34:|:
daylength|14:22:|:
tomorrowdaylength|There will be 1min 56s more daylight tomorrow:|:
dawn|05:41:|:
dusk|21:05:|:
daylightlength|15:24:|:
moonphase|Waning Crescent:|:
MoonAge|24:|:
moonrise|03:48:|:
moonset|15:15:|:
isdaylight|1:|:
IsSunUp|1:|:
SunshineHours|0.0:|:
YSunshineHours|0.0:|:
CurrentSolarMax|146:|:
IsSunny|0:|:
MoonPercent|-23:|:
MoonPercentAbs|23:|:
LowTempAlarm|0:|:
HighTempAlarm|0:|:
TempChangeUpAlarm|0:|:
TempChangeDownAlarm|0:|:
TempChangeLastHour|-4.6:|:
LowPressAlarm|0:|:
HighPressAlarm|0:|:
PressChangeUpAlarm|0:|:
PressChangeDownAlarm|0:|:
HighRainTodayAlarm|0:|:
HighRainRateAlarm|0:|:
HighWindGustAlarm|0:|:
HighWindSpeedAlarm|0:|:
recordsbegandate|25 December 2012:|:
newrecord|0:|:
TempRecordSet|0:|:
WindRecordSet|0:|:
RainRecordSet|0:|:
HumidityRecordSet|0:|:
PressureRecordSet|0:|:
HighTempRecordSet|0:|:
LowTempRecordSet|0:|:
HighTempRangeRecordSet|0:|:
LowTempRangeRecordSet|0:|:
HighAppTempRecordSet|0:|:
LowAppTempRecordSet|0:|:
HighHeatIndexRecordSet|0:|:
LowWindChillRecordSet|0:|:
HighDewPointRecordSet|0:|:
LowDewPointRecordSet|0:|:
HighMinTempRecordSet|0:|:
LowMaxTempRecordSet|0:|:
HighWindGustRecordSet|0:|:
HighWindSpeedRecordSet|0:|:
HighRainRateRecordSet|0:|:
HighHourlyRainRecordSet|0:|:
HighDailyRainRecordSet|0:|:
HighMonthlyRainRecordSet|0:|:
LongestDryPeriodRecordSet|0:|:
LongestWetPeriodRecordSet|0:|:
HighHumidityRecordSet|0:|:
LowHumidityRecordSet|0:|:
HighPressureRecordSet|0:|:
LowPressureRecordSet|0:|:
HighWindrunRecordSet|0:|:
ExtraTemp1|0.0:|:
ExtraTemp2|0.0:|:
ExtraTemp3|0.0:|:
ExtraDP1|0.0:|:
ExtraDP2|0.0:|:
ExtraDP3|0.0:|:
ExtraHum1|0:|:
ExtraHum2|0:|:
ExtraHum3|0:|:
DavisTotalPacketsReceived|21922:|:
DavisTotalPacketsMissed|3540:|:
DavisNumberOfResynchs|0:|:
DavisMaxInARow|193:|:
DavisNumCRCerrors|1007:|:
DavisFirmwareVersion|2.12:|:
THWindex|65.7:|:
THSWindex|0.0:|:
Light|0.0:|:
OsVersion|Windows 8 build 9200:|:
OsLanguage|English:|:
SystemUpTime|4 days 16 hours:|:
ProgramUpTime|2 hours 57 minutes:|:
CpuName|Intel(R) Xeon(R) CPU E5-2667 v2 @ 3.30GHz:|:
CpuCount|2:|:
MemoryStatus|801/2047 MB (free/total):|:
DisplayMode|775x631, 32 bit:|:
AllocatedMemory|90.89 MB:|:
DiskSize|59.46 GB:|:
DiskFree|31.99 GB:|:
RCdew|47.8:|:
RCheatindex|67.1:|:
RChum|50:|:
RCinhum|45:|:
RCintemp|71.4:|:
RCpress|30.086:|:
RCpressTH|30.086:|:
RCpressTL|30.038:|:
RCrfall|0.31:|:
RCrrate|0.00:|:
RCrrateTM|0.00:|:
RCtemp|67.1:|:
RCtempTH|74.6:|:
RCtempTL|55.5:|:
RCwchill|67.1:|:
RCwgust|0.0:|:
RCwgustTM|7.0:|:
RCwspeed|0.0:|:
END_OF_RAW_DATA_LINES;

// end of generation script

// put data in  array
//
$WX = array();
global $WX;
$WXComment = array();
$data = explode(":|:",$rawdatalines);
$nscanned = 0;
foreach ($data as $v => $line) {
  list($vname,$vval,$vcomment) = explode("|",trim($line).'|||');
  if(substr($vname,0,1) == "#") { //
    continue; // ignore comment records
  }
  if(substr($vname,0,1) == "!") { // handle beta tags conditionally
    if($vval == "") {
	  continue; // skip this one
	} else {
	  $vname = substr($vname,1);
	  if($vcomment <> "") {$vcomment .= " (Beta)"; }
	}
  }
  if ($vname <> "") {
    $WX[$vname] = trim($vval);
    if($vcomment <> "") { $WXComment[$vname] = trim($vcomment); }
  }
  $nscanned++;
}
if(isset($_REQUEST['debug'])) {
  print "<!-- loaded $nscanned $WXsoftware \$WX[] entries -->\n";
}

if (isset($_REQUEST["sce"]) and strtolower($_REQUEST["sce"]) == "dump" ) {

  print "<pre>\n";
  print "// \$WX[] array size = $nscanned entries.\n";
  foreach ($WX as $key => $val) {
	  $t =  "\$WX['$key'] = '$val';";
	  if(isset($WXComment[$key])) {$t .=  " $WXComment[$key]"; }
	  print "$t\n";
  }
  print "</pre>\n";
  exit;
}
if(file_exists("CU-defs.php")) { include_once("CU-defs.php"); }
?>