<!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='type784 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='SID784'> </span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr784'> </span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port784'> </span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd784'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State784'> </span></td></tr>
    </table>

    <table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>运行参数</h1></td></tr>
        <tr><td >输入市电电压:<span class='Vin1784'> </span></td><td> 输出工作电压:<span class='Vout784'> </span></td><td>电池电压:<span class='Vbatt784'> </span></td><td>负载百分比:<span class='Aout784'> </span></td></tr>
        <tr><td>环境温度:<span class='Tem784'> </span></td><td>输入市电频率:<span class='Fin784'> </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='b0784'> </span></td><td> 电池电压:<span class='b1784'> </span></td><td>旁路模式:<span class='b2784'> </span></td><td>UPS故障:<span class='b3784'> </span></td></tr>
        <tr><td>机型属性:<span class='b4784'> </span></td><td>UPS模式:<span class='b5784'> </span></td><td>UPS状态:<span class='b6784'> </span></td><td>蜂鸣器:<span class='b7784'> </span></td></tr>
    </table>
    </td>
    </tr>
  </table>
    <a href='javascript:history.back()' class='back' style='color: #fff'>返回</a>
    </div>
<script>
var itype=784;
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){
        $(".SID784").html(n.SID);
        $(".Addr784").html(n.Addr);
        $(".Port784").html(n.Port%256);
        $(".DateUpd784").html(n.DateUpd);
        $(".State784").html(window.parent.parseState(n.State));

        $(".Vin1784").html(n.Vin1/100+"V");
        $(".Vout784").html(n.Vout/100+"V");
        $(".Vbatt784").html(n.Vbatt/100+"V");
        $(".Mbatt784").html(n.Mbatt/100+"%");
        $(".Tem784").html(n.Tem/100+"℃");
        $(".Fin784").html(n.Fin/100+"Hz");
        $(".Aout784").html(n.Aout/100.0+"%");

        $(".b0784").html(n.b0);
        $(".b1784").html(n.b1);
        $(".b2784").html(n.b2);
        $(".b3784").html(n.b3);
        $(".b4784").html(n.b4);
        $(".b5784").html(n.b5);
        $(".b6784").html(n.b6);
        $(".b7784").html(n.b7);
    })
    $("span:contains('故障'),span:contains('告警'),span:contains('闭合'),span:contains('关闭')").addClass("red").removeClass("ger");
    $("span:contains('正常')").addClass("ger").removeClass("red");
}
</script>
</body>
</html>