<!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='type780 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>UPS</h1></td></tr>
        <tr><td style='width: 200px;'>基本信息</td><td>SID:<span class='SID780'> </span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr780'> </span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port780'> </span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd780'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State780'> </span></td></tr>
    </table>

    <table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>运行参数</h1></td></tr>
        <tr><td>输入频率：<span class='Fin780'></span>&nbsp;HZ</td></tr>
		<tr><td>输入相电压Vr：<span class='Vin1780'></span>&nbsp;V</td></tr>
		<tr><td>输入相电压Vs：<span class='Vin2780'></span>&nbsp;V</td></tr>
		<tr><td>输入相电压Vt：<span class='Vin3780'></span>&nbsp;V</td></tr>
		<tr><td>输出频率：<span class='Fout780'></span>&nbsp;HZ</td></tr>
		<tr><td>输出相电压Vr：<span class='Vout780'></span>&nbsp;V</td></tr>
		<tr><td>输出相电压Vs：<span class='v2780'></span>&nbsp;V</td></tr>
		<tr><td>输出相电压Vt：<span class='v3780'></span>&nbsp;V</td></tr>		
		<tr><td>输出电流Ir：<span class='Aout780'></span>&nbsp;A</td></tr>
		<tr><td>输出电流Is：<span class='Aed780'></span>&nbsp;A</td></tr>
		<tr><td>输出电流It：<span class='v4780'></span>&nbsp;A</td></tr>
		<tr><td>电池电压：<span class='Vbatt780'></span>&nbsp;V</td></tr>
		<tr><td>电池残余容量：<span class='Pbatt780'></span>&nbsp;%</td></tr>
		<tr><td>电池剩余时间：<span class='Mbatt780'></span>&nbsp;分钟</td></tr>		
		<tr><td>电池温度：<span class='Tem780'></span>&nbsp;°C</td></tr>
    </table>
    <table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>工作状态</h1></td></tr>
        <tr><td>市电状态：<span class='b7780'>&nbsp;</span></td><td >UPS异常状态：<span class='b5780'>&nbsp;</span></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='javascript:history.back()' class='back' style='color: #fff'>返回</a>
    </div>
<script>
    var itype=780;
    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) {
			$(".SID780").html(n.SID);
			$(".Addr780").html(n.Addr);
			$(".Port780").html(n.Port % 256);
			$(".DateUpd780").html(n.DateUpd);
			$(".State780").html(window.parent.parseState(n.State));
			$(".Fin780").html(n.Fin / 100);
			$(".Vin1780").html(n.Vin1 / 10);
			$(".Vin2780").html(n.Vin2 / 10);
			$(".Vin3780").html(n.Vin3 / 10);
			$(".Fout780").html(n.Fout / 100);
			$(".Vout780").html(n.Vout / 10);
			$(".v2780").html(n.v2 / 10);
			$(".v3780").html(n.v3 / 10);
			$(".Aout780").html(n.Aout / 10);
			$(".Aed780").html(n.Aed / 10);
			$(".v4780").html(n.v4 / 10);
			$(".Vbatt780").html(n.Vbatt / 10);
			$(".Pbatt780").html(n.Pbatt / 10);
			$(".Mbatt780").html(n.Mbatt / 10);
			$(".Tem780").html(n.Tem / 10);
			if (n.b7 == "0")
				$(".b7780").html("正常");
			else
				$(".b7780").html("异常");
			if (n.b5 == "0")
				$(".b5780").html("正常");
			else
				$(".b5780").html("异常");
		})
		$("span:contains('故障'),span:contains('告警'),span:contains('异常')").addClass("red").removeClass("ger");
		$("span:contains('正常')").addClass("ger").removeClass("red");
	}
</script>
</body>
</html>