<!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='type781 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='SID781'> </span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr781'> </span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port781'> </span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd781'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State781'> </span></td></tr>
    </table>

    <table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>运行参数</h1></td></tr>
        <tr><td >输入电压:<span class='Vin1781'> </span>&nbsp;<span class='Vin2781'> </span>&nbsp;<span class='Vin3781'> </span></td><td> 输出电压:<span class='Vout781'> </span>&nbsp;<span class='Vout2781'> </span>&nbsp;<span class='Vout3781'> </span></td><td>电池电压:<span class='Vbatt781'> </span></td><td>输出电流:<span class='Aout781'> </span>&nbsp;<span class='Aout2781'> </span>&nbsp;<span class='Aout3781'> </span></td></tr>
        <tr><td>电池温度:<span class='Tem781'> </span></td><td>输入频率:<span class='Fin781'> </span></td><td><td>输出频率:<span class='Fout781'> </span></td></tr>
    </table>
    <table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>工作状态</h1></td></tr>
        <tr><td >容量过载告警:<span class='b0781'> </span></td><td> 主路熔丝断:<span class='b1781'> </span></td><td>风扇故障:<span class='b2781'> </span></td><td>环境温度:<span class='b3781'> </span></td></tr>
        <tr><td>紧急关机:<span class='b4781'> </span></td><td>旁路状态:<span class='b5781'> </span></td><td>电池组:<span class='b6781'> </span></td><td>主路电压:<span class='b7781'> </span></td></tr>
    </table>
    </td>
    </tr>
  </table>
    <a href='javascript:history.back()' class='back' style='color: #fff'>返回</a>
    </div>
<script>
var itype=781;
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){
        $(".SID781").html(n.SID);
        $(".Addr781").html(n.Addr);
        $(".Port781").html(n.Port%256);
        $(".DateUpd781").html(n.DateUpd);
        $(".State781").html(window.parent.parseState(n.State));

        
        $(".Vin1781").html(n.Vin1/10+"V");
		$(".Vin2781").html(n.Vin2/10+"V");
		$(".Vin3781").html(n.Vin3/10+"V");
		
        $(".Vout781").html(n.Vout/10+"V");
		$(".Vout2781").html(n.v2/10+"V");
		$(".Vout3781").html(n.v3/10+"V");
		
        $(".Vbatt781").html(n.Vbatt/10+"V");
		
		$(".Aout781").html(n.Aout+"A");
		$(".Aout2781").html(n.Aed+"A");
		$(".Aout3781").html(n.v4+"A");
		
        $(".Tem781").html(n.Tem/10+"℃");
        $(".Fin781").html(n.Fin/10+"Hz");  
        $(".Fout781").html(n.Fout/10+"Hz");            

        $(".b0781").html(n.b0 ? "是" : "否");
        $(".b1781").html(n.b1 ? "是" : "否");
        $(".b2781").html(n.b2 ? "是" : "否");
        $(".b3781").html(n.b3 ? "异常" : "正常");
        $(".b4781").html(n.b4 ? "异常" : "正常");
        $(".b5781").html(n.b5 ? "异常" : "正常");
        $(".b6781").html(n.b6 ? "异常" : "正常");
        $(".b7781").html(n.b7 ? "异常" : "正常");
    })
    $("span:contains('故障'),span:contains('告警'),span:contains('闭合'),span:contains('关闭')").addClass("red").removeClass("ger");
    $("span:contains('正常')").addClass("ger").removeClass("red");
}
</script>
</body>
</html>