<!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='type776 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='SID776'> </span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr776'> </span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port776'> </span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd776'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State776'> </span></td></tr>
        </table>

    <table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'><h1>运行参数</h1></td></tr>
        <tr><td>输入市电电压:<span class='Vin1776'> </span></td><td>输入市电频率:<span class='Fin776'> </span></td><td> 输出电压:<span class='Vout776'> </span></td><td> 输出频率:<span class='Fout776'> </span></td></tr>
        <tr><td>电池电压:<span class='Vbatt776'> </span></td><td>电池剩余容量:<span class='Pbatt776'> </span></td><td>旁路输出电压:<span class='v2776'> </span></td><td>旁路输出电流:<span class='v1776'> </span></td></tr>
        <tr><td>输出负载:<span class='Pout776'> </span></td><td>输出电流:<span class='Aout776'> </span></td><td>输出功率:<span class='v3776'> </span></td><td>功率因数:<span class='v4776'> </span></td></tr>
        </table>
    <table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'><h1>工作状态</h1></td></tr>
        <tr><td>市电状态:<span class='b7776'> </span></td><td>电池低压:<span class='b6776'> </span></td><td>电池充电:<span class='b5776'> </span></td><td>UPS输出状态:<span class='b4776'> </span></td></tr>
        <tr><td>旁路频率:<span class='b3776'> </span></td><td>旁路异常:<span class='b2776'> </span></td><td>旁路过载:<span class='b1776'> </span></td><td>旁路状态:<span class='b0776'> </span></td></tr>
        <tr><td>逆变异常:<span class='s0776'> </span></td><td>逆变过载:<span class='s1776'> </span></td><td>逆变过温:<span class='s2776'> </span></td><td>逆变状态:<span class='s3776'> </span></td></tr>
        </table>
    </td>
    </tr>
  </table>
    <a href='javascript:history.back()' class='back' style='color: #fff'>返回</a>
    </div>
<script>
  var itype=776;
  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){
            $(".SID776").html(n.SID);
            $(".Addr776").html(n.Addr);
            $(".Port776").html(n.Port%256);
            $(".DateUpd776").html(n.DateUpd);
            $(".State776").html(window.parent.parseState(n.State));

            $(".Vin1776").html(n.Vin1/10+"V");
            $(".Fin776").html(n.Fin/10+"Hz");
            $(".Vout776").html(n.Vout/10+"V");
            $(".Fout776").html(n.Fout/10+"Hz");
            $(".Vbatt776").html(n.Vbatt/10+"%");
            $(".Pbatt776").html(n.Pbatt/10+"%");
            $(".v2776").html(n.v2/10+"V");
            $(".v1776").html(n.v1/10+"A");
            $(".Pout776").html(n.Pout/10+"%");
            $(".Aout776").html(n.Aout/10+"A");
            $(".v3776").html(n.v2/10+"VA");
            $(".v4776").html(n.v1/10);

            $(".b7776").html(n.b7);
            $(".b6776").html(n.b6);
            $(".b5776").html(n.b5);
            $(".b4776").html(n.b4);
            $(".b3776").html(n.b3);
            $(".b2776").html(n.b2);
            $(".b1776").html(n.b1);
            $(".b0776").html(n.b0);

            $(".s0776").html((n.status & 1)>>0);
            $(".s1776").html((n.status & 2)>>1);
            $(".s2776").html((n.status & 4)>>2);
            $(".s3776").html((n.status & 8)>>3);
        })
        $("span:contains('故障'),span:contains('告警'),span:contains('闭合'),span:contains('关闭')").addClass("red").removeClass("ger");
        $("span:contains('正常')").addClass("ger").removeClass("red");
    }
</script>
</body>
</html>