<!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='type2058 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='SID2058'> </span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr2058'> </span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port2058'> </span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd2058'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State2058'> </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;'>室内温度&nbsp;℃</td><td><span class='tem2058'> </span></td><td style='width: 200px;'>室内湿度&nbsp;℃</td><td><span class='hum2058'> </span></td></tr>
		<tr><td style='width: 200px;'>设定温度&nbsp;℃</td><td><span class='settem2058'> </span></td><td style='width: 200px;'>设定湿度&nbsp;℃</td><td><span class='sethum2058'> </span></td></tr>
		<tr><td style='width: 200px;'>风机</td><td><span class='fj2058'> </span></td><td style='width: 200px;'>&nbsp;</td><td><span class='p12058'> </span></td></tr>
		<tr><td style='width: 200px;'>压缩机1</td><td><span class='ys12058'> </span></td><td style='width: 200px;'>压缩机2</td><td><span class='ys22058'> </span></td></tr>
		<tr><td style='width: 200px;'>电加热1</td><td><span class='jr12058'> </span></td><td style='width: 200px;'>电加热2</td><td><span class='jr22058'> </span></td></tr>
		<tr><td style='width: 200px;'>除湿</td><td><span class='cs2058'> </span></td><td style='width: 200px;'>加湿</td><td><span class='js2058'> </span></td></tr>
		<tr><td style='width: 200px;'>风机过载</td><td><span class='fjgz2058'> </span></td><td style='width: 200px;'>&nbsp;</td><td><span class='p22058'> </span></td></tr>
		<tr><td style='width: 200px;'>压缩机1过载</td><td><span class='ys1gz2058'> </span></td><td style='width: 200px;'>压缩机2过载</td><td><span class='ys2gz2058'> </span></td></tr>
		<tr><td style='width: 200px;'>电加热1过载</td><td><span class='jr1gz2058'> </span></td><td style='width: 200px;'>电加热2过载</td><td><span class='jr2gz2058'> </span></td></tr>
		<tr><td style='width: 200px;'>冷凝风机1过载</td><td><span class='lfj1gz2058'> </span></td><td style='width: 200px;'>冷凝风机2过载</td><td><span class='lfj2gz2058'> </span></td></tr>
    </table>
    </td>
    </tr>
  </table>
    <a href='javascript:history.back()' class='back' style='color: #fff'>返回</a>
</div>
<script>
  var itype=2058;
  var tescape= 5000,time;

<% db_Open("/NandFlash/tmp/dbDat0.db3"); %>
var sid=<% write(sid);%>;
var json=<% db_QryAdv("select * from tbMatrix 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) {
      $(".SID2058").html(n.SID);
      $(".Addr2058").html(n.Addr);
      $(".Port2058").html(n.Port % 256);
      $(".DateUpd2058").html(n.DateUpd);
	  
      $(".tem2058").html(n.tem/10.0);
      $(".hum2058").html(n.hum/10.0);
      $(".settem2058").html(n.settem/10.0);
      $(".sethum2058").html(n.sethum/10.0);
      $(".fj2058").html(_asertState(n.fj));
      $(".ys12058").html(_asertState(n.ys1));
      $(".ys22058").html(_asertState(n.ys2));
      $(".jr12058").html(_asertState(n.jr1));
      $(".jr22058").html(_asertState(n.jr2));
      $(".cs2058").html(_asertState(n.cs));
      $(".js2058").html(_asertState(n.js));
      $(".fjgz2058").html(n.fjgz);
      $(".ys1gz2058").html(n.ys1gz);
      $(".ys2gz2058").html(n.ys2gz);
      $(".jr1gz2058").html(n.jr1gz);
      $(".jr2gz2058").html(n.jr2gz);
      $(".lfj1gz2058").html(n.lfj1gz);
      $(".lfj2gz2058").html(n.lfj2gz);
	  
    })
    $("span:contains('故障'),span:contains('告警'),span:contains('闭合'),span:contains('关闭'),span:contains('开')").addClass("red").removeClass("ger");
    $("span:contains('正常'),span:contains('关')").addClass("ger").removeClass("red");
  }

function _asertState(st)
{
	var state = "开";
	if (st == 0) {
		state = "关";
	}
	return state;
}
</script>
</body>
</html>