<!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='type2061 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='SID2061'> </span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr2061'> </span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port2061'> </span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd2061'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State2061'> </span></td></tr>
    </table>		

    <table width='100%' style='margin-top: 10px'>
        <tr><td style='border: none'> <h1>空调监测量</h1></td></tr>
		<tr><td >当前温度</td><td><span class='tem2061'> </span>&nbsp;℃</td> <td >当前湿度</td><td><span class='hum2061'> </span>&nbsp;%RH</td></tr>
		<tr><td >设定温度</td><td><span class='temset2061'> </span>&nbsp;℃</td> <td >设定湿度</td><td><span class='humset2061'> </span>&nbsp;%RH</td></tr>
		<tr><td >设定温差</td><td><span class='temh2061'> </span>&nbsp;℃</td> <td >设定湿差</td><td><span class='humh2061'> </span>&nbsp;%RH</td></tr>
	</table>
	
    <table width='100%' style='margin-top: 10px'>
        <tr><td style='border: none'> <h1>空调工作状态</h1></td></tr>
		<tr><td >状态1</td><td><span class='r012061'> </span> </td> <td >状态2</td><td><span class='r022061'> </span></td></tr>
		<tr><td >压缩机1运行</td><td><span class='r072061'> </span> </td> <td >压缩机2运行</td><td><span class='r092061'> </span> </td></tr>
		<tr><td >冷水阀开度</td><td><span class='r0e2061'> </span> </td> <td >热水阀开度</td><td><span class='r0f2061'> </span> </td></tr>
		<tr><td >除湿阀开度</td><td><span class='r102061'> </span> </td> <td >整体状态</td><td><span class='r002061'> </span> </td></tr>
		<tr><td >回风温度</td><td><span class='v002061'> </span> </td> <td >出风温度</td><td><span class='v012061'> </span> </td></tr>
		<tr><td >出水温度</td><td><span class='v022061'> </span> </td> <td >回水温度</td><td><span class='v032061'> </span> </td></tr>
		<tr><td >冷凝温度1</td><td><span class='v042061'> </span> </td> <td >冷凝温度2</td><td><span class='v052061'> </span> </td></tr>
		<tr><td >回风湿度</td><td><span class='v082061'> </span> </td> <td >加湿电流</td><td><span class='v092061'> </span> </td></tr>
	</table>
	
    <table width='100%' style='margin-top: 10px'>
        <tr><td style='border: none'> <h1>空调报警状态</h1></td></tr>
		<tr><td >运行标志</td><td><span class='s0012061'> </span></td> <td >蜂鸣标志</td><td><span class='s012061'> </span></td></tr>
		<tr><td >故障标志</td><td><span class='s022061'> </span></td> <td >全停标志</td><td><span class='s032061'> </span></td></tr>
		<tr><td >CRC校验标志</td><td><span class='s042061'> </span></td> <td >参数超界标志</td><td><span class='s052061'> </span></td></tr>
	</table>
    </td>
    </tr>
  </table>
	
    <a href='javascript:history.back()' class='back' style='color: #fff'>返回</a>
</div>
<script>
var itype=2061;
var tescape= 5000,time;

<% db_Open("/NandFlash/tmp/dbDat0.db3"); %>
var sid=<% write(sid);%>;
var json=<% db_QryAdv("select * from tbCyberHiross where SID="+sid,0); %>;
<% db_Close(); %>
	
    window.history.go(-1);
  });
  $(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) {
      $(".SID2061").html(n.SID);
      $(".Addr2061").html(n.Addr);
      $(".Port2061").html(n.Port % 256);
      $(".DateUpd2061").html(n.DateUpd);
      $(".State2061").html(window.parent.parseState(n.State));
	  
	  
      $(".tem2061").html(n.r11/10);
      $(".hum2061").html(n.r12/10);
      $(".temset2061").html(n.r03/10);
      $(".humset2061").html(n.r0c/10);
      $(".temh2061").html(n.r04/10);
      $(".humh2061").html(n.r0d/10);
	  
      $(".r012061").html(n.r01);
      $(".r022061").html(n.r02);
      $(".r072061").html(n.r07*60+n.r08));
      $(".r092061").html(n.r09*60+n.r0a));
      $(".r0e2061").html(n.r0e);
      $(".r0f2061").html(n.r0f);
      $(".r102061").html(n.r10);
      $(".r002061").html(n.r00);
	  
      $(".v002061").html(n.v00);
      $(".v012061").html(n.v01);
      $(".v022061").html(n.v02);
      $(".v032061").html(n.v03);
      $(".v042061").html(n.v04);
      $(".v052061").html(n.v05);
      $(".v082061").html(n.v08);
      $(".v092061").html(n.v09);
	  
      $(".s002061").html(n.s00);
      $(".s012061").html(n.s01);
      $(".s022061").html(n.s02);
      $(".s032061").html(n.s03);
      $(".s042061").html(n.s04);
      $(".s052061").html(n.s05);
    })
    $("span:contains('故障'),span:contains('告警'),span:contains('闭合'),span:contains('关闭')").addClass("red").removeClass("ger");
    $("span:contains('正常')").addClass("ger").removeClass("red");
  }
  
function _workmode(st)
{
	var state = "开";
	if (st == 0) {
		state = "关";
	}
	return state;
}

function _asertState(st)
{
	var state = "未知";
	if (st == 0) {
		state = "告警关机";
	}
	else if (st == 1) {
		state = "手动";
	}
	else if (st == 2) {
		state = "逻辑关机";
	}
	else if (st == 3) {
		state = "空调关机";
	}
	else if (st == 4) {
		state = "告警待机";
	}
	else if (st == 5) {
		state = "待机";
	}
	else if (st == 6) {
		state = "静默关机";
	}
	else if (st == 7) {
		state = "空调开机";
	}
	else if (st == 8) {
		state = "警告开机";
	}
	else if (st == 9) {
		state = "报警开机";
	}
	else if (st == 10) {
		state = "静默";
	}
	return state;
}

function _almState(st)
{
	var state = "告警(";
	if (st == 0) {
		state = "正常(";
	}
	return state + st + ")";
}

</script>
</body>
</html>