<!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='type2066 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>K200空调监测</h1></td></tr>
        <tr><td style='width: 200px;'>基本信息</td><td>SID:<span class='SID2066'> </span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr2066'> </span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port2066'> </span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd2066'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State2066'> </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='Status2066'></span></td><td width='50%'>设定温度: <span class='Sdwd2066'></span></td></tr>
		<tr><td width='50%'>设定湿度: <span class='Sdsd2066'></span></td><td width='50%'>回风温度: <span class='Hfwd2066'></span></td></tr>
		<tr><td width='50%'>回风湿度: <span class='Hfsd2066'></span></td><td width='50%'></td></tr>
    </table>
	<table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>系统状态</h1></td></tr>
        <tr>
			<td>除湿: <span class='Cs2066'></span></td>
			<td>加湿: <span class='Js2066'></span></td>
			<td>制冷: <span class='Zl2066'></span></td>
		</tr>
		<tr>
			<td>制热: <span class='Zr2066'></span></td>
			<td>风机: <span class='Fj2066'></span></td>
			<td>回风温度探头: <span class='Hfwdtt2066'></span></td>
		</tr>
		<tr>
			<td>送风温度探头: <span class='Sfwdtt2066'></span></td>
			<td>回风湿度探头: <span class='Hfsdtt2066'></span></td>
			<td>室外温度探头: <span class='Swwdtt2066'></span></td>
		</tr>
    </table>
    </td>
    </tr>
  </table>

    <a href='javascript:history.back()' class='back' style='color: #fff'>返回</a>
</div>
<script>
var itype=2066;
var tescape= 5000,time;
  
<% db_Open("/NandFlash/tmp/dbDat0.db3"); %>
var sid=<% write(sid);%>;
var json=<% db_QryAdv("select * from tbCyberK200 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); 
			
        }
    });
}
var monitorStatus = ["正常","告警","故障"];
var Status = ["关机","开机"];
var Status2 = ["关","开"];
var Status3 = ["正常","故障"];

list3(json);
function list3(data){
    $.each(data.recs,function(i,n){
        $(".SID2066").html(n.SID);
        $(".Addr2066").html(n.Addr);
        $(".Port2066").html(n.Port%256);
        $(".DateUpd2066").html(n.DateUpd);
        $(".State2066").html(monitorStatus[n.State%3]);
		
		$(".Status2066").html(Status[n.status]);
        $(".Sdwd2066").html(n.sdwd/10.0+"℃");
        $(".Sdsd2066").html(n.sdsd+"%");
        $(".Hfwd2066").html(n.hfwd/10.0+"℃");
        $(".Hfsd2066").html(n.hfsd+"%");
		if(n.State == 2)
		{
			$(".Cs2066").html("故障");
			$(".Js2066").html("故障");
			$(".Zl2066").html("故障");
			$(".Zr2066").html("故障");
			$(".Fj2066").html("故障");
			
			$(".Hfwdtt2066").html("故障");
			$(".Sfwdtt2066").html("故障");
			$(".Hfsdtt2066").html("故障");
			$(".Swwdtt2066").html("故障");
		}
		else
		{
			$(".Cs2066").html(Status2[n.cs]);
			$(".Js2066").html(Status2[n.js]);
			$(".Zl2066").html(Status2[n.zl]);
			$(".Zr2066").html(Status2[n.zr]);
			$(".Fj2066").html(Status2[n.fj]);
			
			$(".Hfwdtt2066").html(Status3[n.hfwdtt]);
			$(".Sfwdtt2066").html(Status3[n.sfwdtt]);
			$(".Hfsdtt2066").html(Status3[n.hfsdtt]);
			$(".Swwdtt2066").html(Status3[n.swwdtt]);
		}
    })
	$("span:contains('故障'),span:contains('告警'),span:contains('闭合'),span:contains('关闭')").addClass("red").removeClass("ger");
        $("span:contains('正常')").addClass("ger").removeClass("red");
    
}

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