예제 #1
0
$ws['tempActInside'] = wsConvertTemperature($wx['tempActInside'], $from_temp);
$ws['tempActExtra1'] = wsConvertTemperature($wx['tempActExtra1'], $from_temp);
$ws['tempActExtra2'] = wsConvertTemperature($wx['tempActExtra2'], $from_temp);
$ws['tempToday'] = $ws['tempAct'];
if (isset($wx['fromhudx'])) {
    $from = $wx['fromhudx'];
} else {
    $from = $from_temp;
}
$ws['hudxAct'] = wsConvertTemperature($wx['hudxAct'], $from_temp);
# ------------------------------------------ pressure / baro -----------
$from_baro = trim(strtolower($wx['frombaro']));
// ' hPa', of ' mb', of ' inHg'
$ws['baroAct'] = wsConvertBaro($wx['baroAct'], $from_baro);
$ws['baroDelta'] = $ws['baroAct'] - wsConvertBaro($wx['baroDelta'], $from_baro);
$ws['baroTrend'] = langtransstr(wsBarotrendText($ws['baroDelta']));
$ws['baroMinToday'] = wsConvertBaro($wx['baroMinToday'], $from_baro);
$ws['baroMinTodayTime'] = mbdate($wx['baroMinTodayTime']);
$ws['baroMinYday'] = wsConvertBaro($wx['baroMinYday'], $from_baro);
$ws['baroMinYdayTime'] = mbdate($wx['baroMinYdayTime']);
$ws['baroMinMonth'] = wsConvertBaro($wx['baroMinMonth'], $from_baro);
$ws['baroMinMonthTime'] = mb_ymd($wx['baroMinMonthTime']);
$ws['baroMinYear'] = wsConvertBaro($wx['baroMinYear'], $from_baro);
$ws['baroMinYearTime'] = mb_ymd($wx['baroMinYearTime']);
$ws['baroMinAll'] = wsConvertBaro($wx['baroMinAll'], $from_baro);
$ws['baroMinAllTime'] = mb_ymd($wx['baroMinAllTime']);
$ws['baroMaxToday'] = wsConvertBaro($wx['baroMaxToday'], $from_baro);
$ws['baroMaxTodayTime'] = mbdate($wx['baroMaxTodayTime']);
$ws['baroMaxYday'] = wsConvertBaro($wx['baroMaxYday'], $from_baro);
$ws['baroMaxYdayTime'] = mb_ymd($wx['baroMaxYdayTime']);
$ws['baroMaxMonth'] = wsConvertBaro($wx['baroMaxMonth'], $from_baro);
예제 #2
0
$text2 = '<img src="' . $wr2 . '" style="height: 14px; width: 14px;" title="' . $wrtext . '" alt="' . $wrtext . '"/>';
$unit = ' ' . langtransstr(trim($uomWind));
$string1 .= "\r\najaxVars['ajaxwindiconwr']      = '" . $text1 . "';\r\najaxVars['gizmowindicon']       = '" . $text2 . "';\r\najaxVars['ajaxwinddir']         = '" . $wrtext . "';\r\najaxVars['ajaxwinddeg']         = '" . $ws['windActDir'] . "';\r\najaxVars['ajaxwinddirNoU']      = '" . langtransstr($ws['windActDsc']) . "';\r\najaxVars['ajaxwind']            = '" . wsNumber($ws['windAct'], $decWind) . $unit . "';\r\najaxVars['ajaxwindNoU']         = '" . wsNumber($ws['windAct'], $decWind) . "';\r\najaxVars['ajaxgust']            = '" . wsNumber($ws['gustAct'], $decWind) . $unit . "';\r\najaxVars['ajaxgustNoU']         = '" . wsNumber($ws['gustAct'], $decWind) . "';\r\najaxVars['ajaxbeaufortnum']     = '" . $ws['windBeafort'] . "';\r\najaxVars['ajaxbeaufort']        = '" . $convertText . "';\r\najaxVars['ajaxwindmaxgust']     = '" . wsNumber($ws['gustMaxToday'], $decWind) . $unit . "';\r\najaxVars['ajaxwindmaxgusttime'] = '" . langtransstr('at') . ' ' . string_date($ws['gustMaxTodayTime'], $SITE['timeOnlyFormat']) . "';";
#  ---------------------------  Humidity  items
$textUP = langtransstr("Increased by") . ": " . ' %s%% ' . langtransstr("the last hour") . ".";
$textDN = langtransstr("Decreased by") . ": " . ' %s%% ' . langtransstr("the last hour") . ".";
$text = wsGenArrow($ws['humiAct'], $ws['humiDelta'], $textUP, $textDN, '0');
$string1 .= "\r\najaxVars['ajaxhumidity']        = '" . wsNumber($ws['humiAct'], 0) . "%';\r\najaxVars['ajaxhumidityNoU']     = '" . wsNumber($ws['humiAct'], 0) . "';\r\najaxVars['ajaxhumidityarrow']   = '" . $text . "';";
#  ---------------------------  Pressure  items
$textUP = langtransstr('Rising') . ' %s ' . $uomBaro . ' ' . langtransstr(trim($uomPerHour));
$textDN = langtransstr('Falling') . ' %s ' . $uomBaro . ' ' . langtransstr(trim($uomPerHour));
$text = wsGenArrow($ws['baroAct'], $ws['baroDelta'], $textUP, $textDN, $SITE['decBaro']);
if ($SITE['WXsoftware'] == 'WL' || $SITE['WXsoftware'] == 'DW') {
    $pressuretrendname = langtransstr($ws['baroTrend']);
} else {
    $pressuretrendname = wsBarotrendText($ws['baroDelta'], $uomBaro);
}
$string1 .= "\r\najaxVars['ajaxbaro']            = '" . wsNumber($ws['baroAct'], $decBaro) . $uomBaro . "';\r\najaxVars['ajaxbaroNoU']         = '" . wsNumber($ws['baroAct'], $decBaro) . "';\r\najaxVars['ajaxbaroarrow']       = '" . $text . "';\r\najaxVars['ajaxbarotrendtext']   = '" . $pressuretrendname . "';";
#  ---------------------------  solar / uv values - sent only when there are sensors
if ($SITE['SOLAR']) {
    $string1 .= "\r\najaxVars['ajaxsolar']           = '" . wsNumber($ws['solarAct'], 0) . "';";
    if (isset($ws['solActPerc'])) {
        $string1 .= "\r\najaxVars['ajaxsolarpct']        = '" . wsNumber($ws['solActPerc'], 0) . "';";
    } elseif (isset($ws['solarActPerc'])) {
        $string1 .= "\r\najaxVars['ajaxsolarpct']        = '" . wsNumber($ws['solarActPerc'], 0) . "';";
    }
    $string1 .= "\r\najaxVars['ajaxsolarmax']        = '" . wsNumber($ws['solarMaxToday'], 0) . "';";
    if ($ws['solarMaxToday'] != 0) {
        $string1 .= "\r\najaxVars['ajaxsolarmaxtime']    = '" . string_date($ws['solarMaxTodayTime'], $SITE['timeOnlyFormat']) . "';";
    } else {
        $string1 .= "\r\najaxVars['ajaxsolarmaxtime']    = 'none';";