<!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='SID2086'> </span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr2086'> </span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port2086'> </span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd2086'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State2086'> </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='Tem2086'></span></td>
		    <td width='50%'>湿度:<span class='Hum2086'></span></td></tr>
		<tr><td width='50%'>设定温度:<span class='TemSet2086'></span></td>
		    <td width='50%'>温度上限:<span class='TemLow2086'></span></td></tr>
		<tr><td width='50%'>温度下限:<span class='TemHigh2086'></span></td>
		    <td width='50%'>设定湿度:<span class='HumSet2086'></span></td></tr>
		<tr><td width='50%'>湿度上限:<span class='HumLow2086'></span></td>
		    <td width='50%'>湿度下限:<span class='HumHigh2086'></span></td></tr>
    </table>
    <table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>运行状态</h1></td></tr>
		<tr><td width='50%'>压缩机低压报警1:<span class='AlmCompPresLow12086'></span></td>
		    <td width='50%'>压缩机低压报警2:<span class='AlmCompPresLow22086'></span></td></tr>
		<tr><td width='50%'>空气流量报警:<span class='AlmAirFlow2086'></span></td>
		    <td width='50%'>风机过载报警:<span class='AlmFanOvl2086'></span></td></tr>
		<tr><td width='50%'>电加热1过载:<span class='AlmHeaterOvl12086'></span></td>
		    <td width='50%'>电加热2过载:<span class='AlmHeaterOvl22086'></span></td></tr>
		<tr><td width='50%'>漏水/烟火报警:<span class='AlmFire2086'></span></td>
		    <td width='50%'>过滤器堵塞报警:<span class='AlmDirtyFilter2086'></span></td></tr>
		<tr><td width='50%'>室内温度过高报警:<span class='AlmTemHigh2086'></span></td>
		    <td width='50%'>室内温度过低报警:<span class='AlmTemLow2086'></span></td></tr>
		<tr><td width='50%'>湿度过高报警:<span class='AlmHumHigh2086'></span></td>
		    <td width='50%'>湿度过低报警:<span class='AlmHumLow2086'></span></td></tr>
		<tr><td width='50%'>压缩机1运行时的阈值报警:<span class='AlmCompOvt12086'></span></td>
		    <td width='50%'>压缩机2运行时的阈值报警:<span class='AlmCompOvt22086'></span></td></tr>
		<tr><td width='50%'>风机运行时的阈值报警:<span class='AlmFanOvt2086'></span></td>
		    <td width='50%'>房间温度探头断线报警:<span class='AlmRoomTemBro2086'></span></td></tr>
		<tr><td width='50%'>校正温度探头断线报警:<span class='AlmRecoTemBro2086'></span></td>
		    <td width='50%'>室外温度探头断线报警:<span class='AlmOutTemBro2086'></span></td></tr>
		<tr><td width='50%'>出口温度探头断线报警:<span class='AlmOlTemBro2086'></span></td>
		    <td width='50%'>环境湿度探头的报警:<span class='AlmAmbHumBro2086'></span></td></tr>
		<tr><td width='50%'>压力探针1断线报警:<span class='AlmPresBro12086'></span></td>
		    <td width='50%'>压力探针2断线报警:<span class='AlmPresBro22086'></span></td></tr>
		<tr><td width='50%'>条件1温度探头断线报警:<span class='AlmCondTemBro12086'></span></td>
		    <td width='50%'>条件2温度探头断线报警:<span class='AlmCondTemBro22086'></span></td></tr>
		<tr><td width='50%'>高电流报警:<span class='AlmCurHigh2086'></span></td>
		    <td width='50%'>缺水报警:<span class='AlmNoWater2086'></span></td></tr>
		<tr><td width='50%'>低电流报警:<span class='AlmNoCurrent2086'></span></td>
		    <td width='50%'>:<span class='2086'></span></td></tr>
    </table>
    </td>
    </tr>
  </table>
    <a href='javascript:history.back()' class='back' style='color: #fff'>返回</a>
