<!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='type2069 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='SID2069'> </span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr2069'> </span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port2069'> </span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd2069'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State2069'> </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='Tem2069'></span></td><td width='50%'>现场湿度: <span class='Hum2069'></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='FanGz2069'></span></td><td width='50%'>压缩机高压: <span class='YsGy2069'></span></td></tr>
		<tr><td width='50%'>压缩机低压: <span class='YsDy2069'></span></td><td width='50%'>加热器过载: <span class='JrGz2069'></span></td></tr>
		<tr><td width='50%'>加湿器过载: <span class='JsGz2069'></span></td><td width='50%'>火警: <span class='Fire2069'></span></td></tr>
		<tr><td width='50%'>溢水报警: <span class='Leak2069'></span></td><td width='50%'>相位错误: <span class='Phase2069'></span></td></tr>
		<tr><td width='50%'>温度上限报警: <span class='TemHigh2069'></span></td><td width='50%'>温度下限报警: <span class='TemLow2069'></span></td></tr>
        <tr><td>湿度上限报警: <span class='HumHigh2069'></span></td><td>湿度下限报警: <span class='HumLow2069'></span></td></tr>
		<tr><td>温度传感器坏: <span class='TemSenErr2069'></span></td><td>&nbsp; <span class='xxx2069'></span></td></tr>
    </table>
	<table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>系统状态</h1></td></tr>
        <tr>
			<td>通用警报: <span class='ComAlm2069'></span></td>
			<td>湿度上限报警: <span class='HumHigh2069'></span></td>
		</tr>
		<tr>
			<td>温度传感器坏: <span class='TemSenErr2069'></span></td>
			<td>湿度下限报警: <span class='HumLow2069'></span></td>
		</tr>
		<tr>
			<td>风机状态: <span class='FanStat2069'></span></td>
			<td>加热器状态: <span class='JrState2069'></span></td>
		</tr>
		<tr>
			<td>压缩机状态: <span class='YsState2069'></span></td>
			<td>加湿器状态: <span class='JsState2069'></span></td>
		</tr>
		<tr>
			<td>Co-work模式: <span class='CoMode2069'></span></td>
			<td>除湿: <span class='CsMode2069'></span></td>
		</tr>
		<tr>
			<td>加湿: <span class='JsMode2069'></span></td>
			<td>制冷: <span class='ZlMode2069'></span></td>
		</tr>
    </table>
    </td>
    </tr>
  </table>

    <a href='javascript:history.back()' class='back' style='color: #fff'>返回</a>
</div>
<script>
var itype=2069;
var tescape= 5000,time;
  
<% db_Open("/NandFlash/tmp/dbDat0.db3"); %>
var sid=<% write(sid);%>;
var json=<% db_QryAdv("select * from tbCyberHairf 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){
        $(".SID2069").html(n.SID);
        $(".Addr2069").html(n.Addr);
        $(".Port2069").html(n.Port%256);
        $(".DateUpd2069").html(n.DateUpd);
        $(".State2069").html(window.parent.parseState(n.State));
		
		$(".Tem2069").html(n.Tem/10+"℃");
		$(".Hum2069").html(n.Hum/10+"%RH");
		if (n.FanGz == 0)
			n.FanGz = "正常"
		else if (n.FanGz == 0)
			n.FanGz = "报警确认"
		else
			n.FanGz = "报警"
		$(".FanGz2069").html(n.FanGz);
		if (n.YsGy == 0)
			n.YsGy = "正常"
		else if (n.YsGy == 2)
			n.YsGy = "报警确认"
		else
			n.YsGy = "报警"
		$(".YsGy2069").html(n.YsGy);
		if (n.YsDy == 0)
			n.YsDy = "正常"
		else if (n.YsDy == 2)
			n.YsDy = "报警确认"
		else
			n.YsDy = "报警"
		$(".YsDy2069").html(n.YsDy);
		if (n.JrGz == 0)
			n.JrGz = "正常"
		else if (n.JrGz == 2)
			n.JrGz = "报警确认"
		else
			n.JrGz = "报警"
		$(".JrGz2069").html(n.JrGz);
		if (n.JsGz == 0)
			n.JsGz = "正常"
		else if (n.JsGz == 2)
			n.JsGz = "报警确认"
		else
			n.JsGz = "报警"
		$(".JsGz2069").html(n.JsGz);
		if (n.Leak == 0)
			n.Leak = "正常"
		else if (n.Leak == 2)
			n.Leak = "报警确认"
		else
			n.Leak = "报警"
		$(".Leak2069").html(n.Leak);
		if (n.Phase == 0)
			n.Phase = "正常"
		else if (n.Phase == 2)
			n.Phase = "报警确认"
		else
			n.Phase = "报警"
		$(".Phase2069").html(n.Phase);
		if (n.TemHigh == 0)
			n.TemHigh = "正常"
		else if (n.TemHigh == 2)
			n.TemHigh = "报警确认"
		else
			n.TemHigh = "报警"
		$(".TemHigh2069").html(n.TemHigh);
		if (n.TemLow == 0)
			n.TemLow = "正常"
		else if (n.TemLow == 2)
			n.TemLow = "报警确认"
		else
			n.TemLow = "报警"
		$(".TemLow2069").html(n.TemLow);
		if (n.Fire == 0)
			n.Fire = "正常"
		else if (n.Fire == 2)
			n.Fire = "报警确认"
		else
			n.Fire = "报警"
		$(".Fire2069").html(n.Fire);
		if (n.HumHigh == 0)
			n.HumHigh = "正常"
		else if (n.HumHigh == 2)
			n.HumHigh = "报警确认"
		else
			n.HumHigh = "报警"
		$(".HumHigh2069").html(n.HumHigh);
		if (n.HumLow == 0)
			n.HumLow = "正常"
		else if (n.HumLow == 2)
			n.HumLow = "报警确认"
		else
			n.HumLow = "报警"
		$(".HumLow2069").html(n.HumLow);
		if (n.TemSenErr == 0)
			n.TemSenErr = "正常"
		else if (n.TemSenErr == 2)
			n.TemSenErr = "报警确认"
		else
			n.TemSenErr = "报警"
		$(".TemSenErr2069").html(n.TemSenErr);
		
		$(".ComAlm2069").html(n.ComAlm ? "有报警" : "无报警");
		$(".FanStat2069").html(n.FanStat ? "开" : "关");
		$(".YsState2069").html(n.YsState ? "开" : "关");
		$(".JrState2069").html(n.JrState ? "开" : "关");
		$(".JsState2069").html(n.JsState ? "开" : "关");
		$(".CoMode2069").html(n.CoMode2 ? "独立" : "协作");
		$(".CsMode2069").html(n.CsMode ? "除湿状态" : "非除湿");
		$(".JsMode2069").html(n.JsMode ? "加湿状态" : "非加湿");
		$(".ZlMode2069").html(n.ZlMode ? "制冷状态" : "非制冷");
		
    })
	$("span:contains('故障'),span:contains('告警'),,span:contains('闭合'),span:contains('关闭')").addClass("red").removeClass("ger");
        $("span:contains('正常')").addClass("ger").removeClass("red");
    
}

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