<!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='SID1798'> </span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr1798'> </span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port1798'> </span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd1798'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State1798'> </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='Fan1Speed1798'></span></td>
		    <td width='25%'>内风机2转速:<span class='Fan2Speed1798'></span></td>
			<td width='25%'>外风机1转速:<span class='Fan3Speed1798'></span></td>
		    <td width='25%'>外风机2转速:<span class='Fan4Speed1798'></span></td></tr>
		<tr><td width='25%'>外风机3转速:<span class='Fan5Speed1798'></span></td>
		    <td width='25%'>排氢风机转速:<span class='HFanSpeed1798'></span></td>
			<td width='25%'>内部温度:<span class='TemRoom1798'></span></td>
		    <td width='25%'>外机回风温度:<span class='TemExt1798'></span></td></tr>
		<tr><td width='25%'>模拟温度:<span class='TemSet1798'></span></td>
		    <td width='25%'>当前电压:<span class='Voltage1798'></span></td>
			<td width='25%'>柜内温度:<span class='TemI31798'></span></td>
		    <td width='25%'><span class='1798'></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='StFan1Run1798'></span></td>
		    <td width='25%'>内风机2运行标志:<span class='StFan2Run1798'></span></td>
			<td width='25%'>外风机1运行标志:<span class='StFan3Run1798'></span></td>
		    <td width='25%'>外风机2运行标志:<span class='StFan4Run1798'></span></td></tr>
		<tr><td width='25%'>外风机3运行标志:<span class='StFan5Run1798'></span></td>
		    <td width='25%'>排氢风机运行标志:<span class='StHFanRun1798'></span></td>
			<td width='25%'>加热开启标志:<span class='StHeatRun1798'></span></td>
		    <td width='25%'>制冷开启标志:<span class='StCoolRun1798'></span></td></tr>
		<tr><td width='25%'>报警继电器吸合标志:<span class='StRelayAm1798'></span></td>
		    <td width='25%'>系统运行或停机标志:<span class='StAircRun1798'></span></td>
			<td width='25%'>外风机运行标志:<span class='StEFanRun1798'></span></td>
		    <td width='25%'><span class='1798'></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='AlmIntFan11798'></span></td>
		    <td width='25%'>内风机2故障:<span class='AlmIntFan21798'></span></td>
			<td width='25%'>外风机1故障:<span class='AlmExtFan11798'></span></td>
		    <td width='25%'>外风机2故障:<span class='AlmExtFan21798'></span></td></tr>
		<tr><td width='25%'>外风机3故障:<span class='AlmExtFan21798'></span></td>
		    <td width='25%'>排氢风机故障:<span class='AlmHFan1798'></span></td>
			<td width='25%'>柜内温感故障:<span class='AlmIntTemErr1798'></span></td>
		    <td width='25%'>柜内高温告警:<span class='AlmIntTemHi1798'></span></td></tr>
		<tr><td width='25%'>柜内低温告警:<span class='AlmIntTemLo1798'></span></td>
		    <td width='25%'>为排风口温感故障:<span class='AlmExtTemErr1798'></span></td>
			<td width='25%'>为排风口高温告警:<span class='AlmExtTemHi1798'></span></td>
		    <td width='25%'>更换滤网告警:<span class='AlmFlit1798'></span></td></tr>
		<tr><td width='25%'>高电压告警:<span class='AlmHVolt1798'></span></td>
		    <td width='25%'>低电压告警:<span class='AlmLVolt1798'></span></td>
			<td width='25%'>压缩机高压告警:<span class='AlmHp1798'></span></td>
		    <td width='25%'>柜内温感故障:<span class='AlmI3TemErr1798'></span></td></tr>
    </table>
    </table>
    </td>
    </tr>
  </table>
    <a href='javascript:history.back()' class='back' style='color: #fff'>返回</a>
</div>
<script>
var itype=1798;
var tescape= 5000,time;
  
