<!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='type773 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='SID773'> </span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr773'> </span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port773'> </span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd773'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State773'> </span></td></tr>
        </table>

    <table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>运行参数</h1></td></tr>
        <tr><td >输入电压:<span class='Vin1773'> </span>&nbsp;<span class='Vin2773'> </span>&nbsp;<span class='Vin3773'> </span></td><td> 输出电压:<span class='Vout773'> </span>&nbsp;<span class='Vout2773'> </span>&nbsp;<span class='Vout3773'> </span></td><td>电池剩余容量:<span class='Pbatt773'> </span></td><td>输出电流:<span class='Aout773'> </span>&nbsp;<span class='Aout2773'> </span>&nbsp;<span class='Aout3773'> </span></td></tr>
        <tr><td>电池备用时间:<span class='Mbatt773'> </span></td><td>环境温度:<span class='Tem773'> </span></td><td>输入市电频率:<span class='Fin773'> </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='b7773'> </span></td><td> 电池电压:<span class='b6773'> </span></td><td>旁路模式:<span class='b5773'> </span></td><td>UPS故障:<span class='b4773'> </span></td></tr>
        <tr><td>机型属性:<span class='b3773'> </span></td><td>UPS模式:<span class='b2773'> </span></td><td>UPS状态:<span class='b1773'> </span></td><td>蜂鸣器:<span class='b0773'> </span></td></tr>
        </table>
    </td>
    </tr>
  </table>
    <a href='javascript:history.back()' class='back' style='color: #fff'>返回</a>
    </div>
<script>
  var itype=773;
  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){
            $(".SID773").html(n.SID);
            $(".Addr773").html(n.Addr);
            $(".Port773").html(n.Port%256);
            $(".DateUpd773").html(n.DateUpd);
            $(".State773").html(window.parent.parseState(n.State));

            $(".Vin1773").html(n.Vin1/10+"V");
            $(".Vin2773").html(n.Vin2/10+"V");
            $(".Vin3773").html(n.Vin3/10+"V");

            $(".Vout773").html(n.Vout/10+"V");
            $(".Vout2773").html(n.v2/10+"V");
            $(".Vout3773").html(n.v3/10+"V");

            $(".Pbatt773").html(n.Pbatt+"%");

            $(".Aout773").html(n.Aout+"A");
            $(".Aout2773").html(n.Aed+"A");
            $(".Aout3773").html(n.v4+"A");

            $(".Mbatt773").html(n.Mbatt/100+"秒");
            $(".Tem773").html(n.Tem/10+"℃");
            $(".Fin773").html(n.Fin/10+"Hz");

            if (n.b0 == "0")
                $(".b0773").html("正常");
            else
                $(".b0773").html("温度过高");

            if (n.b1 == "0")
                $(".b1773").html("正常");
            else
                $(".b1773").html("输入故障");

            if (n.b2 == "0")
                $(".b2773").html("正常");
            else
                $(".b2773").html("输出故障");

            if (n.b3 == "0")
                $(".b3773").html("正常");
            else
                $(".b3773").html("过载");

            if (n.b4 == "0")
                $(".b4773").html("正常");
            else
                $(".b4773").html("旁路故障");

            if (n.b5 == "0")
                $(".b5773").html("正常");
            else
                $(".b5773").html("输出关闭");

            if (n.b6 == "0")
                $(".b6773").html("正常");
            else
                $(".b6773").html("异常");

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