</div>
<script>
var itype=2086;
var tescape= 5000,time;
  
<% db_Open("/NandFlash/tmp/dbDat0.db3"); %>
var sid=<% write(sid);%>;
var json=<% db_QryAdv("select * from tbCybHserial 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){
        $(".SID2086").html(n.SID);
        $(".Addr2086").html(n.Addr);
        $(".Port2086").html(n.Port%256);
        $(".DateUpd2086").html(n.DateUpd);
        $(".State2086").html(parseState(n.State));
		
		$(".Tem2086").html((n.Tem/10) + "℃");
		$(".Hum2086").html((n.Hum/10) + "%");
		$(".TemSet2086").html((n.TemSet/10) + "℃");
		$(".TemLow2086").html((n.TemLow/10) + "℃");
		$(".TemHigh2086").html((n.TemHigh/10) + "℃");
		$(".HumSet2086").html((n.HumSet/10) + "%");
		$(".HumLow2086").html((n.HumLow/10) + "%");
		$(".HumHigh2086").html((n.HumHigh/10) + "%");
		$(".AlmCompPresLow12086").html((n.AlmCompPresLow1) ? "告警" : "正常");
		$(".AlmCompPresLow22086").html((n.AlmCompPresLow2) ? "告警" : "正常");
		$(".AlmAirFlow2086").html((n.AlmAirFlow) ? "告警" : "正常");
		$(".AlmFanOvl2086").html((n.AlmFanOvl) ? "告警" : "正常");
		$(".AlmHeaterOvl12086").html((n.AlmHeaterOvl1) ? "告警" : "正常");
		$(".AlmHeaterOvl22086").html((n.AlmHeaterOvl2) ? "告警" : "正常");
		$(".AlmFire2086").html((n.AlmFire) ? "告警" : "正常");
		$(".AlmDirtyFilter2086").html((n.AlmDirtyFilter) ? "告警" : "正常");
		$(".AlmTemHigh2086").html((n.AlmTemHigh) ? "告警" : "正常");
		$(".AlmTemLow2086").html((n.AlmTemLow) ? "告警" : "正常");
		$(".AlmHumHigh2086").html((n.AlmHumHigh) ? "告警" : "正常");
		$(".AlmHumLow2086").html((n.AlmHumLow) ? "告警" : "正常");
		$(".AlmCompOvt12086").html((n.AlmCompOvt1) ? "告警" : "正常");
		$(".AlmCompOvt22086").html((n.AlmCompOvt2) ? "告警" : "正常");
		$(".AlmFanOvt2086").html((n.AlmFanOvt) ? "告警" : "正常");
		$(".AlmRoomTemBro2086").html((n.AlmRoomTemBro) ? "告警" : "正常");
		$(".AlmRecoTemBro2086").html((n.AlmRecoTemBro) ? "告警" : "正常");
		$(".AlmOutTemBro2086").html((n.AlmOutTemBro) ? "告警" : "正常");
		$(".AlmOlTemBro2086").html((n.AlmOlTemBro) ? "告警" : "正常");
		$(".AlmAmbHumBro2086").html((n.AlmAmbHumBro) ? "告警" : "正常");
		$(".AlmPresBro12086").html((n.AlmPresBro1) ? "告警" : "正常");
		$(".AlmPresBro22086").html((n.AlmPresBro2) ? "告警" : "正常");
		$(".AlmCondTemBro12086").html((n.AlmCondTemBro1) ? "告警" : "正常");
		$(".AlmCondTemBro22086").html((n.AlmCondTemBro2) ? "告警" : "正常");
		$(".AlmCurHigh2086").html((n.AlmCurHigh) ? "告警" : "正常");
		$(".AlmNoWater2086").html((n.AlmNoWater) ? "告警" : "正常");
		$(".AlmNoCurrent2086").html((n.AlmNoCurrent) ? "告警" : "正常");
    })

	$("span:contains('故障'),span:contains('告警'),,span:contains('闭合'),span:contains('停止')").addClass("red").removeClass("ger");
    $("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 "故障";
}

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