<?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|6/23/2023:|:
time|11:15 on 23 June 2023:|:
timehhmmss|11:15:04:|:
timeUTC|17:15 on 23 June 2023:|:
day|23:|:
dayname|Friday:|:
shortdayname|Fri:|:
month|06:|:
monthname|June:|:
shortmonthname|Jun:|:
year|2023:|:
shortyear|23:|:
hour|11:|:
minute|15:|:
apptemp|66.1:|:
avgtemp|60.5:|:
temp|71.0:|:
intemp|73.5:|:
temptrend|+3.1:|:
temptrendtext|Rising:|:
temptrendenglish|Rising:|:
heatindex|71.0:|:
humidex|71.0:|:
hum|26:|:
inhum|50:|:
dew|34.4:|:
wchill|71.0:|:
wetbulb|55.6:|:
rfall|0.00:|:
rrate|0.00:|:
rhour|0.00:|:
rmidnight|0.00:|:
r24hour|0.00:|:
LastRainTipISO|2023-06-20 11:14:|:
press|29.659:|:
presstrend|Rising Rapidly:|:
presstrendval|0.017:|:
presstrendenglish|Rising:|:
altimeterpressure|29.918:|:
wlatest|5.0:|:
bearing|204:|:
currentwdir|SSW:|:
wspeed|3.0:|:
avgbearing|216:|:
wdir|SW:|:
wgust|7.0:|:
nextwindindex|1227:|:
beaufort|F1:|:
beaufortnumber|1:|:
beaudesc|Light air:|:
cloudbase|8318 ft:|:
cloudbasevalue|8318:|:
UV|0.0:|:
SolarRad|0:|:
forecast| Mostly cloudy and cooler. Windy with possible wind shift to the W, NW, or N. :|:
forecastnumber|-26:|:
cumulusforecast|Exceptional Weather, Stormy, much precipitation:|:
wsforecast| Mostly cloudy and cooler. Windy with possible wind shift to the W, NW, or N. :|:
tempTH|71.0:|:
TtempTH|11:12:|:
tempTL|53.2:|:
TtempTL|05:50:|:
temprange|17.8:|:
apptempTH|66.6:|:
TapptempTH|11:00:|:
apptempTL|51.1:|:
TapptempTL|05:56:|:
heatindexTH|71.0:|:
TheatindexTH|11:12:|:
wchillTL|53.2:|:
TwchillTL|05:50:|:
dewpointTH|51.8:|:
TdewpointTH|08:18:|:
dewpointTL|31.9:|:
TdewpointTL|10:51:|:
humTH|76:|:
ThumTH|06:26:|:
humTL|24:|:
ThumTL|10:51:|:
rrateTM|0.00:|:
TrrateTM|00:00:|:
hourlyrainTH|0.00:|:
ThourlyrainTH|00:00:|:
pressTH|29.669:|:
TpressTH|10:41:|:
pressTL|29.561:|:
TpressTL|05:36:|:
windTM|4.0:|:
TwindTM|10:40:|:
wgustTM|11.0:|:
TwgustTM|10:48:|:
bearingTM|242:|:
TwgustTM|10:48:|:
Tbeaufort|F2:|:
TwindTM|10:40:|:
Tbeaufortnumber|2:|:
TwindTM|10:40:|:
windrun|3.4:|:
domwindbearing|203:|:
domwinddir|SSW:|:
BearingRangeFrom|129:|:
BearingRangeTo|316:|:
BearingRangeFrom10|120:|:
BearingRangeTo10|320:|:
ET|0.000:|:
heatdegdays|2.4:|:
cooldegdays|0.3:|:
tempYH|86.6:|:
TtempYH|17:36:|:
tempYL|51.4:|:
TtempYL|05:08:|:
temprangeY|35.2:|:
apptempYH|86.3:|:
TapptempYH|17:36:|:
apptempYL|49.8:|:
TapptempYL|05:08:|:
heatindexYH|83.9:|:
TheatindexYH|17:36:|:
wchillYL|51.4:|:
TwchillYL|05:08:|:
dewpointYL|38.1:|:
TdewpointYL|02:10:|:
dewpointYH|53.7:|:
TdewpointYH|13:47:|:
humYH|74:|:
ThumYH|06:13:|:
humYL|20:|:
ThumYL|17:20:|:
rfallY|0.00:|:
rrateYM|0.00:|:
TrrateYM|00:00:|:
hourlyrainYH|0.00:|:
ThourlyrainYH|00:00:|:
pressYH|29.854:|:
TpressYH|00:53:|:
pressYL|29.598:|:
TpressYL|19:18:|:
windYM|2.0:|:
TwindYM|12:15:|:
wgustYM|7.0:|:
TwgustYM|16:55:|:
bearingYM|68:|:
TwgustYM|16:55:|:
Ybeaufort|F1:|:
TwindYM|12:15:|:
Ybeaufortnumber|1:|:
TwindYM|12:15:|:
domwindbearingY|269:|:
domwinddirY|W:|:
windrunY|8.3:|:
heatdegdaysY|4.0:|:
cooldegdaysY|5.9:|:
MonthTempH|88.3:|:
MonthTempHT|3:16 PM:|:
MonthTempHD|06 June:|:
MonthTempL|46.0:|:
MonthTempLT|7:11 AM:|:
MonthTempLD|21 June:|:
MonthMinTempH|60.7:|:
MonthMinTempHD|19 June:|:
MonthMaxTempL|71.7:|:
MonthMaxTempLD|15 June:|:
MonthHighDailyTempRange|36.9:|:
MonthHighDailyTempRangeD|17 June:|:
MonthLowDailyTempRange|19.4:|:
MonthLowDailyTempRangeD|12 June:|:
MonthHeatIndexH|85.5:|:
MonthHeatIndexHT|3:10 PM:|:
MonthHeatIndexHD|06 June:|:
MonthWChillL|46.0:|:
MonthWChillLT|7:11 AM:|:
MonthWChillLD|21 June:|:
MonthAppTempH|87.9:|:
MonthAppTempHT|3:10 PM:|:
MonthAppTempHD|06 June:|:
MonthAppTempL|43.8:|:
MonthAppTempLT|6:11 AM:|:
MonthAppTempLD|17 June:|:
MonthDewPointH|58.9:|:
MonthDewPointHT|6:14 PM:|:
MonthDewPointHD|14 June:|:
MonthDewPointL|29.2:|:
MonthDewPointLT|11:14 PM:|:
MonthDewPointLD|16 June:|:
MonthHumH|95:|:
MonthHumHT|11:31 AM:|:
MonthHumHD|15 June:|:
MonthHumL|20:|:
MonthHumLT|5:20 PM:|:
MonthHumLD|22 June:|:
MonthPressH|30.010:|:
MonthPressHT|9:13 AM:|:
MonthPressHD|16 June:|:
MonthPressL|29.367:|:
MonthPressLT|5:09 PM:|:
MonthPressLD|19 June:|:
MonthGustH|21.0:|:
MonthGustHT|2:58 PM:|:
MonthGustHD|03 June:|:
MonthWindH|9.0:|:
MonthWindHT|3:00 PM:|:
MonthWindHD|03 June:|:
MonthWindRunH|37.6:|:
MonthWindRunHD|19 June:|:
rmonth|1.45:|:
MonthRainRateH|18.58:|:
MonthRainRateHT|11:13 AM:|:
MonthRainRateHD|20 June:|:
MonthHourlyRainH|0.54:|:
MonthHourlyRainHT|9:36 AM:|:
MonthHourlyRainHD|15 June:|:
MonthDailyRainH|1.19:|:
MonthDailyRainHD|15 June:|:
MonthLongestDryPeriod|10:|:
MonthLongestDryPeriodD|13 June:|:
MonthLongestWetPeriod|2:|:
MonthLongestWetPeriodD|03 June:|:
YearTempH|88.3:|:
YearTempHT|3:16 PM:|:
YearTempHD|06 June:|:
YearTempL|0.9:|:
YearTempLT|7:23 AM:|:
YearTempLD|31 January:|:
YearHighDailyTempRange|39.7:|:
YearHighDailyTempRangeD|30 April:|:
YearLowDailyTempRange|0.0:|:
YearLowDailyTempRangeD|16 March:|:
YearHeatIndexH|85.5:|:
YearHeatIndexHT|3:10 PM:|:
YearHeatIndexHD|06 June:|:
YearWChillL|-2.1:|:
YearWChillLT|5:05 AM:|:
YearWChillLD|31 January:|:
YearAppTempH|87.9:|:
YearAppTempHT|3:10 PM:|:
YearAppTempHD|06 June:|:
YearAppTempL|-5.5:|:
YearAppTempLT|7:23 AM:|:
YearAppTempLD|31 January:|:
YearDewPointH|58.9:|:
YearDewPointHT|6:14 PM:|:
YearDewPointHD|14 June:|:
YearDewPointL|-4.2:|:
YearDewPointLT|4:05 PM:|:
YearDewPointLD|19 April:|:
YearMinTempH|60.7:|:
YearMinTempHD|19 June:|:
YearMaxTempL|20.9:|:
YearMaxTempLD|31 January:|:
YearHumH|97:|:
YearHumHT|12:00 AM:|:
YearHumHD|01 January:|:
YearHumL|11:|:
YearHumLT|6:41 PM:|:
YearHumLD|30 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|14.05:|:
YearRainRateH|18.58:|:
YearRainRateHT|11:13 AM:|:
YearRainRateHD|20 June:|:
YearHourlyRainH|0.54:|:
YearHourlyRainHT|9:36 AM:|:
YearHourlyRainHD|15 June:|:
YearDailyRainH|1.19:|:
YearDailyRainHD|15 June:|:
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|18.58:|:
TrrateM|at 11:13 AM on 20 June 2023:|:
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|6/23/2023 11:15:04 AM:|:
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|2:|:
WindRoseData|0.0,0.0,0.0,0.0,0.0,18.0,51.0,373.0,842.0,3305.0,3683.0,768.0,141.0,84.0,15.0,0.0:|:
WindRosePoints|16:|:
WindSampleCount|3600:|:
LatestNOAAMonthlyReport|:|:
LatestNOAAYearlyReport|:|:
sunrise|05:57:|:
sunset|21:00:|:
daylength|15:03:|:
tomorrowdaylength|There will be 0min 3s less daylight tomorrow:|:
dawn|05:24:|:
dusk|21:34:|:
daylightlength|16:10:|:
moonphase|Waxing Crescent:|:
MoonAge|5:|:
moonrise|10:58:|:
moonset|00:25:|:
isdaylight|1:|:
IsSunUp|1:|:
SunshineHours|0.0:|:
YSunshineHours|0.0:|:
CurrentSolarMax|891:|:
IsSunny|0:|:
MoonPercent|26:|:
MoonPercentAbs|26:|:
LowTempAlarm|0:|:
HighTempAlarm|0:|:
TempChangeUpAlarm|0:|:
TempChangeDownAlarm|0:|:
TempChangeLastHour|+3.1:|:
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|11895:|:
DavisTotalPacketsMissed|2791:|:
DavisNumberOfResynchs|0:|:
DavisMaxInARow|51:|:
DavisNumCRCerrors|768:|:
DavisFirmwareVersion|2.12:|:
THWindex|67.4:|:
THSWindex|0.0:|:
Light|0.0:|:
OsVersion|Windows 8 build 9200:|:
OsLanguage|English:|:
SystemUpTime|1 hour 22 minutes:|:
ProgramUpTime|1 hour 20 minutes:|:
CpuName|Intel(R) Xeon(R) CPU E5-2667 v2 @ 3.30GHz:|:
CpuCount|2:|:
MemoryStatus|879/2047 MB (free/total):|:
DisplayMode|1149x815, 32 bit:|:
AllocatedMemory|110.75 MB:|:
DiskSize|59.46 GB:|:
DiskFree|33.02 GB:|:
RCdew|34.4:|:
RCheatindex|71.0:|:
RChum|26:|:
RCinhum|50:|:
RCintemp|73.5:|:
RCpress|29.659:|:
RCpressTH|29.669:|:
RCpressTL|29.561:|:
RCrfall|0.00:|:
RCrrate|0.00:|:
RCrrateTM|0.00:|:
RCtemp|71.0:|:
RCtempTH|71.0:|:
RCtempTL|53.2:|:
RCwchill|71.0:|:
RCwgust|7.0:|:
RCwgustTM|11.0:|:
RCwspeed|3.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"); }
?>