<% db_Open("/NandFlash/tmp/dbDat0.db3"); %>
var sid=<% write(sid);%>;
var json=<% db_QryAdv("select * from tbAircICX 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){
        $(".SID1798").html(n.SID);
        $(".Addr1798").html(n.Addr);
        $(".Port1798").html(n.Port%256);
        $(".DateUpd1798").html(n.DateUpd);
        $(".State1798").html(parseState(n.State));
		
		$(".Fan1Speed1798").html((n.Fan1Speed/10) + "RPM");
		$(".Fan2Speed1798").html((n.Fan2Speed/10) + "RPM");
		$(".Fan3Speed1798").html((n.Fan3Speed/10) + "RPM");
		$(".Fan4Speed1798").html((n.Fan4Speed/10) + "RPM");
		$(".Fan5Speed1798").html((n.Fan5Speed/10) + "RPM");
		$(".HFanSpeed1798").html((n.HFanSpeed/10) + "RPM");
		$(".TemRoom1798").html((n.TemRoom/10) + "℃");
		$(".TemExt1798").html((n.TemExt/10) + "℃");
		$(".TemSet1798").html((n.TemSet /10) + "℃");
		$(".Voltage1798").html((n.Voltage/10) + "V");
		$(".TemI31798").html((n.TemI3/10) + "℃");
		
		$(".StFan1Run1798").html((n.StFan1Run) ? "运行" : "停止");
		$(".StFan2Run1798").html((n.StFan2Run) ? "运行" : "停止");
		$(".StFan3Run1798").html((n.StFan3Run) ? "运行" : "停止");
		$(".StFan4Run1798").html((n.StFan4Run) ? "运行" : "停止");
		$(".StFan5Run1798").html((n.StFan5Run) ? "运行" : "停止");
		$(".StHFanRun1798").html((n.StHFanRun) ? "运行" : "停止");
		$(".StHeatRun1798").html((n.StHeatRun) ? "运行" : "停止");
		$(".StCoolRun1798").html((n.StCoolRun) ? "运行" : "停止");
		$(".StRelayAm1798").html((n.StRelayAm) ? "运行" : "停止");
		$(".StAircRun1798").html((n.StAircRun) ? "运行" : "停止");
		$(".StEFanRun1798").html((n.StEFanRun) ? "运行" : "停止");
		
		$(".AlmIntFan11798").html((n.AlmIntFan1) ? "故障" : "正常");
		$(".AlmIntFan21798").html((n.AlmIntFan2) ? "故障" : "正常");
		$(".AlmExtFan11798").html((n.AlmExtFan1) ? "故障" : "正常");
		$(".AlmExtFan21798").html((n.AlmExtFan2) ? "故障" : "正常");
		$(".AlmExtFan21798").html((n.AlmExtFan2) ? "故障" : "正常");
		$(".AlmHFan1798").html((n.AlmHFan) ? "故障" : "正常");
		$(".AlmIntTemErr1798").html((n.AlmIntTemErr) ? "故障" : "正常");
		$(".AlmIntTemHi1798").html((n.AlmIntTemHi) ? "故障" : "正常");
		$(".AlmIntTemLo1798").html((n.AlmIntTemLo) ? "故障" : "正常");
		$(".AlmExtTemErr1798").html((n.AlmExtTemErr) ? "故障" : "正常");
		$(".AlmExtTemHi1798").html((n.AlmExtTemHi) ? "故障" : "正常");
		$(".AlmFlit1798").html((n.AlmFlit) ? "故障" : "正常");
		$(".AlmHVolt1798").html((n.AlmHVolt) ? "故障" : "正常");
		$(".AlmLVolt1798").html((n.AlmLVolt) ? "故障" : "正常");
		$(".AlmHp1798").html((n.AlmHp) ? "故障" : "正常");
		$(".AlmI3TemErr1798").html((n.AlmI3TemErr) ? "故障" : "正常");
    })

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