<!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='type2065 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='SID2065'> </span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr2065'> </span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port2065'> </span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd2065'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State2065'> </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='tem2065'> </span></td><td style='width: 200px;'>设置温度&nbsp;</td><td><span class='temset2065'> </span></td></tr>
		<tr><td style='width: 200px;'>回水温度&nbsp;</td><td><span class='witem2065'> </span></td><td style='width: 200px;'>出水温度&nbsp;</td><td><span class='wotem065'> </span></td></tr>
		<tr><td style='width: 200px;'>排气1温度</td><td><span class='fotem12065'> </span></td><td style='width: 200px;'>排气2温度&nbsp;</td><td><span class='fotem22065'> </span></td></tr>
		<tr><td style='width: 200px;'>排气3温度</td><td><span class='fotem32065'> </span></td><td style='width: 200px;'>排气4温度</td><td><span class='fotem42065'> </span></td></tr>
		<tr><td style='width: 200px;'>排气5温度</td><td><span class='fotem52065'> </span></td><td style='width: 200px;'>排气6温度</td><td><span class='fotem62065'> </span></td></tr>
		<tr><td style='width: 200px;'>运行模式</td><td><span class='runst2065'> </span></td><td style='width: 200px;'>压缩机数量</td><td><span class='pcnt2065'> </span></td></tr>
		<tr><td style='width: 200px;'>机型选择1</td><td><span class='mcmode12065'> </span></td><td style='width: 200px;'>机型选择2</td><td><span class='mcmode22065'> </span></td></tr>
		<tr><td style='width: 200px;'>压缩机1</td><td><span class='pst12065'> </span></td><td style='width: 200px;'>压缩机2</td><td><span class='pst22065'> </span></td></tr>
		<tr><td style='width: 200px;'>水冷机</td><td><span class='wst2065'> </span></td><td style='width: 200px;'>内风机</td><td><span class='fist2065'> </span></td></tr>
		<tr><td style='width: 200px;'>电加热</td><td><span class='ehst2065'> </span></td><td style='width: 200px;'></td><td><span class='sjbj2065'> </span></td></tr>
    </table>
    </td>
    </tr>
  </table>
    <a href='javascript:history.back()' class='back' style='color: #fff'>返回</a>
</div>
<script>
  var itype=2065;
  var tescape= 5000,time;

<% db_Open("/NandFlash/tmp/dbDat0.db3"); %>
var sid=<% write(sid);%>;
var json=<% db_QryAdv("select * from tbDF34BMS 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) {
      $(".SID2065").html(n.SID);
      $(".Addr2065").html(n.Addr);
      $(".Port2065").html(n.Port % 256);
      $(".DateUpd2065").html(n.DateUpd);
      $(".State2065").html(window.parent.parseState(n.State));

	  
      $(".tem2065").html(n.tem + "℃");
      $(".temset2065").html(n.temset + "℃");
      $(".witem2065").html(n.witem + "℃");
      $(".wotem065").html(n.wotem + "℃");
      $(".fotem12065").html(n.fotem1 + "℃");
      $(".fotem22065").html(n.fotem2 + "℃");
      $(".fotem32065").html(n.fotem3 + "℃");
      $(".fotem42065").html(n.fotem4 + "℃");
      $(".fotem52065").html(n.fotem5 + "℃");
      $(".fotem62065").html(n.fotem6 + "℃");
	  
	  if (0 == n.runst)
		n.runst = "关机+自动";
	  else if (1 == n.runst)
		n.runst = "关机+制冷";
	  else if (2 == n.runst)
		n.runst = "关机+除湿";
	  else if (3 == n.runst)
		n.runst = "关机+通风";
	  else if (4 == n.runst)
		n.runst = "关机+制热循环";
	  /*else if (5 == n.runst)
		n.runst = "单冷电加热";
	  else if (6 == n.runst)
		n.runst = "单冷电加热";
	  else if (7 == n.runst)
		n.runst = "单冷电加热";*/
	  else if (8 == n.runst)
		n.runst = "开机+自动";
	  else if (9 == n.runst)
		n.runst = "开机+制冷";
	  else if (10 == n.runst)
		n.runst = "开机+除湿";
	  else if (11 == n.runst)
		n.runst = "开机+通风";
	  else if (12 == n.runst)
		n.runst = "开机+制热循环";
	  else
		n.runst = "未知模式";
      $(".runst2065").html(n.runst);
      $(".pcnt2065").html(n.pcnt);
      $(".mcmode12065").html(n.mcmode1 ? "风冷" : "风冷");
	  if (0 == n.mcmode2)
		n.mcmode2 = "热泵";
	  else if (1 == n.mcmode2)
		n.mcmode2 = "热泵电辅";
	  else if (2 == n.mcmode2)
		n.mcmode2 = "单冷";
	  else if (3 == n.mcmode2)
		n.mcmode2 = "单冷电加热";
	  else
		n.mcmode2 = "未知型号";
      $(".mcmode22065").html(n.mcmode2);
      $(".pst12065").html(_asertState(n.pst1));
      $(".pst22065").html(_asertState(n.pst2));
      $(".wst2065").html(_asertState(n.wst));
      $(".fist2065").html(_asertState(n.fist));
      $(".ehst2065").html(_asertState(n.ehst));
    })
    $("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>