<!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='type792 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='SID792'> </span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr792'> </span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port792'> </span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd792'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State792'> </span></td></tr>
    </table>

    <table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>运行参数</h1></td></tr>
        <tr><td >输入电压:<span class='VinA792'> </span>&nbsp;<span class='VinB792'> </span>&nbsp;<span class='VinC792'> </span></td><td> 输出电压:<span class='VoutA792'> </span>&nbsp;<span class='VoutB792'> </span>&nbsp;<span class='VoutC792'> </span></td><td> 旁路电压:<span class='VBA792'> </span>&nbsp;<span class='VBB792'> </span>&nbsp;<span class='VBC792'> </span></td></tr>
		<tr><td >输入电流:<span class='IinA792'> </span>&nbsp;<span class='IinB792'> </span>&nbsp;<span class='IinC792'> </span></td><td>输出电流:<span class='IoutA792'> </span>&nbsp;<span class='IoutB792'> </span>&nbsp;<span class='IoutC792'> </span></td><td> 旁路电流:<span class='IBA792'> </span>&nbsp;<span class='IBB792'> </span>&nbsp;<span class='IBC792'> </span></td></tr>
        <tr><td>输入频率:<span class='FinA792'> </span>&nbsp;<span class='FinB792'> </span>&nbsp;<span class='FinC792'> </span></td><td>输出频率:<span class='FoutA792'> </span>&nbsp;<span class='FoutB792'> </span>&nbsp;<span class='FoutC792'> </span></td><td> 旁路频率:<span class='FBA792'> </span>&nbsp;<span class='FBB792'> </span>&nbsp;<span class='FBC792'> </span></td></tr>
		<tr><td>电池温度:<span class='Tem792'> </span></td><td>电池电压:<span class='Vbatt792'> </span></td><td>电池容量:<span class='Pbatt792'> </span></td></tr>
		<tr><td>电池剩于时间:<span class='Mbatt792'> </span></td><td> <span class='xxx792'> </span></td><td> <span class='xx792'> </span></td></tr>

    </table>
    <table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>工作状态</h1></td></tr>
        <tr><td >输出过载:<span class='b15792'> </span></td><td> 逆变故障:<span class='b14792'> </span></td><td>电池充电:<span class='b13792'> </span></td><td >电池充电异常:<span class='b12792'> </span></td></tr>
        <tr><td >电池自检:<span class='b11792'> </span></td><td> 电池自动检测:<span class='b10792'> </span></td><td>电池温度异常:<span class='b9792'> </span></td><td >旁路模式:<span class='b8792'> </span></td></tr>
        <tr><td >ECO模式:<span class='b7792'> </span></td><td> UPS状态:<span class='b6792'> </span></td><td>UPS告警:<span class='b5792'> </span></td><td >UPS耦合:<span class='b4792'> </span></td></tr>
        <tr><td >引擎状态:<span class='b3792'> </span></td><td> 系统状态:<span class='b2792'> </span></td><td>电池低压告警:<span class='b1792'> </span></td><td >过载保护:<span class='b0792'> </span></td></tr>
    </table>
    </td>
    </tr>
  </table>
    <a href='javascript:history.back()' class='back' style='color: #fff'>返回</a>
    </div>
<script>
var itype=792;
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){
        $(".SID792").html(n.SID);
        $(".Addr792").html(n.Addr);
        $(".Port792").html(n.Port%256);
        $(".DateUpd792").html(n.DateUpd);
        $(".State792").html(window.parent.parseState(n.State));

        $(".VinA792").html(n.Vin1/10+"V");
		$(".VinB792").html(n.Vin2/10+"V");
		$(".VinC792").html(n.Vin3/10+"V");
		
        $(".VoutA792").html(n.Vout1/10+"V");
		$(".VoutB792").html(n.Vout2/10+"V");
		$(".VoutC792").html(n.Vout3/10+"V");
		
        $(".VBA792").html(n.VB1/10+"V");
		$(".VBB792").html(n.VB2/10+"V");
		$(".VBC792").html(n.VB3/10+"V");
		
		$(".IinA792").html(n.Iin1/10+"A");
		$(".IinB792").html(n.Iin2/10+"A");
		$(".IinC792").html(n.Iin3/10+"A");
		
		$(".IoutA792").html(n.Iout1/10+"A");
		$(".IoutB792").html(n.Iout2/10+"A");
		$(".IoutC792").html(n.Iout3/10+"A");
		
		$(".IBA792").html(n.IB1/10+"A");
		$(".IBB792").html(n.IB2/10+"A");
		$(".IBC792").html(n.IB3/10+"A");
		
		$(".FinA792").html(n.Fin1/10+"Hz");
		$(".FinB792").html("");
		$(".FinC792").html("");
		
		$(".FoutA792").html(n.Fout1/10+"Hz");
		$(".FoutB792").html("");
		$(".FoutC792").html("");
		
		$(".FBA792").html(n.FB1/10+"Hz");
		$(".FBB792").html("");
		$(".FBC792").html("");
		
        $(".Tem792").html(n.Tem/10+"℃");  
        $(".Vbatt792").html(n.Vbatt/10+"V");            
		$(".Pbatt792").html(n.Pbatt/10+"%");
        $(".Mbatt792").html(n.Mbatt/10+"min");  
		
        $(".b15792").html(n.b15 ? "告警" : "正常");
        $(".b14792").html(n.b14 ? "告警" : "正常");
        $(".b13792").html(n.b13 ? "充电" : "未充电");
        $(".b12792").html(n.b12 ? "告警" : "正常");
        $(".b11792").html(n.b11 ? "电池自检中" : "正常");
        $(".b10792").html(n.b10 ? "开" : "关");
        $(".b9792").html(n.b9 ? "告警" : "正常");
        $(".b8792").html(n.b8 ? "旁路" : "非旁路");
        $(".b7792").html(n.b7 ? "ECO工作" : "正常");
        $(".b6792").html(n.b6 ? "后备式" : "在线式");
        $(".b5792").html(n.b5 ? "告警" : "正常");
        $(".b4792").html(n.b4 ? "耦合" : "正常");
        $(".b3792").html(n.b3 ? "工作中" : "未工作");
        $(".b2792").html(n.b2 ? "工作" : "停止");
        $(".b1792").html(n.b1 ? "告警" : "正常");
        $(".b0792").html(n.b0 ? "告警" : "正常");

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