Page 2 of 2

Re: Station Status question

Posted: Sun 14 Jan 2018 11:49 pm
by dazza1223
du u mine this ken ?


// Standard checks for weather software updates
//
// check the appropriate realtime file first
if($SITE['WXsoftware'] == 'WD' and isset($SITE['clientrawfile'])) {
do_check($SITE['WXsoftwareLongName']." ".langtransstr("realtime"),$SITE['clientrawfile'],15,'file');
}
if($SITE['WXsoftware'] == 'MH' and isset($SITE['clientrawFile'])) {
do_check($SITE['WXsoftwareLongName']." ".langtransstr("realtime"),$SITE['clientrawFile'],60+30,'file');
}
if($SITE['WXsoftware'] == 'VWS' and isset($SITE['wflashdir'])) {
do_check($SITE['WXsoftwareLongName']." ".langtransstr("realtime"),$SITE['wflashdir'].'wflash.txt',15,'file');
}
if($SITE['WXsoftware'] == 'VWS' and isset($SITE['wflashdir'])) {
do_check($SITE['WXsoftwareLongName']." ".langtransstr("realtime").' 2',$SITE['wflashdir'].'wflash2.txt',60+15,'file');
}
if($SITE['WXsoftware'] == 'CU' and isset($SITE['realtimefile'])) {
do_check($SITE['WXsoftwareLongName']." ".langtransstr("realtime"),$SITE['realtimefile'],15,'file');
}
if($SITE['WXsoftware'] == 'WL' and isset($SITE['WLrealtime'])) {
do_check($SITE['WXsoftwareLongName']." ".langtransstr("realtime"),$SITE['WLrealtime'],90,'file'); // weatherlink updates at 90 second intervals
}
if($SITE['WXsoftware'] == 'WCT' and isset($SITE['WCTrealtime'])) {
do_check($SITE['WXsoftwareLongName']." ".langtransstr("realtime"),$SITE['WCTrealtime'],90,'file'); // weatherlink updates at 90 second intervals
}

// check the weather tags themselves
if($SITE['WXsoftware'] == 'WSN') { // Only WeatherSnoop does not upload the WXtags file
do_check($SITE['WXsoftwareLongName']." ".langtransstr("FTP"),'weather.json',60*5+15,'file');
} elseif ($SITE['WXsoftware'] == 'WLCOM') {
# no FTP check for WCOM
} else {
do_check($SITE['WXsoftwareLongName']." ".langtransstr("FTP"),$SITE['WXtags'],60*5+15,'file');
}
// check the internal date of the tags file
$chkdate = fixup_date($date) . ' ' . fixup_time($time); // handle all formats to make standard
print "<!-- ".$SITE['WXtags']." internal update date time='$date $time' fixed='$chkdate' -->\n";
do_check($SITE['WXsoftwareLongName']." ".langtransstr("weather data"),strtotime($chkdate),60*5+15,'application');


// checks for optional NOAA-style report updates
if($SITE['WXsoftware'] == 'CU' and isset($WX['LatestNOAAMonthlyReport']) and
file_exists($SITE['NOAAdir'].$WX['LatestNOAAMonthlyReport'])) {
do_check($SITE['WXsoftwareLongName']." ".langtransstr("NOAA report"),
$SITE['NOAAdir'].$WX['LatestNOAAMonthlyReport'],24*60*60+10*60,'file');
}

if($SITE['WXsoftware'] == 'VWS' and file_exists($SITE['NOAAdir'].'noaamo.txt')) {
do_check($SITE['WXsoftwareLongName']." ".langtransstr("NOAA report"),
$SITE['NOAAdir'].'noaamo.txt',60*65+15,'file');
}

if($SITE['WXsoftware'] == 'WD' and
file_exists($SITE['HistoryFilesDir'].'dailynoaareport.htm')) {
do_check($SITE['WXsoftwareLongName']." ".langtransstr("NOAA report"),
$SITE['HistoryFilesDir'].'dailynoaareport.htm',24*60*60+15*60,'file');
}

