<!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='type772 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='SID772'> </span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr772'> </span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port772'> </span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd772'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State772'> </span></td></tr>
    </table>

    <table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>运行参数</h1></td></tr>
        <tr><td >输入电压:<span class='Vin1772'> </span>&nbsp;<span class='Vin2772'> </span>&nbsp;<span class='Vin3772'> </span></td><td> 输出电压:<span class='Vout772'> </span>&nbsp;<span class='Vout2772'> </span>&nbsp;<span class='Vout3772'> </span></td><td>输出电流:<span class='Aout772'> </span>&nbsp;<span class='Aout2772'> </span>&nbsp;<span class='Aout3772'> </span></td></tr>
        <tr><td>电池电压:<span class='Vbatt772'> </span></td><td>环境温度:<span class='Tem772'> </span></td><td>输出频率:<span class='Fout772'> </span></td></tr>
        <tr><td>电池容量:<span class='Pbatt772'> </span></td><td>电池剩余时间:<span class='Mbatt772'> </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='b7772'> </span></td><td> 电池电压:<span class='b6772'> </span></td><td>旁路模式:<span class='b5772'> </span></td><td>UPS故障:<span class='b4772'> </span></td></tr>
        <tr><td>机型属性:<span class='b3772'> </span></td><td>UPS模式:<span class='b2772'> </span></td><td>UPS状态:<span class='b1772'> </span></td><td>蜂鸣器:<span class='b0772'> </span></td></tr>
    </table>
    </td>
    </tr>
  </table>
    <a href='javascript:history.back()' class='back' style='color: #fff'>返回</a>
    </div>
<script>
var itype=772;
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){
        $(".SID772").html(n.SID);
        $(".Addr772").html(n.Addr);
        $(".Port772").html(n.Port%256);
        $(".DateUpd772").html(n.DateUpd);
        $(".State772").html(window.parent.parseState(n.State));

        $(".Vin1772").html(n.Vin1/10+"V");
		$(".Vin2772").html(n.Vin2/10+"V");
		$(".Vin3772").html(n.Vin3/10+"V");
		
        $(".Vout772").html(n.Vout/10+"V");
		$(".Vout2772").html(n.v2/10+"V");
		$(".Vout3772").html(n.v3/10+"V");
		
        $(".Pbatt772").html(n.Pbatt+"%");
		
		$(".Aout772").html(n.Aout+"A");
		$(".Aout2772").html(n.Aed+"A");
		$(".Aout3772").html(n.v4+"A");
		
        $(".Vbatt772").html(n.Vbatt/10+"V");
        $(".Mbatt772").html(n.Mbatt/1+"秒");
        $(".Tem772").html(n.Tem/10+"℃");
        $(".Fout772").html(n.Fout/10+"Hz");            

		if (n.b0 == "0")
			$(".b0772").html("关");
		else
			$(".b0772").html("开");
			
		if (n.b1 == "0")
			$(".b1772").html("开机");
		else
			$(".b1772").html("关机");
			
		if (n.b2 == "0")
			$(".b2772").html("普通工作");
		else
			$(".b2772").html("测试中");	

		if (n.b3 == "0")
			$(".b3772").html("在线式");
		else
			$(".b3772").html("后备式");	

		if (n.b4 == "0")
			$(".b4772").html("正常");
		else
			$(".b4772").html("故障");	

		if (n.b5 == "0")
			$(".b5772").html("非旁路模式");
		else
			$(".b5772").html("旁路模式");	

		if (n.b6 == "0")
			$(".b6772").html("正常");
		else
			$(".b6772").html("低电压");		

		if (n.b7 == "0")
			$(".b7772").html("正常");
		else
			$(".b7772").html("异常");					
    })
    $("span:contains('故障'),span:contains('告警'),span:contains('闭合'),span:contains('关闭')").addClass("red").removeClass("ger");
    $("span:contains('正常')").addClass("ger").removeClass("red");
}
</script>
</body>
</html>