<!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='type779 empty' style=' margin: 10px;'>
  <table width="100%">
    <tr>
    <td width="300px" style="text-align: center;"><img src="img/ico-ups.png" style="width: 50%;text-align: center;"></td>
    <td>
    <table width='100%'>
        <tr><td style='border: none'> <h1>HR7340 UPS</h1></td></tr>
        <tr><td style='width: 200px;'>基本信息</td><td>SID:<span class='SID779'> </span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr779'> </span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port779'> </span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd779'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State779'> </span></td></tr>
        </table>

    <table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>运行参数</h1></td></tr>
        <tr><td>输入频率：<span class='Fin779'></span>&nbsp;HZ</td></tr>
		<tr><td>输入相电压Vr：<span class='Vin1779'></span>&nbsp;V</td></tr>
		<tr><td>输入相电压Vs：<span class='Vin2779'></span>&nbsp;V</td></tr>
		<tr><td>输入相电压Vt：<span class='Vin3779'></span>&nbsp;V</td></tr>
		<tr><td>输出频率：<span class='Fout779'></span>&nbsp;HZ</td></tr>
		<tr><td>输出相电压Vr：<span class='Vout779'></span>&nbsp;V</td></tr>
		<tr><td>输出相电压Vs：<span class='v2779'></span>&nbsp;V</td></tr>
		<tr><td>输出相电压Vt：<span class='v3779'></span>&nbsp;V</td></tr>		
		<tr><td>输出电流Ir：<span class='Aout779'></span>&nbsp;A</td></tr>
		<tr><td>输出电流Is：<span class='Aed779'></span>&nbsp;A</td></tr>
		<tr><td>输出电流It：<span class='v4779'></span>&nbsp;A</td></tr>
		<tr><td>电池电压：<span class='Vbatt779'></span>&nbsp;V</td></tr>
		<tr><td>电池残余容量：<span class='Pbatt779'></span>&nbsp;%</td></tr>
		<tr><td>电池剩余时间：<span class='Mbatt779'></span>&nbsp;分钟</td></tr>		
		<tr><td>电池温度：<span class='Tem779'></span>&nbsp;°C</td></tr>
        </table>
    <table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>工作状态</h1></td></tr>
        <tr><td >UPS异常状态：<span class='b4779'> </span></td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
        <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
        </table>
    </td>
    </tr>
  </table>
    <a href='#' class='back' style='color: #fff'>返回</a>
    </div>
<script>
    var itype=779;
    var tescape= 5000,time;
<%
	db_Open("/NandFlash/tmp/dbDat0.db3");
%>
	var sid=<% write(sid);%>;
	var json=<% db_QryAdv("select * from tbUps 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) {
   		$(".SID779").html(n.SID);
   		$(".Addr779").html(n.Addr);
   		$(".Port779").html(n.Port % 256);
   		$(".DateUpd779").html(n.DateUpd);
   		$(".State779").html(window.parent.parseState(n.State));
   		$(".Fin779").html(n.Fin / 10);
		$(".Vin1779").html(n.Vin1 / 10);
		$(".Vin2779").html(n.Vin2 / 10);
		$(".Vin3779").html(n.Vin3 / 10);
		$(".Fout779").html(n.Fout / 10);	
   		$(".Vout779").html(n.Vout / 10);
		$(".v2779").html(n.v2 / 10);
		$(".v3779").html(n.v3 / 10);
		$(".Aout779").html(n.Aout / 10);
		$(".Aed779").html(n.Aed / 10);
   		$(".v4779").html(n.v4 / 10);
		$(".Vbatt779").html(n.Vbatt / 10);
		$(".Pbatt779").html(n.Pbatt / 10);
		$(".Mbatt779").html(n.Mbatt);
		$(".Tem779").html(n.Tem / 10);		
   		if (n.b4 == "0")
   			$(".b4779").html("正常");
   		else
   			$(".b4779").html("异常");
   	})
   	$("span:contains('故障'),span:contains('告警'),span:contains('异常')").addClass("red").removeClass("ger");
   	$("span:contains('正常')").addClass("ger").removeClass("red");
   }
</script>
</body>
</html>