<!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='type777 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='SID777'> </span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr777'> </span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port777'> </span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd777'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State777'> </span></td></tr>
        </table>

    <table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>运行参数</h1></td></tr>
        <tr><td >输入电压:<span class='Vin1777'> </span>&nbsp;<span class='Vin2777'> </span>&nbsp;<span class='Vin3777'> </span></td><td> 输出电压:<span class='Vout777'> </span>&nbsp;<span class='Vout2777'> </span>&nbsp;<span class='Vout3777'> </span></td><td>电池剩余容量:<span class='Pbatt777'> </span></td><td>输出电流:<span class='Aout777'> </span>&nbsp;<span class='Aout2777'> </span>&nbsp;<span class='Aout3777'> </span></td></tr>
        <tr><td>输出频率:<span class='Fout777'> </span></td><td>1号电池组电压值:<span class='Vbatt777'> </span></td><td>2号电池组电压值:<span class='Vdc777'> </span></td><td></td></tr>
        </table>
    <table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>工作状态</h1></td></tr>
        <tr><td >市电电压:<span class='b7777'> </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='javascript:history.back()' class='back' style='color: #fff'>返回</a>
    </div>
<script>
  var itype=777;
  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){
        $(".SID777").html(n.SID);
        $(".Addr777").html(n.Addr);
        $(".Port777").html(n.Port%256);
        $(".DateUpd777").html(n.DateUpd);
        $(".State777").html(window.parent.parseState(n.State));

            $(".Vin1777").html(n.Vin1+"V");
			$(".Vin2777").html(n.Vin2+"V");
			$(".Vin3777").html(n.Vin3+"V");
			
            $(".Vout777").html(n.Vout+"V");
			$(".Vout2777").html(n.v2+"V");
			$(".Vout3777").html(n.v3+"V");
			
            $(".Pbatt777").html(n.Pbatt+"%");
			
			$(".Aout777").html(n.Aout+"A");
			$(".Aout2777").html(n.Aed+"A");
			$(".Aout3777").html(n.v4+"A");
			
            $(".Fout777").html(n.Fout/10+"HZ");
            $(".Vbatt777").html(n.Vbatt+"V");
            $(".Vdc777").html(n.Vdc+"V");            

			if (n.b7 == "0")
				$(".b7777").html("正常");
			else
				$(".b7777").html("异常");					
        })
        $("span:contains('故障'),span:contains('告警'),span:contains('异常')").addClass("red").removeClass("ger");
        $("span:contains('正常')").addClass("ger").removeClass("red");
    }
</script>
</body>
</html>