<!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='SID2087'> </span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr2087'> </span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port2087'> </span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd2087'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State2087'> </span></td></tr>
    </table>
    <table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>基本信息</h1></td></tr>
		<tr><td width='25%'>1#回风温度 ℃:<span class='TemRes12087'></span></td>
		    <td width='25%'>2#回风温度 ℃:<span class='TemRes22087'></span></td>
			<td width='25%'>3#回风温度 ℃:<span class='TemRes32087'></span></td>
		    <td width='25%'>4#回风温度 ℃:<span class='TemRes42087'></span></td></tr>
		<tr><td width='25%'>5#回风温度 ℃:<span class='TemRes52087'></span></td>
		    <td width='25%'>出风温度 ℃:<span class='TemSup2087'></span></td>
			<td width='25%'>室外温度 ℃:<span class='TemOut2087'></span></td>
		    <td width='25%'>1#回风湿度 %:<span class='HumRes12087'></span></td></tr>
		<tr><td width='25%'>2#回风湿度 %:<span class='HumRes22087'></span></td>
		    <td width='25%'>3#回风湿度 %:<span class='HumRes32087'></span></td>
			<td width='25%'>4#回风湿度 %:<span class='HumRes42087'></span></td>
		    <td width='25%'>5#回风湿度 %:<span class='HumRes52087'></span></td></tr>
		<tr><td width='25%'>加湿电流检测 :<span class='CurHumDetect2087'></span></td>
		    <td width='25%'>电压检测 V:<span class='VolDetect2087'></span></td>
		    <td width='25%'><span class='2087'></span></td>
		    <td width='25%'><span class='2087'></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='StateFanIn2087'></span></td>
		    <td width='25%'>1#压缩机:<span class='StateComp12087'></span></td>
			<td width='25%'>2#压缩机:<span class='StateComp22087'></span></td>
		    <td width='25%'>1#电加热:<span class='StateHeater12087'></span></td></tr>
		<tr><td width='25%'>2#电加热:<span class='StateHeater22087'></span></td>
		    <td width='25%'>3#电加热:<span class='StateHeater32087'></span></td>
			<td width='25%'>电极加湿:<span class='StatePoleHum2087'></span></td>
		    <td width='25%'>1#外风机:<span class='StateFanOut12087'></span></td></tr>
		<tr><td width='25%'>2#外风机:<span class='StateFanOut22087'></span></td>
		    <td width='25%'><span class='2087'></span></td>
		    <td width='25%'><span class='2087'></span></td>
		    <td width='25%'><span class='2087'></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='TemSet2087'></span></td>
		    <td width='25%'>温度灵敏度 ℃:<span class='TemSen2087'></span></td>
			<td width='25%'>湿度设定点 % :<span class='HumSet2087'></span></td>
		    <td width='25%'>湿度灵敏度 % :<span class='HumSen2087'></span></td></tr>
		<tr><td width='25%'>高温告警点 ℃:<span class='TemHigh2087'></span></td>
		    <td width='25%'>低温告警点 ℃:<span class='TemLow2087'></span></td></tr>
		<tr><td width='25%'>高湿告警点 %:<span class='HumHigh2087'></span></td>
		    <td width='25%'>低湿告警点 %:<span class='HumLow2087'></span></td>
		    <td width='25%'><span class='2087'></span></td>
		    <td width='25%'><span class='2087'></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='AlmTemHigh2087'></span></td>
		    <td width='25%'>回风低温告警:<span class='AlmTemLow2087'></span></td>
			<td width='25%'>回风高湿告警:<span class='AlmHumHigh2087'></span></td>
		    <td width='25%'>回风低湿告警:<span class='AlmHumLow2087'></span></td></tr>
		<tr><td width='25%'>回风温感故障:<span class='AlmSenFault2087'></span></td>
		    <td width='25%'><span class='2087'></span></td>
		    <td width='25%'><span class='2087'></span></td>
		    <td width='25%'><span class='2087'></span></td></tr>
    </table>
    </table>
    </td>
    </tr>
  </table>
    <a href='javascript:history.back()' class='back' style='color: #fff'>返回</a>
</div>
<script>
var itype=2087;
var tescape= 5000,time;
  
<% db_Open("/NandFlash/tmp/dbDat0.db3"); %>
var sid=<% write(sid);%>;
var json=<% db_QryAdv("select * from tbCyberMateDX 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){
        $(".SID2087").html(n.SID);
        $(".Addr2087").html(n.Addr);
        $(".Port2087").html(n.Port%256);
        $(".DateUpd2087").html(n.DateUpd);
        $(".State2087").html(parseState(n.State));
		
		$(".TemRes12087").html((n.TemRes1/10) + "℃");
		$(".TemRes22087").html((n.TemRes2/10) + "℃");
		$(".TemRes32087").html((n.TemRes3/10) + "℃");
		$(".TemRes42087").html((n.TemRes4/10) + "℃");
		$(".TemRes52087").html((n.TemRes5/10) + "℃");
		$(".TemSup2087").html((n.TemSup/10) + "℃");
		$(".TemOut2087").html((n.TemOut/10) + "℃");
		$(".HumRes12087").html((n.HumRes1/10) + "%");
		$(".HumRes22087").html((n.HumRes2/10) + "%");
		$(".HumRes32087").html((n.HumRes3/10) + "%");
		$(".HumRes42087").html((n.HumRes4/10) + "%");
		$(".HumRes52087").html((n.HumRes5/10) + "%");
		$(".CurHumDetect2087").html((n.CurHumDetect) + "mA");
		$(".VolDetect2087").html((n.VolDetect) + "V");
		$(".StateFanIn2087").html((n.StateFanIn) ? "运行" : "停止");
		$(".StateComp12087").html((n.StateComp1) ? "运行" : "停止");
		$(".StateComp22087").html((n.StateComp2) ? "运行" : "停止");
		$(".StateHeater12087").html((n.StateHeater1) ? "运行" : "停止");
		$(".StateHeater22087").html((n.StateHeater2) ? "运行" : "停止");
		$(".StateHeater32087").html((n.StateHeater3) ? "运行" : "停止");
		$(".StatePoleHum2087").html((n.StatePoleHum) ? "运行" : "停止");
		$(".StateFanOut12087").html((n.StateFanOut1) ? "运行" : "停止");
		$(".StateFanOut22087").html((n.StateFanOut2) ? "运行" : "停止");
		$(".TemSet2087").html((n.TemSet/10) + "℃");
		$(".TemSen2087").html((n.TemSen/10) + "℃");
		$(".HumSet2087").html((n.HumSet/10) + "%");
		$(".HumSen2087").html((n.HumSen/10) + "%");
		$(".TemHigh2087").html((n.TemHigh/10) + "℃");
		$(".TemLow2087").html((n.TemLow/10) + "℃");
		$(".HumHigh2087").html((n.HumHigh/10) + "%");
		$(".HumLow2087").html((n.HumLow/10) + "%");
		$(".AlmTemHigh2087").html((n.AlmTemHigh) ? "告警" : "正常");
		$(".AlmTemLow2087").html((n.AlmTemLow) ? "告警" : "正常");
		$(".AlmHumHigh2087").html((n.AlmHumHigh) ? "告警" : "正常");
		$(".AlmHumLow2087").html((n.AlmHumLow) ? "告警" : "正常");
		$(".AlmSenFault2087").html((n.AlmSenFault) ? "告警" : "正常");
    })

	$("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>