$MYYYYfile = date('FY') . '.htm'; // generates the <Monthname><YYYY>.htm filename used by WD
if($SITE['WXsoftware'] == 'WD' and file_exists($SITE['HistoryFilesDir'].$MYYYYfile)) {
do_check($SITE['WXsoftwareLongName']." ".langtransstr("Month report"),
$SITE['HistoryFilesDir'].$MYYYYfile,24*60*60+15*60,'file');
}

if($SITE['WXsoftware'] == 'WL' and file_exists($SITE['NOAACurDir'].'NOAAMO.TXT')) {
do_check($SITE['WXsoftwareLongName']." ".langtransstr("NOAA report"),
$SITE['NOAACurDir'].'NOAAMO.TXT',60*5+15,'file');
}
if($SITE['WXsoftware'] == 'WLCOM') {
$uoms = $SITE['uomTemp'].$SITE['uomBaro'].$SITE['uomWind'].$SITE['uomRain'].
$SITE['uomSnow'].$SITE['uomDistance'].$SITE['uomPerHour'];
$from = array('/',' ','&deg;','.php');
$to = '';
$testFile = $SITE['cacheFileDir'].
str_replace ($from, $to,
'weatherlinkcom-yday-'.$SITE['WLCOMdid'].'_'.$uoms.'.txt'); // add uoms to filename


do_check($SITE['WXsoftwareLongName']." ".langtransstr("Yesterday Data").
' [ <a href="'.$SITE['cacheFileDir'].'LOG_saveYesterday.php.txt">'.langtransstr('View Log').']</a> ]',
$testFile,1440*60+15,'file');
}

Re: Station Status question

Posted: Sun 14 Jan 2018 11:51 pm
by dazza1223
yh i am learning bit by bit ken


am i on the right trackes

// check the appropriate realtime file first
if($SITE['WXsoftware'] == 'WD' and isset($SITE['clientrawfile'])) {
do_check($SITE['WXsoftwareLongName']." ".langtransstr("realtime"),$SITE['clientrawfile'],15,'file');
}
if($SITE['WXsoftware'] == 'MH' and isset($SITE['clientrawFile'])) {
do_check($SITE['WXsoftwareLongName']." ".langtransstr("realtime"),$SITE['clientrawFile'],60+30,'file');
}
if($SITE['WXsoftware'] == 'VWS' and isset($SITE['wflashdir'])) {
do_check($SITE['WXsoftwareLongName']." ".langtransstr("realtime"),$SITE['wflashdir'].'wflash.txt',15,'file');
}
if($SITE['WXsoftware'] == 'VWS' and isset($SITE['wflashdir'])) {
do_check($SITE['WXsoftwareLongName']." ".langtransstr("realtime").' 2',$SITE['wflashdir'].'wflash2.txt',60+15,'file');
}
if($SITE['WXsoftware'] == 'CU' and isset($SITE['realtimefile'])) {
do_check($SITE['WXsoftwareLongName']." ".langtransstr("realtime"),$SITE['realtimefile'],15,'file');

Re: Station Status question

Posted: Mon 15 Jan 2018 5:12 pm
by saratogaWX
Ummm... posting the unmodified code from my include-wxstatus.php is not helpful. YOU will have to read, understand, and modify the code to make it work on your non-template website. As I said before, that code (unmodified) requires parts from Settings.php, Settings-weather.php (for your PWS weather software), common.php to fully operate. That is what you need to either include or replace all the $SITE['...'] variables with data regarding your PWS.

I'm not going to write the modifications for you.. it's your hobby, so you get to write it and debug it.

Re: Station Status question

Posted: Mon 15 Jan 2018 5:16 pm
by dazza1223
ok ken i will spend some time with it and try and do it buddy but thank u ken