<!DOCTYPE html>
<% language=javascript %>
<html>
<head lang="en">
    <meta charset="GB2312">
    <title></title>
    <link href="css/style.css" title="style" rel="stylesheet" type="text/css" />
    <script src="js/jquery-1.6.3.min.js"></script>
    <script src="js/omara.js"></script>

</head>
<body style="background: #F3F3F3">
<div class='type2084 empty' style=' margin: 10px;'>
  <table width="100%">
    <tr>
    <td width="300px" style="text-align: center;"><img src="img/ico-cyber.png" style="width: 60%;text-align: center;"></td>
    <td>
    <table width='100%'>
        <tr><td style='border: none'> <h1>空调监测</h1></td></tr>
        <tr><td style='width: 200px;'>基本信息</td><td>SID:<span class='SID2084'> </span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr2084'> </span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port2084'> </span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd2084'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State2084'> </span></td></tr>
    </table>
    <table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>基本信息</h1></td></tr>
		<tr><td width='50%'>室内温度:<span class='FloTemSen2084'></span></td>
			<td width='50%'><span class='2084'></span></td></tr>
		<tr><td width='50%'>制冷设定点:<span class='FloTemCoolSet2084'></span></td>
		    <td width='50%'>制热设定点:<span class='FloTemHeatSet2084'></span></td></tr>
		<tr><td width='50%'>制冷精度:<span class='FloTemCoolAcc2084'></span></td>
		    <td width='50%'>制热精度:<span class='FloTemHeatAcc2084'></span></td></tr>
		<tr><td width='50%'>室内温度传感器校准:<span class='FloTemClib2084'></span></td>
		    <td width='50%'>制冷设定值的最小值:<span class='FloTemCoolMin2084'></span></td></tr>
		<tr><td width='50%'>制冷设定值的最大值:<span class='FloTemCoolMax2084'></span></td>
		    <td width='50%'>制热设定值的最小值:<span class='FloTemHeatMin2084'></span></td></tr>
		<tr><td width='50%'>制热设定值的最大值:<span class='FloTemHeatMax2084'></span></td>
		    <td width='50%'>低温报警:<span class='FloTemAmL2084'></span></td></tr>
		<tr><td width='50%'>高温报警:<span class='FloTemAmH2084'></span></td>
			<td width='50%'>报警精度:<span class='FloTemAmAcc2084'></span></td></tr>
		<tr><td width='50%'>报警延迟:<span class='IntAmDelay2084'></span></td>
		    <td width='50%'>蜂鸣器:<span class='StaBeer2084'></span></td></tr>
		<tr><td width='50%'>制冷输出开度:<span class='IntCoolOp2084'></span></td>
		    <td width='50%'>制冷输出状态:<span class='StaCool2084'></span></td></tr>
    </table>
    <table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>告警状态</h1></td></tr>
		<tr><td width='50%'>室内温度传感器故障报警:<span class='AlmTemSenFault2084'></span></td>
		    <td width='50%'>高温报警:<span class='AlmTemHigh2084'></span></td></tr>
		<tr><td width='50%'>低温报警:<span class='AlmTemLow2084'></span></td>
		    <td width='50%'>高低压或无风量报警:<span class='AlmNoAir2084'></span></td></tr>
		<tr><td width='50%'>启动时出错:<span class='AlmStartFault2084'></span></td>
		    <td width='50%'>室内温度传感器读数报警:<span class='AlmTemSen2084'></span></td></tr>
    </table>
    </td>
    </tr>
  </table>
    <a href='javascript:history.back()' class='back' style='color: #fff'>返回</a>
</div>
<script>
var itype=2084;
var tescape= 5000,time;
  
<% db_Open("/NandFlash/tmp/dbDat0.db3"); %>
var sid=<% write(sid);%>;
var json=<% db_QryAdv("select * from tbCybIR33 where SID="+sid,0);%>;
<% db_Close(); %>
	
$(function(){
   time=setInterval(ajax,tescape)
});
function ajax(){
    $.ajax({
        type: "POST",
        url: "omdev/smdat0.asp",
        data: "itype="+itype+"&sid="+sid,
        dataType:"json",
        success: function(msg){
            list3(msg); 
			
        }
    });
}

list3(json);
function list3(data){
	if (data.reccnt == 0)
		return;
    $.each(data.recs,function(i,n){
        $(".SID2084").html(n.SID);
        $(".Addr2084").html(n.Addr);
        $(".Port2084").html(n.Port%256);
        $(".DateUpd2084").html(n.DateUpd);
        $(".State2084").html(parseState(n.State));
		
		var unit = "℃";
		//if (n.IntTemUnit)
		//	unit = "℉";
		$(".FloTemSen2084").html((n.FloTemSen/1000) + unit);
		$(".FloTemCoolSet2084").html((n.FloTemCoolSet/1000) + unit);
		$(".FloTemHeatSet2084").html((n.FloTemHeatSet/1000) + unit);
		$(".FloTemCoolAcc2084").html((n.FloTemCoolAcc/1000) + unit);
		$(".FloTemHeatAcc2084").html((n.FloTemHeatAcc/1000) + unit);
		$(".FloTemClib2084").html((n.FloTemClib/1000) + unit);
		$(".FloTemCoolMin2084").html((n.FloTemCoolMin/1000) + unit);
		$(".FloTemCoolMax2084").html((n.FloTemCoolMax/1000) + unit);
		$(".FloTemHeatMin2084").html((n.FloTemHeatMin/1000) + unit);
		$(".FloTemHeatMax2084").html((n.FloTemHeatMax/1000) + unit);
		$(".FloTemAmL2084").html((n.FloTemAmL/1000) + unit);
		$(".FloTemAmH2084").html((n.FloTemAmH/1000) + unit);
		$(".FloTemAmAcc2084").html((n.FloTemAmAcc/1000) + unit);
		$(".IntAmDelay2084").html((n.IntAmDelay) + "min");
		$(".IntCoolOp2084").html((n.IntCoolOp) + "%");
		$(".AlmTemSenFault2084").html((n.AlmTemSenFault) ? "告警" : "正常");
		$(".AlmTemHigh2084").html((n.AlmTemHigh) ? "告警" : "正常");
		$(".AlmTemLow2084").html((n.AlmTemLow) ? "告警" : "正常");
		$(".AlmNoAir2084").html((n.AlmNoAir) ? "告警" : "正常");
		$(".AlmStartFault2084").html((n.AlmStartFault) ? "告警" : "正常");
		$(".AlmTemSen2084").html((n.AlmTemSen) ? "告警" : "正常");
		$(".StaBeer2084").html((n.StaBeer) ? "开启" : "关闭");
		$(".StaCool2084").html((n.StaCool) ? "开启" : "关闭");
    })

	$("span:contains('故障'),span:contains('告警'),,span:contains('闭合'),span:contains('关闭')").addClass("red").removeClass("ger");
    $("span:contains('正常')").addClass("ger").removeClass("red");
}

function parseAlm(istate){
    if(istate==0) return "正常";
    else   if(istate==1) return "告警";
    else return "无效";
}

function parseState(istate){
    if(istate==0) return "正常";
    else   if(istate==1) return "告警";
    else return "故障";
}

</script>
</body>
</html>