<!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='type791 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>基本信息</h1></td></tr>
        <tr><td style='width: 200px;'>基本信息</td><td>SID:<span class='SID791'> </span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr791'> </span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port791'> </span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd791'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State791'> </span></td></tr>
    </table>

    <table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>运行参数</h1></td></tr>
        <tr><td >输入电压:<span class='VinA791'> </span>&nbsp;<span class='VinB791'> </span>&nbsp;<span class='VinC791'> </span></td><td> 输出电压:<span class='VoutA791'> </span>&nbsp;<span class='VoutB791'> </span>&nbsp;<span class='VoutC791'> </span></td><td> 旁路电压:<span class='VBA791'> </span>&nbsp;<span class='VBB791'> </span>&nbsp;<span class='VBC791'> </span></td></tr>
		<tr><td >输入电流:<span class='IinA791'> </span>&nbsp;<span class='IinB791'> </span>&nbsp;<span class='IinC791'> </span></td><td>输出电流:<span class='IoutA791'> </span>&nbsp;<span class='IoutB791'> </span>&nbsp;<span class='IoutC791'> </span></td><td> <span class='IBA791'> </span>&nbsp;<span class='IBB791'> </span>&nbsp;<span class='IBC791'> </span></td></tr>
        <tr><td>输入频率:<span class='FinA791'> </span>&nbsp;<span class='FinB791'> </span>&nbsp;<span class='FinC791'> </span></td><td>输出频率:<span class='FoutA791'> </span>&nbsp;<span class='FoutB791'> </span>&nbsp;<span class='FoutC791'> </span></td><td> <span class='FBA791'> </span>&nbsp;<span class='FBB791'> </span>&nbsp;<span class='FBC791'> </span></td></tr>
		<tr><td>电池电压:<span class='Vbatt791'> </span></td><td>电池容量:<span class='Pbatt791'> </span></td><td><span class='Tem791'> </span></td></tr>
		<tr><td>电池剩于时间:<span class='Mbatt791'> </span></td><td> <span class='xxx791'> </span></td><td> <span class='xx791'> </span></td></tr>

    </table>
    <table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>工作状态</h1></td></tr>
        <tr><td >充电器故障:<span class='b15791'> </span></td><td> 电池晶闸管故障:<span class='b14791'> </span></td><td>初始化故障:<span class='b13791'> </span></td><td >母线电压异常:<span class='b12791'> </span></td></tr>
        <tr><td >熔丝断:<span class='b11791'> </span></td><td> 旁路晶闸管故障:<span class='b10791'> </span></td><td>逆变晶闸管故障:<span class='b9791'> </span></td><td >输入晶闸管故障:<span class='b8791'> </span></td></tr>
        <tr><td >风扇故障:<span class='b7791'> </span></td><td> 辅助电源故障:<span class='b6791'> </span></td><td>逆变器故障:<span class='b5791'> </span></td><td >整流器故障:<span class='b4791'> </span></td></tr>
        <tr><td >整流器限流:<span class='b3791'> </span></td><td> 整流器状态:<span class='b2791'> </span></td><td>电池充电:<span class='b1791'> </span></td><td >电池自检:<span class='b0791'> </span></td></tr>
    </table>
    </td>
    </tr>
  </table>
    <a href='javascript:history.back()' class='back' style='color: #fff'>返回</a>
    </div>
<script>
var itype=791;
var tescape= 5000,time;

<% db_Open("/NandFlash/tmp/dbDat0.db3"); %>
var sid=<% write(sid);%>;
var json=<% db_QryAdv("select * from tbUpsEx 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){
        $(".SID791").html(n.SID);
        $(".Addr791").html(n.Addr);
        $(".Port791").html(n.Port%256);
        $(".DateUpd791").html(n.DateUpd);
        $(".State791").html(window.parent.parseState(n.State));

        $(".VinA791").html(n.Vin1/10+"V");
		$(".VinB791").html(n.Vin2/10+"V");
		$(".VinC791").html(n.Vin3/10+"V");
		
        $(".VoutA791").html(n.Vout1/10+"V");
		$(".VoutB791").html(n.Vout2/10+"V");
		$(".VoutC791").html(n.Vout3/10+"V");
		
        $(".VBA791").html(n.VB1/10+"V");
		$(".VBB791").html(n.VB2/10+"V");
		$(".VBC791").html(n.VB3/10+"V");
		
		$(".IinA791").html(n.Iin1/10+"A");
		$(".IinB791").html(n.Iin2/10+"A");
		$(".IinC791").html(n.Iin3/10+"A");
		
		$(".IoutA791").html(n.Iout1/10+"A");
		$(".IoutB791").html(n.Iout2/10+"A");
		$(".IoutC791").html(n.Iout3/10+"A");
		
		$(".FinA791").html(n.Fin1/10+"Hz");
		$(".FinB791").html("");
		$(".FinC791").html("");
		
		$(".FoutA791").html(n.Fout1/10+"Hz");
		$(".FoutB791").html("");
		$(".FoutC791").html("");
		
		//$(".FBA791").html(n.FB1/10+"Hz");
		//$(".FBB791").html("");
		//$(".FBC791").html("");
		
        //$(".Tem791").html(n.Tem/10+"℃");  
        $(".Vbatt791").html(n.Vbatt/10+"V");            
		$(".Pbatt791").html(n.Pbatt/10+"%");
        $(".Mbatt791").html(n.Mbatt/10+"min");  
		
        $(".b15791").html(n.b15 ? "告警" : "正常");
        $(".b14791").html(n.b14 ? "告警" : "正常");
        $(".b13791").html(n.b13 ? "告警" : "正常");
        $(".b12791").html(n.b12 ? "告警" : "正常");
        $(".b11791").html(n.b11 ? "告警" : "正常");
        $(".b10791").html(n.b10 ? "告警" : "正常");
        $(".b9791").html(n.b9 ? "告警" : "正常");
        $(".b8791").html(n.b8 ? "告警" : "正常");
        $(".b7791").html(n.b7 ? "告警" : "正常");
        $(".b6791").html(n.b6 ? "告警" : "正常");
        $(".b5791").html(n.b5 ? "告警" : "正常");
        $(".b4791").html(n.b4 ? "告警" : "正常");
        $(".b3791").html(n.b3 ? "工作中" : "未工作");
        $(".b2791").html(n.b2 ? "工作" : "停止");
        $(".b1791").html(n.b1 ? "充电中" : "未充电");
        $(".b0791").html(n.b0 ? "电池自检中" : "正常");

    })
    $("span:contains('故障'),span:contains('告警'),span:contains('闭合'),span:contains('关闭')").addClass("red").removeClass("ger");
    $("span:contains('正常')").addClass("ger").removeClass("red");
}
</script>
</body>
</html>