<!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='type2049 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='SID2049'> </span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr2049'> </span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port2049'> </span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd2049'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State2049'> </span></td></tr>
    </table>
	
    <table width='100%' style='margin-top: 10px'>
        <tr><td style='border: none'> <h1>基本参数</h1></td></tr>
		<tr><td style='width: 200px;'>空调状态:<span class='status2049'> </span></td><td style='width: 200px;'>报警状态:<span class='warn2049'> </span></td></tr>
		<tr><td style='width: 200px;'>室内温度:<span class='tem2049'> </span>&nbsp;℃</td><td style='width: 200px;'>室内湿度:<span class='hum2049'> </span>&nbsp;%RH</td></tr>
		<tr><td style='width: 200px;'>回风温度设定点:<span class='hftemset2049'> </span>&nbsp;℃</td><td style='width: 200px;'>送温度设定点:<span class='sftemset2049'> </span>&nbsp;℃</td></tr>
		<tr><td style='width: 200px;'>湿度设定点:<span class='temset2049'> </span>&nbsp;%RH</td></tr>
		<tr><td style='width: 200px;'>温度偏差:<span class='temoff2049'> </span></td><td style='width: 200px;'>湿度偏差:<span class='humoff2049'> </span></td></tr>
		<tr><td style='width: 200px;'>温度死区:<span class='temdead2049'> </span></td><td style='width: 200px;'>湿度死区:<span class='humdead2049'> </span></td></tr>
		<tr><td style='width: 200px;'>高温告警值:<span class='htemw2049'> </span></td><td style='width: 200px;'>低温告警值:<span class='ltemw2049'> </span></td></tr>
		<tr><td style='width: 200px;'>高湿告警值:<span class='hhumw2049'> </span></td><td style='width: 200px;'>低湿告警值:<span class='lhumw2049'> </span></td></tr>
		<tr><td style='width: 200px;'>送风高温告警值:<span class='sftemw2049'> </span></td><td style='width: 200px;'><span class='2049'> </span></td></tr>
	</table>
    <table width='100%' style='margin-top: 10px'>
        <tr><td style='border: none'> <h1>电压监测</h1></td></tr>
		<tr><td style='width: 200px;'>A相电压:<span class='va2049'> </span>&nbsp;V</td><td style='width: 200px;'>B相电压:<span class='vb2049'> </span>&nbsp;V</td></tr>
		<tr><td style='width: 200px;'>C相电压:<span class='vc2049'> </span>&nbsp;V</td><td style='width: 200px;'>加湿器电流:<span class='c2049'> </span>&nbsp;A</td></tr>
		<tr><td style='width: 200px;'>电源频率:<span class='pl2049'> </span>&nbsp;HZ</td><td style='width: 200px;'><span class='xx2049'> </span></td></tr>
    </table>
    <table width='100%' style='margin-top: 10px'>
        <tr><td style='border: none'> <h1>空调开关状态</h1></td></tr>
		<tr><td style='width: 200px;'>风机输出开关状态:<span class='stfansw2049'> </span></td>
		    <td style='width: 200px;'>加湿器输出开关状态:<span class='sthumisw2049'> </span></td></tr>
		<tr><td style='width: 200px;'>压缩机1输出开关状态:<span class='stcomp1sw2049'> </span></td>
		    <td style='width: 200px;'>压缩机2输出开关状态:<span class='stcomp2sw2049'> </span></td></tr>
		<tr><td style='width: 200px;'>加热1输出开关状态:<span class='stheater1sw2049'> </span></td>
		    <td style='width: 200px;'>加热2输出开关状态:<span class='stheater2sw2049'> </span></td></tr>
		<tr><td style='width: 200px;'>公共报警输出开关状态:<span class='stalmswsw2049'> </span></td>
		    <td style='width: 200px;'>液路旁通1输出开关状态:<span class='stwbybass1sw2049'> </span></td></tr>
		<tr><td style='width: 200px;'>液路旁通2输出开关状态:<span class='stwbybass2sw2049'> </span></td>
		    <td style='width: 200px;'>注水输出开关状态:<span class='stwatersw2049'> </span></td></tr>
		<tr><td style='width: 200px;'>除湿输出开关状态:<span class='stdehumisw2049'> </span></td>
		    <td style='width: 200px;'>备用输出开关状态:<span class='streservesw2049'> </span></td></tr>
		<tr><td style='width: 200px;'>压缩机1反相输出开关状态:<span class='stcomp1ressw2049'> </span></td>
		    <td style='width: 200px;'>压缩机2反相输出开关状态:<span class='stcomp2ressw2049'> </span></td></tr>
		<tr><td style='width: 200px;'>制冷状态:<span class='stcool2049'> </span></td>
		    <td style='width: 200px;'>加热状态:<span class='stheat2049'> </span></td></tr>
		<tr><td style='width: 200px;'>除湿状态:<span class='stdehumi2049'> </span></td>
		    <td style='width: 200px;'>加湿状态:<span class='sthumi2049'> </span></td></tr>
    </table>
    </td>
    </tr>
  </table>
    <a href='javascript:history.back()' class='back' style='color: #fff'>返回</a>
