<!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='type2052 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='SID2052'> </span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr2052'> </span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port2052'> </span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd2052'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State2052'> </span></td></tr>
		<tr><td style='width: 200px;'>开机/关机</td><td><span class='started2052'> </span></td></tr>
		<tr><td style='width: 200px;'>有故障标志</td><td><span class='fault2052'> </span></td></tr>
		<tr><td style='width: 200px;'>回风温度</td><td><span class='tem2052'> </span>&nbsp;℃</td></tr>
		<tr><td style='width: 200px;'>回风湿度</td><td><span class='hum2052'> </span>&nbsp;%RH</td></tr>
		<tr><td style='width: 200px;'>设定温度</td><td><span class='tem22052'> </span>&nbsp;℃</td></tr>
		<tr><td style='width: 200px;'>设定湿度</td><td><span class='hum22052'> </span>&nbsp;%RH</td></tr>
    </table>
    </td>
    </tr>
  </table>
    <a href='javascript:history.back()' class='back' style='color: #fff'>返回</a>
</div>
<script>
var itype=2052;
var tescape= 5000,time;

<% db_Open("/NandFlash/tmp/dbDat0.db3"); %>
var sid=<% write(sid);%>;
var json=<% db_QryAdv("select * from tbPlc 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) {
      if (n.started == 0) {
        n.started = "停止";
      } else {
        n.started = "启动";
      }
      if (n.fault == 0) {
        n.fault = "无故障";
      } else {
        n.fault = "有故障";
      }
      $(".SID2052").html(n.SID);
      $(".Addr2052").html(n.Addr);
      $(".Port2052").html(n.Port % 256);
      $(".DateUpd2052").html(n.DateUpd);
      $(".State2052").html(window.parent.parseState(n.State));
      $(".started2052").html(n.started);
      $(".fault2052").html(n.fault);
      $(".tem2052").html(n.tem/10);
      $(".hum2052").html(n.hum/10);
      $(".tem22052").html(n.tem2/10);
      $(".hum22052").html(n.hum2/10);
    })
    $("span:contains('故障'),span:contains('告警'),span:contains('闭合'),span:contains('关闭')").addClass("red").removeClass("ger");
    $("span:contains('正常')").addClass("ger").removeClass("red");
  }
</script>
</body>
</html>