<!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='type2077 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='SID2077'> </span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr2077'> </span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port2077'> </span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd2077'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State2077'> </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='TemRet2077'></span></td><td width='50%'>回风湿度: <span class='HumRet2077'></span></td></tr>
		<tr><td width='50%'>设定温度: <span class='TemSet2077'></span></td><td width='50%'>设定湿度: <span class='HumSet2077'></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='RunMode2077'></span></td><td width='50%'> <span class='2077'></span></td></tr>
		<tr><td width='50%'>制冷状态: <span class='StCool2077'></span></td><td width='50%'>加热状态: <span class='StHeat2077'></span></td></tr>
		<tr><td width='50%'>加湿状态: <span class='StHum2077'></span></td><td width='50%'>除湿状态: <span class='StDeHum2077'></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='AlmTemSup2077'></span></td><td width='50%'>冷凝压力故障:<span class='AlmCoolFault2077'></span></td></tr>
		<tr><td width='50%'>高温报警:<span class='AlmTemH2077'></span></td><td width='50%'>低温报警:<span class='AlmTemL2077'></span></td></tr>
		<tr><td width='50%'>高湿报警:<span class='AlmHumH2077'></span></td><td width='50%'>低湿报警:<span class='AlmHumL2077'></span></td></tr>
		<tr><td width='50%'>高压报警:<span class='AlmPreH2077'></span></td><td width='50%'>高压锁定:<span class='AlmPreHLock2077'></span></td></tr>
		<tr><td width='50%'>低压报警:<span class='AlmPreL2077'></span></td><td width='50%'>低压锁定:<span class='AlmPreLLock2077'></span></td></tr>
		<tr><td width='50%'>排气报警:<span class='AlmVent2077'></span></td><td width='50%'>排气锁定:<span class='AlmVentLock2077'></span></td></tr>
		<tr><td width='50%'>加湿过流:<span class='AlmHumOCP2077'></span></td><td width='50%'>内风机故障:<span class='AlmFanFault2077'></span></td></tr>
		<tr><td width='50%'>地板溢水:<span class='AlmLeak2077'></span></td><td width='50%'>气流丢失:<span class='AlmAirLoss2077'></span></td></tr>
		<tr><td width='50%'>加湿器故障:<span class='AlmHumFault2077'></span></td><td width='50%'>加热器故障:<span class='AlmHeatFault2077'></span></td></tr>
		<tr><td width='50%'>回风温度故障:<span class='AlmTemRetFault2077'></span></td><td width='50%'>回风湿度故障:<span class='AlmHumRetFault2077'></span></td></tr>
		<tr><td width='50%'>防雷告警:<span class='AlmThunder2077'></span></td><td width='50%'><span class='2077'></span></td></tr>
    </table>
    </td>
    </tr>
  </table>
    <a href='javascript:history.back()' class='back' style='color: #fff'>返回</a>
</div>
<script>
var itype=2077;
var tescape= 5000,time;
  
<% db_Open("/NandFlash/tmp/dbDat0.db3"); %>
var sid=<% write(sid);%>;
var json=<% db_QryAdv("select * from tbCyberCoolSmart 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){
    $.each(data.recs,function(i,n){
        $(".SID2077").html(n.SID);
        $(".Addr2077").html(n.Addr);
        $(".Port2077").html(n.Port%256);
        $(".DateUpd2077").html(n.DateUpd);
        $(".State2077").html(parseState(n.State));
		
		$(".TemRet2077").html(n.TemRet/10 + "℃");
		$(".HumRet2077").html(n.HumRet + "％");
		$(".TemSet2077").html(n.TemSet/10 + "℃");
		$(".HumSet2077").html(n.HumSet/10 + "％");
		
		//0：本地关机，1：远程关机，2：监控关机，3：组网待机，4：电源保护，5：气流保护，6：压机锁定，7：系统开机
		if (n.RunMode == 0)
			n.RunMode = "本地关机";
		else if (n.RunMode == 1)
			n.RunMode = "远程关机";
		else if (n.RunMode == 2)
			n.RunMode = "监控关机";
		else if (n.RunMode == 3)
			n.RunMode = "组网待机";
		else if (n.RunMode == 4)
			n.RunMode = "电源保护";
		else if (n.RunMode == 5)
			n.RunMode = "气流保护";
		else if (n.RunMode == 6)
			n.RunMode = "压机锁定";
		else if (n.RunMode == 7)
			n.RunMode = "系统开机";
		else
			n.RunMode = "未知";
		$(".RunMode2077").html(n.RunMode);
		
		$(".StCool2077").html(n.StCool ? "开启" : "停止");
		$(".StHeat2077").html(n.StHeat ? "开启" : "停止");
		$(".StHum2077").html(n.StHum ? "开启" : "停止");
		$(".StDeHum2077").html(n.StDeHum ? "开启" : "停止");
		$(".AlmTemSup2077").html(n.AlmTemSup ? "告警" : "正常");
		$(".AlmTemH2077").html(n.AlmTemH ? "告警" : "正常");
		$(".AlmTemL2077").html(n.AlmTemL ? "告警" : "正常");
		$(".AlmHumH2077").html(n.AlmHumH ? "告警" : "正常");
		$(".AlmHumL2077").html(n.AlmHumL ? "告警" : "正常");
		$(".AlmPreH2077").html(n.AlmPreH ? "告警" : "正常");
		$(".AlmPreHLock2077").html(n.AlmPreHLock ? "告警" : "正常");
		$(".AlmPreL2077").html(n.AlmPreL ? "告警" : "正常");

		$(".AlmPreLLock2077").html(n.AlmPreLLock ? "告警" : "正常");

		$(".AlmThunder2077").html(n.AlmThunder ? "告警" : "正常");

		$(".AlmVent2077").html(n.AlmVent ? "告警" : "正常");

		$(".AlmVentLock2077").html(n.AlmVentLock ? "告警" : "正常");

		$(".AlmHumOCP2077").html(n.AlmHumOCP ? "告警" : "正常");

		$(".AlmFanFault2077").html(n.AlmFanFault ? "告警" : "正常");

		$(".AlmLeak2077").html(n.AlmLeak ? "告警" : "正常");

		$(".AlmAirLoss2077").html(n.AlmAirLoss ? "告警" : "正常");

		$(".AlmHumFault2077").html(n.AlmHumFault ? "告警" : "正常");

		$(".AlmHeatFault2077").html(n.AlmHeatFault ? "告警" : "正常");

		$(".AlmTemRetFault2077").html(n.AlmTemRetFault ? "告警" : "正常");

		$(".AlmHumRetFault2077").html(n.AlmHumRetFault ? "告警" : "正常");

		$(".AlmCoolFault2077").html(n.AlmCoolFault ? "告警" : "正常");

    })

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

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


</script>

</body>

</html>