</div>
<script>
  var itype=2049;
  var tescape= 5000,time;
  
<% db_Open("/NandFlash/tmp/dbDat0.db3"); %>
var sid=<% write(sid);%>;
var json=<% db_QryAdv("select * from tbEmerson 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) {
      $(".SID2049").html(n.SID);
      $(".Addr2049").html(n.Addr);
      $(".Port2049").html(n.Port % 256);
      $(".DateUpd2049").html(n.DateUpd);
      $(".State2049").html(window.parent.parseState(n.State));	
      if (n.status == 0) {
        n.status = "运行";
      } else if (n.status == 1){
        n.status = "待机";
      }else if (n.status == 2){
        n.status = "关机";
      }else if (n.status == 3){
        n.status = "远程关机";
      }
      $(".status2049").html(n.status);	  
      if (n.warn == 0) {
        n.warn = "无报警";
      } else {
        n.warn = "有报警(详情请到空调面板查看)";
      }
      $(".warn2049").html(n.warn);	
      $(".tem2049").html(n.tem/10);
      $(".hum2049").html(n.hum/10);	  
      $(".hftemset2049").html(n.hftemset/10);
      $(".temset2049").html(n.temset/10);
      $(".sftemset2049").html(n.sftemset/10);
	  $(".va2049").html(n.va/10);
	  $(".vb2049").html(n.vb/10);
	  $(".vc2049").html(n.vc/10);
	  $(".c2049").html(n.c/10);
	  $(".pl2049").html(n.pl/10);
	  
	  $(".temoff2049").html(n.temoff/10);
      $(".humoff2049").html(n.humoff/10);
	  $(".temdead2049").html(n.temdead/10);
      $(".humdead2049").html(n.humdead/10);
	  $(".htemw2049").html(n.htemw/10);
      $(".ltemw2049").html(n.ltemw/10);
	  $(".hhumw2049").html(n.hhumw/10);
      $(".lhumw2049").html(n.lhumw/10);
	  $(".sftemw2049").html(n.sftemw/10);
	  
	  $(".stfansw2049").html(n.stfansw ? "开" : "关");
	  $(".sthumisw2049").html(n.sthumisw ? "开" : "关");
	  $(".stcomp1sw2049").html(n.stcomp1sw ? "开" : "关");
	  $(".stcomp2sw2049").html(n.stcomp2sw ? "开" : "关");
	  $(".stheater1sw2049").html(n.stheater1sw ? "开" : "关");
	  $(".stheater2sw2049").html(n.stheater2sw ? "开" : "关");
	  $(".stalmswsw2049").html(n.stalmswsw ? "开" : "关");
	  $(".stwbybass1sw2049").html(n.stwbybass1sw ? "开" : "关");
	  $(".stwbybass2sw2049").html(n.stwbybass2sw ? "开" : "关");
	  $(".stwatersw2049").html(n.stwatersw ? "开" : "关");
	  $(".stdehumisw2049").html(n.stdehumisw ? "开" : "关");
	  $(".streservesw2049").html(n.streservesw ? "开" : "关");
	  $(".stcomp1ressw2049").html(n.stcomp1ressw ? "开" : "关");
	  $(".stcomp2ressw2049").html(n.stcomp2ressw ? "开" : "关");
	  $(".stcool2049").html(n.stcool ? "开" : "关");
	  $(".stheat2049").html(n.stheat ? "开" : "关");
	  $(".stdehumi2049").html(n.stdehumi ? "开" : "关");
	  $(".sthumi2049").html(n.sthumi ? "开" : "关");
      
    })
    $("span:contains('故障'),span:contains('告警'),span:contains('闭合'),span:contains('关闭'),span:contains('有报警')").addClass("red").removeClass("ger");
    $("span:contains('正常'),span:contains('无报警')").addClass("ger").removeClass("red");
  }
</script>
</body>
</html>