<!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>

</head>
<body style="background: #F3F3F3">
<div class='type2070 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='SID2070'> </span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr2070'> </span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port2070'> </span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd2070'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State2070'> </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='TemCur2070'></span></td><td width='50%'>传感器湿度: <span class='HumCur2070'></span></td></tr>
		<tr><td width='50%'>面板显示温度: <span class='TemPlan2070'></span></td><td width='50%'>面板显示湿度: <span class='HumPlan2070'></span></td></tr>
		<tr><td width='50%'>温度高限: <span class='TemHSet2070'></span></td><td width='50%'>温度低限: <span class='TemLSet2070'></span></td></tr>
		<tr><td width='50%'>加湿高限: <span class='HumHSet2070'></span></td><td width='50%'>加湿低限: <span class='HumLSet2070'></span></td></tr>
    </table>
    <table width='100%' style='margin-top: 30px'>
        <tr><td> <h1>报警状态</h1></td></tr>
		<tr><td>通用报警: <span class='CusAlm2070'></span></td><td width='50%'>火警: <span class='FireAlm2070'></span></td></tr>
		<tr><td>温度高限报警: <span class='TemHAlm2070'></span></td><td width='50%'>温度低限报警: <span class='TemLAlm2070'></span></td></tr>
        <tr><td>湿度高限报警: <span class='Js1On2070'></span></td><td>湿度低限报警: <span class='Js1On2070'></span></td></tr>
		<tr><td>电源相序报警: <span class='CsMode2070'></span></td><td>&nbsp; <span class='xxx2070'></span></td></tr>
    </table>
	<table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>系统状态</h1></td></tr>
        <tr><td>开关机: <span class='PowOn2070'></span></td><td>传感器是否连接: <span class='SenLink2070'></span></td></tr>
		<tr><td>在除湿模式: <span class='CsMode2070'></span></td><td>加热器1是否开启: <span class='Js1On2070'></span></td></tr>
		<tr><td>加热器2是否开启: <span class='Js2On2070'></span></td><td>加热器3是否开启: <span class='Js3On2070'></span></td></tr>
		<tr><td>除湿器开启: <span class='CsOn2070'></span></td><td>备用机开启: <span class='ByOn2070'></span></td></tr>
    </table>
    </td>
    </tr>
  </table>

    <a href='javascript:history.back()' class='back' style='color: #fff'>返回</a>
</div>
<script>
var itype=2070;
var tescape= 5000,time;
  
<% db_Open("/NandFlash/tmp/dbDat0.db3"); %>
var sid=<% write(sid);%>;
var json=<% db_QryAdv("select * from tbCyberCanatalKN10 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){
        $(".SID2070").html(n.SID);
        $(".Addr2070").html(n.Addr);
        $(".Port2070").html(n.Port%256);
        $(".DateUpd2070").html(n.DateUpd);
        $(".State2070").html(window.parent.parseState(n.State));
		
		$(".TemCur2070").html(n.TemCur/10+"℃");
		$(".HumCur2070").html(n.HumCur/10+"%RH");
		$(".TemPlan2070").html(n.TemPlan/10+"℃");
		$(".HumPlan2070").html(n.HumPlan/10+"%RH");
		$(".TemHSet2070").html(n.TemHSet/10+"℃");
		$(".TemLSet2070").html(n.TemLSet/10+"℃");
		$(".HumHSet2070").html(n.HumHSet/10+"%RH");
		$(".HumLSet2070").html(n.HumLSet/10+"%RH");
		
		$(".CusAlm2070").html(n.CusAlm ? "是" : "否");
		$(".FireAlm2070").html(n.FireAlm ? "是" : "否");
		$(".TemHAlm2070").html(n.TemHAlm ? "是" : "否");
		$(".TemLAlm2070").html(n.TemLAlm ? "是" : "否");
		$(".CsMode2070").html(n.CsMode ? "是" : "否");
		
		$(".PowOn2070").html(n.PowOn ? "是" : "否");
		$(".SenLink2070").html(n.SenLink ? "是" : "否");
		$(".Js1On2070").html(n.Js1On ? "是" : "否");
		$(".Js2On2070").html(n.Js2On ? "是" : "否");
		$(".CsOn2070").html(n.CsOn ? "是" : "否");
		$(".Js3On2070").html(n.Js3On ? "是" : "否");
		$(".ByOn2070").html(n.ByOn ? "是" : "否");
		
    })
	$("span:contains('故障'),span:contains('告警'),,span:contains('闭合'),span:contains('关闭')").addClass("red").removeClass("ger");
        $("span:contains('正常')").addClass("ger").removeClass("red");
    
}

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