<!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='type789 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>GXEUPS</h1></td></tr>
        <tr><td style='width: 200px;'>基本信息</td><td>SID:<span class='SID789'> </span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr789'> </span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port789'> </span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd789'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State789'> </span></td></tr>
    </table>

    <table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>运行参数</h1></td></tr>
        <tr><td >输入电压:<span class='VinA789'> </span>&nbsp;<span class='VinB789'> </span>&nbsp;<span class='VinC789'> </span></td><td> 输出电压:<span class='VoutA789'> </span>&nbsp;<span class='VoutB789'> </span>&nbsp;<span class='VoutC789'> </span></td><td >输入电流:<span class='IinA789'> </span>&nbsp;<span class='IinB789'> </span>&nbsp;<span class='IinC789'> </span></td><td>输出电流:<span class='IoutA789'> </span>&nbsp;<span class='IoutB789'> </span>&nbsp;<span class='IoutC789'> </span></td></tr>
        <tr><td>输入频率:<span class='FinA789'> </span>&nbsp;<span class='FinB789'> </span>&nbsp;<span class='FinC789'> </span></td><td>输出频率:<span class='FoutA789'> </span>&nbsp;<span class='FoutB789'> </span>&nbsp;<span class='FoutC789'> </span></td></tr>
		<tr><td>电池温度:<span class='Tem789'> </span></td><td>电池电压:<span class='Vbatt789'> </span></td><td>电池容量:<span class='Pbatt789'> </span></td><td>电池剩于时间:<span class='Mbatt789'> </span></td></tr>

    </table>
    <table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>工作状态</h1></td></tr>
        <tr><td >电池连接状态:<span class='b15789'> </span></td><td> 维修旁路空开状态:<span class='b14789'> </span></td><td>EPO状态:<span class='b13789'> </span></td><td >逆变器启动容量不足:<span class='p12789'> </span></td></tr>
        <tr><td >发电机接入:<span class='b11789'> </span></td><td> 交流输入故障:<span class='b10789'> </span></td><td>旁路故障:<span class='b9789'> </span></td><td >输出短路:<span class='b8789'> </span></td></tr>
        <tr><td >电池 EOD:<span class='b7789'> </span></td><td> 电池自检状态:<span class='b6789'> </span></td><td>电池低压:<span class='b5789'> </span></td><td >电池接反:<span class='b4789'> </span></td></tr>
        <tr><td >输入N线断开:<span class='b3789'> </span></td><td> 旁路风扇故障:<span class='b2789'> </span></td><td>失去N+X冗余:<span class='b1789'> </span></td><td >EOD系统禁止:<span class='b0789'> </span></td></tr>
    </table>
    </td>
    </tr>
  </table>
    <a href='javascript:history.back()' class='back' style='color: #fff'>返回</a>
    </div>
<script>
var itype=789;
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){
        $(".SID789").html(n.SID);
        $(".Addr789").html(n.Addr);
        $(".Port789").html(n.Port%256);
        $(".DateUpd789").html(n.DateUpd);
        $(".State789").html(window.parent.parseState(n.State));

        $(".VinA789").html(n.Vin1/10+"V");
		$(".VinB789").html(n.Vin2/10+"V");
		$(".VinC789").html(n.Vin3/10+"V");
		
        $(".VoutA789").html(n.Vout1/10+"V");
		$(".VoutB789").html(n.Vout2/10+"V");
		$(".VoutC789").html(n.Vout3/10+"V");
		
		$(".IinA789").html(n.Iin1/10+"A");
		$(".IinB789").html(n.Iin2/10+"A");
		$(".IinC789").html(n.Iin3/10+"A");
		
		$(".IoutA789").html(n.Iout1/10+"A");
		$(".IoutB789").html(n.Iout2/10+"A");
		$(".IoutC789").html(n.Iout3/10+"A");
		
		$(".FinA789").html(n.Fin1/10+"Hz");
		$(".FinB789").html(n.Fin2/10+"Hz");
		$(".FinC789").html(n.Fin3/10+"Hz");
		
		$(".FoutA789").html(n.Fout1/10+"Hz");
		$(".FoutB789").html(n.Fout2/10+"Hz");
		$(".FoutC789").html(n.Fout3/10+"Hz");
		
        $(".Tem789").html(n.Tem/10+"℃");  
        $(".Vbatt789").html(n.Vbatt/10+"V");            
		$(".Pbatt789").html(n.Pbatt/10+"%");
        $(".Mbatt789").html(n.Mbatt/10+"min");  
		
		var str = "未连接";
		if (n.b15)
			str = "已连接"
        $(".b15789").html(str);
		
		str = "断开";
		if (n.b14)
			str = "闭合"
        $(".b14789").html(str);
		
		str = "无紧急关机";
		if (n.b13)
			str = "紧急关机"
        $(".b13789").html(str);
		
		str = "容量足够";
		if (n.b12)
			str = "容量不足"
        $(".b12789").html(str);
		
		str = "否";
		if (n.b11)
			str = "是"
        $(".b11789").html(str);
		
		str = "否";
		if (n.b10)
			str = "是"
        $(".b10789").html(str);
		
		str = "否";
		if (n.b9)
			str = "是"
        $(".b9789").html(str);
		
		str = "否";
		if (n.b8)
			str = "是"
        $(".b8789").html(str);
		
		str = "否";
		if (n.b7)
			str = "是"
        $(".b7789").html(str);
		
		str = "否";
		if (n.b6)
			str = "是"
        $(".b6789").html(str);
		
		str = "未自检";
		if (n.b5)
			str = "成功"
        $(".b5789").html(str);
		
		str = "否";
		if (n.b4)
			str = "是"
        $(".b4789").html(str);
		
		str = "否";
		if (n.b3)
			str = "是"
        $(".b3789").html(str);
		
		str = "否";
		if (n.b2)
			str = "是"
        $(".b2789").html(str);
		
		str = "否";
		if (n.b1)
			str = "是"
        $(".b1789").html(str);
		
		str = "否";
		if (n.b0)
			str = "是"
        $(".b0789").html(str);

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