<!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='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='SID2094'> </span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr2094'> </span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port2094'> </span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd2094'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State2094'> </span></td></tr>
    </table>
    <table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>基本信息</h1></td></tr>
		<tr><td width='25%'>运 行:<span class='StRun2094'></span></td>
		    <td width='25%'>通 讯:<span class='StComm2094'></span></td>
			<td width='25%'></td></tr>
		<tr><td width='25%'>模 式:<span class='Mode2094'></span></td>
		    <td width='25%'>温度设置:<span class='TemSet2094'></span></td>
			<td width='25%'>风 速:<span class='Fan2094'></span></td></tr>
		<tr><td width='25%'>回风温度:<span class='Tem2094'></span></td>
		    <td width='25%'>外盘温度1:<span class='TemW12094'></span></td>
			<td width='25%'></span></td></tr>
	</table>
    </td>
    </tr>
  </table>
    <a href='javascript:history.back()' class='back' style='color: #fff'>返回</a>
</div>
<script>
var itype=2094;
var tescape= 5000,time;
  
<% db_Open("/NandFlash/tmp/dbDat0.db3"); %>
var sid=<% write(sid);%>;
var json=<% db_QryAdv("select * from tbCyberEk503 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){
        $(".SID2094").html(n.SID);
        $(".Addr2094").html(n.Addr);
        $(".Port2094").html(n.Port%256);
        $(".DateUpd2094").html(n.DateUpd);
        $(".State2094").html(parseState(n.State));
		
        if (n.StRun==0) n.StRun="关机"; else n.StRun="开机";
		$(".StRun2094").html(n.StRun);
        if (n.StComm==0) n.StComm="正常"; else n.StComm="故障";
		$(".StComm2094").html(n.StComm);
        if (n.Mode==1) n.Mode="制冷";
        else if (n.Mode==2) n.Mode="制热";
        else if (n.Mode==3) n.Mode="自动";
        else if (n.Mode==4) n.Mode="送风";
        else if (n.Mode==5) n.Mode="除湿";
		$(".Mode2094").html(n.Mode);
		$(".TemSet2094").html(n.TemSet + "℃");
        if (n.Fan==0) n.Fan="低速";
        else if (n.Fan==1) n.Fan="中速";
        else if (n.Fan==2) n.Fan="高速";
        else if (n.Fan==3) n.Fan="自动";
		$(".Fan2094").html(n.Fan);
		$(".Tem2094").html((n.Tem/10) + "℃");
		$(".TemW12094").html((n.TemW1/10) + "℃");
		//$(".TemW22094").html((n.TemW2/10) + "℃");
    })

	$("span:contains('故障'),span:contains('告警'),,span:contains('关闭'),span:contains('开机')").addClass("red").removeClass("ger");
    $("span:contains('正常'),span:contains('开启'),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 "故障";
}

function alarmState(istate){
    if(istate==0) return "正常";
    else   if(istate==1) return "短路";
    else return "开路";
}

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